Search completed in 1.22 seconds.
Performance fundamentals - Web Performance
per
formance means efficiency. in the context of open web apps, this document explains in general what per
formance is, how the browser plat
form helps improve it, and what tools and processes you can use to test and improve it. what is per
formance? ultimately, user-perceived per
formance is the only per
formance that matters. users provide inputs to the system through touch, movement, and speech. in return, they perceive outputs through sight, touch, and hearing. per
formance is the quality of system outputs in response to user inputs. all other things being equal, code optimized for some target besides user-perceived per
formance (hereafter upp) loses when competing against code optimized for upp. users prefer, say, a responsive, smooth app that only processes 1,000 database transactio...
...reafter upp) loses when competing against code optimized for upp. users prefer, say, a responsive, smooth app that only processes 1,000 database transactions per second, over a choppy, unresponsive app that processes 100,000,000 per second. of course, it's by no means pointless to optimize other metrics, but real upp targets come first. the next few subsections point out and discuss essential per
formance metrics. responsiveness responsiveness simply means how fast the system provides outputs (possibly multiple ones) in response to user inputs. for example, when a user taps the screen, they expect the pixels to change in a certain way. for this interaction, the responsiveness metric is the time elapsed between the tap and the pixel change. responsiveness sometimes involves multiple stages o...
...mory to user state is an important concern that we go over in more detail below. power usage the final metric discussed here is power usage. like memory usage, users perceive power usage only indirectly, by how long their devices can maintain all other upp goals. in service of meeting upp goals, the system must use only the minimum power required. ...
...And 20 more matches
Intl.DateTimeFormat.prototype.formatToParts() - JavaScript
the intl.datetime
format.prototype.
formattoparts() method allows locale-aware
formatting of strings produced by datetime
format
formatters. syntax datetime
format.
formattoparts(date) parameters date optional the date to
format. return value an array of objects containing the
formatted date in parts. description the
formattoparts() method is useful for custom
formatting of date strings. it returns an array of objects containing the locale-specific tokens from which it possible to build custom strings while preserving the locale-specific parts. 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". dayperiod ...
...string used for the name of the time zone, for example "utc". weekday the string used for the weekday, for example "m", "monday", or "montag". year the string used for the year, for example "2012" or "96". yearname the string used for the yearname in relevant contexts, for example "geng-zi" polyfill a polyfill for this feature is available in the proposal repository. ...
...", or "montag". year the string used for the year, for example "2012" or "96". yearname the string used for the yearname in relevant contexts, for example "geng-zi" polyfill a polyfill for this feature is available in the proposal repository. ...
...And 18 more matches
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
this document describes the javascript interface in mozilla 1.2 and up to the xslt processing engine (trans
formiix). creating an xsltprocessor to start, you need to create an xsltprocessor object: var processor = new xsltprocessor(); specifying the stylesheet before you can use it, you must import a stylesheet with the xsltprocessor.importstylesheet() method. it has a single parameter, which is the dom node of the xslt stylesheet to import. note: the import is live, meaning that if you alter the stylesheet dom after importing it, this will be reflected in the processing. ...
...lesheet with the xsltprocessor.importstylesheet() method. it has a single parameter, which is the dom node of the xslt stylesheet to import. note: the import is live, meaning that if you alter the stylesheet dom after importing it, this will be reflected in the processing. ...
...cessor.importstylesheet() method. it has a single parameter, which is the dom node of the xslt stylesheet to import. note: the import is live, meaning that if you alter the stylesheet dom after importing it, this will be reflected in the processing. rather than modifying the dom it is recommended to use stylesheet parameters which are usually easier and can give better per
formance. ...
...And 14 more matches
Intl.NumberFormat.prototype.formatToParts() - JavaScript
the intl.number
format.prototype.
formattoparts() method allows locale-aware
formatting of strings produced by number
format
formatters. syntax intl.number
format.prototype.
formattoparts(number) parameters number optional a number or bigint to
format. return value an array of objects containing the
formatted number in parts. description the
formattoparts() method is useful for custom
formatting of number strings. it returns an array of objects containing the locale-specific tokens from which it possible to build custom strings while preserving the locale-specific parts. ...
...s number optional a number or bigint to
format. return value an array of objects containing the
formatted number in parts. description the
formattoparts() method is useful for custom
formatting of number strings. it returns an array of objects containing the locale-specific tokens from which it possible to build custom strings while preserving the locale-specific parts. 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. decimal the decimal separator string ("."). fraction the fracti...
...the following: currency the currency string, such as the symbols "$" and "€" or the name "dollar", "euro" depending on how currencydisplay is specified. decimal the decimal separator string ("."). fraction the fraction number. group the group separator string (","). infinity the infinity string ("∞"). integer the integer number. ...
...And 13 more matches
Intl.ListFormat.prototype.formatToParts() - JavaScript
each element of the resulting array has two properties: type and value. ...
... each element of the resulting array has two properties: type and value. ...
... each element of the resulting array has two properties: type and value. ...
...And 12 more matches
FormDataEvent.formData - Web APIs
the
formdata read only property of the
formdataevent interface contains the
formdata object representing the data contained in the
form when the event was fired. syntax
formdata =
formdataevent.
formdata returns a
formdata object. ...
... the
formdata read only property of the
formdataevent interface contains the
formdata object representing the data contained in the
form when the event was fired. syntax
formdata =
formdataevent.
formdata returns a
formdata object. ...
... the
formdata read only property of the
formdataevent interface contains the
formdata object representing the data contained in the
form when the event was fired. syntax
formdata =
formdataevent.
formdata returns a
formdata object. ...
...And 11 more matches
Troubleshooting XForms Forms - Archive of obsolete content
troubleshooting check the file type is the page parsed as an xhtml document? right-click on a blank spot on the page, and select view page info. ...
... troubleshooting check the file type is the page parsed as an xhtml document? right-click on a blank spot on the page, and select view page info. ...
... troubleshooting check the file type is the page parsed as an xhtml document? right-click on a blank spot on the page, and select view page info. ...
...And 8 more matches
HTMLFormElement: formdata event - Web APIs
the
formdata event fires after the entry list representing the
form's data is constructed. this happens when the
form is submitted, but can also be triggered by the invocation of a
formdata() constructor. ...
... the
formdata event fires after the entry list representing the
form's data is constructed. this happens when the
form is submitted, but can also be triggered by the invocation of a
formdata() constructor. ...
... the
formdata event fires after the entry list representing the
form's data is constructed. this happens when the
form is submitted, but can also be triggered by the invocation of a
formdata() constructor. ...
...And 8 more matches
Animation performance and frame rate - Web Performance
animation on the web can be done via svg, javascript, including <canvas> and webgl, css animation, <video>, animated gifs and even animated pngs and other image types. the per
formance cost of animating a css property can vary from one property to another, and animating expensive css properties can result in jank as the browser struggles to hit a smooth frame rate. for animated media, such as video and animated gifs, the main per
formance concern is file size - downloading the file size fast enough to not negatively impact per
formance is the greatest issue. ...
...mating expensive css properties can result in jank as the browser struggles to hit a smooth frame rate. for animated media, such as video and animated gifs, the main per
formance concern is file size - downloading the file size fast enough to not negatively impact per
formance is the greatest issue. code based animations, be it css, svg, <canvas>, webgl or other javascript animations, can cause per
formance issues even if the bandwidth footprint is small. these animations can consume cpu and/or cause jank. while per
formance is sensitive to the particular system and its load, per
formance tools can help you understand the work the browser's doing to render your site, and help you prevent and diagnose problems when they occur. users expect all interface interactions to be smooth and all user inte...
...ond (fps). while it is not always possible to maintain 60fps, it is important to maintain a high and steady frame rate for all animations. let's take a look at how we can use browser tools to inspect the frame rate. we'll also discuss some tips to create and maintain a fast and steady frame rate. the developer tool's frame rate and waterfall charts provide insight into the work the browser is per
forming to animate code. using these tools you can measure an application's animation frame rate, and diagnose per
formance bottlenecks if any are found. with css animations you specify a number of keyframes, each of which uses css to define the appearance of the element at a particular stage of the animation. the browser creates the animation as a transition from each keyframe to the next. compared ...
...And 8 more matches
Performance Monitoring: RUM vs synthetic monitoring - Web Performance
synthetic monitoring and real user monitoring (rum) are two approaches for monitoring and providing insight into web per
formance. rum and synthetic monitoring provide for different views of per
formance and have benefits, good use cases and shortfalls. rum is generally best suited for understanding long-term trends whereas synthetic monitoring is very well suited to regression testing and mitigating shorter-term per
formance issues during development. in this article we define and compare these two per
formance monitoring approaches. synthetic monitoring synthetic monitoring involves monitoring the per
formance of a page in a 'laboratory' environment, typically with automation tooling in a consistent as possible environment. synthetic monitoring involves deploying scripts to simulate the...
... an example of synthetic monitoring is webpagetest.org. it is done in a controlled environment where variable like geography, network, device, browser, and cached status are predetermined. ...
... an example of synthetic monitoring is webpagetest.org. ...
...And 7 more matches
Intl.DateTimeFormat.prototype.format() - JavaScript
the intl.datetime
format.prototype.
format() method
formats a date according to the locale and
formatting options of this intl.datetime
format object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax datetime
format.
format(date) parameters date the date to
format. description the
format getter
formats a date into a string according to the locale and
formatting options of this intl.datetime
format object. ...
...pository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax datetime
format.
format(date) parameters date the date to
format. description the
format getter
formats a date into a string according to the locale and
formatting options of this intl.datetime
format object. ...
...'d like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax datetime
format.
format(date) parameters date the date to
format. description the
format getter
formats a date into a string according to the locale and
formatting options of this intl.datetime
format object. examples using
format use the
format getter function for
formatting a single date, here for serbia: var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; var datetime
format = new intl.datetime
format('sr-rs', options); console.log(datetime
format.
format(new date())); // → "недеља, 7. април 2013." using
format with map use the
format getter function for
formatting all dates in an array. n...
...And 5 more matches
Intl.RelativeTimeFormat.prototype.formatToParts() - JavaScript
the intl.relativetime
format.prototype.
formattoparts() method returns an array of objects representing the relative time
format in parts that can be used for custom locale-aware
formatting. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax relativetime
format.
formattoparts(value, unit) parameters value numeric value to use in the internationalized relative time message. unit unit to use in the relative time internationalized message. possible values are: "year", "quarter", "month", "week", "day", "hour", "minute", "second". plural
forms are also permitted. return value an array of objects containing...
...equest. syntax relativetime
format.
formattoparts(value, unit) parameters value numeric value to use in the internationalized relative time message. unit unit to use in the relative time internationalized message. possible values are: "year", "quarter", "month", "week", "day", "hour", "minute", "second". plural
forms are also permitted. return value an array of objects containing the
formatted relative time in parts. description the intl.relativetime
format.prototype.
formattoparts method is a version of the
format method which it returns an array of objects which represent "parts" of the object, separating the
formatted number into its consituent parts and separating it from other surrounding text. ...
...ray of objects containing the
formatted relative time in parts. description the intl.relativetime
format.prototype.
formattoparts method is a version of the
format method which it returns an array of objects which represent "parts" of the object, separating the
formatted number into its consituent parts and separating it from other surrounding text. these objects have two properties: type a number
format
formattoparts type, and value, which is the string which is the component of the output. if a "part" came from number
format, it will have a unit property which indicates the unit being
formatted; literals which are part of the larger frame will not have this property. ...
...And 5 more matches
Performance budgets - Web Performance
conversion rate). these goals can be: timing based (e.g. time to interactive, first contentful paint). quantity-based (e.g. amount of js files/total image size). rule-based (e.g. pagespeed index, lighthouse score). their primary goal is to prevent regressions, but they can provide insights to forecast trends (i.e. ...
...conversion rate). these goals can be: timing based (e.g. time to interactive, first contentful paint). quantity-based (e.g. amount of js files/total image size). rule-based (e.g. pagespeed index, lighthouse score). their primary goal is to prevent regressions, but they can provide insights to forecast trends (i.e. ...
...s files/total image size). rule-based (e.g. pagespeed index, lighthouse score). their primary goal is to prevent regressions, but they can provide insights to forecast trends (i.e. on september, 50% of the budget was spent in a week). additionally, it can uncover development needs (i.e. a large library with smaller alternatives is often picked to solve a common problem). how do i define a per
formance budget? a budget should include 2 levels: warning. error. the warning level allows you to be proactive and plan any tech debt, while not blocking development or deploys. the error level is an upper bound limit, where changes will have a negative and noticeable impact. in order to begin, you need to first measure the devices and connection speeds where your users are coming from (e.g.
...And 5 more matches
Intl.DateTimeFormat.prototype.formatRange() - JavaScript
the intl.datetime
format.prototype.
formatrange()
formats a date range in the most concise way based on the locale and options provided when instantiating intl.datetime
format object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax intl.datetime
format.prototype.
formatrange(startdate, enddate) examples basic
formatrange usage this method receives two dates and
formats the date range in the most concise way based on the locale and options provided when instantiating intl.datetime
format. let date1 = new date(date.utc(2007, 0, 10, 10, 0, 0)); let date2 = new date(date.utc(2007, 0, 10, 11, 0, 0)); let date3 = ne...
... concise way based on the locale and options provided when instantiating intl.datetime
format. ...
...0, 0)); let date2 = new date(date.utc(2007, 0, 10, 11, 0, 0)); let date3 = new date(date.utc(2007, 0, 20, 10, 0, 0)); // > 'wed, 10 jan 2007 10:00:00 gmt' // > 'wed, 10 jan 2007 11:00:00 gmt' // > 'sat, 20 jan 2007 10:00:00 gmt' let fmt1 = new intl.datetime
format("en", { year: '2-digit', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric' }); console.log(fmt1.
format(date1)); console.log(fmt1.
formatrange(date1, date2)); console.log(fmt1.
formatrange(date1, date3)); // > '1/10/07, 10:00 am' // > '1/10/07, 10:00 – 11:00 am' // > '1/10/07, 10:00 am – 1/20/07, 10:00 am' let fmt2 = new intl.datetime
format("en", { year: 'numeric', month: 'short', day: 'numeric' }); console.log(fmt2.
format(date1)); console.log(fmt2.
formatrange(date1, date2)); conso...
...And 4 more matches
Intl.DateTimeFormat.prototype.formatRangeToParts() - JavaScript
the intl.datetime
format.prototype.
formatrangetoparts() method allows locale-specific tokens representing each part of the
formatted date range produced by datetime
format
formatters. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax intl.datetime
format.prototype.
formatrangetoparts(startdate, enddate) examples basic
formatrangetoparts usage this method receives two dates and returns an array of objects containing the locale-specific tokens representing each part of the
formatted date range. let date1 = new date(date.utc(2007, 0, 10, 10, 0, 0)); let date2 = new date(date.utc(2007, 0, 10, 11, 0, 0)); // > 'wed...
... 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. ...
... array of objects containing the locale-specific tokens representing each part of the
formatted date range. ...
...And 4 more matches
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
on versions of xml content. built from the ground up utilizing a wide variety of xml technologies, firefox incorporates within itself all of the mechanisms needed to process both original xml documents and the specialized stylesheets used to style and lay them out for html display, reducing server load with client-side processing. at present, gecko (the layout engine behind firefox) supports two
forms of xml stylesheets. for basic control of appearance — fonts, colors, position, and so forth — gecko uses css. css1 and css2 are well supported and support for the emerging css3 standard is under development. for further in
formation about css, see eric meyer's css pages. our focus here is on the second type of stylesheet that gecko supports: the xslt stylesheet. xslt stands for extensible st...
...or basic control of appearance — fonts, colors, position, and so forth — gecko uses css. css1 and css2 are well supported and support for the emerging css3 standard is under development. for further in
formation about css, see eric meyer's css pages. our focus here is on the second type of stylesheet that gecko supports: the xslt stylesheet. xslt stands for extensible stylesheet language/trans
form and the name is apt. xslt allows a stylesheet author to trans
form a primary xml document in two significant ways: manipulating and sorting the content, including a wholesale reordering of it if so desired, and trans
forming the content into a different
format (and in the case of firefox, the focus is on converting it on the fly into html which can then be displayed by the browser). xslt/xpath ref...
...irefox, the focus is on converting it on the fly into html which can then be displayed by the browser). ...
...And 4 more matches
Intl.RelativeTimeFormat.prototype.format() - JavaScript
the intl.relativetime
format.prototype.
format() method
formats a value and unit according to the locale and
formatting options of this relativetime
format object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax relativetime
format.
format(value, unit) parameters value numeric value to use in the internationalized relative time message. unit unit to use in the relative time internationalized message. possible values are: "year", "quarter", "month", "week", "day", "hour", "minute", "second". plural
forms are also permitted. ...
...nd us a pull request. syntax relativetime
format.
format(value, unit) parameters value numeric value to use in the internationalized relative time message. unit unit to use in the relative time internationalized message. possible values are: "year", "quarter", "month", "week", "day", "hour", "minute", "second". plural
forms are also permitted. description the function returned by the
format getter
formats a value and a unit into a string according to the locale and
formatting options of this intl.relativetime
format object. examples basic
format usage the following example shows how to create a relative time
formatter using the english language. ...
...hour", "minute", "second". plural
forms are also permitted. description the function returned by the
format getter
formats a value and a unit into a string according to the locale and
formatting options of this intl.relativetime
format object. examples basic
format usage the following example shows how to create a relative time
formatter using the english language. // create a relative time
formatter in your locale // with default values explicitly passed in. const rtf = new intl.relativetime
format("en", { localematcher: "best fit", // other values: "lookup" numeric: "always", // other values: "auto" style: "long", // other values: "short" or "narrow" }); //
format relative time using negative value (-1). ...
...And 3 more matches
CSS and JavaScript animation performance - Web Performance
css transitions and animations both css transitions and animations can be used to write animation. ...
...nd, allow developers to make animations between a set of starting property values and a final set rather than between two states. css animations consist of two components: a style describing the css animation, and a set of key frames that indicate the start and end states of the animation's style, as well as possible intermediate points. see using css animations for more details. in terms of per
formance, there is no difference between implementing an animation with css transitions or animations. both of them are classified under the same css-based umbrella in this article. requestanimationframe the requestanimationframe() api provides an efficient way to make animations in javascript. the callback function of the method is called by the browser before the next repaint on each frame. compar...
...me() is much more efficient. developers can create an animation by simply changing an element's style each time the loop is called (or updating the canvas draw, or whatever.) note: like css transitions and animations, requestanimationframe() pauses when the current tab is pushed into the background. for more details read animating with javascript from setinterval to requestanimationframe. per
formance comparison: transitions vs. requestanimationframe the fact is that, in most cases, the per
formance of css-based animations is almost the same as javascripted animations — in firefox at least. some javascript-based animation libraries, like gsap and velocity.js, even claim that they are able to achieve better per
formance than native css transitions/animations. this can occur because css tr...
...And 3 more matches
Intl.ListFormat.prototype.format() - JavaScript
the
format() method returns a string with a language-specific representation of the list. syntax list
format.
format([list]); parameters list an iterable object, such as an array return value a language-specific
formatted string representing the elements of the list description the
format() method returns a string that has been
formatted based on parameters provided in the intl.list
format object. the locales and options parameters customize the behavior of
format() and let applications specify the language conventions that should be used to
format the list. examples using
format the following example shows how to create a list
formatter using the english language. ...
...n parameters provided in the intl.list
format object. the locales and options parameters customize the behavior of
format() and let applications specify the language conventions that should be used to
format the list. examples using
format the following example shows how to create a list
formatter using the english language. ...
... locales and options parameters customize the behavior of
format() and let applications specify the language conventions that should be used to
format the list. examples using
format the following example shows how to create a list
formatter using the english language. ...
...let applications specify the language conventions that should be used to
format the list. examples using
format the following example shows how to create a list
formatter using the english language. const list = ['motorcycle', 'bus', 'car']; console.log(new intl.list
format('en-gb', { style: 'long', type: 'conjunction' }).
format(list)); // > motorcycle, bus and car console.log(new intl.list
format('en-gb', { style: 'short', type: 'disjunction' }).
format(list)); // > motorcycle, bus or car console.log(new intl.list
format('en-gb', { style: 'narrow', type: 'unit' }).
format(list)); // > motorcycle bus car specifications specification intl.list
formatthe definition of '
format()' in that specification. ...
Intl.NumberFormat.prototype.format() - JavaScript
the intl.number
format.prototype.
format() method
formats a number according to the locale and
formatting options of this number
format object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax number
format.
format(number) parameters number a number or bigint to
format. description the
format getter function
formats a number into a string according to the locale and
formatting options of this number
format object. ...
...'d like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax number
format.
format(number) parameters number a number or bigint to
format. description the
format getter function
formats a number into a string according to the locale and
formatting options of this number
format object. examples using
format use the
format getter function for
formatting a single currency value, here for russia: var options = { style: 'currency', currency: 'rub' }; var number
format = new intl.number
format('ru-ru', options); console.log(number
format.
format(654321.987)); // → "654 321,99 руб." using
format with map use the
format getter function for
formatting all numbers in an array. note that the function ...
...ter function for
formatting a single currency value, here for russia: var options = { style: 'currency', currency: 'rub' }; var number
format = new intl.number
format('ru-ru', options); console.log(number
format.
format(654321.987)); // → "654 321,99 руб." using
format with map use the
format getter function for
formatting all numbers in an array. note that the function is bound to the number
format from which it was obtained, so it can be passed directly to array.prototype.map. this is considered a historical artefact, as part of a convention which is no longer followed for new features, but is preserved to maintain compatibility with existing programs. ...
...ing all numbers in an array. note that the function is bound to the number
format from which it was obtained, so it can be passed directly to array.prototype.map. this is considered a historical artefact, as part of a convention which is no longer followed for new features, but is preserved to maintain compatibility with existing programs. var a = [123456.789, 987654.321, 456789.123]; var number
format = new intl.number
format('es-es'); var
formatted = a.map(n => number
format.
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.number
format.prototype.
format' in that specification. ...
SyntaxError: Malformed formal parameter - JavaScript
the last argument is the source code for the new function you're creating. all the rest make up your new function's argument list. the argument list is invalid somehow. perhaps you accidentally picked a keyword like if or var as an argument name, or perhaps there's some stray punctuation in your argument list. or maybe you accidentally passed an invalid value, like a number or object. ok, that fixed my problem. ...
...the argument list is invalid somehow. perhaps you accidentally picked a keyword like if or var as an argument name, or perhaps there's some stray punctuation in your argument list. or maybe you accidentally passed an invalid value, like a number or object. ok, that fixed my problem. but why didn't you say that in the first place? admittedly the wording in the error message is slightly strange. "
formal parameter" is a fancy way of saying "function argument". and we use the word "mal
formed" because all firefox engineers are huge fans of 19th-century gothic horror novels. examples invalid cases var f = function('x y', 'return x + y;'); // syntaxerror (missing a comma) var f = function('x,', 'return x;'); // syntaxerror (extraneous comma) var f = function(37, "alert('ok')"); // syntaxerror ...
Recommended Web Performance Timings: How long is too long? - Web Performance
r downloading a cat video on a five-year-old device over an edge network in northern siberia would likely find a 20-second download speedy. if you wait three or four seconds without communicating to the user that a load is happening and showing some progress, the typical site will lose potential visitors, and those visitors will take a long time to come back if they ever do. in optimizing for per
formance, do set an ambitious first load goal, such as 5 seconds over the mobile 3g network and 1.5 seconds on an office t1 line, with even more ambitious page load goals for subsequent page loads, leveraging service workers and caching. there are different suggested times for initially loading the page versus loading additional assets, responding to user interaction, and ensuring smooth animations: ...
... a hover or button press, but that doesn't mean the completed response should be instantaneous. while a slower than 100ms reaction may create a disconnect between the user interaction and the response, a 100 to 200ms transition for a response may help the user notice the response their interaction initiated, such as a menu opening. if a response takes longer than 100ms to complete, provide some
form of feedback to in
form the user the interaction has occurred. ...
Optimizing startup performance - Web Performance
an often overlooked aspect of app software development—even among those focusing on per
formance optimization—is startup per
formance. how long does your app take to start up? does it seem to lock up the device or the user's browser while the app loads? that makes users worry that your app is crashed, or that something else is wrong. it's always a good idea to take the time to ensure that your app starts up nicely. this article offers tips and suggestions to help you achieve that goal, both when writing a new app and when porting an app from another plat
form to the web. starting up nicely regardless of plat
form, it's always a good idea to start up as quickly as possible. since that's a universal issue, we won't be focusing on it too much here. instead, we're going to look at a mo...
... notification. you should present some kind of interface, such as a progress bar, so that the user knows how much longer they'll need to wait while your app starts up. where there's a will... if you're starting your project from scratch, it's usually pretty easy to just write everything the "right way," making appropriate bits of the code asynchronous. all pure startup calculations should be per
formed in background threads, while you keep the run-time of main thread events as short as possible. include a progress indicator so the user knows what's going on and how long they'll be waiting. in theory, anyway, it should be pretty easy to design your new app to start up nicely. on the other hand, however, it can get tricky when you're porting an existing app to the web. a desktop application do...
Client-side form validation - Learn web development
previous overview:
forms next before submitting data to the server, it is important to ensure all required
form controls are filled out, in the correct
format. this is called client-side
form validation, and helps ensure data submitted matches the requirements set forth in the various
form controls. this article leads you through basic concepts and examples of client-side
form validation. prerequisites: computer literacy, a reasonable understanding of html, css, and javascript. objective: to understand what client-side
form validation is, why it's important, and how to apply various techniques to implement it. client-side validation is an initial check and an important feature of good user experience; by catching invalid data on the client-side, the us...
...re of good user experience; by catching invalid data on the client-side, the user can fix it straight away. if it gets to the server and is then rejected, a noticeable delay is caused by a round trip to the server and then back to the client-side to tell the user to fix their data. however, client-side validation should not be considered an exhaustive security measure! your apps should always per
form security checks on any
form-submitted data on the server-side as well as the client-side, because client-side validation is too easy to bypass, so malicious users can still easily send bad data through to your server. read website security for an idea of what could happen; implementing server-side validation is somewhat beyond the scope of this module, but you should bear it in mind. what is for...
...side as well as the client-side, because client-side validation is too easy to bypass, so malicious users can still easily send bad data through to your server. read website security for an idea of what could happen; implementing server-side validation is somewhat beyond the scope of this module, but you should bear it in mind. what is
form validation? go to any popular site with a registration
form, and you will notice that they provide feedback when you don't enter your data in the
format they are expecting. you'll get messages such as: "this field is required" (you can't leave this field blank). "please enter your phone number in the
format xxx-xxxx" (a specific data
format is required for it to be considered valid). "please enter a valid email address" (the data you entered is not i...
...And 73 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
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. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... <input type="radio" name="radio"/> range a control for entering a number whose exact value is not important. displays as a range widget defaulting to the middle value. used in conjunction min and max to define the range of acceptable values. <input type="range" name="range" min="0" max="25"/> html5 reset a button that resets the contents of the
form to default values. not recommended. <input type="reset" name="reset"/> search a single-line text field for entering search strings. line-breaks are automatically removed from the input value. may include a delete icon in supporting browsers that can be used to clear the field. displays a search icon instead of enter key on some devices with dynamic keypads. <i...
... search a single-line text field for entering search strings. line-breaks are automatically removed from the input value. may include a delete icon in supporting browsers that can be used to clear the field. displays a search icon instead of enter key on some devices with dynamic keypads. <input type="search" name="search"/> html5 submit a button that submits the
form. <input type="submit" name="submit"/> tel a control for entering a telephone number. displays a telephone keypad in some devices with dynamic keypads. <input type="tel" name="tel"/> html5 text the default value. a single-line text field. line-breaks are automatically removed from the input value. <input type="text" name="text"/> ...
...And 63 more matches
Your first form - Learn web development
overview:
forms next the first article in our series provides you with your very first experience of creating a web
form, including designing a simple
form, implementing it using the right html
form controls and other html elements, adding some very simple styling via css, and describing how data is sent to a server. we'll expand on each of these subtopics in more detail later on in the module. prerequisites: basic computer literacy, and a basic understanding of html. objective: to gain familiarity with what web
forms are, what they are used for, how to think about designing them, and the basic html elements you'll need for simple cases. ...
...w data is sent to a server. we'll expand on each of these subtopics in more detail later on in the module. prerequisites: basic computer literacy, and a basic understanding of html. objective: to gain familiarity with what web
forms are, what they are used for, how to think about designing them, and the basic html elements you'll need for simple cases. what are web
forms? web
forms are one of the main points of interaction between a user and a web site or application.
forms allow users to enter data, which is generally sent to a web server for processing and storage (see sending
form data later in the module), or used on the client-side to immediately update the interface in some way (for example, add another item to a list, or show or hide a ui feature). a we...
... web
forms are one of the main points of interaction between a user and a web site or application.
forms allow users to enter data, which is generally sent to a web server for processing and storage (see sending
form data later in the module), or used on the client-side to immediately update the interface in some way (for example, add another item to a list, or show or hide a ui feature). a web
form's html is made up of one or more
form controls (sometimes called widgets), plus some additional elements to help structure the overall
form — they are often referred to as html
forms. the controls can be single or multi-line text fields, dropdown boxes, buttons, checkboxes, or radio buttons, and are mostly created using the <input> element, although there are some other elements to learn about ...
...And 49 more matches
Sending forms through JavaScript - Learn web development
html
forms can send an http request declaratively. but
forms can also prepare an http request to send via javascript, for example via xmlhttprequest. this article explores such approaches. a
form is not always a
form with progressive web apps, single page apps, and framework based apps, it's common to use html
forms to send data without loading a new document when response data is received. let's first talk about why this requires a different approach. gaining control of the global interface standard html
form submission, as described in the previous article, loads the url where the data was sent, which means the browser window navigates with a full page load. avoiding a full page load can provide a smoother experience by avoiding network lag, and possible visual issues like flickering. ...
...when the user tries to send the data, the application takes control and transmits the data asynchronously in the background, updating only the parts of the ui that require changes. ...
...ously in the background, updating only the parts of the ui that require changes. sending arbitrary data asynchronously is generally called ajax, which stands for "asynchronous javascript and xml". how is it different? the xmlhttprequest (xhr) dom object can build http requests, send them, and retrieve their results. historically, xmlhttprequest was designed to fetch and send xml as an exchange
format, which has since been superceded by json. but neither xml nor json fit into
form data request encoding.
form data (application/x-www-
form-urlencoded) is made of url-encoded lists of key/value pairs. for transmitting binary data, the http request is reshaped into multipart/
form-data. note: the fetch api is often used in place of xhr these days — it is a modern, updated version of xhr, which ...
...And 43 more matches
XForms Custom Controls - Archive of obsolete content
since firefox 4, xbl and xul are disabled by default for all pages not loaded from a chrome:// url. this also includes content loaded from file:// urls. it is possible to re-enable this by following the steps on using remote xul. this is required for all examples here to run! purpose you are in the right place if you would like to create your own custom renderings of the x
forms controls like input, output, trigger, etc. we will also show you how to create custom controls that work with the x
forms model and are automatically updated just like x
forms controls. the purpose of this article is to give you enough background in
formation so that you'll be able to get a good start. to really grasp the following in
formation, a good understanding of x
forms, xbl, javascript and css is needed. xpco...
...o get a good start. to really grasp the following in
formation, a good understanding of x
forms, xbl, javascript and css is needed. xpcom knowledge will certainly not hurt. but even if you are only comfortable with a couple of these technologies, we hope that the possibilities outlined below will inspire you to learn more where you need to. implementation status the framework we use in the mozilla x
forms processor is very much a "work in progress". please keep in mind that just about everything we mention here may change to some degree as we continue to work on it. ...
...ble with a couple of these technologies, we hope that the possibilities outlined below will inspire you to learn more where you need to. implementation status the framework we use in the mozilla x
forms processor is very much a "work in progress". please keep in mind that just about everything we mention here may change to some degree as we continue to work on it. work has just started in the w3c x
forms working group to investigate the custom control issue, so eventually (hopefully?) there will be an "official" and common way to customize your
form's user interface across all x
forms processors. ...
...And 42 more matches
Web Performance
the longer it takes for a site to respond, the more users will abandon the site. ...
... the longer it takes for a site to respond, the more users will abandon the site. ...
... the longer it takes for a site to respond, the more users will abandon the site. ...
...And 42 more matches
How to structure a web form - Learn web development
previous overview:
forms next with the basics out of the way, we'll now look in more detail at the elements used to provide structure and meaning to the different parts of a
form. prerequisites: basic computer literacy, and a basic understanding of html. objective: to understand how to structure html
forms and give them semantics so they are usable and accessible. the flexibility of
forms makes them one of the most complex structures in html; you can build any kind of basic
form using dedicated
form elements and attributes. using correct structure when building an html
form will help ensure that the
form is both usable and accessible. the <
form> element the <
form> element
formally defines a
form and attributes that determine the
form's behavior. each...
...es them one of the most complex structures in html; you can build any kind of basic
form using dedicated
form elements and attributes. using correct structure when building an html
form will help ensure that the
form is both usable and accessible. the <
form> element the <
form> element
formally defines a
form and attributes that determine the
form's behavior. each time you want to create an html
form, you must start it by using this element, nesting all the contents inside. many assistive technologies and browser plugins can discover <
form> elements and implement special hooks to make them easier to use. we already met this in the previous article. ...
...s a
form and attributes that determine the
form's behavior. each time you want to create an html
form, you must start it by using this element, nesting all the contents inside. many assistive technologies and browser plugins can discover <
form> elements and implement special hooks to make them easier to use. we already met this in the previous article. warning: it's strictly forbidden to nest a
form inside another
form. nesting can cause
forms to behave in an unpredictable manner, so it is a bad idea. it's always possible to use a
form control outside of a <
form> element. if you do so, by default that control has nothing to do with any
form unless you associate it with a
form using the
form attribute. ...
...And 41 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. in this guide, we'll look at the container
formats used most commonly on the web, covering basics about their specifications as well as their benefits, limitations, and ideal use cases. webrtc does not use a container at all. instead, it streams the encoded audio and video tracks directly from one peer to another using mediastreamtrack objects to represent each track. see codecs used by webrtc for in
formation about codecs commonly used for making webrtc calls, as well as browser compatibility in
formation around codec support in webrtc. ...
...ns, and ideal use cases. webrtc does not use a container at all. instead, it streams the encoded audio and video tracks directly from one peer to another using mediastreamtrack objects to represent each track. see codecs used by webrtc for in
formation about codecs commonly used for making webrtc calls, as well as browser compatibility in
formation around codec support in webrtc. common container
formats while there are a vast number of media container
formats, the ones listed below are the ones you are most likely to encounter. some support only audio while others support both audio and video. 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). howe...
...ts, the ones listed below are the ones you are most likely to encounter. some support only audio while others support both audio and video. 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). however, you may also encounter mp3, ogg, webm, avi, and other
formats. 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. for example, an ogg file with only an opus audio track is sometimes referred to as an opus file, and might even have the extension .opus. but it's still actually just an ogg ...
...And 41 more matches
Styling web forms - Learn web development
previous overview:
forms next in the previous few articles we looked at all the html you'll need to create and structure your web
forms. in this article we will move on to looking at how to use css to style your
form controls. this has historically been difficult —
form controls vary greatly in how easy they are to customize with css — but it is getting easier as old browsers are retired and modern browsers give us more features to use. prerequisites: basic computer literacy, and a basic understanding of html and css. objective: to understand the issues behind styling
forms, and learn some of the basic styling techniques that will be useful to you. ...
...hey are to customize with css — but it is getting easier as old browsers are retired and modern browsers give us more features to use. prerequisites: basic computer literacy, and a basic understanding of html and css. objective: to understand the issues behind styling
forms, and learn some of the basic styling techniques that will be useful to you. ...
...ss — but it is getting easier as old browsers are retired and modern browsers give us more features to use. prerequisites: basic computer literacy, and a basic understanding of html and css. objective: to understand the issues behind styling
forms, and learn some of the basic styling techniques that will be useful to you. ...
...And 40 more matches
Sending form data - Learn web development
previous overview:
forms once the
form data has been validated on the client-side, it is okay to submit the
form. and, since we covered validation in the previous article, we're ready to submit! this article looks at what happens when a user submits a
form — where does the data go, and how do we handle it when it gets there? we also look at some of the security concerns associated with sending
form data. prerequisites: basic computer literacy, an understanding of html, and basic knowledge of http and server-side programming. objective: to understand what happens when
form data is submitted, including getting a basic idea of how data is processed on the server first we'll discuss what happens to the data when a
form is submitted. client/server a...
...hat happens to the data when a
form is submitted. client/server architecture at it's most basic, the web uses a client/server architecture that can be summarized as follows. a client (usually a web browser) sends a request to a server (most of the time a web server like apache, nginx, iis, tomcat, etc.), using the http protocol. the server answers the request using the same protocol. an html
form on a web page is nothing more than a convenient user-friendly way to configure an http request to send data to a server. this enables the user to provide in
formation to be delivered in the http request. note: to get a better idea of how client-server architectures work, read our server-side website programming first steps module. ...
...all of its attributes are designed to let you configure the request to be sent when a user hits a submit button. the two most important attributes are action and method. the action attribute the action attribute defines where the data gets sent. its value must be a valid relative or absolute url. ...
...And 39 more matches
Using FormData Objects - Web APIs
the
formdata object lets you compile a set of key/value pairs to send using xmlhttprequest. it is primarily intended for use in sending
form data, but can be used independently from
forms in order to transmit keyed data. 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. ...
... the
formdata object lets you compile a set of key/value pairs to send using xmlhttprequest. it is primarily intended for use in sending
form data, but can be used independently from
forms in order to transmit keyed data. 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. ...
... of key/value pairs to send using xmlhttprequest. it is primarily intended for use in sending
form data, but can be used independently from
forms in order to transmit keyed data. 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. ...
...And 38 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. however, the ones listed below are generally recognized as usable on the web, though bmp is generally not recommended as browser support is potentially constrained; it should usually be avoided for web content. ...
... 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. however, the ones listed below are generally recognized as usable on the web, though bmp is generally not recommended as browser support is potentially constrained; it should usually be avoided for web content. ...
...d usually be avoided for web content. ...
...And 36 more matches
HTMLFormElement - Web APIs
the html
formelement interface represents a <
form> element in the dom. it allows access to—and, in some cases, modification of—aspects of the
form, as well as access to its component elements. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</...
...aco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlelement</text></a><polyline points="491,25 501,20 501,30 491,25" stroke="#d4dde4" fill="none"/><line x1="501" y1="25" x2="509" y2="25" stroke="#d4dde4"/><line x1="509" y1="25" x2="509" y2="90" stroke="#d4dde4"/><line x1="509" y1="90" x2="492" y2="90" stroke="#d4dde4"/><a xlink:href="/docs/web/api/html
formelement" target="_top"><rect x="341" y="65" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="416" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">html
formelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interf...
..." fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="416" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">html
formelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, htmlelement. html
formelement.elements read only a html
formcontrolscollection holding all
form controls belonging to this
form element. ...
...And 34 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. as we saw in the previous article, text fields and buttons are perfectly easy to style; now we will dig into styling the bits that are more problematic. prerequisites: basic computer literacy, and a basic understanding of html and css. objective: to understand what parts of
forms are hard to style, and why; to learn what can be done to customize them. 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...
...ptgroup> and <datalist>. <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. appearance: controlling os-level styling in the previous article we said that historically, styling of web
form controls was largely taken from the underlying operating system, which is part of the problem with customizing the look of these controls. the appearance property was created as a way to control what os- or system-level styling was applied to web
form controls. unfortunately, the behavior of this property's original implementations was very different across browsers, making it not very usable. n...
...ity. if you look at the reference page you'll see a lot of different possible values listed for -webkit-appearance, however by far the most helpful value, and probably the only one you'll use, is none. this stops any control you apply it to from using system-level styling, as much as possible, and lets you build up the styles yourself using css. ...
...And 32 more matches
Using Performance Timeline - Web APIs
the following example show the usage of these methods getentries(), getentriesbyname() and getentriesbytype(). ...
...the following example show the usage of these methods getentries(), getentriesbyname() and getentriesbytype(). ...
...the following example show the usage of these methods getentries(), getentriesbyname() and getentriesbytype(). ...
...And 31 more matches
Basic native form controls - Learn web development
previous overview:
forms next in the previous article, we marked up a functional web
form example, introducing some
form controls and common structural elements, and focusing on accessibility best practices. 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. in this particular article we will look at the original set of
form controls, available in all browsers since the early days of the web. prerequisites: basic computer literacy, and a basic understanding of html. objective: to understand in detail the original set of native
form widgets available in browsers for collecting data, and how to implement them using html. you've a...
...le we will look at the original set of
form controls, available in all browsers since the early days of the web. prerequisites: basic computer literacy, and a basic understanding of html. objective: to understand in detail the original set of native
form widgets available in browsers for collecting data, and how to implement them using html. you've already met some
form elements, including <
form>, <fieldset>, <legend>, <textarea>, <label>, <button>, and <input>. this article covers: the common input types button, checkbox, file, hidden, image, password, radio, reset, submit, and text. some of the attributes that are common to all
form controls. ...
...e
form elements, including <
form>, <fieldset>, <legend>, <textarea>, <label>, <button>, and <input>. this article covers: the common input types button, checkbox, file, hidden, image, password, radio, reset, submit, and text. some of the attributes that are common to all
form controls. note: the features discussed in this article are supported in all browsers, which is not the case for all
form controls. we cover newer
form controls added in html5 in the next two articles. if you want a more advanced reference, you should consult our html
forms element reference, and in particular our extensive <input> types reference. text input fields text <input> fields are the most basic
form widgets. they are a very convenient way to let the user enter any kind of data, and we've already seen a ...
...And 30 more matches
Adding a new todo form: Vue events, methods, and models - Learn web development
. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn about handling
forms in vue, and by association, events, models, and methods. creating a new to-do
form we now have an app that displays a list of to-do items. however, we can't update our list of items without manually changing our code! let's fix that. let's create a new component that will allow us to add a new to-do item. in your components folder, create a new file called todo
form.vue. add a...
...tems. however, we can't update our list of items without manually changing our code! ...
...ode! ...
...And 29 more matches
SVGTransformList - Web APIs
svg trans
form list interface the svgtrans
formlist defines a list of svgtrans
form objects. an svgtrans
formlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
... svg trans
form list interface the svgtrans
formlist defines a list of svgtrans
form objects. an svgtrans
formlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
... of svgtrans
form objects. an svgtrans
formlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...And 27 more matches
Navigation and resource timings - Web Performance
navigation events. resource timings are detailed network timing measurements regarding the loading of an application's resources. both provide the same read-only properties, but navigation timing measures the main document's timings whereas the resource timing provides the times for all the assets or resources called in by that main document and the resources' requested resources. ...
... measurements regarding the loading of an application's resources. both provide the same read-only properties, but navigation timing measures the main document's timings whereas the resource timing provides the times for all the assets or resources called in by that main document and the resources' requested resources. ...
...s the resource timing provides the times for all the assets or resources called in by that main document and the resources' requested resources. the general per
formance timings below have been deprecated in favor of the per
formance entry api, which provides for marking and measuring times along the navigation and resource loading process. while deprecated, they are supported in all browsers. per
formance timings the per
formancetiming api, a javascript api for measuring the loading per
formance of the requested page, is deprecated but supported in all browsers. it has been replaced with the per
formancenavigationtiming api. the per
formance timing api provided read only times, in milliseconds(ms), describing at what time each point in the page loading process was reached. as displayed in the im...
...And 25 more matches
Intl.NumberFormat() constructor - JavaScript
the following unicode extension key is allowed: nu the numbering system to be used. ...
...the following unicode extension key is allowed: nu the numbering system to be used. ...
...the following unicode extension key is allowed: nu the numbering system to be used. ...
...And 24 more matches
XForms Accessibility
intoduction this article provides a quick guide to how accessibility is handled in gecko for x
forms.. assistive technologies api for x
forms is supported starting from firefox 3 (gecko 1.9). implementation of accessible objects for x
forms elements is based on top of the existing object hierarchy introduced in the mozilla accessibility module. x
forms elements behavior is implemented in accordance with accessible toolkit checklist. in general, when elements are similar to html elements, they are exposed to msaa/atk in a similar way. get build subsections below explain how you can obtain accessible x
forms-enabled build. these are either downloading latest build of firefox or building it yourself. downloading builds notion: x
forms is no longer distributed with firefox build. you must build i...
...milar way. get build subsections below explain how you can obtain accessible x
forms-enabled build. these are either downloading latest build of firefox or building it yourself. downloading builds notion: x
forms is no longer distributed with firefox build. you must build it yourself. see section below. for firefox, you may directly download the nighly "trunk" build of firefox and install the x
forms extension which lives in 'xpi' directory of the build. note, x
forms accessibility is implemented only on trunk. trunk builds are not considered stable and should not be installed on top of the firefox used for daily browsing. ...
...ust build it yourself. see section below. for firefox, you may directly download the nighly "trunk" build of firefox and install the x
forms extension which lives in 'xpi' directory of the build. note, x
forms accessibility is implemented only on trunk. trunk builds are not considered stable and should not be installed on top of the firefox used for daily browsing. currently we have verified that x
forms accessibility is working on the windows plat
form, and linux testing has not yet been done, although everything should work and is ready to be tested. you will find trunk builds of firefox at ftp.mozilla.org, trunk builds of x
forms extension (windows) at ftp.mozilla.org or trunk builds of x
forms extension (linux) ftp.mozilla.org. build it yourself if you would like to build firefox/seamonkey yo...
...And 23 more matches
Performance best practices for Firefox front-end engineers
always keep in mind the side effects your changes may have, from blocking other tasks, to interfering with other user interface elements. avoid the main thread where possible the main thread is where we process user events and do painting. it's also important to note that most of our javascript runs on the main thread, so it's easy for script to cause delays in event processing or painting. ...
...allows you to put all of your dom writes (most importantly, anything that could change the size or position of things in the dom) just before the style and layout steps of the pipeline, combining all the style and layout calculations into a single batch so it all happens once, in a single frame tick, instead of across multiple frames. see detecting and avoiding synchronous reflow below for more in
formation. this also means that requestanimationframe() is not a good place to put queries for layout or style in
formation. detecting and avoiding synchronous style flushes what are style flushes? when css is applied to a document (html or xul, it doesn’t matter), the browser does calculations to figure out which css styles will apply to each element. this happens the first time the page loads a...
...hes) to occur synchronously during the javascript part of the 16 ms window. the more of them there are, the more likely they'll exceed the 16ms frame budget. if that happens, some of them will be postponed until the next frame (or possibly multiple frames, if necessary), this skipping of frames is called jank. ...
...And 22 more matches
PerformanceTiming - Web APIs
these properties each describe the time at which a particular point in the page loading process was reached. ...
... these properties each describe the time at which a particular point in the page loading process was reached. ...
... these properties each describe the time at which a particular point in the page loading process was reached. ...
...And 21 more matches
SVGTransform - Web APIs
svg trans
form interface svgtrans
form is the interface for one of the component trans
formations within an svgtrans
formlist; thus, an svgtrans
form object corresponds to a single component (e.g., scale(…) or matrix(…)) within a trans
form attribute. an svgtrans
form object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. interface overview 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 ...
...oid 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_trans
form_unknown = 0 svg_trans
form_matrix = 1 svg_trans
form_translate = 2 svg_trans
form_scale = 3 svg_trans
form_rotate = 4 svg_trans
form_skewx = 5 svg_trans
form_skewy = 6 normative document svg 1.1 (2nd edition) constants name value description svg_trans
form_unknown 0 the unit type is not one of predefined unit types.
... svg_trans
form_skewx = 5 svg_trans
form_skewy = 6 normative document svg 1.1 (2nd edition) constants name value description svg_trans
form_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 21 more matches
transform-origin - CSS: Cascading Style Sheets
the trans
form-origin css property sets the origin for an element's trans
formations. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the trans
formation origin is the point around which a trans
formation is applied. for example, the trans
formation origin of the rotate() function is the center of rotation. this property is applied by first translating the element by the value of the property, then applying the element's trans
form, then translating by the negated property value. ...
...a pull request. the trans
formation origin is the point around which a trans
formation is applied. for example, the trans
formation origin of the rotate() function is the center of rotation. this property is applied by first translating the element by the value of the property, then applying the element's trans
form, then translating by the negated property value. this means, this definition trans
form-origin: -100% 50%; trans
form: rotate(45deg); results in the same trans
formation as trans
form-origin: 0 0; trans
form: translate(-100%, 50%) rotate(45deg) translate(100%, -50%); by default, the origin of a trans
form is center. ...
...perty, then applying the element's trans
form, then translating by the negated property value. this means, this definition trans
form-origin: -100% 50%; trans
form: rotate(45deg); results in the same trans
formation as trans
form-origin: 0 0; trans
form: translate(-100%, 50%) rotate(45deg) translate(100%, -50%); by default, the origin of a trans
form is center. ...
...And 21 more matches
Using microformats - Archive of obsolete content
micro
formats allow web sites to provide semantic data to the browser in order to make it possible to present summaries of the in
formation on a page without having to know how to parse the document itself. firefox 3 implements a global micro
formats object that provides access to micro
formats. this object and its api make finding and reading micro
formats easy to do. loading the micro
formats api the micro
formats object is created using the new javascript script loader added to firefox 3. ...
...itself. firefox 3 implements a global micro
formats object that provides access to micro
formats. this object and its api make finding and reading micro
formats easy to do. loading the micro
formats api the micro
formats object is created using the new javascript script loader added to firefox 3. to use the api, you need to first load the object: components.utils.import("resource://gre/modules/micro
formats.js"); once you've loaded the micro
formats api, you can manage micro
formats using the methods listed here; for in
formation about parsing micro
formats, see parsing micro
formats in javascript. predefined micro
formats firefox 3 provides definitions implementing several common micro
formats: adr represents an address (such as a street or mailing address). geo represents a geographical loca...
...age micro
formats using the methods listed here; for in
formation about parsing micro
formats, see parsing micro
formats in javascript. predefined micro
formats firefox 3 provides definitions implementing several common micro
formats: adr represents an address (such as a street or mailing address). geo represents a geographical location using latitude and longitude. hcard represents contact in
formation for a person. hcalendar represents a calendar appointment entry. tag used to add tags to other micro
formats. methods add() adds a new micro
format to the micro
format module. note: if a micro
format by the specified name already exists, it is replaced by the new one. add(name, definition); parameters name the name of the micro
format to add to the micro
format module. definition ...
...And 20 more matches
Other form controls - Learn web development
multi-line text fields a multi-line text field is specified using a <textarea> element, rather than using the <input> element. ...
... multi-line text fields a multi-line text field is specified using a <textarea> element, rather than using the <input> element. ...
... multi-line text fields a multi-line text field is specified using a <textarea> element, rather than using the <input> element. ...
...And 20 more matches
Measuring performance - Learn web development
previous overview: per
formance next meauring per
formance provides an important metric to help you asses the success of your app, site, or web service. for example, you can use per
formance metrics to determine how your app per
forms in comparison to a competitor or you can compare your app's per
formance across releases. the metrics you choose to measure should be relevant to your users, site, and business goals. they should be collected and measured in a consistent manner and analyzed in a
format that can be consumed and understood by non-technical stakeholders. this article introduces web perfomrance metrics that you can use to measure and optimize your site's per
formance. prerequisites: basic computer literacy, basic software installed, and basic knowledg...
...consistent manner and analyzed in a
format that can be consumed and understood by non-technical stakeholders. this article introduces web perfomrance metrics that you can use to measure and optimize your site's per
formance. prerequisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies. objective: to provide in
formation about web per
formance metrics that you can collect through various web per
formance apis and tools that you can use to visualize that data. per
formance apis when writing code for the web, there are a large number of web apis available that allow you to create your own per
formance measuring tools. ...
...o provide in
formation about web per
formance metrics that you can collect through various web per
formance apis and tools that you can use to visualize that data. per
formance apis when writing code for the web, there are a large number of web apis available that allow you to create your own per
formance measuring tools. you can use the navigation timing api to measure client-side web per
formance; including the amount of time needed to unload the previous page, how long domain lookups take, the total time spent executing the window's load handler, and more. you can use the api for metrics related to all of the navigation events displayed in the didagram below. ...
...And 20 more matches
text-transform - CSS: Cascading Style Sheets
the text-trans
form css property specifies how to capitalize an element's text. it can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized. it also can help improve legibility for ruby. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the text-trans
form property takes into account language-specific case mapping rules such as the following: in turkic languages, like turkish (tr), azerbaijani (az), crimean tatar (crh), volga tatar (tt), and bashkir (ba), there are two kinds of i, with and without the dot, and two case pairings: i/İ and ı/i. in german (de), the ß be...
...ccount language-specific case mapping rules such as the following: in turkic languages, like turkish (tr), azerbaijani (az), crimean tatar (crh), volga tatar (tt), and bashkir (ba), there are two kinds of i, with and without the dot, and two case pairings: i/İ and ı/i. in german (de), the ß becomes ss in uppercase. in dutch (nl), the ij digraph becomes ij, even with text-trans
form: capitalize, which only puts the first letter of a word in uppercase. in greek (el), vowels lose their accent when the whole word is in uppercase (ά/Α), except for the disjunctive eta (ή/Ή). also, diphthongs with an accent on the first vowel lose the accent and gain a diaeresis on the second vowel (άι/ΑΪ). in greek (el), the lowercase sigma character has two
forms: σ and ς. ...
... in greek (el), vowels lose their accent when the whole word is in uppercase (ά/Α), except for the disjunctive eta (ή/Ή). also, diphthongs with an accent on the first vowel lose the accent and gain a diaeresis on the second vowel (άι/ΑΪ). in greek (el), the lowercase sigma character has two
forms: σ and ς. ς is used only when sigma terminates a word. when applying text-trans
form: lowercase to an uppercase sigma (Σ), the browser needs to choose the right lowercase
form based on context. in irish (ga), certain prefixed letters remain in lowercase when the base initial is capitalized, so for example text-trans
form: uppercase will change ar aon tslí to ar aon tslÍ and not, as one might expect, ar aon tslÍ (firefox only). in some cases, a hyphen is also removed upon up...
...And 20 more matches
HTML forms in legacy browsers - Learn web development
er resources that can be amazingly helpful: browser vendor documentation mozilla: you're in the right place, just browse mdn microsoft: internet explorer standards support documentation webkit: because there are several different editions of this engine, things are a little trickier. the webkit blog and planet webkit aggregate the best articles by webkit core developers. chrome plat
form status site is also important. as well as the apple web site. make things simple because html
forms involves complex interaction, there is one rule of thumb: keep it simple, also known as the "kiss principal". there are so many cases where we want
forms that are "nicer" or "with advanced functionality", but building efficient html
forms is not a question of design or technology. rather...
... graceful degradation is web developer's best friend graceful degradation and progressive enhancement are development patterns that allow you to build great stuff by supporting a wide range of browsers at the same time. ...
...ty on ux for the masses, explains it well. graceful degradation is web developer's best friend graceful degradation and progressive enhancement are development patterns that allow you to build great stuff by supporting a wide range of browsers at the same time. when you build something for a modern browser, and you want to be sure it will work, one way or another, on legacy browsers, you are per
forming graceful degradation. let's see some examples related to html
forms. html input types the input types added in html5 are all useable, even in ancient browsers, because the way they degrade is highly predictable. if a browser does not know the value of the type attribute of an <input> element, it will fall back as if the value were text. <label for="mycolor"> pick a color <input type="c...
...And 19 more matches
<form> - HTML: Hypertext Markup Language
the html <
form> element represents a document section containing interactive controls for submitting in
formation. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. it is possible to use the :valid and :invalid css pseudo-classes to style a <
form> element based on whether or not the elements inside the
form are valid. content categories flow content, palpable content permitted content flow content, but not containing <
form> elements tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content implici...
... accept comma-separated content types the server accepts. this attribute was removed in html5 and should not be used. ...
... accept comma-separated content types the server accepts. this attribute was removed in html5 and should not be used. ...
...And 19 more matches
What is web performance? - Learn web development
previous overview: per
formance next web per
formance is all about making web sites fast, including making slow processes seem fast. does the site load quickly, allow the user to start interacting with it quickly, and offer reassuring feedback if something is taking time to load (e.g. a loading spinner)? are scrolling and animations smooth? ...
...r
formance next web per
formance is all about making web sites fast, including making slow processes seem fast. does the site load quickly, allow the user to start interacting with it quickly, and offer reassuring feedback if something is taking time to load (e.g. a loading spinner)? are scrolling and animations smooth? ...
...tions smooth? this article provides a brief introduction to objective, measureable web per
formance*, looking at what technologies, techniques, and tools are involved in web optimization. prerequisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies. objective: to gain basic familiarity of what is involved with web per
formance. * versus subjective, perceived per
formance, covered in the next article what is web per
formance? web per
formance is the objective measurement and perceived user experience of a web site or application. this includes the following major areas: reducing overall load time: how long does it take the files required to render the web site to download on to the user's computer? this ten...
...And 18 more matches
transform - CSS: Cascading Style Sheets
the trans
form css property lets you rotate, scale, skew, or translate an element. it modifies the coordinate space of the css visual
formatting model. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if the property has a value different than none, a stacking context will be created. in that case, the element will act as a containing block for any position: fixed; or position: absolute; elements that it contains. only trans
formable elements can be trans
formed. that is, all elements whose layout is governed by the css box model except for: non-replaced inline boxes, table-column boxes, and table-column-group boxes. ...
...context will be created. in that case, the element will act as a containing block for any position: fixed; or position: absolute; elements that it contains. only trans
formable elements can be trans
formed. that is, all elements whose layout is governed by the css box model except for: non-replaced inline boxes, table-column boxes, and table-column-group boxes. ...
...he element will act as a containing block for any position: fixed; or position: absolute; elements that it contains. only trans
formable elements can be trans
formed. that is, all elements whose layout is governed by the css box model except for: non-replaced inline boxes, table-column boxes, and table-column-group boxes. ...
...And 18 more matches
Perceived performance - Learn web development
previous overview: per
formance next perceived per
formance is how fast a website seems to the user. how a user perceives your per
formance is as important, or perhaps more important, than any objective statistic, but it's subjective, and not as readily measurable. perceived per
formance is user perspective, not a metric. this article provides a brief introduction to perceived per
formance, looking at user perceptions, and what objective tools can be used to measure that which is subjective. prerequisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies. objective: to gain basic familiarity of user perception of web per
formance. per
formance is about user perception. how fast a website feels like it's l...
... the main thread), it is possible to keep the user engaged while they wait by showing a loading spinner, or a series of useful hints and tips (or jokes, or whatever else you think might be appropriate). such an approach is much better than just showing nothing, which will make it feel like it is taking a lot longer and possibly lead to your users thinking it is broken and giving up. perceived per
formance the perception of how fast your site loads and how responsive feels to user interaction is vitally important; even more important that actual download time but difficult to quantify. there are areas of your site that you may not be able to make faster, but you can make it feel faster even if the metrics discussed in the othser sections can't be improved. there is no unicorn metric that can ...
...aningful paint, or fmp, is the when content appears on the screen that is actually meaningful; which is a better metric for user-perceived loading experience, but still not ideal. largest contentful paint (lcp) metric, definited in the largest contentful paint api, reports the render time of the largest content element visible in the viewport. speed index is also used to approximate perceived per
formance: it measures the average time for pixels on the visible screen to be painted. it doesn't account for jitter, nor does it weight which content important to a user more highly, so it's not a perfect metric. these metrics have to do with initial load and render. it is also important to ensure the site feels fast once the user begins interacting with it. for this, time to interactive, is a good ...
...And 17 more matches
The "why" of web performance - Learn web development
overview: per
formance next web per
formance is all about making websites fast, including making slow processes seem fast. this article provides an introduction into why web per
formance is important to site visitors and for your business goals. prerequisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies. objective: to gain basic familiarity of why web per
formance is important for good user experience. web per
formance refers to how quickly site content loads and renders in a web browser, and how well it responds to user interaction. bad per
forming sites are slow to display and slow to respond to input. bad per
forming sites increase site abandonment. ...
...ologies. objective: to gain basic familiarity of why web per
formance is important for good user experience. web per
formance refers to how quickly site content loads and renders in a web browser, and how well it responds to user interaction. bad per
forming sites are slow to display and slow to respond to input. bad per
forming sites increase site abandonment. at its worst, bad per
formance causes content to be completely inaccessible. a good goal for web per
formance is for users to not notice per
formance. while an individual's perception of site per
formance per
formance is subjective, loading and rendering can be measured. ...
...tion. bad per
forming sites are slow to display and slow to respond to input. bad per
forming sites increase site abandonment. at its worst, bad per
formance causes content to be completely inaccessible. a good goal for web per
formance is for users to not notice per
formance. while an individual's perception of site per
formance per
formance is subjective, loading and rendering can be measured. good per
formance may not be obvious to most site visitors, but most will immediately recognize a sluggish site. that is why we care. why care about per
formance? ...
...And 17 more matches
Web performance - Learn web development
building websites requires html, css, and javascript. to build websites and applications people want to use, which attract and retain users, you need to create a good user experience. part of good user experience is ensuring the content is quick to load and responsive to user interaction. this is known as web per
formance, and in this module you'll focus on the fundamentals of how to create per
formant websites. ...
... which attract and retain users, you need to create a good user experience. part of good user experience is ensuring the content is quick to load and responsive to user interaction. this is known as web per
formance, and in this module you'll focus on the fundamentals of how to create per
formant websites. the rest of our beginner's learning material tried to stick to web best practices such as per
formance and accessibility as much as possible, however, it is good to focus specifically on such topics too, and make sure you are familiar with them. learning pathway while knowing html, css, and javascript is needed for implementing many web per
formance improvement recommendations, knowing how to build applications is not a necessary pre-condition for understanding and measuring web per
formance. ...
...end that before you work through this module, you at least get a basic idea of web development by working through our getting started with the web module. ...
...And 17 more matches
<transform-function> - CSS: Cascading Style Sheets
perspective perspective() sets the distance between the user and the z=0 plane. rotation rotate() rotates an element around a fixed point on the 2d plane. ...
... perspective perspective() sets the distance between the user and the z=0 plane. rotation rotate() rotates an element around a fixed point on the 2d plane. ...
... perspective perspective() sets the distance between the user and the z=0 plane. rotation rotate() rotates an element around a fixed point on the 2d plane. ...
...And 17 more matches
Document.forms - Web APIs
the
forms read-only property of the document interface returns an htmlcollection listing all the <
form> elements contained in the document. note: similarly, you can access a list of a
form's component user input elements using the html
formelement.elements property. syntax collection = document.
forms; value an htmlcollection object listing all of the document's
forms. each item in the collection is a html
formelement representing a single <
form> element. if the document has no
forms, the returned collection is empty, with a length of zero. ...
...ss a list of a
form's component user input elements using the html
formelement.elements property. syntax collection = document.
forms; value an htmlcollection object listing all of the document's
forms. each item in the collection is a html
formelement representing a single <
form> element. if the document has no
forms, the returned collection is empty, with a length of zero. ...
...st of a
form's component user input elements using the html
formelement.elements property. syntax collection = document.
forms; value an htmlcollection object listing all of the document's
forms. each item in the collection is a html
formelement representing a single <
form> element. if the document has no
forms, the returned collection is empty, with a length of zero. ...
...And 16 more matches
PerformanceNavigationTiming - Web APIs
the per
formancenavigationtiming interface provides methods and properties to store and retrieve metrics regarding the browser's document navigation events. for example, this interface can be used to determine how much time it takes to load or unload a document. ...
...termine how much time it takes to load or unload a document. ...
...n: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/per
formanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">per
formanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/per
formancenavigationtiming" target="_top"><rect x="201" y="1" width="270" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="336" y="30" font-size="12px" font-family="consolas,monaco,andal...
...And 16 more matches
ARIA: form role - Accessibility
the
form landmark role can be used to identify a group of elements on a page that provide equivalent functionality to an html
form. <div role="
form" id="contact-info" aria-label="contact in
formation"> <!--
form content --> </div> this is a
form that collects and saves a user's contact in
formation. important: use an html <
form> element to contain your
form controls, rather than the aria
form role, unless you have a very good reason. the html <
form> element is sufficient to tell assistive technologies that there is a
form. description a
form landmark identifies a region of content that contains a collection of items and objects that, as a whole, combine to create a
form when no other named landmark is appropriate (e.g. main or search). ...
...aria-labelledby, aria-label or title). ...
...the html <
form> element is sufficient to tell assistive technologies that there is a
form. description a
form landmark identifies a region of content that contains a collection of items and objects that, as a whole, combine to create a
form when no other named landmark is appropriate (e.g. main or search). using the <
form> element will automatically communicate a section of content as a
form landmark, if it is provided an accessible name. developers should always prefer using the correct semantic html element over using aria. use the html <
form> element if possible. the <
form> element defines a
form landmark when it has an accessible name (e.g. aria-labelledby, aria-label or title). ...
...And 16 more matches
transform - SVG: Scalable Vector Graphics
however, be aware that there are some difference in syntax between the css property and the attribute. ...
...however, be aware that there are some difference in syntax between the css property and the attribute. ...
...00/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g fill="grey" trans
form="rotate(-10 50 100) translate(-36 45.5) skewx(40) scale(1 0.5)"> <path id="heart" d="m 10,30 a 20,20 0,0,1 50,30 a 20,20 0,0,1 90,30 q 90,60 50,90 q 10,60 10,30 z" /> </g> <use xlink:href="#heart" fill="none" stroke="red"/> </svg> note: as of svg2, trans
form is a presentation attribute, meaning it can be used as a css property. however, be aware that there are some difference in syntax between the css property and the attribute. see the documentation for the css property trans
form for the specific syntax to use in that case. ...
...And 16 more matches
The business case for web performance - Learn web development
previous overview: per
formance we've discussed the importance of web per
formance. you've learned what you need to do to optimize for web per
formance. but how do you convince your clients and/or management to prioritize and invest in per
formance? in this section, we discuss creating a clear business-case to convince decision-makers to make the investment. prerequisites: basic computer literacy, basic knowledge of client-side web technologies, and a basic understanding of web per
formance optimization. objective: to gain confidence in working with clients and management to get them to make web per
formance a priority. making per
formance a business priority we've discussed how prioritizing per
formance can improve user experience and therefore revenue. w...
...f client-side web technologies, and a basic understanding of web per
formance optimization. objective: to gain confidence in working with clients and management to get them to make web per
formance a priority. making per
formance a business priority we've discussed how prioritizing per
formance can improve user experience and therefore revenue. we know that not prioritizing web per
formance can result in a loss of business revenue. this article discusses how certain business metrics directly relate to a user's web per
formance experience and how to apply service design to boost the user's experiences of web per
formance. ...
.... we know that not prioritizing web per
formance can result in a loss of business revenue. this article discusses how certain business metrics directly relate to a user's web per
formance experience and how to apply service design to boost the user's experiences of web per
formance. it highlights the importance of understanding how cumulative experiences impact conversion and retention rates. per
formance budgets setting a web per
formance budget can help you make sure the team stays on track in keeping the site and help prevent regressions. a per
formance budget is a set of limits that are set to specify limits, such as maximum number of http requests allowed, the maximum total size of all the assets combined, the minimum allowable fps on a specific device, etc, that must be maintained. the b...
...And 15 more matches
PerformanceResourceTiming - Web APIs
the per
formanceresourcetiming interface enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources. an application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource, such as an xmlhttprequest, <svg>, image, or script. the interface's properties create a resource loading timeline with high-resolution timestamps for network events such as redirect start and end times, fetch start, dns lookup start and end times, response start and end times, etc.. additionally, the interface extends per
formanceentry with other properties which provide data about the size of the fetched resource as well as the type of resource that initiated the fetch. <div id="interfacediagram" style="displ...
...ce as well as the type of resource that initiated the fetch. ...
...n: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/per
formanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">per
formanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/per
formanceresourcetiming" target="_top"><rect x="201" y="1" width="250" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="326" y="30" font-size="12px" font-family="consolas,monaco,andale ...
...And 15 more matches
Microformats - HTML: Hypertext Markup Language
summary micro
formats (sometimes abbreviated μf) are standards used to embed semantics & structured data in html, and provide an api to be used by search engines, aggregators, and other tools. these minimal patterns of html are used for marking up entities that range from fundamental to domain-specific in
formation, such as people, organizations, events, and locations. micro
formats use supporting vocabularies to describe objects and name-value pairs to assign values to their properties. the properties are carried in class attributes that can be added to any html element, while the data values re-use html element content and semantic attributes. ...
...that range from fundamental to domain-specific in
formation, such as people, organizations, events, and locations. micro
formats use supporting vocabularies to describe objects and name-value pairs to assign values to their properties. the properties are carried in class attributes that can be added to any html element, while the data values re-use html element content and semantic attributes. micro
formats2 is an update to micro
formats that provides a simpler way of annotating html structured syntax & vocabularies than previous approaches of using rdfa and microdata which require learning new attributes. micro
formats are supported by all major search engines. ...
... to add a property to an object, the p-*, u-*, dt-*, e-* class names are used on one of the object's descendants. ...
...And 15 more matches
Intl.DateTimeFormat - JavaScript
the intl.datetime
format object is a constructor for objects that enable language-sensitive date and time
formatting. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constructor intl.datetime
format() creates a new datetime
format object. static methods intl.datetime
format.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.datetime
format.prototype.
format() getter function that
formats a date according to the locale and
formatting options of this datetime
format object. intl.
...t object. static methods intl.datetime
format.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.datetime
format.prototype.
format() getter function that
formats a date according to the locale and
formatting options of this datetime
format object. intl.datetime
format.prototype.
formattoparts() returns an array of objects representing the date string in parts that can be used for custom locale-aware
formatting. intl.datetime
format.prototype.resolvedoptions() returns a new object with properties reflecting the locale and
formatting options computed during initialization of the object. ...
...g options of this datetime
format object. intl.datetime
format.prototype.
formattoparts() returns an array of objects representing the date string in parts that can be used for custom locale-aware
formatting. intl.datetime
format.prototype.resolvedoptions() returns a new object with properties reflecting the locale and
formatting options computed during initialization of the object. intl.datetime
format.prototype.
formatrange() this method receives two dates and
formats the date range in the most concise way based on the locale and options provided when instantiating datetime
format. intl.datetime
format.prototype.
formatrangetoparts() this method receives two dates and returns an array of objects containing the locale-specific tokens representing each part of the
formatted date range. exampl...
...And 15 more matches
CSS performance optimization - Learn web development
for this reason, css is render blocking, unless the browser knows the css is not currently needed. the browser can paint the page once it has downloaded the css and built the css object model. browsers follow a specific rendering path: paint only occurs after layout, which occurs after the render tree is created, which in turn requires both the dom and the cssom trees. to optimize the cssom construction, remove unnecessary styles, minify, compress and cache it, and split css not required at page load into additional files to reduce css render blocking. ...
...ads the stylesheet, but doesn't render block. by separating out the css into multiple files, the main render-blocking file, in this case styles.css, is much smaller, reducing the time that rendering is blocked. animating on the gpu browsers are optimized to handle css animations, and handle animating properties that do not trigger a reflow (and therefore also a repaint) very well. to improve per
formance, the node being animated can be moved off the main thread and onto the gpu. properties that will lead to compositing include 3d trans
forms (trans
form: translatez(), rotate3d(), etc.), animating trans
form and opacity, position: fixed, will-change, and filter. some elements, including <video>, <canvas> and <iframe>, are also on their own layer. when an element is promoted as a layer, also known...
...an be moved off the main thread and onto the gpu. properties that will lead to compositing include 3d trans
forms (trans
form: translatez(), rotate3d(), etc.), animating trans
form and opacity, position: fixed, will-change, and filter. some elements, including <video>, <canvas> and <iframe>, are also on their own layer. when an element is promoted as a layer, also known as composited, animating trans
form properties is done in the gpu, resulting in improved per
formance, especially on mobile. will-change property the css will-change property tells browsers which properties of an element are expected to change enabling browsers to set up optimizations before the element is actually changed, improving per
formance by doing potentially expensive work before it is required. will-change: opacity, tran...
...And 14 more matches
JavaScript performance - Learn web development
previous overview: per
formance next while images and video account for over 70% of the bytes downloaded for the average website, byte per byte, javascript has a greater negative impact on per
formance. this article looks to introduce per
formance issues caused by scripts and introduces tips and tricks for optimizing javascript for web per
formance. prerequisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies. objective: to learn about the effects of javascript on per
formance optimization, and how a javascript file size is not the only impact on web per
formance. similar to images and video, the best way to improve per
formance is to omit what is not, in fact, necessary. but not all bytes downloaded h...
...we'll cover tips and tricks to minimize that impact on download. but javascript can also consume the main thread, the cpu, and the battery. it can make the ui feel unresponsive or janky. we'll introduce concepts for handling that as well. download impact web applications include a lot of javascript. ...
...epts for handling that as well. download impact web applications include a lot of javascript. many applications are built with a javascrpit framework, or multiple, with several additional dependencies. often times third party scripts and apis are added, including a/b testing, tracking pixels, and features like maps and support features. all of this javascript must be downloaded. eventually. per
formance optimizatins should include: reducing the amount of javascript that is needed. some features requiring complex javascript can be done with a few lines of javascript. requiring a library for other features may improve developer experience, but is all that javascript required? is there a lighter weight or home spun solutions? some features may not be necessary, and though they may add some ...
...And 14 more matches
JS_AddArgumentFormatter
obsolete since jsapi 18this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. add or remove a
format string handler for js_convertarguments, js_pusharguments, js_convertargumentsva, and js_pushargumentsva. ...
... obsolete since jsapi 18this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. add or remove a
format string handler for js_convertarguments, js_pusharguments, js_convertargumentsva, and js_pushargumentsva. ...
... obsolete since jsapi 18this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. add or remove a
format string handler for js_convertarguments, js_pusharguments, js_convertargumentsva, and js_pushargumentsva. ...
...And 14 more matches
XForms Alert Element - Archive of obsolete content
type restrictions the alert element can be bound to any simple content. ...
...st in instance data, in a remote document, or as inline text. if more than one source of message is specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text. attributes single-node binding linking src - url of a document whose contents will be retrieved by the alert element and used to provide the alert message for the containing
form control. type restrictions the alert element can be bound to any simple content. representations can be represented in two ways: modeless window that contains the alert element's message (default representation). the alert element's message can also be displayed immediately after the containing
form control element in the x
forms document's layout. this representation is used if the aler...
... be bound to any simple content. representations can be represented in two ways: modeless window that contains the alert element's message (default representation). the alert element's message can also be displayed immediately after the containing
form control element in the x
forms document's layout. this representation is used if the alert element has an inline display style. ...
...And 13 more matches
Images, media, and form elements - Learn web development
understanding what is and isn't possible can save some frustration, and this lesson will highlight some of the main things that you need to know. ...
...that replaced elements, when they become part of a grid or flex layout, have different default behaviors, essentially to avoid them being stretched strangely by the layout. to force the image to stretch to fill the grid cell it is in, you'd have to do something like following: img { width: 100%; height: 100%; } this would however stretch the image, so probably isn't what you'd want to do. ...
...lements, when they become part of a grid or flex layout, have different default behaviors, essentially to avoid them being stretched strangely by the layout. to force the image to stretch to fill the grid cell it is in, you'd have to do something like following: img { width: 100%; height: 100%; } this would however stretch the image, so probably isn't what you'd want to do. ...
...And 13 more matches
Web forms — Working with user data - Learn web development
this module provides a series of articles that will help you master the essentials of web
forms. web
forms are a very powerful tool for interacting with users — most commonly they are used for collecting data from users, or allowing them to control a user interface. however, for historical and technical reasons it's not always obvious how to use them to their full potential. in the articles listed below, we'll cover all the essential aspects of web
forms including marking up their html structure, styling
form controls, validating
form data, and submitting data to the server. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites before starting this module, y...
... looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites before starting this module, you should at least work through our introduction to html. at this point you should find the introductory guides easy to understand, and also be able to make use of our basic native
form controls guide. mastering
forms however requires more than just html knowledge — you also need to learn some specific techniques to style
form controls, and some scripting knowledge is required to handle things like validation and creating custom
form controls. therefore, before you look at the other sections listed below we'd recommend that you go away and learn some css and javascript first.
...just html knowledge — you also need to learn some specific techniques to style
form controls, and some scripting knowledge is required to handle things like validation and creating custom
form controls. therefore, before you look at the other sections listed below we'd recommend that you go away and learn some css and javascript first. the above text is a good indicator as to why we've put web
forms into its own standalone module, rather than trying to mix bits of it into the html, css, and javascript topic areas —
form elements are more complex than most other html elements, and they also require a close marriage of related css and javascript techniques to get the most out of them. note: if you are working on a computer/tablet/other device where you don't have the ability to create you...
...And 13 more matches
Performance API - Web APIs
the high resolution time standard defines a per
formance interface that supports client-side latency measurements within applications. the per
formance interfaces are considered high resolution because they are accurate to a thousandth of a millisecond (subject to hardware or software constraints). the interfaces support a number of use cases including calculating frame-rates (potentially important in animations) and benchmarking (such as the time to load a resource). since a plat
form's system clock is subject to various skews (such as ntp adjustments), the interfaces support a monotonic clock i.e. a clock that is always increasing. as such, the per
formance api defines a domhighrestimestamp type rather than using the date.now() interface. domhighrestimestamp the domhighrestimestamp type, as ...
...the value could be a discrete point in time or the difference in time between two discrete points in time. the unit of domhighrestimestamp is milliseconds and should be accurate to 5 µs (microseconds). ...
...e in time between two discrete points in time. the unit of domhighrestimestamp is milliseconds and should be accurate to 5 µs (microseconds). however, if the browser is unable to provide a time value accurate to 5 microseconds (because, for example, due to hardware or software constraints), the browser can represent the value as a time in milliseconds accurate to a millisecond. ...
...And 13 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. ...
... 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. ...
... 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. ...
...And 13 more matches
Understanding WebAssembly text format - WebAssembly
to enable webassembly to be read and edited by humans, there is a textual representation of the wasm binary
format. this is an intermediate
form designed to be exposed in text editors, browser developer tools, etc. this article explains how that text
format works, in terms of the raw syntax, and how it is related to the underlying bytecode it represents — and the wrapper objects representing wasm in javascript. note: this is potentially overkill if you are a web developer who just wants to load a wasm module into a page and use it in your code (see using the webassembly javascript api), but it is more useful if for example, you want to write wasm modules to optimize the per
formance of your javascript library, or build your own webassembly compiler. s-expressions in both the binary and ...
...ript. note: this is potentially overkill if you are a web developer who just wants to load a wasm module into a page and use it in your code (see using the webassembly javascript api), but it is more useful if for example, you want to write wasm modules to optimize the per
formance of your javascript library, or build your own webassembly compiler. s-expressions in both the binary and textual
formats, the fundamental unit of code in webassembly is a module. in the text
format, a module is represented as one big s-expression. s-expressions are a very old and very simple textual
format for representing trees, and thus we can think of a module as a tree of nodes that describe the module’s structure and its code. unlike the abstract syntax tree of a programming language, though, webassemb...
...s a tree with the root node “module” and two child nodes, a "memory" node with the attribute "1" and a "func" node. we’ll see shortly what these nodes actually mean. the simplest module let's start with the simplest, shortest possible wasm module. (module) this module is totally empty, but is still a valid module. if we convert our module to binary now (see converting webassembly text
format to wasm), we’ll see just the 8 byte module header described in the binary
format: 0000000: 0061 736d ; wasm_binary_magic 0000004: 0100 0000 ; wasm_binary_version adding functionality to your module ok, that’s not very interesting, let’s add some executable code to this module. all code in a webassembly module is grouped into functions, which have the followin...
...And 13 more matches
Mozilla XForms User Interface - Archive of obsolete content
introduction this article is a quick reference of the x
forms user interface elements. mainly this is aimed to document how x
forms elements will be presented in mozilla since the x
forms specifications give only a hint of how controls might be rendered. currently x
forms can be hosted by xhtml and xul in seamonkey and firefox. later we have plans to support x
forms hosted by svg. the x
forms specs define two kinds of x
forms ui elements, called '
form controls' and 'x
forms user interface'. elements from the "
form controls" group allows users to interact with instance data. ...
...pecifications give only a hint of how controls might be rendered. currently x
forms can be hosted by xhtml and xul in seamonkey and firefox. later we have plans to support x
forms hosted by svg. the x
forms specs define two kinds of x
forms ui elements, called '
form controls' and 'x
forms user interface'. elements from the "
form controls" group allows users to interact with instance data. the set of "x
forms user interface" elements exist to aid
form authors in combining host language markup and x
forms markup together in order to build user interfaces. some of the '
form controls' can have multiple appearances and thus may be rendered in multiple ways. ...
...ments from the "
form controls" group allows users to interact with instance data. the set of "x
forms user interface" elements exist to aid
form authors in combining host language markup and x
forms markup together in order to build user interfaces. some of the '
form controls' can have multiple appearances and thus may be rendered in multiple ways. we use the data type of the instance node that the
form control is bound to as a clue when making a rendering decision. the
form author can also use the 'appearance' attribute on the
form control to give us another clue. for example, a x
forms 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 da...
...And 12 more matches
Describing microformats in JavaScript - Archive of obsolete content
micro
formats are described in javascript by using a standardized structure
format that has several standard members that describe the object. micro
format definition
format the micro
format definition must contain the following entries: mfversion specifies the version number of the micro
format api to which the definition was written. for firefox 3, this should be set to 0.8. mfobject the javascript object that implements the micro
format. classname a string specifying the name of the micro
format's class as referenced in html (class="classname"). required an array indicating the names of any properties that must be specified. this may be left out if all properties are optional. properties a structure describing the properties of the micro
format. property specifications ea...
...fault value. subproperties it's possible for a property to itself include more properties; to do so, include them in a subproperties structure within the property. datatype the type of data contained by the property. ...
...ubproperties it's possible for a property to itself include more properties; to do so, include them in a subproperties structure within the property. datatype the type of data contained by the property. ...
...And 12 more matches
Parsing microformats in JavaScript - Archive of obsolete content
firefox 3 introduces a new api for managing and parsing micro
formats. this article examines the generic micro
format parsing api, which handles the heavy lifting of pulling data out of a micro
format. this api is primarily intended to be used when implementing new micro
formats. methods datetimegetter() specifically retrieves a date from a micro
format node. after getting the text, it is normalized into an iso 8601 date. normalizeddate = micro
formats.parser.datetimegetter(propnode, parentnode); parameters propnode the dom node to check. parentnode the property's parent node. if it is a subproperty, this is the parent property node. otherwise this is the micro
format node. ...
...ized into an iso 8601 date. normalizeddate = micro
formats.parser.datetimegetter(propnode, parentnode); parameters propnode the dom node to check. parentnode the property's parent node. if it is a subproperty, this is the parent property node. otherwise this is the micro
format node. return value a string containing the normalized date. defaultgetter() uses the micro
format patterns to decide what the correct text for a given micro
format property is. this includes looking at thing such as abbr, img and alt, area and alt, and value excerpting. propertyvalue = micro
formats.parser.defaultgetter(propnode, parentnode, datatype); parameters propnode the dom node to check. parentnode the property's parent node. if it is a subproperty, this...
...icro
format property is. this includes looking at thing such as abbr, img and alt, area and alt, and value excerpting. propertyvalue = micro
formats.parser.defaultgetter(propnode, parentnode, datatype); parameters propnode the dom node to check. parentnode the property's parent node. if it is a subproperty, this is the parent property node. otherwise this is the micro
format node. datatype "html" if the search should be done using innerhtml(), or "text" to use innertext(). the default is "text". return value a string containing the property's value. emailgetter() specifically retrieves an email address from a micro
format node. this removes the subject if one is specified, as well as the mailto: prefix. ...
...And 12 more matches
CSS property compatibility table for form controls - Learn web development
however, they will give you good insight into what can and can't be done, which will help you learn how to do things. how to read the tables values for each property, there are four possible values: yes there's reasonably consistent support for the property across browsers. you may still face strange side effects in certain edge cases. partial while the property works, you may frequently face strange side effects or inconsistencies. ...
...iors are common to many browsers at a global level: border, background, border-radius, height using one of these properties can partially or fully turn off the native look & feel of widgets on some browsers. be careful when you use them. line-height this property is supported inconsistently across browsers and you should avoid it. text-decoration this property is not supported by opera on
form widgets. text-overflow opera, safari, and ie9 do not support this property on
form widgets. text-shadow opera does not support text-shadow on
form widgets and ie9 does not support it at all. text fields see the text, search, and password input types. property n t note css box model width yes yes height partial[1][2] yes ...
... text-align yes yes text-decoration partial partial see the note about opera text-indent partial[1] partial[1] ie9 supports this property only on <textarea>s, whereas opera only supports it on single line text fields. text-overflow partial partial text-shadow partial partial text-trans
form yes yes border and background background partial[1] yes webkit browsers (mostly on mac osx and ios) use the native look & feel for the search fields. therefore, it's required to use -webkit-appearance:none to be able to apply this property to search fields. on windows 7, internet explorer 9 does not apply the border unless background:none is app...
...And 12 more matches
Transformations - Web APIs
« previousnext » earlier in this tutorial we've learned about the canvas grid and the coordinate space. until now, we only used the default grid and changed the size of the overall canvas for our needs. with trans
formations there are more powerful ways to translate the origin to a different position, rotate the grid and even scale it. saving and restoring state before we look at the trans
formation methods, let's look at two other methods which are indispensable once you start generating ever more complex drawings. save() saves the entire state of the canvas. restore() restores the most recently saved canvas state. canvas states are stored on a stack. every time the save() method is called, the current drawing state is pushed onto the stack. a drawing state consists...
...n methods, let's look at two other methods which are indispensable once you start generating ever more complex drawings. save() saves the entire state of the canvas. restore() restores the most recently saved canvas state. canvas states are stored on a stack. every time the save() method is called, the current drawing state is pushed onto the stack. a drawing state consists of the trans
formations that have been applied (i.e. translate, rotate and scale – see below). the current values of the following attributes: strokestyle, fillstyle, globalalpha, linewidth, linecap, linejoin, miterlimit, linedashoffset, shadowoffsetx, shadowoffsety, shadowblur, shadowcolor, globalcompositeoperation, font, textalign, textbaseline, direction, imagesmoothingenabled. the current clipping path, wh...
...ly in order to return to the previous state. this would be easy for two properties, but if we have more than that, our code would become very long, very fast. when the second restore() statement is called, the original state (the one we set up before the first call to save) is restored and the last rectangle is once again drawn in black. screenshotlive sample translating the first of the trans
formation methods we'll look at is translate(). this method is used to move the canvas and its origin to a different point in the grid. translate(x, y) moves the canvas and its origin on the grid. x indicates the horizontal distance to move, and y indicates how far to move the grid vertically. it's a good idea to save the canvas state before doing any trans
formations. in most cases, it is just e...
...And 12 more matches
GlobalEventHandlers.onformdata - Web APIs
the on
formdata property of the globaleventhandlers mixin is the eventhandler for processing
formdata events, fired after the entry list representing the
form's data is constructed. this happens when the
form is submitted, but can also be triggered by the invocation of a
formdata() constructor. on
formdata is available on html
formelement. syntax target.on
formdata = functionref; value functionref is a function name or a function expression. the function receives a
formdataevent object as its sole argument. ...
...ng the
form's data is constructed. this happens when the
form is submitted, but can also be triggered by the invocation of a
formdata() constructor. on
formdata is available on html
formelement. syntax target.on
formdata = functionref; value functionref is a function name or a function expression. the function receives a
formdataevent object as its sole argument. ...
...s data is constructed. this happens when the
form is submitted, but can also be triggered by the invocation of a
formdata() constructor. on
formdata is available on html
formelement. syntax target.on
formdata = functionref; value functionref is a function name or a function expression. the function receives a
formdataevent object as its sole argument. ...
...And 12 more matches
Visual formatting model - CSS: Cascading Style Sheets
in css the visual
formatting model describes how user agents take the document tree, and process and display it for visual media. this includes continuous media such as a computer screen and paged media such as a book or document printed by browser print functions. most of the in
formation applies equally to continuous and paged media. in the visual
formatting model, each element in the document tree generates zero or more boxes according to the box model. the layout of these boxes is governed by: box dimensions and type. positioning scheme (normal flow, float, and absolute positioning). relationships between elements in the document tree. external in
formation (e.g., viewport size, intrinsic dimensions of images, etc.). ...
...when reading specifications you will often find references to the model as defined in css2, so an understanding of the model and the terms used to describe it in css2 is valuable when reading other layout specifications. ...
...ent in the document tree generates zero or more boxes according to the box model. the layout of these boxes is governed by: box dimensions and type. positioning scheme (normal flow, float, and absolute positioning). relationships between elements in the document tree. external in
formation (e.g., viewport size, intrinsic dimensions of images, etc.). much of the in
formation about the visual
formatting model is defined in css2, however, various level 3 specifications have added to this in
formation. when reading specifications you will often find references to the model as defined in css2, so an understanding of the model and the terms used to describe it in css2 is valuable when reading other layout specifications. in this document we define the model and introduce some of the related te...
...And 12 more matches
Populating the page: how browsers work - Web Performance
users want web experiences with content that is fast to load and smooth to interact with. therefore, a developer should strive to achieve these two goals. to understand how to improve per
formance and perceived per
formance, it helps to understand how the browser works. overview fast sites provide better user experiences. users want and expect web experiences with content that is fast to load and smooth to interact with. ...
... load and smooth to interact with. therefore, a developer should strive to achieve these two goals. to understand how to improve per
formance and perceived per
formance, it helps to understand how the browser works. overview fast sites provide better user experiences. users want and expect web experiences with content that is fast to load and smooth to interact with. two major issues in web per
formance are understanding issues having to do with latency and issues having to do with the fact that for the most part, browsers are single threaded. latency is our main threat to overcome to ensure a fast load. to be fast to load, the developers’ goals include sending requested in
formation as fast as possible, or at least seem super fast. network latency is the time it takes to transmit bytes ov...
...ving to do with latency and issues having to do with the fact that for the most part, browsers are single threaded. latency is our main threat to overcome to ensure a fast load. to be fast to load, the developers’ goals include sending requested in
formation as fast as possible, or at least seem super fast. network latency is the time it takes to transmit bytes over-the-air to computers. web per
formance is what we have to do to make the page load happen as quickly as possible. for the most part, browsers are considered single threaded. for smooth interactions, the developer's goal is to ensure per
formant site interactions, from smooth scrolling to being responsive to touch. render time is key, with ensuring the main thread can complete all the work we throw at it and still always be availab...
...And 12 more matches
How to build custom form controls - Learn web development
in this article, we will discuss how to build a custom control. to that end, we will work with an example: rebuilding the <select> element. we will also discuss how, when, and whether building your own control makes sense, and what to consider when building a control is a requirement. ...
...t device companies can't do. it is best not to invent new user interactions. for any interaction you do add, it is vital to spend time in the design stage; if you define a behavior poorly, or forget to define one, it will be very hard to redefine it once the users have gotten used to it. if you have doubts, ask for the opinions of others, and if you have the budget for it, do not hesitate to per
form user tests. this process is called ux design. if you want to learn more about this topic, you should check out the following helpful resources: uxmatters.com uxdesign.com the ux design section of smashingmagazine note: also, in most systems there is a way to open the <select> element with the keyboard to look at all the available choices (this is the same as clicking the <select> element ...
... to display the current value of the control --> <span class="value">cherry</span> <!-- this container will contain all the options available for our control. because it's a list, it makes sense to use the ul element. --> <ul class="optlist"> <!-- each option only contains the value to be displayed, we'll see later how to handle the real value that will be sent with the
form data --> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> note the use of class names; these identify each relevant part regardless of the actual underlying html elements used. this is important to make sure that we don't bind our css and javascript to a...
...And 11 more matches
FormDataEvent - Web APIs
the
formdataevent interface represents a
formdata event — such an event is fired on an html
formelement object after the entry list representing the
form's data is constructed. this happens when the
form is submitted, but can also be triggered by the invocation of a
formdata() constructor. this allows a
formdata object to be quickly obtained in response to a
formdata event firing, rather than needing to put it together yourself when you wish to submit
form data via a method like xmlhttprequest (see using
formdata objects). constructor
formdataevent() creates a new
formdataevent object instance. properties inherits properties from its parent interface, event.
formdataevent.
formdata contains the
formdata object representing the data contained in the
form when the event was fired. ...
...est (see using
formdata objects). constructor
formdataevent() creates a new
formdataevent object instance. properties inherits properties from its parent interface, event.
formdataevent.
formdata contains the
formdata object representing the data contained in the
form when the event was fired. methods inherits methods from its parent interface, event. ...
...ng
formdata objects). constructor
formdataevent() creates a new
formdataevent object instance. properties inherits properties from its parent interface, event.
formdataevent.
formdata contains the
formdata object representing the data contained in the
form when the event was fired. methods inherits methods from its parent interface, event. ...
...And 11 more matches
PerformanceEntry.duration - Web APIs
"resource" - returns the difference between the resource's responseend timestamp and its starttime timestamp. ...
... "resource" - returns the difference between the resource's responseend timestamp and its starttime timestamp. ...
...e in web workers. the value returned by this property depends on the per
formance entry's type: "frame" - returns a timestamp indicating the difference between the starttimes of two successive frames. "mark" - returns "0" (a mark has no duration). "measure" - returns the timestamp that is the duration of the measure. "navigation" - returns the timestamp that is the difference between the per
formancenavigationtiming.loadeventend and per
formanceentry.starttime properties, respectively. "resource" - returns the difference between the resource's responseend timestamp and its starttime timestamp. this property is read only . syntax entry.duration; return value a domhighrestimestamp representing the duration of the per
formance entry. if the duration concept doesn't apply for a particula...
...And 11 more matches
Performance Timeline - Web APIs
the per
formance timeline api defines extensions to the per
formance interface to support client-side latency measurements within applications. the extensions provide interfaces to retrieve per
formance entry metrics based on specific filter criteria. the standard also includes interfaces that allow an application to define per
formance observer callbacks that are notified when specific per
formance events are added to the browser's per
formance timeline. this document provides an overview of the standard's interfaces. for more details about the interfaces, see the reference pages and using per
formance timeline. ...
... on specific filter criteria. the standard also includes interfaces that allow an application to define per
formance observer callbacks that are notified when specific per
formance events are added to the browser's per
formance timeline. this document provides an overview of the standard's interfaces. for more details about the interfaces, see the reference pages and using per
formance timeline. per
formance extensions the per
formance timeline api extends the per
formance interface with three methods that provide different mechanisms to get a set of per
formance records (metrics), depending on the specified filter criteria. ...
...'s interfaces. for more details about the interfaces, see the reference pages and using per
formance timeline. per
formance extensions the per
formance timeline api extends the per
formance interface with three methods that provide different mechanisms to get a set of per
formance records (metrics), depending on the specified filter criteria. the methods are: getentries() returns all recorded per
formance entries or, optionally, the entries based on the specified name, per
formance type and/or the initiatortype (such as an html element). getentriesbyname() returns the recorded per
formance entries based on the specified name and optionally the per
formance type. ...
...And 11 more matches
WebGLRenderingContext.getUniformLocation() - Web APIs
part of the webgl api, the webglrenderingcontext method getuni
formlocation() returns the location of a specific uni
form variable which is part of a given webglprogram. the uni
form variable is returned as a webgluni
formlocation object, which is an opaque identifier used to specify where in the gpu's memory that uni
form variable is located. once you have the uni
form's location, you can access the uni
form itself using one of the other uni
form access methods, passing in the uni
form location as one of the inputs: getuni
form() returns the value of the uni
form at the given location. ...
...returned as a webgluni
formlocation object, which is an opaque identifier used to specify where in the gpu's memory that uni
form variable is located. once you have the uni
form's location, you can access the uni
form itself using one of the other uni
form access methods, passing in the uni
form location as one of the inputs: getuni
form() returns the value of the uni
form at the given location. uni
form[1234][fi][v]() sets the uni
form's value to the specified value, which may be a single floating point or integer number, or a 2-4 component vector specified either as a list of values or as a float32array or int32array. uni
formmatrix[234][fv]() sets the uni
form's value to the specified matrix, possibly with transposition. the value is represented as a sequence of glfloat values or as a float32a...
... sets the uni
form's value to the specified value, which may be a single floating point or integer number, or a 2-4 component vector specified either as a list of values or as a float32array or int32array. uni
formmatrix[234][fv]() sets the uni
form's value to the specified matrix, possibly with transposition. the value is represented as a sequence of glfloat values or as a float32array. the uni
form itself is declared in the shader program using glsl. syntax webgluni
formlocation = webglrenderingcontext.getuni
formlocation(program, name); parameters program the webglprogram in which to locate the specified uni
form variable. name a domstring specifying the name of the uni
form variable whose location is to be returned. the name can't have any whitespace in it, and you can't use this fu...
...And 11 more matches
XRRigidTransform.inverse - Web APIs
in other words, its position and orientation both return to their prior configurations. ...
...in other words, its position and orientation both return to their prior configurations. ...
...in other words, its position and orientation both return to their prior configurations. ...
...And 11 more matches
transform-box - CSS: Cascading Style Sheets
values content-box the content box is used as the reference box. the reference box of a <table> is the border box of its table wrapper box, not its table box. border-box the border box is used as the reference box. the reference box of a <table> is the border box of its table wrapper box, not its table box. ...
... values content-box the content box is used as the reference box. the reference box of a <table> is the border box of its table wrapper box, not its table box. border-box the border box is used as the reference box. the reference box of a <table> is the border box of its table wrapper box, not its table box. ...
... values content-box the content box is used as the reference box. the reference box of a <table> is the border box of its table wrapper box, not its table box. border-box the border box is used as the reference box. the reference box of a <table> is the border box of its table wrapper box, not its table box. ...
...And 11 more matches
transform-style - CSS: Cascading Style Sheets
the trans
form-style css property sets whether children of an element are positioned in the 3d space or are flattened in the plane of the element. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if flattened, the element's children will not exist on their own in the 3d-space. as this property is not inherited, it must be set for all non-leaf descendants of the element. ...
...e is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if flattened, the element's children will not exist on their own in the 3d-space. as this property is not inherited, it must be set for all non-leaf descendants of the element. ...
... repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if flattened, the element's children will not exist on their own in the 3d-space. as this property is not inherited, it must be set for all non-leaf descendants of the element. ...
...And 11 more matches
FormData() - Web APIs
the
formdata() constructor creates a new
formdata object. note: this feature is available in web workers. syntax var
formdata = new
formdata(
form) parameters
form optional an html <
form> element — when specified, the
formdata object will be populated with the
form's current keys/values using the name property of each element for the keys and their submitted value for the values. it will also encode file input content. ...
... available in web workers. syntax var
formdata = new
formdata(
form) parameters
form optional an html <
form> element — when specified, the
formdata object will be populated with the
form's current keys/values using the name property of each element for the keys and their submitted value for the values. it will also encode file input content. ...
...ers. syntax var
formdata = new
formdata(
form) parameters
form optional an html <
form> element — when specified, the
formdata object will be populated with the
form's current keys/values using the name property of each element for the keys and their submitted value for the values. it will also encode file input content. ...
...And 10 more matches
performance.getEntriesByName() - Web APIs
the getentriesbyname() method returns a list of per
formanceentry objects for the given name and type. the list's members (entries) can be created by making per
formance marks or measures (for example by calling the mark() method) at explicit points in time. note: this feature is available in web workers. syntax entries = window.per
formance.getentriesbyname(name, type); arguments name the name of the entry to retrieve. type optional the type of entry to retrieve such as "mark". the valid entry types are listed in per
formanceentry.entrytype. return value entries a list of per
formanceentry objects that have the specified name and type. if the type argument is not specified, only the name will be used to determine the entries to return. the items will be in chronological order bas...
...r
formanceentry.entrytype. return value entries a list of per
formanceentry objects that have the specified name and type. if the type argument is not specified, only the name will be used to determine the entries to return. the items will be in chronological order based on the entries' starttime. if no objects meet the specified criteria, an empty list is returned. example function use_per
formanceentry_methods() { log("per
formanceentry tests ..."); if (per
formance.mark === undefined) { log("... ...
... type. if the type argument is not specified, only the name will be used to determine the entries to return. the items will be in chronological order based on the entries' starttime. if no objects meet the specified criteria, an empty list is returned. example function use_per
formanceentry_methods() { log("per
formanceentry tests ..."); if (per
formance.mark === undefined) { log("... ...
...And 10 more matches
performance.getEntriesByType() - Web APIs
the getentriesbytype() method returns a list of per
formanceentry objects for a given type. the list's members (entries) can be created by making per
formance marks or measures (for example by calling the mark() method) at explicit points in time. note: this feature is available in web workers. syntax entries = window.per
formance.getentriesbytype(type); arguments type the type of entry to retrieve such as "mark". the valid entry types are listed in per
formanceentry.entrytype. return value entries a list of per
formanceentry objects that have the specified type. the items will be in chronological order based on the entries' starttime. if no objects have the specified type, or no argument is provided, an empty list is returned. ...
... the type of entry to retrieve such as "mark". the valid entry types are listed in per
formanceentry.entrytype. return value entries a list of per
formanceentry objects that have the specified type. the items will be in chronological order based on the entries' starttime. if no objects have the specified type, or no argument is provided, an empty list is returned. example function useper
formanceentrymethods() { log("per
formanceentry tests ..."); if (per
formance.mark === undefined) { log("... ...
... value entries a list of per
formanceentry objects that have the specified type. the items will be in chronological order based on the entries' starttime. if no objects have the specified type, or no argument is provided, an empty list is returned. example function useper
formanceentrymethods() { log("per
formanceentry tests ..."); if (per
formance.mark === undefined) { log("... ...
...And 10 more matches
WebGL2RenderingContext.uniform[1234][uif][v]() - Web APIs
the webgl2renderingcontext.uni
form[1234][uif][v]() methods of the webgl api specify values of uni
form variables. ui stands for unsigned integer, i for integer, f for float, and v for vector. not all combinations are valid: u cannot be combined with f. see the syntax table below. ...
... the webgl2renderingcontext.uni
form[1234][uif][v]() methods of the webgl api specify values of uni
form variables. ui stands for unsigned integer, i for integer, f for float, and v for vector. not all combinations are valid: u cannot be combined with f. see the syntax table below. ...
... the webgl2renderingcontext.uni
form[1234][uif][v]() methods of the webgl api specify values of uni
form variables. ui stands for unsigned integer, i for integer, f for float, and v for vector. not all combinations are valid: u cannot be combined with f. see the syntax table below. ...
...And 10 more matches
WebGLRenderingContext.uniform[1234][fi][v]() - Web APIs
the webglrenderingcontext.uni
form[1234][fi][v]() methods of the webgl api specify values of uni
form variables. all active uni
form variables defined in a program object are initialized to 0 when the program object is linked successfully. they retain the values assigned to them by a call to this method until the next successful link operation occurs on the program object, when they are once again initialized to 0. many of the functions described here have expanded webgl 2 interfaces, which can be found under webgl2renderingcontext.uni
form[1234][uif][v](). ...
... to 0 when the program object is linked successfully. they retain the values assigned to them by a call to this method until the next successful link operation occurs on the program object, when they are once again initialized to 0. many of the functions described here have expanded webgl 2 interfaces, which can be found under webgl2renderingcontext.uni
form[1234][uif][v](). ...
...linked successfully. they retain the values assigned to them by a call to this method until the next successful link operation occurs on the program object, when they are once again initialized to 0. many of the functions described here have expanded webgl 2 interfaces, which can be found under webgl2renderingcontext.uni
form[1234][uif][v](). ...
...And 10 more matches
Basic form hints - Accessibility
when implementing
forms using traditional html
form-related elements, it is important to provide labels for controls, and explicitly associate a label with its control. when a screen reader user navigates a page, the screen reader will describe
form controls. without a direct association between the control and its label, the screen reader has no way of knowing which label is the correct one. the example below shows a simple
form with labels. note that each <input> element has an id, and each <label> element has a for attribute, indicating the id of the associated <input>. ...
...reader user navigates a page, the screen reader will describe
form controls. without a direct association between the control and its label, the screen reader has no way of knowing which label is the correct one. the example below shows a simple
form with labels. note that each <input> element has an id, and each <label> element has a for attribute, indicating the id of the associated <input>. ...
...wai-aria, the accessible rich internet applications specification from the w3c's web accessibility initiative, provides the aria-labelledby attribute for these cases. the example below shows a radio button group ...
...And 10 more matches
XForms - Archive of obsolete content
obsolete since gecko 19 (firefox 19 / thunderbird 19 / seamonkey 2.16)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. note: support for x
forms was removed from firefox in firefox 19. see the html
forms guide for approaches to creating
forms in html5. x
forms essentials an online book giving you a guided tour of x
forms. x
forms were envisioned as the future of online
forms as envisioned by the w3c. ...
...moved at any time. try to avoid using it. note: support for x
forms was removed from firefox in firefox 19. see the html
forms guide for approaches to creating
forms in html5. x
forms essentials an online book giving you a guided tour of x
forms. x
forms were envisioned as the future of online
forms as envisioned by the w3c. drawing on other w3c standards like xml schema, xpath, and xml events, x
forms tried to address some of the limitations of the current html
forms model. however, x
forms never gained traction and is now considered obsolete. ...
...ml5. x
forms essentials an online book giving you a guided tour of x
forms. x
forms were envisioned as the future of online
forms as envisioned by the w3c. drawing on other w3c standards like xml schema, xpath, and xml events, x
forms tried to address some of the limitations of the current html
forms model. however, x
forms never gained traction and is now considered obsolete. other strengths that x
forms brings to the table is the separation of data from presentation, strong data typing, the ability to submit xml data to servers instead of name/value pairs, and a descriptive way to author
forms so that they can be displayed by a wide variety of devices. x
forms is a w3c specification. x
forms tutorial and cookbook x
forms in wikibook
format - over 50 examples tested with firefox. ...
...And 9 more matches
Advanced text formatting - Learn web development
previous overview: introduction to html next there are many other elements in html for
formatting text, which we didn't get to in the html text fundamentals article. the elements described in this article are less known, but still useful to know about (and this is still not a complete list by any means). here you'll learn about marking up quotations, description lists, computer code and other related text, subscript and superscript, contact in
formation, and more. prerequisites: basic html familiarity, as covered in getting started with html. html text
formatting, as covered in html text fundamentals. objective: to learn how to use lesser-known html elements to mark up advanced semantic features. description lists in html text fundamentals, we walked t...
...elings and in the process relaying them to the audience (but not to other characters.) monologue in drama, where a character speaks their thoughts out loud to share them with the audience and any other characters present. aside in drama, where a character shares a comment only with the audience for humorous or dramatic effect. this is usually a feeling, thought or piece of additional background in
formation 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. let's finish marking up our example: <dl> <dt>soliloquy</dt> <dd>in drama, where a character speaks to themselves, representing their inner thoughts or feelings a...
...e audience (but not to other characters.)</dd> <dt>monologue</dt> <dd>in drama, where a character speaks their thoughts out loud to share them with the audience and any other characters present.</dd> <dt>aside</dt> <dd>in drama, where a character shares a comment only with the audience for humorous or dramatic effect. this is usually a feeling, thought, or piece of additional background in
formation.</dd> </dl> the browser default styles will display description lists with the descriptions indented somewhat from the terms. note that it is permitted to have a single term with multiple descriptions, for example: <dl> <dt>aside</dt> <dd>in drama, where a character shares a comment only with the audience for humorous or dramatic effect. this is usually a feeling, thought, or piec...
...And 9 more matches
HTMLFormElement.elements - Web APIs
the html
formelement property elements returns an html
formcontrolscollection listing all the
form controls contained in the <
form> element. independently, you can obtain just the number of
form controls using the length property. you can access a particular
form control in the returned collection by using either an index or the element's name or id. prior to html 5, the returned object was an htmlcollection, on which html
formcontrolscollection is based. note: similarly, you can get a list of all of the
forms contained within a given document using the document's
forms property. syntax nodelist = html
formelement.elements value an html
formcontrolscollection containing all non-image controls in the
form. ...
.... prior to html 5, the returned object was an htmlcollection, on which html
formcontrolscollection is based. note: similarly, you can get a list of all of the
forms contained within a given document using the document's
forms property. syntax nodelist = html
formelement.elements value an html
formcontrolscollection containing all non-image controls in the
form. this is a live collection; if
form controls are added to or removed from the
form, this collection will update to reflect the change. the
form controls in the returned collection are in the same order in which they appear in the
form by following a preorder, depth-first traversal of the tree. this is called tree order. ...
... containing all non-image controls in the
form. this is a live collection; if
form controls are added to or removed from the
form, this collection will update to reflect the change. the
form controls in the returned collection are in the same order in which they appear in the
form by following a preorder, depth-first traversal of the tree. this is called tree order. the elements included by html
formelement.elements and html
formelement.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. example quick...
...And 9 more matches
Performance - Web APIs
the per
formance interface provides access to per
formance-related in
formation for the current page. it's part of the high resolution time api, but is enhanced by the per
formance timeline api, the navigation timing api, the user timing api, and the resource timing api. an object of this type can be obtained by calling the window.per
formance read-only attribute. note: this interface and its members are available in web workers, except where indicated below. also, note that per
formance markers and measures are per context. if you create a mark on the main thread (or other worker), you cannot see it in a worker thread, and vice versa. properties the per
formance interface doesn't inherit any properties. ...
...the window.per
formance read-only attribute. note: this interface and its members are available in web workers, except where indicated below. also, note that per
formance markers and measures are per context. if you create a mark on the main thread (or other worker), you cannot see it in a worker thread, and vice versa. properties the per
formance interface doesn't inherit any properties. per
formance.navigation read only a legacy per
formancenavigation object that provides useful context about the operations included in the times listed in timing, including whether the page was a load or a refresh, how many redirections occurred, and so forth. not available in workers. ...
... worker thread, and vice versa. properties the per
formance interface doesn't inherit any properties. per
formance.navigation read only a legacy per
formancenavigation object that provides useful context about the operations included in the times listed in timing, including whether the page was a load or a refresh, how many redirections occurred, and so forth. not available in workers. per
formance.timing read only a legacy per
formancetiming object containing latency-related per
formance in
formation. not available in workers. per
formance.memory read only a non-standard extension added in chrome, this property provides an object with basic memory usage in
formation. you should not use this non-standard api. ...
...And 9 more matches
PerformanceEntry.name - Web APIs
the name property of the per
formanceentry interface returns a value that further specifies the value returned by the per
formanceentry.entrytype property. this property is read only. note: this feature is available in web workers. syntax var name = entry.name; return value the return value depends on the subtype of the per
formanceentry object and the value of per
formanceentry.entrytype, as shown by the table below. value subtype entrytype values description url per
formanceframetiming, per
formancenavigationtiming frame, navigation the document's address. url per
formanceresourcetiming resource the resolved url of the requested resource. this value doesn't change even if the request is redirected. ...
..., as shown by the table below. value subtype entrytype values description url per
formanceframetiming, per
formancenavigationtiming frame, navigation the document's address. url per
formanceresourcetiming resource the resolved url of the requested resource. this value doesn't change even if the request is redirected. domstring per
formancemark mark the name used when the mark was created by calling per
formance.mark(). domstring per
formancemeasure measure name used when the measure was created by calling per
formance.measure(). domstring per
formancepainttiming paint either 'first-paint' or 'first-contentful-paint'. example the following example shows the use of the name property. ...
... the name used when the mark was created by calling per
formance.mark(). domstring per
formancemeasure measure name used when the measure was created by calling per
formance.measure(). domstring per
formancepainttiming paint either 'first-paint' or 'first-contentful-paint'. example the following example shows the use of the name property. function run_per
formanceentry() { log("per
formanceentry support ..."); if (per
formance.mark === undefined) { log("... ...
...And 9 more matches
PerformanceEntry.startTime - Web APIs
the starttime property returns the first recorded timestamp of the per
formance entry. note: this feature is available in web workers. the value returned by this property depends on the per
formance entry's type: "frame" - returns the timestamp when the frame was started. "mark" - returns the timestamp when the mark was created by a call to per
formance.mark(). "measure" - returns the timestamp when the measure was created by a call to per
formance.measure(). "navigation" - returns the timestamp with a value of "0". "resource" - returns the timestamp immediately before the browser starts fetching the resource. this property is read only . syntax entry.starttime; return value a domhighrestimestamp representing the first timestamp when the per
formance entry was created. note: if the...
...the measure was created by a call to per
formance.measure(). "navigation" - returns the timestamp with a value of "0". "resource" - returns the timestamp immediately before the browser starts fetching the resource. this property is read only . syntax entry.starttime; return value a domhighrestimestamp representing the first timestamp when the per
formance entry was created. note: if the per
formance entry has an entrytype of "resource" (i.e. the entry is a per
formanceresourcetiming object), this property returns the per
formanceentry.fetchstart timestamp. example the following example shows the use of the starttime property. ...
...ntry.starttime; return value a domhighrestimestamp representing the first timestamp when the per
formance entry was created. note: if the per
formance entry has an entrytype of "resource" (i.e. the entry is a per
formanceresourcetiming object), this property returns the per
formanceentry.fetchstart timestamp. example the following example shows the use of the starttime property. function run_per
formanceentry() { log("per
formanceentry support ..."); if (per
formance.mark === undefined) { log("... ...
...And 9 more matches
PerformancePaintTiming - Web APIs
the per
formancepainttiming interface of the paint timing provides timing in
formation about "paint" (also called "render") operations during web page construction. "paint" refers to conversion of the render tree to on-screen pixels. an application can register a per
formanceobserver for "paint" per
formance entry types and the observer can retrieve the times that paint events occur. use this in
formation to help identify areas that take too long to provide a good user experience. <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:hre...
... areas that take too long to provide a good user experience. ...
...n: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/per
formanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">per
formanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/per
formancepainttiming" target="_top"><rect x="201" y="1" width="220" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="311" y="30" font-size="12px" font-family="consolas,monaco,andale mon...
...And 9 more matches
Compressed texture formats - Web APIs
the webgl api provides methods to use compressed texture
formats. these are useful to increase texture detail while limiting the additional video memory necessary. by default, no compressed
formats are available: a corresponding compressed texture
format extension must first be enabled. usage unless otherwise specified, this article applies to both webgl 1 and 2 contexts. if supported, textures can be stored in a compressed
format in video memory. this allows for additional detail while limiting the added video memory necessary. textures are uncompressed on the fly when being accessed by a shader. ...
...led. usage unless otherwise specified, this article applies to both webgl 1 and 2 contexts. if supported, textures can be stored in a compressed
format in video memory. this allows for additional detail while limiting the added video memory necessary. textures are uncompressed on the fly when being accessed by a shader. note that this advantage doesn't translate to network bandwidth: while the
formats are better than uncompressed data, they are in general far worse than standard image
formats such as png and jpg. ...
...onal detail while limiting the added video memory necessary. textures are uncompressed on the fly when being accessed by a shader. note that this advantage doesn't translate to network bandwidth: while the
formats are better than uncompressed data, they are in general far worse than standard image
formats such as png and jpg. as compressed textures require hardware support, therefore no specific
formats are required by webgl; instead, a context can make different
formats available, depending on hardware support. this site shows which
formats are supported in the used browser. ...
...And 9 more matches
Intl.DateTimeFormat() constructor - JavaScript
the intl.datetime
format() constructor for objects that enable language-sensitive date and time
formatting. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new intl.datetime
format([locales[, options]]) parameters locales optional a string with a bcp 47 language tag, or an array of such strings. to use the browser's default locale, omit this argument or pass undefined. unicode extension are supported (for example "en-us-u-ca-buddhist"). for the general
form and interpretation of the locales argument, see the intl page. the following unicode extension keys are allowed: nu numbering system. possibl...
...a", "tamldec", "telu", "thai", "tibt". ca calendar. possible values include: "buddhist", "chinese", "coptic", "ethiopia", "ethiopic", "gregory", "hebrew", "indian", "islamic", "iso8601", "japanese", "persian", "roc". hc hour cycle. possible values include: "h11", "h12", "h23", "h24". options optional an object with some or all of the following properties: datestyle the date
formatting style to use when calling
format(). possible values include: "full" "long" "medium" "short" timestyle the time
formatting style to use when calling
format(). possible values include: "full" "long" "medium" "short" fractionalseconddigits the number of fractional seconds to apply when calling
format(). valid values are 0-3. calendar calend...
..." long". numberingsystem numbering system. possible values include: "arab", "arabext", " bali", "beng", "deva", "fullwide", " gujr", "guru", "hanidec", "khmr", " knda", "laoo", "latn", "limb", "mlym", " mong", "mymr", "orya", "tamldec", " telu", "thai", "tibt". localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for in
formation about this option, see the intl page. timezone the time zone to use. the only value implementations must recognize is "utc"; the default is the runtime's default time zone. implementations may also recognize the time zone names of the iana time zone database, such as "asia/shanghai", "asia/kolkata", "america/new_york". hour12 whether to use 12-hour time (as opposed to 24-hour time). ...
...And 9 more matches
Intl.NumberFormat - JavaScript
the intl.number
format object is a constructor for objects that enable language sensitive number
formatting. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constructor intl.number
format() creates a new number
format object. static methods intl.number
format.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.number
format.prototype.
format() getter function that
formats a number according to the locale and
formatting options of this number
format object. ...
...r
format object. static methods intl.number
format.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.number
format.prototype.
format() getter function that
formats a number according to the locale and
formatting options of this number
format object. intl.number
format.prototype.
formattoparts() returns an array of objects representing the number string in parts that can be used for custom locale-aware
formatting. intl.number
format.prototype.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object. ...
...r
format.prototype.
formattoparts() returns an array of objects representing the number string in parts that can be used for custom locale-aware
formatting. intl.number
format.prototype.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object. examples basic usage in basic use without specifying a locale, a
formatted string in the default locale and with default options is returned. var number = 3500; console.log(new intl.number
format().
format(number)); // → '3,500' if in us english locale using locales this example shows some of the variations in localized number
formats. ...
...And 9 more matches
Media type and format guide: image, audio, and video content - Web media technologies
since nearly its beginning, the web has included support for some
form of visual media presentation. originally, these capabilities were limited, and were expanded organically, with different browsers finding their own solutions to the problems around including still and video imagery on the web. the modern web has powerful features to support the presentation and manipulation of media, with several media-related apis supporting various types of content. generally, the media
formats supported by a browser are entirely up to the browser's creators, which can complicate the work of a web developer. this guide provides an overview of the media file types, codecs, and algorithms that may comprise media used on the web. ...
...n and manipulation of media, with several media-related apis supporting various types of content. generally, the media
formats supported by a browser are entirely up to the browser's creators, which can complicate the work of a web developer. 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 in
formation for various combinations of these, and suggestions for prioritization of
formats, as well as which
formats excel at specific types of content. ...
...can complicate the work of a web developer. 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 in
formation for various combinations of these, and suggestions for prioritization of
formats, as well as which
formats excel at specific types of content. ...
...And 9 more matches
Mozilla XForms Specials - Archive of obsolete content
this covers both limitations in the extension, and custom extensions. limitations repeat using attributes the specifications mentions "creating repeating structures via attributes", this is partially supported. (limitation tracked in bug 280368) mixing repeat and table or ul it is not possible to mix repeats with either table or ul. that means that it is not possible to do: <table> <xf:repeat ...> <tr> ... </tr> </xf:repeat> </table> or <ul> <xf:repeat ...> <li> ... </li> </xf:repeat> </ul> section 9.3.2 states that mixing with table will probably never work. ...
...either table or ul. that means that it is not possible to do: <table> <xf:repeat ...> <tr> ... </tr> </xf:repeat> </table> or <ul> <xf:repeat ...> <li> ... </li> </xf:repeat> </ul> section 9.3.2 states that mixing with table will probably never work. mixing with ul might suffer from the same limitation. pseudo-class support we currently support all the css pseudo-classes in x
forms (:enabled, :disabled, etc. ), except for :read-only and :read-write, because of non-specified behaviour of these for (x)html. instead you have to use :-moz-read-only and :-moz-read-write for now. (limitation tracked in bug 313111)pseudo element support there is no support for the pseudo elements (::value, ::repeat-item, and ::repeat-index ). instead you will have to use the following normal clas...
...nly and :-moz-read-write for now. (limitation tracked in bug 313111)pseudo element support there is no support for the pseudo elements (::value, ::repeat-item, and ::repeat-index ). instead you will have to use the following normal classes instead: xf-value xf-repeat-item xf-repeat-index for example, to target the value element of an input control use: @namespace xf url("http://www.w3.org/2002/x
forms"); xf|input .xf-value { ... } the pseudo elements are defined in the css3 basic user interface specification . (limitation tracked in bug 271724) optional parameters in xpath functions optional parameters in xpath functions are not supported, you will have to specify all parameters when calling a function. this affects functions like hmac() or digest(). instead of using digest('abc', 'sha-1'...
...And 8 more matches
Displaying Places information using views
an nsinavhistoryresult instance provides the data for a view. the view is responsible for expanding the root nsinavhistorycontainerresultnode of this instance and displaying the nsinavhistoryresultnode objects contained therein. ...
... of the view, you might specify the place attribute directly in the xul. for more complicated queries or queries whose uris you plan on changing, you will want to set the view's place property dynamically using javascript. note that in the latter case it is not sufficient to call setattribute on the element; use the element's place property instead. see querying places and places query uris for in
formation on query uris. the following example uses the built-in tree view to display bookmarks whose titles or urls contain "mozilla". remember that, because xul is xml, any ampersands in query uris must be written as entity reference & and not simply &. <tree type="places" place="place:terms=mozilla&onlybookmarked=1&querytype=1"> <treecols> <treecol id="title" label="my bookmarks...
...w by setting the type attribute to "places" on a tree element. the treechildren element should be empty: <tree type="places"> <treecols> <treecol id="title" flex="1" primary="true" /> <treecol id="url" flex="1" /> </treecols> <treechildren /> </tree> the tree view is implemented in browser/components/places/content/tree.xml. see the tree reference and trees tutorial for general in
formation about trees. if you would like your tree view to be styled in the same manner that firefox styles its uses of the view, you should include the following stylesheet. note that this stylesheet is different from the one given above, which must be included if you use a built-in places view. the following stylesheet is optional and only applies styles and icons to the built-in tree view: <?xml-...
...And 8 more matches
FormData.set() - Web APIs
value the field's value. ...
... value the field's value. ...
... value the field's value. ...
...And 8 more matches
PerformanceEntry.entryType - Web APIs
the entrytype property returns a domstring representing the type of per
formance metric such as, for example, "mark". this property is read only. note: this feature is available in web workers. syntax var type = entry.entrytype; return value the return value depends on the subtype of the per
formanceentry object and affects the value of the per
formanceentry.name property as shown by the table below. per
formance entry type names value subtype type of name property description of name property frame, navigation per
formanceframetiming, per
formancenavigationtiming url the document's address. resource per
formanceresourcetiming url the resolved url of the requested resource. this value doesn't change even if the request is redirected. ...
...ry type names value subtype type of name property description of name property frame, navigation per
formanceframetiming, per
formancenavigationtiming url the document's address. resource per
formanceresourcetiming url the resolved url of the requested resource. this value doesn't change even if the request is redirected. mark per
formancemark domstring the name used when the mark was created by calling per
formance.mark(). measure per
formancemeasure domstring name used when the measure was created by calling per
formance.measure(). ...
...eresourcetiming url the resolved url of the requested resource. this value doesn't change even if the request is redirected. mark per
formancemark domstring the name used when the mark was created by calling per
formance.mark(). measure per
formancemeasure domstring name used when the measure was created by calling per
formance.measure(). paint per
formancepainttiming domstring either 'first-paint' or 'first-contentful-paint'. ...
...And 8 more matches
PerformanceEntry - Web APIs
the per
formanceentry object encapsulates a single per
formance metric that is part of the per
formance timeline. a per
formance entry can be directly created by making a per
formance mark or measure (for example by calling the mark() method) at an explicit point in an application. per
formance entries are also created in indirect ways such as loading a resource (such as an image). per
formanceentry instances will always be one of the following subtypes: per
formancemark per
formancemeasure per
formanceframetiming per
formancenavigationtiming per
formanceresourcetiming per
formancepainttiming note: this feature is available in web workers. properties per
formanceentry.name read only a value that further specifies the value returned by the per
formanceentry.entrytype property. the value of b...
... per
formancemeasure per
formanceframetiming per
formancenavigationtiming per
formanceresourcetiming per
formancepainttiming note: this feature is available in web workers. properties per
formanceentry.name read only a value that further specifies the value returned by the per
formanceentry.entrytype property. the value of both depends on the subtype. see property page for valid values. per
formanceentry.entrytype read only a domstring representing the type of per
formance metric such as, for example, "mark". see property page for valid values. per
formanceentry.starttime read only a domhighrestimestamp representing the starting time for the per
formance metric. ...
...r
formanceentry.entrytype property. the value of both depends on the subtype. see property page for valid values. per
formanceentry.entrytype read only a domstring representing the type of per
formance metric such as, for example, "mark". see property page for valid values. per
formanceentry.starttime read only a domhighrestimestamp representing the starting time for the per
formance metric. per
formanceentry.duration read only a domhighrestimestamp representing the time value of the duration of the per
formance event. methods per
formanceentry.tojson() returns a json representation of the per
formanceentry object. example the following example checks all per
formanceentry properties to see if the browser supports them and if so, write their values to the console. function print_perfo...
...And 8 more matches
Using the Performance API - Web APIs
a fundamental requirement of web per
formance is a precise and consistent definition of time. the domhighrestimestamp type (a double) is used by all per
formance interfaces to hold such time values. additionally, there must be a way to create a timestamp for a specific point in time; this is done with the now() method. web per
formance interfaces are defined in a suite of standards. the base interface for these standards is the per
formance interface and its methods and properties are extended by different standards. this guide describes how to use the per
formance interfaces that are defined in the high-resolution time standard. other web per
formance guides (listed in the see also section) describe how to use additional methods and properties of the per
formance interface. high precision timing ...
...for time values. the unit is milliseconds and should be accurate to 5 µs (microseconds). however, if the browser is unable to provide a time value accurate to 5 microseconds (because of hardware or software constraints, for example), the browser can represent the value as a time in milliseconds accurate to a millisecond. ...
...rate to a millisecond. the following code example shows the use of domhighrestimestamp and the per
formance.now() method. the now() method returns a timestamp (of type domhighrestimestamp) that is a discrete point in time. by calling this method before and after a task, the time it takes to do the task can be measured. function calculate_time() { var starttime; var endtime; starttime = per
formance.now(); do_task(); endtime = per
formance.now(); return (endtime - starttime); } serializing the per
formance object json serialization of the per
formance object is done via the tojson() method. in the following example, json serialization for the per
formance, per
formance.timing and per
formance.navigation objects is printed in the object element. function print_json() { var json; ...
...And 8 more matches
XSL Transformations in Mozilla FAQ - Web APIs
use the <?xml-stylesheet ?> processing instruction instead of the non-standard xml:stylesheet. 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. mozilla won't load xslt stylesheets from a different domain for security reasons. ...
...t media stylesheets. note that firefox will override your xslt stylesheet if your xml is detected as an rss or atom feed. a known workaround is to add a sufficiently long xml comment to the beginning of your xml file in order to "push" the <feed> or <rss> tag out of the first 512 bytes, which is analyzed by firefox to determine if it's a feed or not. see the discussion on bug #338621 for more in
formation. it works in ie, but not in mozilla? there are even more differences. most come from what we suspect ie to do after the trans
formation. it (afaict) serializes and parses the output to generate what it actually renders. mozilla in contrast renders exactly the result of your trans
formation. can i do disable-output-escaping? this is actually pretty close to the question above. and in short,...
... are pretty easy workarounds. the only use cases we have seen are bad xml or bad xslt. and rss feeds. the latter is pretty much the only issue to us, and we're sorry that we can't support it. but mixing parsing with xslt is brittle and we rather not support d-o-e than either crash or be even slower. ...
...And 8 more matches
Intl.ListFormat - JavaScript
the intl.list
format object is a constructor for objects that enable language-sensitive list
formatting. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constructor intl.list
format() creates a new list
format object. static methods intl.list
format.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.list
format.prototype.
format() returns a language-specific
formatted string representing the elements of the list. ...
...intl.list
format() creates a new list
format object. static methods intl.list
format.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.list
format.prototype.
format() returns a language-specific
formatted string representing the elements of the list. intl.list
format.prototype.
formattoparts() returns an array of objects representing the different components that can be used to
format a list of values in a locale-aware fashion. examples using
format the following example shows how to create a list
formatter using the english language. ...
...esenting the elements of the list. intl.list
format.prototype.
formattoparts() returns an array of objects representing the different components that can be used to
format a list of values in a locale-aware fashion. examples using
format the following example shows how to create a list
formatter using the english language. ...
...And 8 more matches
Privacy, permissions, and information security
as users use the web for more and more of their daily tasks, more of their private or personally-identifying in
formation they share, ideally only with sites they trust. cooperation among web content, the web browser, and the web server is needed to achieve as much privacy and in
formation security as possible. in this article, we examine how to create web content that minimizes the risk of users' personal in
formation or imagery being obtained unexpectedly by third parties. security and privacy defined before we go into any depth about the various security and privacy features available to users on the web, let's define some important terms. ...
...as such, pii extends beyond the web to all aspects of life. ...
...as such, pii extends beyond the web to all aspects of life. ...
...And 8 more matches
How to turn off form autocompletion - Web security
this article explains how a website can disable autocomplete for
form fields. by default, browsers remember in
formation that the user submits through <input> fields on websites. this enables the browser to offer autocompletion (that is, suggest possible completions for fields that the user has started typing in) or autofill (that is, pre-populate certain fields upon load). these features are usually enabled by default, but they can be a privacy concern for users, so browsers can let users disable them. however, some data submitted in
forms either are not useful in the future (for example, a one-time pin) or contain sensitive in
formation (for example, a unique government identifier or credit card security code). as website author, you might prefer that the browser not remember the val...
... contain sensitive in
formation (for example, a unique government identifier or credit card security code). as website author, you might prefer that the browser not remember the values for such fields, even if the browser's autocomplete feature is enabled. note that the wcag 2.1 success criterion 1.3.5: identify input purpose does not require that autocomplete/autofill actually work - merely that
form fields that relate to specific personal user in
formation are programmatically identified. this means that the criterion can be passed (by adding the relevant autocomplete attributes to individual
form fields) even when autocompletion for the
form itself has been turned off. ...
... require that autocomplete/autofill actually work - merely that
form fields that relate to specific personal user in
formation are programmatically identified. this means that the criterion can be passed (by adding the relevant autocomplete attributes to individual
form fields) even when autocompletion for the
form itself has been turned off. ...
...And 8 more matches
Web performance resources - Learn web development
use a cdn for resources which can reduce load times significantly. compress your resources using gzip, brotli, and zopfli. ...
... use a cdn for resources which can reduce load times significantly. compress your resources using gzip, brotli, and zopfli. ...
... use a cdn for resources which can reduce load times significantly. compress your resources using gzip, brotli, and zopfli. ...
...And 7 more matches
FormData.append() - Web APIs
value the field's value. ...
... value the field's value. ...
... value the field's value. ...
...And 7 more matches
performance.getEntries() - Web APIs
the getentries() method returns a list of all per
formanceentry objects for the page. the list's members (entries) can be created by making per
formance marks or measures (for example by calling the mark() method) at explicit points in time. if you are only interested in per
formance entries of certain types or that have certain names, see getentriesbytype() and getentriesbyname(). note: this feature is available in web workers. syntax general syntax: entries = window.per
formance.getentries(); return value entries an array of per
formanceentry objects. the items will be in chronological order based on the entries' starttime. example function use_per
formanceentry_methods() { console.log("per
formanceentry tests ..."); if (per
formance.mark === undefined) { console.log("... perf...
...dow.per
formance.getentries(); return value entries an array of per
formanceentry objects. the items will be in chronological order based on the entries' starttime. example function use_per
formanceentry_methods() { console.log("per
formanceentry tests ..."); if (per
formance.mark === undefined) { console.log("... ...
... entries an array of per
formanceentry objects. the items will be in chronological order based on the entries' starttime. example function use_per
formanceentry_methods() { console.log("per
formanceentry tests ..."); if (per
formance.mark === undefined) { console.log("... ...
...And 7 more matches
Introduction to formatting contexts - CSS: Cascading Style Sheets
this article introduces the concept of
formatting contexts, of which there are several types, including block
formatting contexts, inline
formatting contexts, and flex
formatting contexts. the basics of how they behave and how you can make use of these behaviors are also introduced. everything on a page is part of a
formatting context, or an area which has been defined to lay out content in a particular way. a block
formatting context (bfc) will lay child elements out according to block layout rules, a flex
formatting context will lay its children out as flex items, etc. each
formatting context has specific rules about how layout behaves when in that context. ...
...this means that every element inside the <html> element's block is laid out according to normal flow following the rules for block and inline layout. ...
...cular way. a block
formatting context (bfc) will lay child elements out according to block layout rules, a flex
formatting context will lay its children out as flex items, etc. each
formatting context has specific rules about how layout behaves when in that context. block
formatting contexts the outermost element in a document that uses block layout rules establishes the first, or initial block
formatting context. this means that every element inside the <html> element's block is laid out according to normal flow following the rules for block and inline layout. elements participating in a bfc use the rules outlined by the css box model, which defines how an element's margins, borders, and padding interact with other blocks in the same context. ...
...And 7 more matches
Text formatting - JavaScript
icode scalar values are greater than u+ffff (such as some rare chinese/japanese/korean/vietnamese characters and some emoji) are stored in utf-16 with two surrogate code units each. for example, a string containing the single character u+1f600 "emoji grinning face" will have length 2. accessing the individual code units in such a string using brackets may have undesirable consequences such as the
formation of strings with unmatched surrogate code units, in violation of the unicode standard. (examples should be added to this page after mdn bug 857438 is fixed.) see also string.fromcodepoint() or string.prototype.codepointat(). a string object has a variety of methods: for example those that return a variation on the string itself, such as substring and touppercase. the following table summari...
...ubstring, substr return the specified subset of the string, either by specifying the start and end indexes or the start index and a length. match, matchall, replace, replaceall, search work with regular expressions. tolowercase, touppercase return the string in all lowercase or all uppercase, respectively. normalize returns the unicode normalization
form of the calling string value. repeat returns a string consisting of the elements of the object repeated the given times. trim trims whitespace from the beginning and end of the string. multi-line template literals template literals are string literals allowing embedded expressions. you can use multi-line strings and string interpolation features with them. template...
...5; const ten = 10; console.log('fifteen is ' + (five + ten) + ' and not ' + (2 * five + ten) + '.'); // "fifteen is 15 and not 20." now, with template literals, you are able to make use of the syntactic sugar making substitutions like this more readable: const five = 5; const ten = 10; console.log(`fifteen is ${five + ten} and not ${2 * five + ten}.`); // "fifteen is 15 and not 20." for more in
formation, read about template literals in the javascript reference. internationalization the intl object is the namespace for the ecmascript internationalization api, which provides language sensitive string comparison, number
formatting, and date and time
formatting. the constructors for collator, number
format, and datetime
format objects are properties of the intl object. date and time
formatting...
...And 7 more matches
Critical rendering path - Web Performance
the document object model is created as the html is parsed. the html may request javascript, which may, in turn, alter the dom. the html includes or makes requests for styles, which in turn builds the css object model. ...
...ne combines the two to create the render tree. layout determines the size and location of everything on the page. once layout is determined, pixels are painted to the screen. optimizing the critical rendering path improves the time to first render. understanding and optimizing the critical rendering path is important to ensure reflows and repaints can happen at 60 frames per second, to ensure per
formant user interactions and avoid jank. understanding crp web per
formance includes the server requests and responses, loading, scripting, rendering, layout, and the painting of the pixels to the screen. a request for a web page or app starts with an html request. the server returns the html - response headers and data. the browser then begins parsing the html, converting the received bytes to the...
...e, layout occurs, defining the location and size of all the render tree elements. once complete, the page is rendered, or 'painted' on the screen. document object model dom construction is incremental. the html response turns into tokens which turns into nodes which turn into the dom tree. a single dom node starts with a starttag token and ends with an endtag token. nodes contain all relevant in
formation about the html element. the in
formation is described using tokens. nodes are connected into a dom tree based on token hierarchy. if another set of starttag and endtag tokens come between a set of starttag and endtags, you have a node inside a node, which is how we define the hierarchy of the dom tree. the greater the number of nodes, the longer the following events in the critical rendering...
...And 7 more matches
Basic Transformations - SVG: Scalable Vector Graphics
« previousnext » now we're ready to start distorting our beautiful images. but first, let's
formally introduce the <g> element. with this helper, you can assign properties to a complete set of elements. actually, that's its only purpose. an example: <svg width="30" height="10"> <g fill="red"> <rect x="0" y="0" width="10" height="10" /> <rect x="20" y="0" width="10" height="10" /> </g> </svg> all following trans
formations are summed up in an element's trans
form attribute. trans
formations can be chained simply by concatenating them, separated by whitespace. translation it may be necessary to move an element around, even though you can position it with the according attributes. for this purpose, the translate() trans
formation stands ready. <svg ...
...
form attribute. trans
formations can be chained simply by concatenating them, separated by whitespace. translation it may be necessary to move an element around, even though you can position it with the according attributes. for this purpose, the translate() trans
formation stands ready. <svg width="40" height="50" style="background-color:#bff;"> <rect x="0" y="0" width="10" height="10" trans
form="translate(30,40)" /> </svg> the example will render a rectangle, translated to the point (30,40) instead of (0,0). if the second value is not given, it is assumed to be 0. rotation rotating an element is quite a common task. ...
...trans
formation stands ready. <svg width="40" height="50" style="background-color:#bff;"> <rect x="0" y="0" width="10" height="10" trans
form="translate(30,40)" /> </svg> the example will render a rectangle, translated to the point (30,40) instead of (0,0). if the second value is not given, it is assumed to be 0. rotation rotating an element is quite a common task. use the rotate() trans
formation for this: <svg width="31" height="31"> <rect x="12" y="-10" width="20" height="20" trans
form="rotate(45)" /> </svg> this example shows a square that is rotated by 45 degrees. the value for rotate() is given in degrees. multiple trans
formations trans
formations can be concatenated easily just by separating them with spaces. for example, translate() and rotate() are common used tra...
...And 7 more matches
platform/xpcom - Archive of obsolete content
you can just use require("chrome") to get direct access to the components object, and access xpcom objects from there. implementing xpcom interfaces this module exports a class called unknown which implements the fundamental xpcom interface nsisupports. ...
... either using standard javascript inheritance or using the sdk's heritage module, you can provide your own implementations of xpcom interfaces. "unknown" is named after the "iunknown" interface in com. for example, the add-on below implements the nsiobserver interface to listen for and log all topic notifications: var { class } = require('sdk/core/heritage'); var { unknown } = require('sdk/plat
form/xpcom'); var { cc, ci } = require('chrome') var observerservice = cc['@mozilla.org/observer-service;1']. getservice(ci.nsiobserverservice); var starobserver = class({ extends: unknown, interfaces: [ 'nsiobserver' ], topic: '*', register: function register() { observerservice.addobserver(this, this.topic, false); }, unregister: function() { observerser...
...helloworld constructor, we enable xpcom clients to access the helloworld component, given its contract id. in this example the helloworld component is available to javascript only, so we use the technique documented under the "using wrappedjsobject" section of how to build an xpcom component in javascript. ...
...And 6 more matches
Porting NSPR to Unix Platforms - Archive of obsolete content
porting instructions you can use different threading packages to implement nspr threads. ...
... porting instructions you can use different threading packages to implement nspr threads. ...
... porting instructions you can use different threading packages to implement nspr threads. ...
...And 6 more matches
Running Tamarin performance tests - Archive of obsolete content
set the builtinabc environment variable to the path of the builtin.abc. (in the tamarin-redux/generated directory) set the shellabc environment variable to the path of the shell_toplevel.abc. (in tamarin-redux/generated directory) set the asc environment variable to the path of the asc.jar compiler. you may download the latest asc.jar from ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar. ...
...able to the path of the shell_toplevel.abc. (in tamarin-redux/generated directory) set the asc environment variable to the path of the asc.jar compiler. you may download the latest asc.jar from ftp://ftp.mozilla.org/pub/js/tamarin...latest/asc.jar. also the source to asc.jar may be downloaded and rebuilt from http://opensource.adobe.com/wiki/dis...exsdk/flex+sdk. (optional) you may compare the per
formance of the avmshell to another avmshell. for example you may download or build the latest checked in avmshell to compare against a local change. to compare a build against another build set the avm2 environment variable to the other avmshell or use the "-s --avm2" options. results from the two shells will be shown side to side and the percent speedup will be shown. $ cd tamarin-redux/test/perfor...
...fied by selecting ./runtests.py -c [misc,scimark,jsbench]. also for better accuracy tests may be run multiple times. specifying ./runtests.py -i 10 will run each tests 10 time and use the fastest result. if more than 2 repetitions are specified the 95% percentile confidence rating is calculated. the confidence rating measures the percentage of the mean 95% of the results were within the range. ...
...And 6 more matches
HTML performance features - Learn web development
previous overview: per
formance next html is by default fast and accessible. it is our job, as developers, to ensure that we preserve these two properties when creating or editing html code. complications can occur when, for example, the file size of a <video> embed is too large, or when a webpage is not optimized for mobile devices. this module intends to walk you through the key html per
formance features that can drastically improve the quality of your webpage. prerequisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies. objective: to learn about the impact of html elements and attributes on web per
formance optimization. ...
...to walk you through the key html per
formance features that can drastically improve the quality of your webpage. prerequisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies. objective: to learn about the impact of html elements and attributes on web per
formance optimization. ...
...tes on web per
formance optimization. elements & attributes impacting per
formance the <picture> element the <video> element the <source> element the <img> srcset attribute responsive images preloading content with rel="preload" - (https://w3c.github.io/preload/ ) async / defer attributes <iframe> <object> <script> rel attribute conclusion previous overview: per
formance next in this module the "why" of web per
formance what is web per
formance? how do users perceive per
formance? ...
...And 6 more matches
Performance
the articles linked to from here will help you improve per
formance, whether you're developing core mozilla code or an add-on. documentation reporting a per
formance problem a user friendly guide to reporting a per
formance problem. a development environment is not required. benchmarking tips on generating valid per
formance metrics. per
formance best practices in extensions a per
formance "best practices" guide for extension developers. measuring add-on startup per
formance a guide for add-on developers on how to set up a per
formance testing environment. ...
...
formance problem. a development environment is not required. benchmarking tips on generating valid per
formance metrics. per
formance best practices in extensions a per
formance "best practices" guide for extension developers. measuring add-on startup per
formance a guide for add-on developers on how to set up a per
formance testing environment. xul school: add-on per
formance tips for add-on developers to help them avoid impairing application per
formance. gpu per
formance tips for profiling and improving per
formance when using a gpu. scroll-linked effects in
formation on scroll-linked effects, their effect on per
formance, related tools, and possible mitigation techniques. ...
...testing environment. xul school: add-on per
formance tips for add-on developers to help them avoid impairing application per
formance. gpu per
formance tips for profiling and improving per
formance when using a gpu. scroll-linked effects in
formation on scroll-linked effects, their effect on per
formance, related tools, and possible mitigation techniques. automated per
formance testing and sheriffing in
formation on automated per
formance testing and sheriffing at mozilla. best practices for front-end engineers tips for reducing impacts on browser per
formance in front-end code. memory profiling and leak detection tools the developer tools "memory" panel the memory panel in the devtools supports taking heap snapshots, diffing th...
...And 6 more matches
CanvasPattern.setTransform() - Web APIs
the pattern gets applied if you set it as the current fillstyle and gets drawn onto the canvas when using the fillrect() method, for example. ...
...the pattern gets applied if you set it as the current fillstyle and gets drawn onto the canvas when using the fillrect() method, for example. ...
...the pattern gets applied if you set it as the current fillstyle and gets drawn onto the canvas when using the fillrect() method, for example. ...
...And 6 more matches
PerformanceEntry.toJSON() - Web APIs
the tojson() method is a serializer; it returns a json representation of the per
formance entry object. note: this feature is available in web workers. syntax json = perfentry.tojson(); arguments none return value json a json object that is the serialization of the per
formanceentry object. example the following example shows the use of the tojson() method. function run_per
formanceentry() { log("per
formanceentry support ..."); if (per
formance.mark === undefined) { log("... ...
... this feature is available in web workers. syntax json = perfentry.tojson(); arguments none return value json a json object that is the serialization of the per
formanceentry object. example the following example shows the use of the tojson() method. function run_per
formanceentry() { log("per
formanceentry support ..."); if (per
formance.mark === undefined) { log("... ...
....tojson(); arguments none return value json a json object that is the serialization of the per
formanceentry object. example the following example shows the use of the tojson() method. function run_per
formanceentry() { log("per
formanceentry support ..."); if (per
formance.mark === undefined) { log("... ...
...And 6 more matches
SVGTransformable - Web APIs
browser compatibility the compatibility table on this page is generated from structured data. ...
... browser compatibility the compatibility table on this page is generated from structured data. ...
... browser compatibility the compatibility table on this page is generated from structured data. ...
...And 6 more matches
WebGLTransformFeedback - Web APIs
the webgltrans
formfeedback interface is part of the webgl 2 api and enables trans
form feedback, which is the process of capturing primitives generated by vertex processing. it allows to preserve the post-trans
form rendering state of an object and resubmit this data multiple times. ...
... the webgltrans
formfeedback interface is part of the webgl 2 api and enables trans
form feedback, which is the process of capturing primitives generated by vertex processing. it allows to preserve the post-trans
form rendering state of an object and resubmit this data multiple times. ...
...ce is part of the webgl 2 api and enables trans
form feedback, which is the process of capturing primitives generated by vertex processing. it allows to preserve the post-trans
form rendering state of an object and resubmit this data multiple times. ...
...And 6 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
webvtt files the mime type of webvtt is text/vtt. a webvtt file (.vtt) contains cues, which can be either a single line or multiple lines, as shown below: webvtt 00:01.000 --> 00:04.000 - never drink liquid nitrogen. 00:05.000 --> 00:09.000 - it will perforate your stomach. - you could die. ...
... webvtt files the mime type of webvtt is text/vtt. a webvtt file (.vtt) contains cues, which can be either a single line or multiple lines, as shown below: webvtt 00:01.000 --> 00:04.000 - never drink liquid nitrogen. 00:05.000 --> 00:09.000 - it will perforate your stomach. - you could die. ...
...e for showing the text that appears underneath. on the same line, we then have a string of "-->". we finish the first line with a second time, which is the ending time for showing the associated text. we can then have one or more lines that start with a hyphen (-), each containing part of the text track to be shown. we can also place comments in our .vtt file, to help us remember important in
formation about the parts of our file. these should be on separate lines, starting with the string note. you'll find more about these in the below section. it is important to not use "extra" blank lines within a cue, for example between the timings line and the cue payload. webvtt is line based; a blank line will close the cue. webvtt comments comments are an optional component that can be used to ...
...And 6 more matches
Intl.RelativeTimeFormat() constructor - JavaScript
possible values are: "always" (default, e.g., 1 day ago), or "auto" (e.g., yesterday). ...
...possible values are: "always" (default, e.g., 1 day ago), or "auto" (e.g., yesterday). ...
...possible values are: "always" (default, e.g., 1 day ago), or "auto" (e.g., yesterday). ...
...And 6 more matches
OpenSearch description format
this article focuses on creating opensearch-compatible search plugins that support these additional firefox features. opensearch description files can be advertised as described in autodiscovery of search plugins, and can be installed programmatically as described in adding search engines from web pages. ...
... a website describe a search engine for itself, so that a browser or other client application can use that search engine. opensearch is supported by (at least) firefox, edge, internet explorer, safari, and chrome. (see reference material for links to other browsers' documentation.) firefox also supports additional features not in the opensearch standard, such as search suggestions and the <search
form> element. this article focuses on creating opensearch-compatible search plugins that support these additional firefox features. opensearch description files can be advertised as described in autodiscovery of search plugins, and can be installed programmatically as described in adding search engines from web pages. opensearch description file the xml file that describes a search engine follows ...
...it must be 16 or fewer characters of plain text, with no html or other markup. description a brief description of the search engine. it must be 1024 or fewer characters of plain text, with no html or other markup. inputencoding the character encoding to use when submitting ...
...And 6 more matches
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
optional attributes count specifies what in the source tree should be numbered sequentially. it uses an xpath expression. ...
... optional attributes count specifies what in the source tree should be numbered sequentially. it uses an xpath expression. ...
... optional attributes count specifies what in the source tree should be numbered sequentially. it uses an xpath expression. ...
...And 6 more matches
JavaScript/XSLT Bindings - XSLT: Extensible Stylesheet Language Transformations
the stylesheet has to be passed in as an xml document, which means that the .xsl file has to be loaded by the page before calling xsltprocessor.importstylesheet(). this can be done via xmlhttprequest or xmldocument.load(). ...
...the stylesheet has to be passed in as an xml document, which means that the .xsl file has to be loaded by the page before calling xsltprocessor.importstylesheet(). this can be done via xmlhttprequest or xmldocument.load(). ...
...the xml document can be a separate xml file loaded as shown in figure 1, or it can be part of the existing page. to process part of a page's dom, it is necessary to first create an xml document in memory. assuming that the dom to be processed is contained by an elemen...
...And 6 more matches
XForms API Reference - Archive of obsolete content
this page is the beginning of the x
forms api reference. ...
... this page is the beginning of the x
forms api reference. ...
... this page is the beginning of the x
forms api reference. ...
...And 5 more matches
Building Mozilla XForms - Archive of obsolete content
getting started things to know first: the x
forms extension has a dependency on the schema-validation extension, so you need to build both (that's done automatically) mozilla switched from cvs to mercurial starting with firefox 3.5. during cvs times, the mozilla repository contained both extensions. since the switch to mercurial, the extensions live in separate repositories. before you can start building the x
forms extension, you should check your mozilla build environment by doing a regular firefox build. have a look at the build instructions for detailed in
formation for your plat
form. the following table gives you an overview of which version you want to build: firefox version gecko/toolkit version source code notes status firefox 2.0 gecko 1.8.1 cvs, branch mozilla_1_8_bra...
...d in
formation for your plat
form. ...
... firefox version gecko/toolkit version source code notes status firefox 2.0 gecko 1.8.1 cvs, branch mozilla_1_8_branch not developed any more last release: 0.8.5ff2 firefox 3.0 gecko 1.9.0 cvs, branch head not developed any more last release: 0.8.5ff3 firefox 3.5 gecko 1.9.1 x
forms/schema-validation code does not build with firefox 3.5 any more not supported firefox 3.6 gecko 1.9.2 x
forms/schema-validation code does not build with firefox 3.6 any more not developed any more last release: 0.8.6 firefox 4 gecko 2.0 mercurial, repositories mozilla-central x
forms schema-validation mostly works upcoming 0.8.7 release if you have your first working firefox build, you can go on with building the x
forms extension. firefox 3.5 and up: get the source code if you want to build x
form...
...And 5 more matches
XForms Repeat Element - Archive of obsolete content
node set binding special startindex - optional 1-based initial value of the repeat index. ...
... node set binding special startindex - optional 1-based initial value of the repeat index. the default value is 1. ...
...d control set is placed vertically. compact layout each generated control set is placed horizontally. occurs when the repeat element's appearance attribute has a value of compact. behaviour focusing a generated control may change the current index of the containing repeat element. the index is equal to the index of the control set that the focused control belongs to. actions you can use x
forms action module elements to modify the nodeset that the repeat element is bound to. the most useful actions for altering the contents of a repeat are the insert (see the spec), delete (see the spec) and setindex (see the spec) elements. example <model> <instance> <my:lines> <my:line name="a"> <my:price>3.00</my:price> </my:line> <my:line name="b"> <my:pri...
...And 5 more matches
HTMLFormElement.requestSubmit() - Web APIs
the html
formelement method requestsubmit() requests that the
form be submitted using a specific submit button. syntax html
formelement.requestsubmit(submitter); parameters submitter optional the submit button whose attributes describe the method by which the
form is to be submitted. this may be either an <input> or <button> element whose type attribute is submit. if you omit the submitter parameter, the
form element itself is used as the submitter. return value none. exceptions typeerror the specified submitter is not a submit button. notfounderror the specified submitter isn't a member of the
form on which requestsubmit() was called. the submitter must be either a descendant of the
form element or must have an
form attribute referring to the
form. usage notes the obv...
... button. notfounderror the specified submitter isn't a member of the
form on which requestsubmit() was called. the submitter must be either a descendant of the
form element or must have an
form attribute referring to the
form. usage notes the obvious question is: why does this method exist, when we've had the submit() method since the dawn of time? ...
.... the submitter must be either a descendant of the
form element or must have an
form attribute referring to the
form. usage notes the obvious question is: why does this method exist, when we've had the submit() method since the dawn of time? ...
...And 5 more matches
HTMLFormElement: submit event - Web APIs
the submit event fires when a <
form> is submitted. 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. however, the submitevent which is sent to indicate the
form's submit action has been triggered includes a submitter property, which is the button that was invoked to trigger the submit request. 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. ...
...t. however, the submitevent which is sent to indicate the
form's submit action has been triggered includes a submitter property, which is the button that was invoked to trigger the submit request. 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. the event is not sent to the
form when calling the
form.submit() method directly. note: trying to submit a
form that does not pass validation triggers an invalid event. in this case, the validation prevents
form submission, and thus there is no submit event. ...
...ter while editing a field (e.g. <input type="text">) in a
form. the event is not sent to the
form when calling the
form.submit() method directly. note: trying to submit a
form that does not pass validation triggers an invalid event. in this case, the validation prevents
form submission, and thus there is no submit event. examples this example uses eventtarget.addeventlistener() to listen for
form submit, and logs the current event.timestamp whenever that occurs, then prevents the default action of submitting the
form. ...
...And 5 more matches
performance.measure() - Web APIs
name - set to the "name" given when the measure was created. starttime - set to the start mark timestamp. ...
... name - set to the "name" given when the measure was created. starttime - set to the start mark timestamp. ...
... name - set to the "name" given when the measure was created. starttime - set to the start mark timestamp. duration - set to a domhighrestimestamp that is the duration of the measure (typically, the end mark timestamp minus the start mark timestamp). ...
...And 5 more matches
WebGL2RenderingContext.uniformMatrix[234]x[234]fv() - Web APIs
the webgl2renderingcontext.uni
formmatrix[234]x[234]fv() methods of the webgl 2 api specify matrix values for uni
form variables. there are no 2x2, 3x3, and 4x4 versions of this method. they are abbreviated in 2, 3, and 4, respectively. see the syntax below. ...
... the webgl2renderingcontext.uni
formmatrix[234]x[234]fv() methods of the webgl 2 api specify matrix values for uni
form variables. there are no 2x2, 3x3, and 4x4 versions of this method. they are abbreviated in 2, 3, and 4, respectively. see the syntax below. ...
... the webgl2renderingcontext.uni
formmatrix[234]x[234]fv() methods of the webgl 2 api specify matrix values for uni
form variables. there are no 2x2, 3x3, and 4x4 versions of this method. they are abbreviated in 2, 3, and 4, respectively. see the syntax below. ...
...And 5 more matches
Using CSS transforms - CSS: Cascading Style Sheets
by modifying the coordinate space, css trans
forms change the shape and position of the affected content without disrupting the normal document flow. this guide provides an introduction to using trans
forms. css trans
forms are implemented using a set of css properties that let you apply affine linear trans
formations to html elements. these trans
formations include rotation, skewing, scaling, and translation both in the plane and in the 3d space. only elements positioned by the box model can be trans
formed. as a rule of thumb, an element is positioned by the box model if it has display: block. css trans
forms properties two major properties are used to define css trans
forms: trans
form and trans
form-origin trans
form-origin specifies the position of the origin. by default, it is at the ce...
...itioned by the box model can be trans
formed. as a rule of thumb, an element is positioned by the box model if it has display: block. css trans
forms properties two major properties are used to define css trans
forms: trans
form and trans
form-origin trans
form-origin specifies the position of the origin. by default, it is at the center of the element and can be moved. it is used by several trans
forms, like rotations, scaling or skewing, that need a specific point as a parameter. trans
form specifies the trans
forms to apply to the element. it is a space-separated list of trans
forms, which are applied one after the other, as requested by the composition operation. composite trans
forms are effectively applied in order from right to left. examples here is an unaltered image of the mdn logo: ...
...ies the trans
forms to apply to the element. it is a space-separated list of trans
forms, which are applied one after the other, as requested by the composition operation. composite trans
forms are effectively applied in order from right to left. examples here is an unaltered image of the mdn logo: rotating here is the mdn logo rotated 90 degrees from its bottom-left corner. <img style="trans
form: rotate(90deg); trans
form-origin: bottom left;" src="https://udn.realityripple.com/samples/6d/6633f3efc0.png"> skewing and translating here is the mdn logo, skewed by 10 degrees and translated by 150 pixels on the x-axis. ...
...And 5 more matches
Date and time formats used in HTML - HTML: Hypertext Markup Language
certain html elements use date and/or time values. the
formats of the strings that specify these values are described in this article. elements that use such
formats include certain
forms of the <input> element that let the user choose or specify a date, time, or both, as well as the <ins> and <del> elements, whose datetime attribute specifies the date or date and time at which the insertion or deletion of content occurred. for <input>, the values of type that return a value which contains a string representing a date and/or time are: date datetime datetime-local month time week examples before getting into the intricacies of how date and time strings are written and parsed in html, here are some examples that should give you a good idea what the more commonly-used date and ti...
...tent occurred. for <input>, the values of type that return a value which contains a string representing a date and/or time are: date datetime datetime-local month time week examples before getting into the intricacies of how date and time strings are written and parsed in html, here are some examples that should give you a good idea what the more commonly-used date and time string
formats look like. example html date and time strings string date and/or time 2005-06-07 june 7, 2005 [details] 08:45 8:45 am [details] 08:45:25 8:45 am and 25 seconds [details] 0033-08-04t03:40 3:40 am on august 4, 33 [details] 1977-04-01t14:00:30 30 seconds after 2:00 pm on april 1, 1977 [details] 1...
...ails] 0033-08-04t03:40 3:40 am on august 4, 33 [details] 1977-04-01t14:00:30 30 seconds after 2:00 pm on april 1, 1977 [details] 1901-01-01t00:00z midnight utc on january 1, 1901 [details] 1901-01-01t00:00:01-04:00 1 second past midnight eastern standard time (est) on january 1, 1901 [details] basics before looking at the various
formats of date and time related strings used by html elements, it is helpful to understand a few fundamental facts about the way they're defined. html uses a variation of the iso 8601 standard for its date and time strings. it's worth reviewing the descriptions of the
formats you're using in order to ensure that your strings are in fact compatible with html, as the html specification includes algorit...
...And 5 more matches
Intl.RelativeTimeFormat - JavaScript
the intl.relativetime
format object enables language-sensitive relative time
formatting. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constructor intl.relativetime
format.relativetime
format() creates a new intl.relativetime
format object. static methods intl.relativetime
format.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. ...
...interactive-examples and send us a pull request. constructor intl.relativetime
format.relativetime
format() creates a new intl.relativetime
format object. static methods intl.relativetime
format.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.relativetime
format.prototype.
format()
formats a value and a unit according to the locale and
formatting options of the given intl.relativetime
format object. ...
...c methods intl.relativetime
format.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.relativetime
format.prototype.
format()
formats a value and a unit according to the locale and
formatting options of the given intl.relativetime
format object. intl.relativetime
format.prototype.
formattoparts() returns an array of objects representing the relative time
format in parts that can be used for custom locale-aware
formatting. intl.relativetime
format.prototype.resolvedoptions() returns a new object with properties reflecting the locale and
formatting options computed during initialization of the object. ...
...And 5 more matches
An Overview - XSLT: Extensible Stylesheet Language Transformations
an xslt stylesheet is marked as such by the inclusion of a standard xslt heading. ...
...uage/trans
form is a very powerful language, and a complete discussion of it is well beyond the scope of this article, but a brief discussion of some basic concepts will be helpful in understanding the description of netscape's capabilities that follows. an xslt stylesheet is an xml document. unlike css, which has its own specialized syntax, an xslt stylesheet is an xml document, which must con
form to all xml rules, including well-
formedness. so the model for trans
formation is that one xml document is used to trans
form another xml document. an xslt stylesheet is marked as such by the inclusion of a standard xslt heading. the outermost element in an xslt stylesheet must be the <xsl:stylesheet> element (an acceptable alternate is the <xsl:trans
form> element). this element will include at le...
...standard xslt heading. the outermost element in an xslt stylesheet must be the <xsl:stylesheet> element (an acceptable alternate is the <xsl:trans
form> element). this element will include at least one namespace declaration and the mandatory version attribute. other namespaces and three optional attributes may also be included. the mandatory namespace for xslt is "http://www.w3.org/1999/xsl/trans
form". namespaces are the subject of a fair amount of confusion in xml. despite the fact that very often namespaces appear to be uris, they do not, in fact, refer to a resource located at that address. ...
...And 5 more matches
Building TransforMiiX standalone - Archive of obsolete content
this document is out of date. we support building a standalone version of trans
formiix on windows, unix and os x. read the build instructions for your plat
form to get the requirements, which are the same as for mozilla. you need to get the source from cvs. add tx_exe=1 mk_add_options build_modules="xpcom trans
formiix" ac_add_options --enable-standalone-modules="xpcom trans
formiix" to your .mozconfig, and use client.mk to pull as usual. this will pull the necessary subtree with mozilla/client.mk mozilla/build/unix/modules.mk mozilla/build mozilla/config mozilla/expat mozilla/extensions/trans
formiix mozilla/include mozilla/allmakefiles.sh mozilla/client.mk mozilla/aclocal.m4 mozilla/configure mozilla/configure.in mozilla/makefile.in plus nspr and xpcom from the cvs repository. building ...
...g from a full mozilla tree is not supported. it is recommended to add ac_add_options --disable-gtktest ac_add_options --without-jpeg ac_add_options --without-zlib ac_add_options --without-png ac_add_options --without-x to your .mozconfig, too, as it stops configure from testing unneeded libs. make -f client.mk build as usual. ...
...supported. it is recommended to add ac_add_options --disable-gtktest ac_add_options --without-jpeg ac_add_options --without-zlib ac_add_options --without-png ac_add_options --without-x to your .mozconfig, too, as it stops configure from testing unneeded libs. make -f client.mk build as usual. of course, make -f client.mk checks out and builds just trans
formiix alright. ...
...And 4 more matches
XForms Submit Element - Archive of obsolete content
accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special submission - required reference to element submission. ...
... accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special submission - required reference to element submission. ...
... accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special submission - required reference to element submission. ...
...And 4 more matches
Reporting a Performance Problem
this article will guide you in reporting a per
formance problem using the built-in gecko profiler tool. enabling the profiler toolbar button these steps only work in firefox 75+. visit https://profiler.firefox.com/ click on "enable profiler menu button" the profiler toolbar button will show up in the top right of the url bar as a small stopwatch icon you can right-click on the button and remove it from the toolbar when you're done with it. using the profiler when enabled, the profiler toolbar button is not recording by default. recording can be done by clicking on the toolbar icon to open its panel. make sure to choose an appropriate setting for the recording (if you're not sure, choose firefox plat
form), and then choosing "start recording". the toolbar icon turns blue when...
...if you choose custom settings (and then clicking edit settings) for the profiler, you can adjust the size of the buffer (presently defaults to 90 mb) and the time interval between data collection (presently defaults to 1 ms). note that increasing the buffer size uses more memory and can make capturing a profile take longer. ...
...s). note that increasing the buffer size uses more memory and can make capturing a profile take longer. using the keyboard shortcuts is often more convenient than using the mouse to interact with the ui: ctrl+shift+1 - start/stop the profiler ctrl+shift+2 - take a profile and launch the viewer to view it capturing and sharing a profile while the profiler is recording, reproduce the per
formance problem. if possible let the problem manifest itself for 5-10 seconds. press ctrl+shift+2 or click on the profiler toolbar icon in the top right and select 'capture'. try to do this within a few seconds from reproducing the per
formance problem as only the last few seconds are recorded. if the timeline has a large red block it's a good sign. the data will open in a new tab. wait until the...
...And 4 more matches
TPS Formdata Lists
a
formdata asset list is an array of objects, each with the following properties: fieldname: required. value: required. date: the date the
form data was used, expressed in hours from the present, so 0 means now, and -24 means 24 hours ago. optional, defaults to 0. ...
... a
formdata asset list is an array of objects, each with the following properties: fieldname: required. value: required. date: the date the
form data was used, expressed in hours from the present, so 0 means now, and -24 means 24 hours ago. optional, defaults to 0. ...
...dname: required. value: required. date: the date the
form data was used, expressed in hours from the present, so 0 means now, and -24 means 24 hours ago. optional, defaults to 0. ...
...And 4 more matches
CanvasRenderingContext2D.setTransform() - Web APIs
the canvasrenderingcontext2d.settrans
form() method of the canvas 2d api resets (overrides) the current trans
formation to the identity matrix, and then invokes a trans
formation described by the arguments of this method. this lets you scale, rotate, translate (move), and skew the context. note: see also the trans
form() method; instead of overriding the current trans
form matrix, it multiplies it with a given one. syntax ctx.settrans
form(a, b, c, d, e, f); ctx.settrans
form(matrix); the trans
formation matrix is described by: [acebdf001]\left[ \begin{array}{ccc} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{array} \right] parameters settrans
form() has two types of parameter that it can accept. ...
...with a given one. syntax ctx.settrans
form(a, b, c, d, e, f); ctx.settrans
form(matrix); the trans
formation matrix is described by: [acebdf001]\left[ \begin{array}{ccc} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{array} \right] parameters settrans
form() has two types of parameter that it can accept. the older type consists of several parameters representing the individual components of the trans
formation matrix to set: a (m11) horizontal scaling. a value of 1 results in no scaling. b (m12) vertical skewing. c (m21) horizontal skewing. d (m22) vertical scaling. a value of 1 results in no scaling. e (dx) horizontal translation (moving). f (dy) vertical translation (moving). ...
... examples skewing a shape this example skews a rectangle both vertically (.2) and horizontally (.8). scaling and translation remain unchanged. ...
...And 4 more matches
CanvasRenderingContext2D.transform() - Web APIs
a value of 1 results in no scaling. b (m12) vertical skewing. c (m21) horizontal skewing. d (m22) vertical scaling. a value of 1 results in no scaling. ...
...a value of 1 results in no scaling. b (m12) vertical skewing. c (m21) horizontal skewing. d (m22) vertical scaling. a value of 1 results in no scaling. ...
...a value of 1 results in no scaling. b (m12) vertical skewing. c (m21) horizontal skewing. d (m22) vertical scaling. a value of 1 results in no scaling. ...
...And 4 more matches
HTMLObjectElement.form - Web APIs
living standard initial definition. ...
... living standard initial definition. ...
... living standard initial definition. ...
...And 4 more matches
performance.clearMeasures() - Web APIs
the clearmeasures() method removes the named measure from the browser's per
formance entry buffer. if the method is called with no arguments, all per
formance entries with an entry type of "measure" will be removed from the per
formance entry buffer. note: this feature is available in web workers. syntax per
formance.clearmeasures(); per
formance.clearmeasures(name); arguments name optional a domstring representing the name of the timestamp. if this argument is omitted, all per
formance entries with an entry type of "measure" will be removed. return value void example the following example shows both uses of the clearmeasures() method. // create a small helper to show how many per
formancemeasure entries there are. function logmeasurecount() { console.log( "found this many...
...ng the name of the timestamp. if this argument is omitted, all per
formance entries with an entry type of "measure" will be removed. return value void example the following example shows both uses of the clearmeasures() method. // create a small helper to show how many per
formancemeasure entries there are. function logmeasurecount() { console.log( "found this many entries: " + per
formance.getentriesbytype("measure").length ); } // create a bunch of measures. ...
...h an entry type of "measure" will be removed. return value void example the following example shows both uses of the clearmeasures() method. // create a small helper to show how many per
formancemeasure entries there are. function logmeasurecount() { console.log( "found this many entries: " + per
formance.getentriesbytype("measure").length ); } // create a bunch of measures. ...
...And 4 more matches
performance.clearResourceTimings() - Web APIs
the clearresourcetimings() method removes all per
formance entries with an entrytype of "resource" from the browser's per
formance data buffer and sets the size of the per
formance data buffer to zero. to set the size of the browser's per
formance data buffer, use the per
formance.setresourcetimingbuffersize() method. note: this feature is available in web workers. syntax per
formance.clearresourcetimings(); arguments void return value none this method has no return value. ...
...ffer, use the per
formance.setresourcetimingbuffersize() method. note: this feature is available in web workers. syntax per
formance.clearresourcetimings(); arguments void return value none this method has no return value. ...
...esourcetimingbuffersize() method. note: this feature is available in web workers. syntax per
formance.clearresourcetimings(); arguments void return value none this method has no return value. ...
...And 4 more matches
TransformStream - Web APIs
the trans
formstream interface of the streams api represents a set of trans
formable data. constructor trans
formstream() creates and returns a trans
form stream object from the given handlers. properties trans
formstream.readable read only the readable end of a trans
formstream. trans
formstream.writable read only the writable end of a trans
formstream. methods none examples anything-to-uint8array stream in the following example, a trans
form stream passes through all chunks it receives as uint8array values. const trans
formcontent = { start() {}, // required. ...
... properties trans
formstream.readable read only the readable end of a trans
formstream. trans
formstream.writable read only the writable end of a trans
formstream. methods none examples anything-to-uint8array stream in the following example, a trans
form stream passes through all chunks it receives as uint8array values. const trans
formcontent = { start() {}, // required. ...
...ler.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 uint8array(chunk)) else if ('function' === typeof chunk.valueof && chunk.valueof() !== chunk) this.trans
form(chunk.valueof(), controller) // hack else if ('tojson' in chunk) this.trans
form(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...
...And 4 more matches
WebGLRenderingContext.getActiveUniform() - Web APIs
the webglrenderingcontext.getactiveuni
form() method of the webgl api returns a webglactiveinfo object containing size, type, and name of a uni
form attribute. it is generally used when querying unknown uni
forms either for debugging or generic library creation. syntax webglactiveinfo webglrenderingcontext.getactiveuni
form(program, index); parameters program a webglprogram specifying the webgl shader program from which to obtain the uni
form variable's in
formation. index a gluint specifying the index of the uni
form attribute to get. this value is an index 0 to n - 1 as returned by gl.getprogramparameter(program, gl.active_uni
forms). return value a webglactiveinfo object describing the uni
form. the type attribute of the return value will be one of the following: gl.float gl.float...
...cube gl.sampler_2d_shadow gl.sampler_2d_array gl.sampler_2d_array_shadow gl.sampler_cube_shadow gl.int_sampler_2d gl.int_sampler_3d gl.int_sampler_cube gl.int_sampler_2d_array gl.unsigned_int_sampler_2d gl.unsigned_int_sampler_3d gl.unsigned_int_sampler_cube gl.unsigned_int_sampler_2d_array when gl.linkprogram is called, webgl creates a list of active uni
forms. these are possible values of the name attribute of return values of getactiveuni
form. webgl generates one or more entries in the list depending on the declared type of the uni
form in the shader: single basic type: one entry with the name of the uni
form. e.g. uni
form vec4 a; will result in a. array of basic type: one entry with the name of the uni
form suffixed with [0]. e.g. uni
form vec4 b...
... webgl generates one or more entries in the list depending on the declared type of the uni
form in the shader: single basic type: one entry with the name of the uni
form. e.g. uni
form vec4 a; will result in a. array of basic type: one entry with the name of the uni
form suffixed with [0]. e.g. uni
form vec4 b[]; will result in b[0]. struct type: one entry for each member of the struct. e.g. uni
form struct { float foo; vec4 bar; } c; will result in c.foo and c.bar. arrays of structs or arrays: each entry of the array will generate its own entries. e.g. uni
form struct { float foo; vec4 bar; } d[2]; will result in: d[0].foo d[0].bar d[1].foo d[1].bar uni
form blocks: one entry for each member. if the uni
form block has an instance name, the block name is prefixed. e.g. unif...
...And 4 more matches
Keyframe Formats - Web APIs
element.animate([ { // from opacity: 0, color: "#fff" }, { // to opacity: 1, color: "#000" } ], 2000); offsets for each keyframe can be specified by providing an offset value. ...
... element.animate([ { // from opacity: 0, color: "#fff" }, { // to opacity: 1, color: "#000" } ], 2000); offsets for each keyframe can be specified by providing an offset value. ...
... element.animate([ { // from opacity: 0, color: "#fff" }, { // to opacity: 1, color: "#000" } ], 2000); offsets for each keyframe can be specified by providing an offset value. ...
...And 4 more matches
XRRigidTransform() - Web APIs
the xrrigidtrans
form() constructor creates and returns a new xrrigidtrans
form object, representing the position and orientation of a point or object. among other things, xrrigidtrans
form is used when providing a trans
form to translate between coordinate systems across spaces. syntax let xrrigidtrans
form = new xrrigidtrans
form(position, orientation); parameters position optional an object con
forming to dompointinit which specifies the coordinates at which the point or object is located. these dimensions are specified in meters. if this parameter is left out or is not compatible with dompointinit, the position used is assumed to be {x: 0, y: 0, z: 0, w: 1}. w must always be 1. ...
...m(position, orientation); parameters position optional an object con
forming to dompointinit which specifies the coordinates at which the point or object is located. these dimensions are specified in meters. if this parameter is left out or is not compatible with dompointinit, the position used is assumed to be {x: 0, y: 0, z: 0, w: 1}. w must always be 1. orientation optional an object con
forming to dompointinit which specifies the direction in which the object is facing. the default value for orientation is {x: 0, y: 0, z: 0, w: 1}. the specified orientation gets normalized if it's not already. ...
...is not compatible with dompointinit, the position used is assumed to be {x: 0, y: 0, z: 0, w: 1}. w must always be 1. orientation optional an object con
forming to dompointinit which specifies the direction in which the object is facing. the default value for orientation is {x: 0, y: 0, z: 0, w: 1}. the specified orientation gets normalized if it's not already. return value a new xrrigidtrans
form object which has been initialized to represent a trans
form matrix that would adjust the position and orientation of an object from the origin to the specified position and facing in the direction indicated by orientation. 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, st...
...And 4 more matches
Block formatting context - Developer guides
floats (elements where float isn't none). absolutely positioned elements (elements where position is absolute or fixed). inline-blocks (elements with display: inline-block). table cells (elements with display: table-cell, which is the default for html table cells). table captions (elements with display: table-caption, which is the default for html table captions). ...
... flex or inline-flex) if they are neither flex nor grid nor table containers themselves. grid items (direct children of the element with display: grid or inline-grid) if they are neither flex nor grid nor table containers themselves. multicol containers (elements where column-count or column-width isn't auto, including elements with column-count: 1). column-span: all should always create a new
formatting context, even when the column-span: all element isn't contained by a multicol container (spec change, chrome bug).
formatting contexts affect layout, but typically, we create a new block
formatting context for the positioning and clearing floats rather than changing the layout, because an element that establishes a new block
formatting context will: contain internal floats. exclude ex...
...there's no floating children avaliable inside a flex/grid container, but exclude external floats and suppress margin collapsing still works. examples contain internal floats make float content and alongside content the same height. ...
...And 4 more matches
CSP: form-action - HTTP
the http content-security-policy (csp)
form-action directive restricts the urls which can be used as the target of a
form submissions from a given context. whether
form-action should block redirects after a
form submission is debated and browser implementations of this aspect are inconsistent (e.g. firefox 57 doesn't block the redirects whereas chrome 63 does). csp version 2 directive type navigation directive default-src fallback no. not setting this allows anything. ...
...m-action should block redirects after a
form submission is debated and browser implementations of this aspect are inconsistent (e.g. firefox 57 doesn't block the redirects whereas chrome 63 does). csp version 2 directive type navigation directive default-src fallback no. not setting this allows anything. syntax one or more sources can be set for the
form-action policy: content-security-policy:
form-action <source>; content-security-policy:
form-action <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (a...
...a hash, shall be propagated to all the scripts loaded by that root script. at the same time, any allow-list or source expressions such as 'self' or 'unsafe-inline' are ignored. see script-src for an example. 'report-sample' requires a sample of the violating code to be included in the violation report. ...
...And 4 more matches
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. ...
... description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. ...
... description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. ...
...And 4 more matches
Intl.NumberFormat.supportedLocalesOf() - JavaScript
options optional. an object that may have the following property: localematcher the locale matching algorithm to use. ...
... options optional. an object that may have the following property: localematcher the locale matching algorithm to use. ...
... options optional. ...
...And 4 more matches
Forms related code snippets - Archive of obsolete content
here are some <
form> related code snippets. date picker (before implementing it in a working environment, please read the note about the const statement compatibility) <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>datepicker example - mdn</title> <script type="text/javascript"> /*\ |*| |*| datepicker example mdndeveloper network |*| |*| https://developer.mozilla.org/docs/code_snippets/
forms |*| https://developer.mozilla.org/user:fusionchess |*| |*| this snippet is released under the gnu public license, version 3 or later. |*| http://www.gnu.org/licenses/gpl-3.0-standalone.html |*| \*/ (function () { function datepicker (otarget) { const otable = document.createelement("table"), ohrow = document.createelemen...
...it is supported in firefox & chrome (v8) and partially supported in opera 9+ and safari. it is not s...
...it is supported in firefox & chrome (v8) and partially supported in opera 9+ and safari. it is not supported in i...
...And 3 more matches
Appendix A: Add-on Performance - Archive of obsolete content
startup this is the area where add-ons have the most noticeable impact. ...
... startup this is the area where add-ons have the most noticeable impact. ...
... startup this is the area where add-ons have the most noticeable impact. ...
...And 3 more matches
Date.prototype.toLocaleFormat() - Archive of obsolete content
the non-standard tolocale
format() method converts a date to a string using the specified
formatting. intl.datetime
format is an alternative to
format dates in a standards-compliant way. see also the newer version of date.prototype.tolocaledatestring(). this feature has been removed and will no longer work in firefox 58+. see warning: date.prototype.tolocale
format is deprecated for more in
formation and migration help. syntax dateobj.tolocale
format(
formatstring) parameters
formatstring a
format string in the same
format expected by the strftime() function in c. return value a string representing the given date using the specified
formatting. description the tolocale
format() method provides greater software control over the
formatting of the generated date and/or time. name...
...ption the tolocale
format() method provides greater software control over the
formatting of the generated date and/or time. names for months and days of the week are localized using the operating system's locale. however, ordering of the day and month and other localization tasks are not handled automatically since you have control over the order in which they occur. you should take care that the
format string is localized properly according to the user's system settings. be aware that the locale used is not necessarily the same as the locale of the browser. ...
...he day and month and other localization tasks are not handled automatically since you have control over the order in which they occur. you should take care that the
format string is localized properly according to the user's system settings. be aware that the locale used is not necessarily the same as the locale of the browser. ...
...And 3 more matches
XForms Custom Controls Examples - Archive of obsolete content
introduction here is a collection of misc. custom control examples. please feel free to add your own examples. a full example showing a complete
form can be found on x
forms:custom_controls. ...
... introduction here is a collection of misc. custom control examples. please feel free to add your own examples. a full example showing a complete
form can be found on x
forms:custom_controls. ...
... introduction here is a collection of misc. custom control examples. please feel free to add your own examples. a full example showing a complete
form can be found on x
forms:custom_controls. ...
...And 3 more matches
Test your skills: Form validation - Learn web development
this aim of this skill test is to assess whether you've understood our client-side
form validation article. note: you can try out solutions locally, however it may be helpful to put your code in an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page.
form validation 1 in this task, we are providing you with a simple support query
form, and we want you to add some validation features to it: make all of the input fields mandatory to complete before the
form can be submitted. change the type of the "email address" and "phone number" fields to make the browser apply some more specific validation suitable for the data being asked for. give the "user name"...
... can be submitted. change the type of the "email address" and "phone number" fields to make the browser apply some more specific validation suitable for the data being asked for. give the "user name" field a required length of between 5 and 20 characters, the "phone number" field a maximum length of 15 characters, and the "comment" field a maximum length of 200 characters. ...
... the "user name" field a required length of between 5 and 20 characters, the "phone number" field a maximum length of 15 characters, and the "comment" field a maximum length of 200 characters. try submitting your
form — it should refuse to submit until the above constaints are followed, and give suitable error messages. to help, you might want to consider adding some simple css to show when a
form field is valid or invalid. download the starting point for this task to work in your own editor or in an online editor.
form validation 2 now we want you to take the same
form you saw in the previous task (use your previous answer if you want to), and add some more specific pattern validation to the first three fields using regular expressions. all of the user names in our application con...
...And 3 more matches
nsIURLFormatter
the set of known variables is predefined. ...
...the set of known variables is predefined. ...
...the set of known variables is predefined. ...
...And 3 more matches
FormData - Web APIs
the
formdata interface provides a way to easily construct a set of key/value pairs representing
form fields and their values, which can then be easily sent using the xmlhttprequest.send() method. it uses the same
format a
form would use if the encoding type were set to "multipart/
form-data". you can also pass it directly to the urlsearchparams constructor if you want to generate query parameters in the way a <
form> would do if it were using simple get submission. an object implementing
formdata can directly be used in a for...of structure, instead of entries(): for (var p of my
formdata) is equivalent to for (var p of my
formdata.entries()). note: this feature is available in web workers. constructor
formdata() creates a new
formdata object. ...
... generate query parameters in the way a <
form> would do if it were using simple get submission. an object implementing
formdata can directly be used in a for...of structure, instead of entries(): for (var p of my
formdata) is equivalent to for (var p of my
formdata.entries()). note: this feature is available in web workers. constructor
formdata() creates a new
formdata object. methods
formdata.append() appends a new value onto an existing key inside a
formdata object, or adds the key if it does not already exist.
formdata.delete() deletes a key/value pair from a
formdata object.
formdata.entries() returns an iterator allowing to go through all key/value pairs contained in this object. ...
...n web workers. constructor
formdata() creates a new
formdata object. methods
formdata.append() appends a new value onto an existing key inside a
formdata object, or adds the key if it does not already exist.
formdata.delete() deletes a key/value pair from a
formdata object.
formdata.entries() returns an iterator allowing to go through all key/value pairs contained in this object.
formdata.get() returns the first value associated with a given key from within a
formdata object.
formdata.getall() returns an array of all the values associated with a given key from within a
formdata.
formdata.has() returns a boolean stating whether a
formdata object contains a certain key. ...
...And 3 more matches
HTMLFormElement: reset event - Web APIs
the reset event fires when a <
form> is reset. bubbles yes (although specified as a simple event that doesn't bubble) cancelable yes interface event event handler property globaleventhandlers.onreset examples this example uses eventtarget.addeventlistener() to listen for
form resets, and logs the current event.timestamp whenever that occurs. ...
...t event fires when a <
form> is reset. bubbles yes (although specified as a simple event that doesn't bubble) cancelable yes interface event event handler property globaleventhandlers.onreset examples this example uses eventtarget.addeventlistener() to listen for
form resets, and logs the current event.timestamp whenever that occurs. ...
...ires when a <
form> is reset. bubbles yes (although specified as a simple event that doesn't bubble) cancelable yes interface event event handler property globaleventhandlers.onreset examples this example uses eventtarget.addeventlistener() to listen for
form resets, and logs the current event.timestamp whenever that occurs. ...
...And 3 more matches
NetworkInformation - Web APIs
the networkin
formation interface provides in
formation 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. the networkin
formation interfaces cannot be instantiated. it is instead accessed through the connection property of the navigator interface. note: this feature is available in web workers. properties this interface also inherits properties of its parent, eventtarget. networkin
formation.downlink read only returns the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds. ...
... it is instead accessed through the connection property of the navigator interface. note: this feature is available in web workers. properties this interface also inherits properties of its parent, eventtarget. networkin
formation.downlink read only returns the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds. networkin
formation.downlinkmax read only returns the maximum downlink speed, in megabits per second (mbps), for the underlying connection technology. ...
...terface also inherits properties of its parent, eventtarget. networkin
formation.downlink read only returns the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds. networkin
formation.downlinkmax read only returns the maximum downlink speed, in megabits per second (mbps), for the underlying connection technology. networkin
formation.effectivetype read only returns the effective type of the connection meaning one of 'slow-2g', '2g', '3g', or '4g'. this value is determined using a combination of recently observed round-trip time and downlink values. networkin
formation.rtt read only returns the estimated effective round-trip time of the current connection, rounded to the nearest multiple of 25 milliseconds. networkin...
...And 3 more matches
Network Information API - Web APIs
note: this feature is available in web workers. examples detect connection changes this example watches for changes to the user's connection. ...
... note: this feature is available in web workers. examples detect connection changes this example watches for changes to the user's connection. ...
...e would be called soon after page load to check for a connection type where preloading a video may not be desirable. if a cellular connection is found, then the preloadvideo flag is set to false. for simplicity and clarity, this example only tests for one connection type. ...
...And 3 more matches
performance.clearMarks() - Web APIs
the clearmarks() method removes the named mark from the browser's per
formance entry buffer. if the method is called with no arguments, all per
formance entries with an entry type of "mark" will be removed from the per
formance entry buffer. note: this feature is available in web workers. syntax per
formance.clearmarks(); per
formance.clearmarks(name); arguments name optional a domstring representing the name of the timestamp. if this argument is omitted, all per
formance entries with an entry type of "mark" will be removed. return value void example the following example shows both uses of the clearmarks() method. // create a small helper to show how many per
formancemark entries there are. ...
...g representing the name of the timestamp. if this argument is omitted, all per
formance entries with an entry type of "mark" will be removed. return value void example the following example shows both uses of the clearmarks() method. // create a small helper to show how many per
formancemark entries there are. function logmarkcount() { console.log( "found this many entries: " + per
formance.getentriesbytype("mark").length ); } // create a bunch of marks. ...
...rmance entries with an entry type of "mark" will be removed. return value void example the following example shows both uses of the clearmarks() method. // create a small helper to show how many per
formancemark entries there are. function logmarkcount() { console.log( "found this many entries: " + per
formance.getentriesbytype("mark").length ); } // create a bunch of marks. ...
...And 3 more matches
performance.now() - Web APIs
it used to be the same as t0 of the main context, but this was changed. in shared or service workers, the value in the worker might be higher than that of the main context because that window can be created after those workers. ...
...it used to be the same as t0 of the main context, but this was changed. in shared or service workers, the value in the worker might be higher than that of the main context because that window can be created after those workers. ...
...pically round the returned value by some amount in order to be less predictable. this inherently introduces a degree of inaccuracy by limiting the resolution or precision of the timer. for example, firefox rounds the returned time to 1 millisecond increments. the precision of the returned value is subject to change if/when the security concerns are alleviated through other means. syntax t = per
formance.now(); example const t0 = per
formance.now(); dosomething(); const t1 = per
formance.now(); console.log(`call to dosomething took ${t1 - t0} milliseconds.`); unlike other timing data available to javascript (for example date.now), the timestamps returned by per
formance.now() are not limited to one-millisecond resolution. instead, they represent times as floating-point numbers with up to mic...
...And 3 more matches
PerformanceEventTiming - Web APIs
the per
formanceeventtiming interface of the event timing api provides timing in
formation for the event types listed below. auxclick beforeinput click compositionend compositionstart compositionupdate contextmenu dblclick dragend dragenter dragleave dragover dragstart drop input keydown keypress keyup mousedown mouseenter mouseleave mouseout mouseover mouseup pointerover pointerenter pointerdown pointerup pointercancel pointerout pointerleave gotpointercapture lostpointercapture touchstart touchend touchcancel properties per
formanceeventtiming.processingstart returns the time at which event dispatch started. per
formanceeventtiming.processingend returns the time at which the event dispatch ended. ...
...e mouseout mouseover mouseup pointerover pointerenter pointerdown pointerup pointercancel pointerout pointerleave gotpointercapture lostpointercapture touchstart touchend touchcancel properties per
formanceeventtiming.processingstart returns the time at which event dispatch started. per
formanceeventtiming.processingend returns the time at which the event dispatch ended. per
formanceeventtiming.cancelable returns the associated event's cancelable attribute. per
formanceeventtiming.target returns the associated event's last target, if it is not removed. ...
... properties per
formanceeventtiming.processingstart returns the time at which event dispatch started. per
formanceeventtiming.processingend returns the time at which the event dispatch ended. per
formanceeventtiming.cancelable returns the associated event's cancelable attribute. per
formanceeventtiming.target returns the associated event's last target, if it is not removed. methods per
formanceeventtiming.tojson() converts the per
formanceeventtiming object to json. ...
...And 3 more matches
PerformanceMark - Web APIs
per
formancemark is an abstract interface for per
formanceentry objects with an entrytype of "mark". entries of this type are created by calling per
formance.mark() to add a named domhighrestimestamp (the mark) to the browser's per
formance timeline. ...
...stimestamp (the mark) to the browser's per
formance timeline. ...
...n: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/per
formanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">per
formanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/per
formancemark" target="_top"><rect x="201" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="276" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monos...
...And 3 more matches
PerformanceMeasure - Web APIs
per
formancemeasure is an abstract interface for per
formanceentry objects with an entrytype of "measure". entries of this type are created by calling per
formance.measure() to add a named domhighrestimestamp (the measure) between two marks to the browser's per
formance timeline. ...
...re) between two marks to the browser's per
formance timeline. ...
...n: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/per
formanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">per
formanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/per
formancemeasure" target="_top"><rect x="201" y="1" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="291" y="30" font-size="12px" font-family="consolas,monaco,andale mono,mo...
...And 3 more matches
PerformanceObserverEntryList.getEntries() - Web APIs
the getentries() method of the per
formanceobserverentrylist interface returns a list of explicitly observed per
formance entry objects for a given filter. the list's members are determined by the set of entry types specified in the call to the observe() method. the list is available in the observer's callback function (as the first parameter in the callback). this method is exposed to window and worker interfaces. syntax general syntax: entries = list.getentries(); entries = list.getentries(per
formanceentryfilteroptions); specific usage: entries = list.getentries({name: "entry_name", entrytype: "mark"}); parameters per
formanceentryfilteroptionsoptional is a per
formanceentryfilteroptions dictionary, having the following fields: "name", the name of a per
formance entry. "en...
... entries = list.getentries(per
formanceentryfilteroptions); specific usage: entries = list.getentries({name: "entry_name", entrytype: "mark"}); parameters per
formanceentryfilteroptionsoptional is a per
formanceentryfilteroptions dictionary, having the following fields: "name", the name of a per
formance entry. "entrytype", the entry type. the valid entry types are listed in the per
formanceentry.entrytype method. "initiatortype", the type of the initiating resource (for example an html element). the values are defined by the per
formanceresourcetiming.initiatortype interface. this parameter is currently not supported on chrome or opera. return value a list of explicitly observed per
formanceentry objects that meets the criteria of the filter. the items will be in chronolog...
...s' starttime. if no objects that meet the filter are found, an empty list is returned. if no argument is given, all entries are returned. ...
...And 3 more matches
PerformanceObserverEntryList.getEntriesByName() - Web APIs
the getentriesbyname() method of the per
formanceobserverentrylist interface returns a list of explicitly observed per
formance 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. the list is available in the observer's callback function (as the first parameter in the callback). this method is exposed to window and worker interfaces. syntax entries = list.getentriesbyname(name, type); parameters name a domstring representing the name of the entry to retrieve. type optional a domstring representing the type of entry to retrieve such as "mark". the valid entry types are listed in per
formanceentry.entrytype. ...
...back). this method is exposed to window and worker interfaces. syntax entries = list.getentriesbyname(name, type); parameters name a domstring representing the name of the entry to retrieve. type optional a domstring representing the type of entry to retrieve such as "mark". the valid entry types are listed in per
formanceentry.entrytype. return value a list of explicitly observed per
formance entry objects that have the specified name and type. if the type argument is not specified, only the name will be used to determine the entries to return. the items will be in chronological order based on the entries' starttime. if no objects meet the specified criteria, an empty list is returned. example function print_perf_entry(pe) { console.log("name: " + pe.name + ...
...ems will be in chronological order based on the entries' starttime. if no objects meet the specified criteria, an empty list is returned. ...
...And 3 more matches
WebGL2RenderingContext.getActiveUniforms() - Web APIs
the webgl2renderingcontext.getactiveuni
forms() method of the webgl 2 api retrieves in
formation about active uni
forms within a webglprogram. syntax any gl.getactiveuni
forms(program, uni
formindices, pname); parameters program a webglprogram containing the active uni
forms. uni
formindices an array of gluint specifying the indices of the active uni
forms to query. pname a glenum specifying which in
formation to query. possible values: gl.uni
form_type: returns an array of glenum indicating the types of the uni
forms. gl.uni
form_size: returns an array of gluint indicating the sizes of the uni
forms. gl.uni
form_block_index: returns an array of glint indicating the block indices of the uni
forms. ...
...fying the indices of the active uni
forms to query. pname a glenum specifying which in
formation to query. possible values: gl.uni
form_type: returns an array of glenum indicating the types of the uni
forms. gl.uni
form_size: returns an array of gluint indicating the sizes of the uni
forms. gl.uni
form_block_index: returns an array of glint indicating the block indices of the uni
forms. gl.uni
form_offset: returns an array of glint indicating the uni
form buffer offsets. gl.uni
form_array_stride: returns an array of glint indicating the strides between the elements. gl.uni
form_matrix_stride: returns an array of glint indicating the strides between columns of a column-major matrix or a row-major matrix. ...
...ns an array of glint indicating the block indices of the uni
forms. gl.uni
form_offset: returns an array of glint indicating the uni
form buffer offsets. gl.uni
form_array_stride: returns an array of glint indicating the strides between the elements. gl.uni
form_matrix_stride: returns an array of glint indicating the strides between columns of a column-major matrix or a row-major matrix. gl.uni
form_is_row_major: returns an array of glboolean indicating whether each of the uni
forms is a row-major matrix or not. return value depends on which in
formation is requested using the pname parameter. ...
...And 3 more matches
WebGL2RenderingContext.transformFeedbackVaryings() - Web APIs
the webgl2renderingcontext.trans
formfeedbackvaryings() method of the webgl 2 api specifies values to record in webgltrans
formfeedback buffers. syntax void gl.trans
formfeedbackvaryings(program, varyings, buffermode); parameters program a webglprogram. varyings an array of domstring specifying the the names of the varying variables to use. buffermode a glenum specifying the mode to use when capturing the varying variables. either gl.interleaved_attribs or gl.separate_attribs. return value none. ...
... buffers. syntax void gl.trans
formfeedbackvaryings(program, varyings, buffermode); parameters program a webglprogram. varyings an array of domstring specifying the the names of the varying variables to use. buffermode a glenum specifying the mode to use when capturing the varying variables. either gl.interleaved_attribs or gl.separate_attribs. return value none. ...
...ans
formfeedbackvaryings(program, varyings, buffermode); parameters program a webglprogram. varyings an array of domstring specifying the the names of the varying variables to use. buffermode a glenum specifying the mode to use when capturing the varying variables. either gl.interleaved_attribs or gl.separate_attribs. return value none. ...
...And 3 more matches
WebGLRenderingContext.getUniform() - Web APIs
the webglrenderingcontext.getuni
form() method of the webgl api returns the value of a uni
form variable at a given location. syntax any gl.getuni
form(program, location); parameters program a webglprogram containing the uni
form attribute. location a webgluni
formlocation object containing the location of the uni
form attribute to get. ...
... the webglrenderingcontext.getuni
form() method of the webgl api returns the value of a uni
form variable at a given location. syntax any gl.getuni
form(program, location); parameters program a webglprogram containing the uni
form attribute. location a webgluni
formlocation object containing the location of the uni
form attribute to get. ...
...ontext.getuni
form() method of the webgl api returns the value of a uni
form variable at a given location. syntax any gl.getuni
form(program, location); parameters program a webglprogram containing the uni
form attribute. location a webgluni
formlocation object containing the location of the uni
form attribute to get. ...
...And 3 more matches
WebXR performance guide - Web APIs
rendering tips ... talk about general stuff like limiting how many different loops there are during rendering, avoiding unnecessary drawing, etc. ...
... rendering tips ... talk about general stuff like limiting how many different loops there are during rendering, avoiding unnecessary drawing, etc. ...
... rendering tips ... talk about general stuff like limiting how many different loops there are during rendering, avoiding unnecessary drawing, etc. ...
...And 3 more matches
XRRigidTransform.matrix - Web APIs
the read-only xrrigidtrans
form property matrix returns the trans
form matrix represented by the object. the returned matrix can then be premultiplied with a column vector to rotate the vector by the 3d rotation specified by the orientation, then translate it by the position. syntax let matrix = xrrigidtrans
form.matrix; value a float32array containing 16 entries which represents the 4x4 trans
form matrix which is described by the position and orientation properties. usage notes matrix
format all 4x4 trans
form matrices used in webgl are stored in 16-element float32arrays. the values are stored into the array in column-major order; that is, each column is written into the array top-down before moving to the right one column and writing the next column into the array. thus, for an arr...
...[12]\\ a[1] & a[5] & a[9] & a[13]\\ a[2] & a[6] & a[10] & a[14]\\ a[3] & a[7] & a[11] & a[15]\\ \end{bmatrix} the first time matrix is requested, it gets computed; after that, it's should be cached to avoid slowing down to compute it every time you need it. creating the matrix in this section, intended for more advanced readers, we cover how the api calculates the matrix for the specified trans
form. it begins by allocating a new matrix and writing a 4x4 identity matrix into it: [1000010000100001]\begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 1 \end{bmatrix} this is a trans
form that will not change either the orientation or position of any point, vector, or object to which it's applied. next, the position is placed into the right-hand column, like this, result...
...here px, py, and pz are the values of the x, y, and z members of the dompointreadonly position. ...
...And 3 more matches
XRRigidTransform.position - Web APIs
the units are meters. note: the w component of the point is always 1.0. ...
...the units are meters. note: the w component of the point is always 1.0. ...
...the units are meters. note: the w component of the point is always 1.0. ...
...And 3 more matches
XRRigidTransform - Web APIs
the xrrigidtrans
form is a webxr api interface that represents the 3d geometric trans
form described by a position and orientation. xrrigidtrans
form is used to specify trans
forms throughout the webxr apis, including: the offset and orientation relative to the parent reference space to use when creating a new reference space with getoffsetreferencespace(). the trans
form of an xrview. the trans
form of an xrpose. the xrreferencespaceevent event's trans
form property, as found in the reset event received by an xrreferencespace. the advantage to using xrrigidtrans
form in these places rather than bare arrays that providing the matrix data is that the xrrigidtrans
form automatically does things like computing the inverse of the trans
form. even better, once it's been computed, it's cached so tha...
...n the reset event received by an xrreferencespace. the advantage to using xrrigidtrans
form in these places rather than bare arrays that providing the matrix data is that the xrrigidtrans
form automatically does things like computing the inverse of the trans
form. even better, once it's been computed, it's cached so that subsequent requests are significantly faster. constructor new xrrigidtrans
form() creates a new xrrigidtrans
form object which represents a trans
form that applies a specified position and/or orientation. attributes xrrigidtrans
form.position read only a dompointreadonly specifying a 3-dimensional point, expressed in meters, describing the translation component of the trans
form. ...
...y faster. constructor new xrrigidtrans
form() creates a new xrrigidtrans
form object which represents a trans
form that applies a specified position and/or orientation. attributes xrrigidtrans
form.position read only a dompointreadonly specifying a 3-dimensional point, expressed in meters, describing the translation component of the trans
form. the w attribute is always 1.0. xrrigidtrans
form.orientation read only a dompointreadonly which contains a unit quaternion describing the rotational component of the trans
form. as a unit quaternion, its length is always normalized to 1.0. xrrigidtrans
form.matrix read only returns the trans
form matrix in the
form of a 16-member float32array. see the section matrix
format for how the array is used to represent a matrix. xrrigidtransf...
...And 3 more matches
XRView.transform - Web APIs
the read-only trans
form property of the xrview interface is an xrrigidtrans
form object which provides the position and orientation of the viewpoint relative to the xrreferencespace specified when the xrframe.getviewerpose() method was called to obtain the view object. with the trans
form, you can then position the view as a camera within the 3d scene. if you instead need the more traditional view matrix, you can get using view.trans
form.inverse.matrix; this gets the underlying matrix of the trans
form's inverse. syntax let viewtrans
form = xrview.trans
form; value a xrrigidtrans
form object specifying the position and orientation of the viewpoint represented by the xrview. ...
...if you instead need the more traditional view matrix, you can get using view.trans
form.inverse.matrix; this gets the underlying matrix of the trans
form's inverse. syntax let viewtrans
form = xrview.trans
form; value a xrrigidtrans
form object specifying the position and orientation of the viewpoint represented by the xrview. examples for each view making up the presented scene, the view's trans
form represents the position and orientation of the viewer or camera relative to the reference space's origin. you can then use the inverse of this matrix to trans
form the objects in your scene to adjust their placement and orientation to simulate the viewer's movement through space. in this example, we see an outline of a code fragment used while rendering an xrframe, which makes use of the view tra...
...epresents the position and orientation of the viewer or camera relative to the reference space's origin. you can then use the inverse of this matrix to trans
form the objects in your scene to adjust their placement and orientation to simulate the viewer's movement through space. in this example, we see an outline of a code fragment used while rendering an xrframe, which makes use of the view trans
form to place objects in the world during rendering. ...
...And 3 more matches
Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
the intl.datetime
format.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and date and time
formatting options computed during initialization of this datetime
format object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax datetime
format.resolvedoptions() return value a new object with properties reflecting the locale and date and time
formatting options computed during the initialization of the given datetime
format object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicod...
...default time zone) if none was provided. warning: applications should not rely on undefined being returned, as future versions may return a string value identifying the runtime’s default time zone instead. hour12 the value provided for this property in the options argument or filled in as a default. ...
...ring value identifying the runtime’s default time zone instead. hour12 the value provided for this property in the options argument or filled in as a default. weekday era year month day hour minute second timezonename the values resulting from
format matching between the corresponding properties in the options argument and the available combinations and representations for date-time
formatting in the selected locale. ...
...And 3 more matches
Intl.ListFormat() constructor - JavaScript
the intl.list
format() constructor creates objects that enable language-sensitive list
formatting. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new intl.list
format([locales[, options]]) parameters locales optional. a string with a bcp 47 language tag, or an array of such strings. for the general
form and interpretation of the locales argument, see the intl page. options optional. an object with some or all of the following properties: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". ...
...parameters locales optional. a string with a bcp 47 language tag, or an array of such strings. for the general
form and interpretation of the locales argument, see the intl page. options optional. an object with some or all of the following properties: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for in
formation about this option, see the intl page. type the
format of output message. possible values are "conjunction" that stands for "and"-based lists (default, e.g., a, b, and c), or "disjunction" that stands for "or"-based lists (e.g., a, b, or c). "unit" stands for lists of values with units (e.g., 5 pounds, 12 ounces). style the length of the
formated message. possible values are: "long"...
...sjunction" that stands for "or"-based lists (e.g., a, b, or c). "unit" stands for lists of values with units (e.g., 5 pounds, 12 ounces). style the length of the
formated message. possible values are: "long" (default, e.g., a, b, and c); "short" (e.g., a, b, c), or "narrow" (e.g., a b c). when style is short or narrow, unit is the only allowed value for the type option. examples using
format the following example shows how to create a list
formatter using the english language. ...
...And 3 more matches
format - SVG: Scalable Vector Graphics
the
format attribute indicates the
format of the given font. two elements are using this attribute: <altglyph> and <glyphref> context notes value <string> default value none animatable no <string> this value specifies the
format of the given font. ...
... the
format attribute indicates the
format of the given font. two elements are using this attribute: <altglyph> and <glyphref> context notes value <string> default value none animatable no <string> this value specifies the
format of the given font. ...
...attribute indicates the
format of the given font. two elements are using this attribute: <altglyph> and <glyphref> context notes value <string> default value none animatable no <string> this value specifies the
format of the given font. ...
...And 3 more matches
Performance best practices in extensions - Archive of obsolete content
one of firefox's great advantages is its extreme extensibility. extensions can do almost anything. there is a down side to this: poorly written extensions can have a severe impact on the browsing experience, including on the overall per
formance of firefox itself. this article offers some best practices and suggestions that can not only improve the per
formance and speed of your extension, but also of firefox itself. improving startup per
formance extensions are loaded and run whenever a new browser window opens. that means every time a window opens, your extension can have an impact on how long it takes the user to see the content they're trying to view. there are several things you can do to reduce the amount of time your extension delays the appearance of the user's desired content. load o...
...se features until the user actually logs in. use javascript code modules you can create your own javascript code modules incorporating sets of features that are only needed under specific circumstances. this makes it easy to load chunks of your extension on the fly as needed, instead of loading everything all at once. while javascript modules can be extremely useful, and provide significant per
formance benefits, they should be used wisely. loading modules incurs a small cost, so breaking code up to an unnecessary degree can be counter-productive. code should be modularized to the extent that doing so increases clarity, and loading of large or expensive chunks of code fragments can be significantly deferred. defer everything that you can most extensions have a load event listener in the ma...
...tup functions. do as little as possible here. the browser window is blocked while your add-on's load handler runs, so the more it does, the slower firefox will appear to the user. if there is anything that can be done even a fraction of a second later, you can use an nsitimer or the window.settimeout() method to schedule that work for later. even a short delay can have a big impact. general per
formance tips avoid creating memory leaks memory leaks require the garbage collector and the cycle collector to work harder, which can significantly degrade per
formance. zombie compartments are a particular kind of memory leak that you can detect with minimal effort. see the zombie compartments page, especially the proactive checking of add-ons section. see common causes of memory leaks in extens...
...And 2 more matches
XForms Output Element - Archive of obsolete content
introduction serves to show the instance data that the element is bound to in a read-only manner (see the spec). to see how they work you can try an xhtml example or a xul example. ...
... 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. if binding attributes are present on the control then the value attribute is is ignored. type restrictions the output element can be bound to a node containing simple content of any data type. representations the x
forms 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). calendar - used to represent instance data of type date (xhtml/xul). image - if the instance node contains an image, then an output element can be used in combinatio...
...efault representation for instance data of most types, especially static text (xhtml/xul). calendar - used to represent instance data of type date (xhtml/xul). image - if the instance node contains an image, then an output element can be used in combination with the mediatype element to display the image (fx 3.0 only, xhtml/xul). text displaying the data as text is the default presentation. ...
...And 2 more matches
Perceived performance - MDN Web Docs Glossary: Definitions of Web-related terms
perceived per
formance is a subjective measure of how fast a website seems to a user based on load time and site responsiveness. this measure relies on human perception, not an objective metric like time to interactive. in terms of web per
formance, perceived per
formance is how fast a user interaction feels rather than how fast an interaction actually is, be that a button press or a page load. perceived per
formance is not how fast your site is; it's how fast your users think it is. perceived per
formance is not measured by when your site is done loading but when it has loaded enough for users to believe it has loaded and is interactive. in terms of conversion rates, perceived per
formance is more important than the actual load and response times. speed index is a common metric for measur...
...ance is not how fast your site is; it's how fast your users think it is. perceived per
formance is not measured by when your site is done loading but when it has loaded enough for users to believe it has loaded and is interactive. in terms of conversion rates, perceived per
formance is more important than the actual load and response times. speed index is a common metric for measuring perceived per
formance, though it's not perfect. other features, such as good ux design, including animations, and lazy loading, can make your site appear more responsive, even if the download and response times remain the same. ...
...ve. in terms of conversion rates, perceived per
formance is more important than the actual load and response times. speed index is a common metric for measuring perceived per
formance, though it's not perfect. other features, such as good ux design, including animations, and lazy loading, can make your site appear more responsive, even if the download and response times remain the same. actual per
formance is a measurement from when a request is made, through the downloading, parsing and execution of all resources, and the final paint. while increased per
formance generally increases perceived per
formance, there are some techniques that can be used to increase perceived per
formance while marginally decreasing actual per
formance. there are front end optimization techniques that can improve perce...
...And 2 more matches
Storing the information you need — Variables - Learn web development
f what javascript is. objective: to gain familiarity with the basics of javascript variables. 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 in
formation on how to access this tool). what is a variable? a variable is a container for a value, like a number we might use in a sum, or a string that we might use as part of a sentence. but one special thing about variables is that their contained values can change. let's look at a simple example: <button>press me</button> const button = document.queryselector('button'); button.onclick = functi...
...pecify an index value corresponding to the position of the value you want returned. you might have noticed that arrays in javascript are zero-indexed: the first element is at index 0. you'll learn a lot more about arrays in a future article. objects in programming, an object is a structure of code that models a real-life object. ...
... can have a simple object that represents a box and contains in
formation about its width, length, and height, or you could have an object that represents a person, and contains data about their name, height, weight, what language they speak, how to say hello to them, and more. try entering the following line into your console: let dog = { name : 'spot', breed : 'dalmatian' }; to retrieve the in
formation stored in the object, you can use the following syntax: dog.name we won't be looking at objects any more for now — you can learn more about those in a future module. dynamic typing javascript is a "dynamically typed language", which means that, unlike some other languages, you don't need to specify what data type a variable will contain (numbers, strings, arrays, etc). for example, if...
...And 2 more matches
nsIFormHistory2
toolkit/components/satchel/public/nsi
formhistory.idlscriptable a service which holds a set of name/value pairs. the names correspond to
form field names, and the values correspond to values the user has submitted. so, several values may exist for a single name. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) note: this interface provides no means to access stored values. stored values are used by the
formfillcontroller to generate autocomplete matches. method overview void addentry(in astring name, in astring value); boolean entryexists(in astring name, in astring value); boolean nameexists(in astring name); void removeallentries(); void removeentriesbytimeframe...
...boolean entryexists( in astring name, in astri...
...lentries(); void removeentriesbytimeframe(in long long abegintime, in long long aendtime); void removeentriesforname(in astring name); void removeentry(in astring name, in astring value); attributes attribute type description dbconnection mozistorageconnection returns the underlying db connection the
form history module is using. read only. hasentries boolean returns true if the
form history has any entries. read only. methods addentry() adds a name and value pair to the
form history. void addentry( in astring name, in astring value ); parameters name value entryexists() gets whether a name and value pair exists in the
form history. boolean entryexists( in astring name, in astring value ); parameters name value return value nameexists() returns true if t...
...And 2 more matches
Performance
mozstorage uses sqlite as the database backend. it has generally good per
formance for a small embedded database. however, many things cause various database operations to be slow. transactions there is overhead associated with each transaction. when you execute a sql statement in isolation, an implicit transaction is created around that statement. when transactions are committed, sqlite does journaling which requires syncing data to disk. this operation is extremely slow. therefore, if you are doing many transactions in a row, you will get significant per
formance improvements by surrounding them in a transaction. the asynchronous writes discussed below removes most of the immediate penalty of a commit, so you will not notice the problem as much. however, there is still overhead, and us...
...eue to see what operations have been pending, and they will be slower. if the user shuts down the browser soon after you do this type of operation, you can delay shutdown (possibly for many tens of seconds for large numbers of transactions and slow disks), making it look like the browser is hung. queries careful reordering of the sql statement, or creating the proper indices, can often improve per
formance. see the sqlite optimizer overview on the sqlite web site for in
formation on how sqlite uses indices and executes statements. you might also want to try to the "explain" feature on your statements to see if they are using the indices you expect. type "explain" followed by your statement to see the plan. for example, explain select * from moz_history; the results are hard to understand, but yo...
... in this example, you can see that it is not using an index, so this query would be slow. you can download the command line tool from the sqlite download page. be sure you have a version of the command line tool that is at least as recent as what mozilla uses. as of april 10, 2006, mozilla uses sqlite 3.3.4, but the latest precompiled version of the command line tools is not available for all plat
forms. this will lead to errors that say "database is encrypted" because the tool is not able to recognize the file
format. you may want to check the sqlite_version definition in db/sqlite3/src/sqlite3.h for the current version if you are having problems. caching sqlite has a cache of database pages in memory. it keeps pages associated with the current transaction so it can roll them back, and it also...
...And 2 more matches
FormData.getAll() - Web APIs
the getall() method of the
formdata interface returns all the values associated with a given key from within a
formdata object. note: this method is available in web workers. syntax
formdata.getall(name); parameters name a usvstring representing the name of the key you want to retrieve. returns an array of
formdataentryvalues whose key matches the value passed in the name parameter. if the key doesn't exist, the method returns an empty list. ...
...hin a
formdata object. note: this method is available in web workers. syntax
formdata.getall(name); parameters name a usvstring representing the name of the key you want to retrieve. returns an array of
formdataentryvalues whose key matches the value passed in the name parameter. if the key doesn't exist, the method returns an empty list. ...
... note: this method is available in web workers. syntax
formdata.getall(name); parameters name a usvstring representing the name of the key you want to retrieve. returns an array of
formdataentryvalues whose key matches the value passed in the name parameter. if the key doesn't exist, the method returns an empty list. ...
...And 2 more matches
FormData.has() - Web APIs
the has() method of the
formdata interface returns a boolean stating whether a
formdata object contains a certain key. note: this method is available in web workers. syntax
formdata.has(name); parameters name a usvstring representing the name of the key you want to test for. returns a boolean. ...
... the has() method of the
formdata interface returns a boolean stating whether a
formdata object contains a certain key. note: this method is available in web workers. syntax
formdata.has(name); parameters name a usvstring representing the name of the key you want to test for. returns a boolean. ...
... the has() method of the
formdata interface returns a boolean stating whether a
formdata object contains a certain key. note: this method is available in web workers. syntax
formdata.has(name); parameters name a usvstring representing the name of the key you want to test for. returns a boolean. ...
...And 2 more matches
HTMLFormControlsCollection - Web APIs
this interface replaces one method from htmlcollection, on which it is based. ...
... this interface replaces one method from htmlcollection, on which it is based. ...
...fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="71" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlcollection</text></a><polyline points="141,25 151,20 151,30 141,25" stroke="#d4dde4" fill="none"/><line x1="151" y1="25" x2="181" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/html
formcontrolscollection" target="_top"><rect x="181" y="1" width="260" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="311" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">html
formcontrolscollection</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} pr...
...And 2 more matches
PerformanceLongTaskTiming - Web APIs
the per
formancelongtasktiming interface of the the long tasks api reports instances of long tasks. ...
...e of the the long tasks api reports instances of long tasks. ...
...n: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/per
formanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">per
formanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/per
formancelongtasktiming" target="_top"><rect x="201" y="1" width="250" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="326" y="30" font-size="12px" font-family="consolas,monaco,andale ...
...And 2 more matches
PerformanceObserver.observe() - Web APIs
the observe() method of the per
formanceobserver interface is used to specify the set of per
formance entry types to observe. the per
formance entry types are specified as an array of domstring objects, each naming one entry type; the type names are documented in per
formance entry type names in per
formanceentry.entrytype. when a matching per
formance entry is recorded, the per
formance observer's callback function—set when creating the per
formanceobserver—is invoked. syntax observer.observe(options); parameters options a per
formanceobserverinit dictionary with the following possible members: entrytypes: an array of domstring objects, each specifying one per
formance entry type to observe. may not be used together with the "type" or "buffered" options. type: a single domstring sp...
...eating the per
formanceobserver—is invoked. syntax observer.observe(options); parameters options a per
formanceobserverinit dictionary with the following possible members: entrytypes: an array of domstring objects, each specifying one per
formance entry type to observe. may not be used together with the "type" or "buffered" options. type: a single domstring specifying exactly one per
formance entry type to observe. may not be used together with the entrytypes option. buffered: a boolean flag to indicate whether buffered entries should be queued into the observer's buffer. must be used only with the "type" option. see per
formanceentry.entrytype for a list of valid per
formance entry type names. unrecognized types are ignored, though the browser may output a warning message t...
... into the observer's buffer. must be used only with the "type" option. see per
formanceentry.entrytype for a list of valid per
formance entry type names. unrecognized types are ignored, though the browser may output a warning message to the console to help developers debug their code. if no valid types are found, observe() has no effect. examples this example creates and configures two per
formanceobservers; one watches for "mark" and "frame" events, and the other watches for "measure" events. ...
...And 2 more matches
PerformanceObserverEntryList.getEntriesByType() - Web APIs
the getentriesbytype() method of the per
formanceobserverentrylist returns a list of explicitly observed per
formance entry objects for a given per
formance entry type. the list's members are determined by the set of entry types specified in the call to the observe() method. the list is available in the observer's callback function (as the first parameter in the callback). this method is exposed to window and worker interfaces. syntax entries = list.getentriesbytype(type); parameters type the type of entry to retrieve such as "frame". the valid entry types are listed in per
formanceentry.entrytype. return value a list of explicitly observed per
formanceentry objects that have the specified type. the items will be in chronological order based on the entries' starttime. if no objects hav...
...ical order based on the entries' starttime. if no objects have the specified type, or no argument is provided, an empty list is returned. ...
... no objects have the specified type, or no argument is provided, an empty list is returned. ...
...And 2 more matches
WorkerGlobalScope.performance - Web APIs
the per
formance read-only property of the workerglobalscope interface returns a per
formance object to be used on the worker. not all per
formance properties and methods are available to web workers. this property is read only . syntax var perfobj = self.per
formance; return value a per
formance object. ...
... the per
formance read-only property of the workerglobalscope interface returns a per
formance object to be used on the worker. not all per
formance properties and methods are available to web workers. this property is read only . syntax var perfobj = self.per
formance; return value a per
formance object. ...
...rglobalscope interface returns a per
formance object to be used on the worker. not all per
formance properties and methods are available to web workers. this property is read only . syntax var perfobj = self.per
formance; return value a per
formance object. ...
...And 2 more matches
XRPose.transform - Web APIs
this is the same pose that's returned by the frame's getpose() method. example this handler for the xrsession event select handles events for tracked pointers. ...
...this is the same pose that's returned by the frame's getpose() method. example this handler for the xrsession event select handles events for tracked pointers. ...
...this is the same pose that's returned by the frame's getpose() method. example this handler for the xrsession event select handles events for tracked pointers. ...
...And 2 more matches
XRReferenceSpaceEventInit.transform - Web APIs
examples this simple snippet calls the constructor to create a new reference space event of type reset. ...
... examples this simple snippet calls the constructor to create a new reference space event of type reset. ...
... examples this simple snippet calls the constructor to create a new reference space event of type reset. ...
...And 2 more matches
Warning: Date.prototype.toLocaleFormat is deprecated - JavaScript
the javascript warning "date.prototype.tolocale
format is deprecated; consider using intl.datetime
format instead" occurs when the non-standard date.prototype.tolocale
format method is used. message warning: date.prototype.tolocale
format is deprecated; consider using intl.datetime
format instead error type warning. javascript execution won't be halted. what went wrong? the non-standard date.prototype.tolocale
format method is deprecated and shouldn't be used anymore. it uses a
format string in the same
format expected by the strftime() function in c. the function is no longer available in firefox 58+. examples deprecated syntax the date.prototype.tolocale
format method is deprecated and will be removed (no cross-browser support, available in firefox only). var today = new date(); var dat...
... method is deprecated and shouldn't be used anymore. it uses a
format string in the same
format expected by the strftime() function in c. the function is no longer available in firefox 58+. examples deprecated syntax the date.prototype.tolocale
format method is deprecated and will be removed (no cross-browser support, available in firefox only). var today = new date(); var date = today.tolocale
format('%a, %e. %b %y'); console.log(date); // in german locale // "freitag, 10. märz 2017" alternative standard syntax using the ecmascript intl api the ecma-402 (ecmascript intl api) standard specifies standard objects and methods that enable language sensitive date and time
formatting (available in chrome 24+, firefox 29+, ie11+, safari10+). you can now either use the date.prototype.tolocaleda...
...te); // in german locale // "freitag, 10. märz 2017" alternative standard syntax using the ecmascript intl api the ecma-402 (ecmascript intl api) standard specifies standard objects and methods that enable language sensitive date and time
formatting (available in chrome 24+, firefox 29+, ie11+, safari10+). you can now either use the date.prototype.tolocaledatestring method if you just want to
format one date. var today = new date(); var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; var date = today.tolocaledatestring('de-de', options); console.log(date); // "freitag, 10. märz 2017" or, you can make use of the intl.datetime
format object, which allows you to cache an object with most of the computations done so that
formatting is fast. th...
...And 2 more matches
Understanding latency - Web Performance
what is latency? latency is generally considered to be the amount of time it takes from when a request is made by the user to the time it takes for the response to get back to that user. ...
... what is latency? latency is generally considered to be the amount of time it takes from when a request is made by the user to the time it takes for the response to get back to that user. ...
... what is latency? latency is generally considered to be the amount of time it takes from when a request is made by the user to the time it takes for the response to get back to that user. ...
...And 2 more matches
gradientTransform - SVG: Scalable Vector Graphics
the gradienttrans
form attribute contains the definition of an optional additional trans
formation from the gradient coordinate system onto the target coordinate system (i.e., userspaceonuse or objectboundingbox). this allows for things such as skewing the gradient. this additional trans
formation matrix is post-multiplied to (i.e., inserted to the right of) any previously defined trans
formations, including the implicit trans
formation necessary to convert from object bounding box units to user space. two elements are using this attribute: <lineargradient> and <radialgradient> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <radialgradient id="gradient1" gradientunits="userspaceonuse" cx="100" cy="100" r="100" fx="100" fy="100"> ...
...adient id="gradient1" gradientunits="userspaceonuse" cx="100" cy="100" r="100" fx="100" fy="100"> <stop offset="0%" stop-color="darkblue" /> <stop offset="50%" stop-color="skyblue" /> <stop offset="100%" stop-color="darkblue" /> </radialgradient> <radialgradient id="gradient2" gradientunits="userspaceonuse" cx="100" cy="100" r="100" fx="100" fy="100" gradienttrans
form="skewx(20) translate(-35, 0)"> <stop offset="0%" stop-color="darkblue" /> <stop offset="50%" stop-color="skyblue" /> <stop offset="100%" stop-color="darkblue" /> </radialgradient> <rect x="0" y="0" width="200" height="200" fill="url(#gradient1)" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient2)" style="trans
form: translatex(220px);" /> </svg> usage notes ...
...p offset="0%" stop-color="darkblue" /> <stop offset="50%" stop-color="skyblue" /> <stop offset="100%" stop-color="darkblue" /> </radialgradient> <rect x="0" y="0" width="200" height="200" fill="url(#gradient1)" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient2)" style="trans
form: translatex(220px);" /> </svg> usage notes default value identity trans
form value <trans
form-list> animatable yes <trans
form-list> a list of trans
formation functions specifying some additional trans
formation from the gradient coordinate system onto the target coordinate system. specifications specification status comment css trans
forms level 1the definition of 'surfacescale for <fespecularlighting>' in that...
...And 2 more matches
<animateTransform> - SVG: Scalable Vector Graphics
the animatetrans
form element animates a trans
formation attribute on its target element, thereby allowing animations to control translation, scaling, rotation, and/or skewing. ...
...arget element, thereby allowing animations to control translation, scaling, rotation, and/or skewing. ...
...lowing animations to control translation, scaling, rotation, and/or skewing. ...
...And 2 more matches
Offering a context menu for form controls - Archive of obsolete content
firefox 3 changed the behavior of right-click on
form controls to no longer display a context menu by default. this article describes how an extension can override this change in a particular window, enabling context menus to work on
form controls. this article presents in
formation based on ehsan akhgari's
form control context menu extension, which was created specifically to demonstrate how to do this. there is ongoing discussion about this topic; please see bug 433168 for the latest in
formation. overlay the content the first thing to do is to establish an overlay over the chrome for the window in which you want to allow context menus on
form controls. ...
...ion based on ehsan akhgari's
form control context menu extension, which was created specifically to demonstrate how to do this. there is ongoing discussion about this topic; please see bug 433168 for the latest in
formation. overlay the content the first thing to do is to establish an overlay over the chrome for the window in which you want to allow context menus on
form controls. <overlay id="
formcontrolcontextmenu-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://
formcontrolcontextmenu/content/overlay.js"/> </overlay> change the right-click behavior the overlaid code is responsible for adjusting the behavior of right-clicking on
form controls. window.addeventlistener("load", function() { l...
...e is responsible for adjusting the behavior of right-clicking on
form controls. window.addeventlistener("load", function() { let settargetoriginal = nscontextmenu.prototype.settarget; components.utils.reporterror(settargetoriginal); nscontextmenu.prototype.settarget = function(anode, arangeparent, arangeoffset) { settargetoriginal.apply(this, arguments); if (this.istargeta
formcontrol(anode)) this.shoulddisplay = true; }; }, false); this code, which is run when the window is opened up, works by replacing the settarget() routine for the prototype of nscontextmenu with one that forces the context menu to display if the target of the menu is a
form control. as a result, all controls in the window will support a context menu when right-clicked, since we've ...
...hen the window is opened up, works by replacing the settarget() routine for the prototype of nscontextmenu with one that forces the context menu to display if the target of the menu is a
form control. as a result, all controls in the window will support a context menu when right-clicked, since we've changed the core behavior of context menus to override their default behavior of doing nothing on
form controls. ...
List of Former Mozilla-Based Applications - Archive of obsolete content
the following is a list of all known applications that at one point used mozilla technologies or that are no longer being actively maintained. a list of actively maintained mozilla-based applications is also available. ...
...erating system as of march 2010, rw/w reports jolicloud is on chrome/chrome os joost tv over internet switched from xulrunner-based client to a web application liferea news aggregator switched to webkit in version 1.6 manyone browser browser originally mozilla-based but now i believe the have a web-based tool (need reference for that) miro (
formerly democracy player) video switched from xulrunner to webkit in version 3.0.2 moblin browser browser when moblin became meego it switched from a custom gecko-based browser to chrome nautilus file manager hasn't used mozilla code since version 2.0 raptr client gaming client was a xulrunner app initially but now uses adobe air rift techno...
...now uses adobe air rift technologies software installation over internet no longer using mozilla technology -- need confirmation and details second life virtual world desktop client switched from embedded mozilla browser to a plugin architecture with a qtwebkit plugin applications that are no longer being developed name description additional in
formation aphrodite browser inactive aol client for mac internet software no longer available beonex communicator internet software last news item on site from 2004 chameleon theme builder inactive civil netizen p2p file delivery (email attachment replacement) site not updated since 2006 compuserve client internet s...
... inactive skipstone gtk+ browser last news item on site from february 2008 xabyl visual xbl editor inactive xulplayer media player last project update on 3/14/09 zoomcreator photo collage tool on april 29, 2010 the site announced zoomara was shutting down. the authoring part of this app was xulrunner based. other places to find
former mozilla-based applications: archived mozilla hall of fame page siftery ...
getFormattedString - Archive of obsolete content
%1$s, %2$s, etc.) can be used to specify the position of the corresponding parameter explicitly. ...
...%1$s, %2$s, etc.) can be used to specify the position of the corresponding parameter explicitly. ...
...%1$s, %2$s, etc.) can be used to specify the position of the corresponding parameter explicitly. ...
...%1$s, %2$s, etc.) can be used to specify the position of the corresponding parameter explicitly. ...
Special per-platform menu considerations - Archive of obsolete content
for many menu commands, convention dictates where these items will be placed. for instance, the edit menu always starts with the undo command if such a feature is available in the application, followed by redo, cut, copy, paste, and so forth. some menu items have specific common labels or locations where certain menu items would go that differ on each plat
form. for instance, on windows, the menu item which exits the application is labeled "exit" and is normally placed at the end of the file menu. the mac application menu on the macintosh, an extra menu exists beside the file menu; its name is the same as the name of the application. this menu contains a number of items that pertain to the application. for instance, this is the proper place to put the menu items which open the applic...
...r of items that pertain to the application. for instance, this is the proper place to put the menu items which open the application preferences and which quit the application. this can be accomplished by ensuring that certain common ids are set for the menu items that need to be placed on the application menu. on the mac, these menu items will be moved onto the application menu, but on other plat
forms, they will be left in their original locations. this makes it easier to write the same xul code for all plat
forms. here is a list of the menu item ids which are automatically handled. menu_filequitseparator the separator just before the quit/exit item. menu_filequititem the item which exits the application. menu_prefsseparator the separator just before the pr...
... notes for firefox extension developers on the mac, some elements, once moved to the application menu, are no longer accessible from xul overlays or from javascript injecte...
...pell check"/> <menuitem id="menu_preferences" label="preferences" oncommand="window.opendialog('options.xul', '_new', 'chrome');"/> </menupopup> </menu> </menubar> this menu item will be placed on the application menu on the macintosh but left in the tools menu on other plat
forms. when moved to the application menu, the label and shortcut keys are overridden by plat
form conventions. however, regardless of the plat
form, the command event will be fired on the menu item when it is activated by the user. notes for firefox extension developers on the mac, some elements, once moved to the application menu, are no longer accessible from xul overlays or from javascript injected into browser.xul. for example, using document.getelementbyid() for the quit menu item retu...
application/http-index-format specification - Archive of obsolete content
the syntax of data is defined by the syntax spec for every number type. if a number is encountered that a parser does not understand the parser is required to ignore that line. there is no line length limit. all lines must be terminated by a carriage return followed by a line feed. number codes 100 a human readable comment line. ...
...mber is encountered that a parser does not understand the parser is required to ignore that line. there is no line length limit. all lines must be terminated by a carriage return followed by a line feed. number codes 100 a human readable comment line. machine parsers should ignore this data. this data is not intended for display to the end user and is only meant as a comment to make the file
format clear to a human interpreter. 101 pre
formatted human readable in
formation line. this data is intended for the end user of the file
format data if there is one. this data should be presented to the user when they are viewing data drawn from the file. 102 a human readable in
formation line in html
format. this data is intended for the end user of the file
format data if there is one. this d...
...oken must be url escaped. valid 200 tokens note that all tokens are case insensitive. filename the name of file that can be used to retrieve the file when combined with the full path provided by the 300 line. white space and 8 bit characters must be url encoded. content-length base 10 digits representing the size of the file in bytes. only digits are legal. last-modified rfc 1123 date
format url encoded. content-type mime content type. whitespace and 8-bit characters must be url-encoded. the mime-type for a directory can be given as application/http-index-
format. file-type one of the following keywords to represent a special status for a file: file directory symbolic-link sym-file (a symbolic link to a file) sym-directory (a symbolic link to a directory) permissions ...
... guarentee as 101: as to the functionality of the data or programs 101: presented. 100: 300: ftp://test.netscape.com/u/montulli 100: 200: filename content-length content-type file-type last-modified 201: foo.txt 512 text/plain file tue,%2015%20nov%201994%2008:12:31%20gmt 201: bar.html 9683 text/html file tue,%2025%20oct%201994%2008:12:31%20gmt 201: foobar 0 application/http-index-
format directory tue,%2025%20oct%201994%2008:12:31%20gmt original document in
formation author(s): christian biesinger last updated date: may 10, 2004 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Why Well-Formed Web RSS Module is Popular - Syndicating Your Comments - Archive of obsolete content
there aren't many blogs out there that don't allow commenting of blog posts. however, rss does not provide sufficient facilities for dealing with them. sure rss has the <comments> element, but it points to a html page that isn't machine readable. it is desirable to be able to deal with comments in the same way one deals with rss feeds; through syndication. the rss well-
formed web module exists to fill this gap. ...
...posts. however, rss does not provide sufficient facilities for dealing with them. sure rss has the <comments> element, but it points to a html page that isn't machine readable. it is desirable to be able to deal with comments in the same way one deals with rss feeds; through syndication. the rss well-
formed web module exists to fill this gap. ...
...s> element, but it points to a html page that isn't machine readable. it is desirable to be able to deal with comments in the same way one deals with rss feeds; through syndication. the rss well-
formed web module exists to fill this gap. ...
...this element lets you syndicate your comments. the uri in the <wfw:commentrss> element must point to an rss feed containing the comments for the <item> it is contained in. ...
XForms Styling - Archive of obsolete content
just a starting draft. hopefully someone more proficient in mozilla x
forms and css can clean this up repeats see the mozilla x
forms specials page for some general points. switches can be styled as tabs. triggers use appearance="minimal" to be able to style buttons portability the mozilla x
forms extension is one of the few x
forms processors which allow for styling of the x
forms elements directly, using mostly standard css. processors such as chiba create "old-style" html
forms from x
forms documents, and must be styled accordingly. however, most of the time the transition is straight-forward: view the source after processing of your x
forms document, and map the old styles to the new elements. appearance attributes can also make a big difference. experimenting with these can g...
... the time the transition is straight-forward: view the source after processing of your x
forms document, and map the old styles to the new elements. appearance attributes can also make a big difference. experimenting with these can give you some easier way of styling the contents than just using the default. === example === here's a small example that shows equivalent styles for chiba and mozilla x
forms. ...
...e the transition is straight-forward: view the source after processing of your x
forms document, and map the old styles to the new elements. appearance attributes can also make a big difference. experimenting with these can give you some easier way of styling the contents than just using the default. === example === here's a small example that shows equivalent styles for chiba and mozilla x
forms. ...
...ent, and map the old styles to the new elements. appearance attributes can also make a big difference. ...
XForms Select Element - Archive of obsolete content
he spec). the list of pre-defined items can be specified by either item (see the spec) or itemset (see the spec) elements. you can visually group these pre-defined items by using the choices (see the spec) element to contain them. note, some representations of the select element do not support visual grouping. attributes ui common appearance - the value of this attribute gives a hint to the x
forms 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 selection - isn't currently supported. this attribute, when set to 'open', allows the user to provide free entry to the list. possible values are open and closed, default is closed. incremental - supported, defaul...
...ted, 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. ...
...on to simple content may be relaxed when an itemset element is used, which allows the available choices to be obtained from an x
forms model. the relaxation happens when the itemset element specifies the item value using a copy (see spec) element. this is because a copy element can be used to add a subtree of nodes underneath the element that the select control is bound to. representations the x
forms select element can be represented by the following widgets for the specified appearance attribute values: list - default representation (xhtml/xul) check group- used when appearance = 'full' (xhtml/xul) list displaying a listbox is the default representation (xhtml/xul). characteristics analogous widgets are <html:select size="5" multiple="true"/> and <xul:listbox seltype="multiple"/> v...
... <xf:value>pg</xf:value> </xf:item> <xf:item> <xf:label>green</xf:label> <xf:value>g</xf:value> </xf:item> </xf:choices> <xf:choices> <xf:label>red colors</xf:label> <xf:item> <xf:label>red</xf:label> <xf:value>r</xf:value> </xf:item> <xf:item> <xf:label>magenta</xf:label> <xf:value>m</xf:value> </xf:item> </xf:choices> </x
forms:select> ...
nsIXFormsModelElement
1.0 66 introduced gecko 1.8 obsolete gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsidomdocument getinstancedocument(in domstring instanceid); void rebuild(); void recalculate(); void refresh(); void revalidate(); methods getinstancedocument() nsidomdocument getinstancedocument( in domstring instanceid ); parameters instanceid the id of the instance element to be returned. return value an nsidomdocument. exceptions thrown domexception if there is no matching instance data. ...
... domstring instanceid); void rebuild(); void recalculate(); void refresh(); void revalidate(); methods getinstancedocument() nsidomdocument getinstancedocument( in domstring instanceid ); parameters instanceid the id of the instance element to be returned. return value an nsidomdocument. exceptions thrown domexception if there is no matching instance data. rebuild() signals the x
forms processor to rebuild any internal data structures used to track computational dependencies within the given x
forms model. void rebuild(); parameters none. recalculate() signals the x
forms processor to per
form a full recalculation of the given x
forms model. note: script invocation is not necessarily equivalent to per
forming the recalculate action handler. though the script is assumed to have mod...
... x
forms processor to per
form a full recalculation of the given x
forms model. note: script invocation is not necessarily equivalent to per
forming the recalculate action handler. though the script is assumed to have modified instance data prior to invoking recalculate, the dom mutations are not cached. thus, a full recalculation is necessary to ensure the proper changes are effected throughout the x
forms model. void recalculate(); parameters none. refresh() signals the x
forms processor to per
form a full refresh of
form controls bound to instance nodes for the given x
forms model. void refresh(); parameters none. revalidate() signals the x
forms processor to per
form a full revalidation of the given x
forms model. void revalidate(); parameters none. ...
...ges are effected throughout the x
forms model. void recalculate(); parameters none. refresh() signals the x
forms processor to per
form a full refresh of
form controls bound to instance nodes for the given x
forms model. void refresh(); parameters none. revalidate() signals the x
forms processor to per
form a full revalidation of the given x
forms model. void revalidate(); parameters none. ...
Toolkit version format
this document is a reference for the version
format, as used in firefox 1.5 (xulrunner 1.8) and later. this
format is used by the extension manager, software update, and other parts of the plat
form. versions in at least the following places must con
form to this
format: addon's and target application's version in install and update manifests. the following preferences: app.extensions.version, extensions.lastappversion versions returned by nsixulappinfo. application.ini in xulrunner applications appversion flag in chrome manifests. you can use nsiversioncomparator to compare versions from your application. see older version
formats below for description of the older version
format used in firefox/thunderbird 1.0. ...
...fests. the following preferences: app.extensions.version, extensions.lastappversion versions returned by nsixulappinfo. application.ini in xulrunner applications appversion flag in chrome manifests. you can use nsiversioncomparator to compare versions from your application. see older version
formats below for description of the older version
format used in firefox/thunderbird 1.0. version
format a version string consists of one or more version parts, separated with dots. each version part is itself parsed as a sequence of four parts: <number-a><string-b><number-c><string-d>. each of the parts is optional. numbers are integers base 10 (may be negative), strings are non-numeric ascii characters. a few examples of valid version parts: 0 (as in 1.0): <number-a>=0 5a (as in 1.5a): <n...
...'1.0pre1' < '1.0pre10', while the strings are compared bytewise. see the next section for details on how versions are compared. see maintenance policy for special rules that mark version as "be...
...is less than 1.6). examples 1.-1 < 1 == 1. == 1.0 == 1.0.0 < 1.1a < 1.1aa < 1.1ab < 1.1b < 1.1c < 1.1pre == 1.1pre0 == 1.0+ < 1.1pre1a < 1.1pre1aa < 1.1pre1b < 1.1pre1 < 1.1pre2 < 1.1pre10 < 1.1.-1 < 1.1 == 1.1.0 == 1.1.00 < 1.10 < 1.* < 1.*.1 < 2.0 technical reference for those interested in seeing the implementation of toolkit version comparison, see nsversioncomparator.cpp. older version
formats firefox and thunderbird 1.0 used a simpler version
format, namely major[.minor[.release[.build]]][+] where [..] denotes an optional component, and major, minor, release, and build are all non-negative integers. ...
Version, UI, and Status Information - Plugins
« previousnext » this chapter describes the functions that allow a plug-in to display a message on the status line, get agent in
formation, and check on the current version of the plug-in api and the browser. displaying a status line message users are accustomed to checking the ui status line at the bottom of the browser window for updates on the progress of an operation or the url of a link on the page. you can also use the status line to notify the user of plug-in-related in
formation. the user might appreciate seeing the percentage completed of the current operation or the url of a button or other link object when the cursor is over it, all of which the browser shows. in fact, your plug-in interface should be consistent with the rest of the browser in this way. to accomplish...
...n the status line. the browser always displays the last status line message it receives, regardless of the message source. for this reason, your message is always displayed, but you have no control over how long it stays in the status line before another message replaces it. you should use a different method to display messages that the user needs to see, such as error messages. getting agent in
formation a plug-in can check which browser is running on the user's current system. browsers communicate with http servers, which store agent software name, version, and operating system in a user_agent field. if you want to gather usage statistics or just find out the version of your plug-in's host browser, this in
formation can help you. the plug-in calls the npn_useragent method to retrieve the c...
...version support the windowless feature? */ if (netscape_minor < npvers_has_windowless) { /* plug-in is running in a version of the navigator */ /* that does not support windowless plug-ins. */ return false; } else /* plug-in is running in a navigator version */ /* that has windowless support */ return true; } detecting windowless support on other plat
forms browser implementations on other plat
forms did not have windowless plug-in support at the time it was added to ms windows and mac os x, so a different method must be used to detect whether the browser provides support. bool has_windowless() { npbool supportswindowless = false; nperror ret = npn_getvalue(instance, npnvsupportswindowless, &supportswindowless); return ret == nperr_no_e...
... method must be used to detect whether the browser provides support. bool has_windowless() { npbool supportswindowless = false; nperror ret = npn_getvalue(instance, npnvsupportswindowless, &supportswindowless); return ret == nperr_no_error && supportswindowless; } reloading a plug-in when the browser starts up, it loads all the plug-ins it finds in the plugins directory for the plat
form. if you call npn_reloadplugins, the browser reloads all plug-ins in the plugins directory without restarting. this causes the browser to install a new plug-in and load it, or remove a plug-in, without having to restart. consider using this function as part of the plug-in's smartupdate process. void npn_reloadplugins(npbool reloadpages); the reloadpages parameter is a boolean that indicates whe...
Performance - Firefox Developer Tools
the per
formance tool gives you insight into your site's general responsiveness, javascript and layout per
formance. with the per
formance tool you create a recording, or profile, of your site over a period of time. the tool then shows you an overview of the things the browser was doing to render your site over the profile, and a graph of the frame rate over the profile. ...
...e. with the per
formance tool you create a recording, or profile, of your site over a period of time. the tool then shows you an overview of the things the browser was doing to render your site over the profile, and a graph of the frame rate over the profile. you get four sub-tools to examine aspects of the profile in more detail: the waterfall shows the different operations the browser was per
forming, such as executing layout, javascript, repaints, and garbage collection the call tree shows the javascript functions in which the browser spent most of its time the flame chart shows the javascript call stack over the course of the recording the allocations view shows the heap allocations made by your code over the course of the recording. this view only appears if you checked "record alloc...
...ting layout, javascript, repaints, and garbage collection the call tree shows the javascript functions in which the browser spent most of its time the flame chart shows the javascript call stack over the course of the recording the allocations view shows the heap allocations made by your code over the course of the recording. this view only appears if you checked "record allocations" in the per
formance tool settings. getting started ui tour to find your way around the per
formance tool, here's a quick tour of the ui. how to basic tasks: open the tool, create, save, load, and configure recordings components of the per
formance tool frame rate understand your site's overall responsiveness. call tree find bottlenecks in your site's javascript. allocations see...
...r the course of the recording. waterfall understand the work the browser's doing as the user interacts with your site. flame chart see which javascript functions are executing, and when, over the course of the recording. scenarios animating css properties uses the waterfall to understand how the browser updates a page, and how animating different css properties can affect per
formance. intensive javascript uses the frame rate and waterfall tools to highlight per
formance problems caused by long-running javascript, and how using workers can help in this situation. ...
CanvasRenderingContext2D.getTransform() - Web APIs
the canvasrenderingcontext2d.gettrans
form() method of the canvas 2d api retrieves the current trans
formation matrix being applied to the context. syntax let storedtrans
form = ctx.gettrans
form(); parameters none. return value a dommatrix object. the trans
formation matrix is described by: [acebdf001]\left[ \begin{array}{ccc} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{array} \right] note: the returned object is not live, so updating it will not affect the current trans
formation matrix, and updating the current trans
formation matrix will not affect an already returned dommatrix. examples in the following example, we have two <canvas> elements. ...
...rix is described by: [acebdf001]\left[ \begin{array}{ccc} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{array} \right] note: the returned object is not live, so updating it will not affect the current trans
formation matrix, and updating the current trans
formation matrix will not affect an already returned dommatrix. examples in the following example, we have two <canvas> elements. we apply a trans
form to the first one's context using canvasrenderingcontext2d.settrans
form() and draw a square on it, then retrieve the matrix from it using gettrans
form(). we then apply the retrieved matrix directly to the second canvas context by passing the dommatrix object directly to settrans
form(), and draw a circle on it. html <canvas width="240"></canvas> <canvas width="240"></canvas> css canvas { bo...
...rectly to the second canvas context by passing the dommatrix object directly to settrans
form(), and draw a circle on it. ...
...tly to settrans
form(), and draw a circle on it. html <canvas width="240"></canvas> <canvas width="240"></canvas> css canvas { border: 1px solid black; } javascript const canvases = document.queryselectorall('canvas'); const ctx1 = canvases[0].getcontext('2d'); const ctx2 = canvases[1].getcontext('2d'); ctx1.settrans
form(1, .2, .8, 1, 0, 0); ctx1.fillrect(25, 25, 50, 50); let storedtrans
form = ctx1.gettrans
form(); console.log(storedtrans
form); ctx2.settrans
form(storedtrans
form); ctx2.beginpath(); ctx2.arc(50, 50, 50, 0, 2 * math.pi); ctx2.fill(); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.gettrans
form' in that specification. living standard ...
CanvasRenderingContext2D.resetTransform() - Web APIs
the canvasrenderingcontext2d.resettrans
form() method of the canvas 2d api resets the current trans
form to the identity matrix. syntax void ctx.resettrans
form(); examples resetting the matrix this example draws a rotated rectangle after modifying the matrix, and then resets the matrix using the resettrans
form() method. html <canvas id="canvas"></canvas> javascript the rotate() method rotates the trans
formation matrix by 45°. the fillrect() method draws a filled rectangle, adjusted according to that matrix. ...
... method. html <canvas id="canvas"></canvas> javascript the rotate() method rotates the trans
formation matrix by 45°. the fillrect() method draws a filled rectangle, adjusted according to that matrix. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // draw a rotated rectangle ctx.rotate(45 * math.pi / 180); ctx.fillrect(60, 0, 100, 30); // reset trans
formation matrix to the identity matrix ctx.resettrans
form(); result continuing with a regular matrix whenever you're done drawing trans
formed shapes, you should call resettrans
form() before rendering anything else. in this example, the first two shapes are drawn with a skew trans
formation, and the last two are drawn with the identity (regular) trans
formation. html <canvas id="canvas"></canvas...
...rans
formed shapes, you should call resettrans
form() before rendering anything else. in this example, the first two shapes are drawn with a skew trans
formation, and the last two are drawn with the identity (regular) trans
formation. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // skewed rectangles ctx.trans
form(1, 0, 1.7, 1, 0, 0); ctx.fillstyle = 'gray'; ctx.fillrect(40, 40, 50, 20); ctx.fillrect(40, 90, 50, 20); // non-skewed rectangles ctx.resettrans
form(); ctx.fillstyle = 'red'; ctx.fillrect(40, 40, 50, 20); ctx.fillrect(40, 90, 50, 20); result the skewed rectangles are gray, and the non-skewed rectangles are red. ...
...2d'); // skewed rectangles ctx.trans
form(1, 0, 1.7, 1, 0, 0); ctx.fillstyle = 'gray'; ctx.fillrect(40, 40, 50, 20); ctx.fillrect(40, 90, 50, 20); // non-skewed rectangles ctx.resettrans
form(); ctx.fillstyle = 'red'; ctx.fillrect(40, 40, 50, 20); ctx.fillrect(40, 90, 50, 20); result the skewed rectangles are gray, and the non-skewed rectangles are red. polyfill you can also use the settrans
form() method to reset the current trans
form to the identity matrix, like so: ctx.settrans
form(1, 0, 0, 1, 0, 0); specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.resettrans
form' in that specification. living standard ...
FormData.get() - Web APIs
the get() method of the
formdata interface returns the first value associated with a given key from within a
formdata object. if you expect multiple values and want all of them, use the getall() method instead. note: this method is available in web workers. syntax
formdata.get(name); parameters name a usvstring representing the name of the key you want to retrieve. return value a
formdataentryvalue containing the value. if the key doesn't exist, the method returns null. ...
...xpect multiple values and want all of them, use the getall() method instead. note: this method is available in web workers. syntax
formdata.get(name); parameters name a usvstring representing the name of the key you want to retrieve. return value a
formdataentryvalue containing the value. if the key doesn't exist, the method returns null. ...
...and want all of them, use the getall() method instead. note: this method is available in web workers. syntax
formdata.get(name); parameters name a usvstring representing the name of the key you want to retrieve. return value a
formdataentryvalue containing the value. if the key doesn't exist, the method returns null. ...
... them, use the getall() method instead. note: this method is available in web workers. syntax
formdata.get(name); parameters name a usvstring representing the name of the key you want to retrieve. return value a
formdataentryvalue containing the value. if the key doesn't exist, the method returns null. example the following line creates an empty
formdata object: var
formdata = new
formdata(); if we add two username values using
formdata.append:
formdata.append('username', 'chris');
formdata.append('username', 'bob'); the following get() function will only return the first username value appended:
formdata.get('username'); // returns "chris" specifications specification status comment xmlhttprequestthe definition of 'get()' in that specification. ...
performance.mark() - Web APIs
the mark() method creates a timestamp in the browser's per
formance entry buffer with the given name. the application defined timestamp can be retrieved by one of the per
formance interface's getentries*() methods (getentries(), getentriesbyname() or getentriesbytype()). the mark()'s stores its data internally as per
formanceentry. note: this feature is available in web workers. syntax per
formance.mark(name); arguments name a domstring representing the name of the mark. if the name given to this method already exists in the per
formancetiming interface, syntaxerror is thrown. return value void example the following example shows how to use mark() to create and retrieve per
formancemark entries. ...
... is available in web workers. syntax per
formance.mark(name); arguments name a domstring representing the name of the mark. if the name given to this method already exists in the per
formancetiming interface, syntaxerror is thrown. return value void example the following example shows how to use mark() to create and retrieve per
formancemark entries. // create a bunch of marks. per
formance.mark("squirrel"); per
formance.mark("squirrel"); per
formance.mark("monkey"); per
formance.mark("monkey"); per
formance.mark("dog"); per
formance.mark("dog"); // get all of the per
formancemark entries. const allentries = per
formance.getentriesbytype("mark"); console.log(allentries.length); // 6 // get all of the "monkey" per
formancemark entries. ...
... working draft clarifies mark() processing model. ...
... working draft clarifies mark() processing model. user timingthe definition of 'mark()' in that specification. ...
PerformanceFrameTiming - Web APIs
per
formanceframetiming is an abstract interface that provides frame timing data about the browser's event loop. a frame represents the amount of work a browser does in one event loop such as processing dom events, resizing, scrolling, rendering, css animations, etc.. a frame rate of 60fps (frames per second) for a 60hz refresh rate is the target for a good responsive user experience. this means the browser should process a frame in about 16.7ms. an application can register a per
formanceobserver for "frame" per
formance entry types and the observer can retrieve data about the duration of each frame event. this in
formation can be used to help identify areas that take too long to provide a good user experience. <div id="interfacediagram" style="display: inline-block; position:...
... areas that take too long to provide a good user experience. ...
...e; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/per
formanceframetiming" target="_top"><rect x="1" y="1" width="220" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="111" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">per
formanceframetiming</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but it extends the following per
formanceentry properties (for "frame" per
formance entry types) by qualifying and constraining the properties as follows: per
formanceentry.entrytype returns "frame". per
formanceentry.name returns the document's addres...
...metiming</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but it extends the following per
formanceentry properties (for "frame" per
formance entry types) by qualifying and constraining the properties as follows: per
formanceentry.entrytype returns "frame". per
formanceentry.name returns the document's address. per
formanceentry.starttime returns the timestamp when the frame was started. per
formanceentry.duration returns a timestamp indicating the difference between the starttimes of two successive frames. methods this interface has no methods. example see the example in using the frame timing api. specifications specification status comment frame timingthe definition of 'perfor...
PerformanceNavigation.type - Web APIs
1 type_reload the page was accessed by clicking the reload button or via the location.reload() method. ...
... 1 type_reload the page was accessed by clicking the reload button or via the location.reload() method. ...
...vel 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancenavigation.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. 2 type_back_forward the page was accessed by navigating into the history. 255 type_reserved any other way. ...
...e 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. 2 type_back_forward the page was accessed by navigating into the history. 255 type_reserved any other way. syntax type = per
formancenavigation.type; specifications specification status comment navigation timingthe definition of 'per
formancenavigation.type' in that specification. recommendation initial definition. ...
PeformanceObserver.disconnect() - Web APIs
the disconnect() method of the per
formanceobserver interface is used to stop the per
formance observer from receiving any per
formance entry events. syntax per
formanceobserver.disconnect(); example var observer = new per
formanceobserver(function(list, obj) { var entries = list.getentries(); for (var i=0; i < entries.length; i++) { // process "mark" and "frame" events } }); observer.observe({entrytypes: ["mark", "frame"]}); function perf_observer(list, observer) { // process the "measure" event // ... ...
... candidate recommendation initial definition of disconnect() method. ...
... candidate recommendation initial definition of disconnect() method. ...
...me" events } }); observer.observe({entrytypes: ["mark", "frame"]}); function perf_observer(list, observer) { // process the "measure" event // ... // disable additional per
formance events observer.disconnect(); } var observer2 = new per
formanceobserver(perf_observer); observer2.observe({entrytypes: ["measure"]}); specifications specification status comment per
formance timeline level 2the definition of 'disconnect()' in that specification. candidate recommendation initial definition of disconnect() method. ...
PerformanceObserverEntryList - Web APIs
the per
formanceobserverentrylist interface is a list of pe
formance events that were explicitly observed via the observe() method. note: this interface is exposed to window and worker. methods per
formanceobserverentrylist.getentries() returns a list of explicitly observed per
formanceentry objects based on the given filter. per
formanceobserverentrylist.getentriesbytype() returns a list of explicitly observed per
formanceentry objects of the given entry type. per
formanceobserverentrylist.getentriesbyname() returns a list of explicitly observed per
formanceentry objects based on the given name and entry type. ...
...icitly observed per
formanceentry objects based on the given filter. per
formanceobserverentrylist.getentriesbytype() returns a list of explicitly observed per
formanceentry objects of the given entry type. per
formanceobserverentrylist.getentriesbyname() returns a list of explicitly observed per
formanceentry objects based on the given name and entry type. ...
...sed on the given filter. per
formanceobserverentrylist.getentriesbytype() returns a list of explicitly observed per
formanceentry objects of the given entry type. per
formanceobserverentrylist.getentriesbyname() returns a list of explicitly observed per
formanceentry objects based on the given name and entry type. ...
...list.getentriesbytype() returns a list of explicitly observed per
formanceentry objects of the given entry type. per
formanceobserverentrylist.getentriesbyname() returns a list of explicitly observed per
formanceentry objects based on the given name and entry type. example // create observer for all per
formance event types // list is of type per
formanceobserveentrylist var observe_all = new per
formanceobserver(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 per
formance timeline level 2the definition of 'per
formanceobserverentrylist' in that specification. candidate recommendation...
PerformanceResourceTiming.workerStart - Web APIs
the workerstart read-only property of the per
formanceresourcetiming interface returns a domhighrestimestamp immediately before dispatching the fetchevent if a service worker thread is already running, or immediately before starting the service worker thread if it is not already running. if the resource is not intercepted by a service worker the property will always return 0. note: this feature is available in web workers. syntax resource.workerstart; value a domhighrestimestamp. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... the service worker thread if it is not already running. if the resource is not intercepted by a service worker the property will always return 0. note: this feature is available in web workers. syntax resource.workerstart; value a domhighrestimestamp. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...a service worker the property will always return 0. note: this feature is available in web workers. syntax resource.workerstart; value a domhighrestimestamp. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... of the *start and *end properties of all "resource" type events are logged. ...
PerformanceServerTiming - Web APIs
note: this feature is available in web workers. the per
formanceservertiming interface surfaces server metrics that are sent with the response in the server-timing http header. this interface is restricted to the same origin, but you can use the timing-allow-origin header to specify the domains that are allowed to access the server metrics. note that this interface is only available in secure contexts (https) in some browsers. properties per
formanceservertiming.descriptionread only a domstring value of the server-specified metric description, or an empty string. per
formanceservertiming.durationread only a double that contains the server-specified metric duration, or value 0.0. per
formanceservertiming.nameread only a domstring value of the server-specified metric name. ...
...ttps) in some browsers. properties per
formanceservertiming.descriptionread only a domstring value of the server-specified metric description, or an empty string. per
formanceservertiming.durationread only a double that contains the server-specified metric duration, or value 0.0. per
formanceservertiming.nameread only a domstring value of the server-specified metric name. methods per
formanceservertiming.tojson() returns a domstring that is the json representation of the per
formanceservertiming object. example given a server that sends the server-timing header, for example a node.js server like this: const http = require('http'); function requesthandler(request, response) { const headers = { 'server-timing': ` cache;desc="cache read";dur=23.2, db;dur=53, ...
...'); function requesthandler(request, response) { const headers = { 'server-timing': ` cache;desc="cache read";dur=23.2, db;dur=53, app;dur=47.2 `.replace(/\n/g, '') }; response.writehead(200, headers); response.write(''); return settimeout(_ => { response.end(); }, 1000) }; http.createserver(requesthandler).listen(3000).on('error', console.error); the per
formanceservertiming entries are now observable from javascript via the per
formanceresourcetiming.servertiming property: let entries = per
formance.getentriesbytype('resource'); console.log(entries[0].servertiming); // 0: per
formanceservertiming {name: "cache", duration: 23.2, description: "cache read"} // 1: per
formanceservertiming {name: "db", duration: 53, description: ""} // 2: per
formanceserverti...
... working draft initial definition. ...
PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() - Web APIs
isuserverifyingplat
formauthenticatoravailable() is a static method of the publickeycredential interface that returns a promise which resolves to true if a user-verifying plat
form authenticator is available. a user-verifying plat
form authenticator is a kind of multi-factor authenticator that is part of the client device (it is generally not removable) and that involves an action from the user in order to identify them. at the time of this writing, this method's result only resolves to true on windows when windows hello capabilities are available (on recent versions of this os). note: this method may only be used in top-level contexts and will not be available in an <iframe> for example. syntax publickeycredential.isuserverifyingplat
formauthenticatoravailable() parameters none. retu...
... windows when windows hello capabilities are available (on recent versions of this os). note: this method may only be used in top-level contexts and will not be available in an <iframe> for example. syntax publickeycredential.isuserverifyingplat
formauthenticatoravailable() parameters none. return value a promise which resolves to a boolean indicating whether or a not a user-verifying plat
form authenticator is available. as of today (march 2019), this is basically indicating if windows hello may be used with the web authentication api and that the user has accepted its use. note: this is a static method which is directly called on the publickeycredential interface and not on an instance. note: in earlier versions of the specification, the boolean also conveyed the consent of the u...
...lo may be used with the web authentication api and that the user has accepted its use. note: this is a static method which is directly called on the publickeycredential interface and not on an instance. note: in earlier versions of the specification, the boolean also conveyed the consent of the user to disclose such an authenticator existed. ...
... recommendation initial definition. ...
format - Web APIs
the svgaltglyphelement.
format property is a domstring that defines the
format of the given font. it has the same meaning as the '
format' property of svgglyphrefelement property. if the font is in one of the
formats listed in css2([css2], section15.3.5), then its value is the corresponding <string> parameter of the font. syntax string = myglyph.
format; myglyph.
format = string; value the
format values listed below are taken from css2([css2], section15.3.5). ...
...font. it has the same meaning as the '
format' property of svgglyphrefelement property. if the font is in one of the
formats listed in css2([css2], section15.3.5), then its value is the corresponding <string> parameter of the font. syntax string = myglyph.
format; myglyph.
format = string; value the
format values listed below are taken from css2([css2], section15.3.5). ...
... recommendation ...
... recommendation ...
SVGFontFaceFormatElement - Web APIs
the svgfontface
formatelement interface corresponds to the <font-face-
format> elements. object-oriented access to the attributes of the <font-face-
format> element via the svg dom is not possible. ...
...ce-
format> element via the svg dom is not possible. ...
... methods this interface has no methods but inherits methods from its parent, svgelement. ...
... recommendation initial definition ...
WebGL2RenderingContext.getActiveUniformBlockParameter() - Web APIs
the webgl2renderingcontext.getactiveuni
formblockparameter() method of the webgl 2 api retrieves in
formation about an active uni
form block within a webglprogram. syntax any gl.getactiveuni
formblockparameter(program, uni
formblockindex, pname); parameters program a webglprogram containing the active uni
form block. uni
formblockindex a gluint specifying the index of the active uni
form block within the program. pname a glenum specifying which in
formation to query. possible values: gl.uni
form_block_binding: returns a gluint indicating the uni
form buffer binding point. gl.uni
form_block_data_size: returns a gluint indicating the minimum total buffer object size. ...
...aining the active uni
form block. uni
formblockindex a gluint specifying the index of the active uni
form block within the program. pname a glenum specifying which in
formation to query. possible values: gl.uni
form_block_binding: returns a gluint indicating the uni
form buffer binding point. gl.uni
form_block_data_size: returns a gluint indicating the minimum total buffer object size. gl.uni
form_block_active_uni
forms: returns a gluint indicating the number of active uni
forms in the uni
form block. gl.uni
form_block_active_uni
form_indices: returns a uint32array indicating the list of active uni
forms in the uni
form block. gl.uni
form_block_referenced_by_vertex_shader: returns a glboolean indicating whether the uni
form block is referenced by the vertex shader. ...
...ct size. gl.uni
form_block_active_uni
forms: returns a gluint indicating the number of active uni
forms in the uni
form block. gl.uni
form_block_active_uni
form_indices: returns a uint32array indicating the list of active uni
forms in the uni
form block. gl.uni
form_block_referenced_by_vertex_shader: returns a glboolean indicating whether the uni
form block is referenced by the vertex shader. gl.uni
form_block_referenced_by_fragment_shader: returns a glboolean indicating whether the uni
form block is referenced by the fragment shader. return value depends on which in
formation is requested using the pname parameter. if an error occurs, null is returned. ...
... a glboolean indicating whether the uni
form block is referenced by the vertex shader. gl.uni
form_block_referenced_by_fragment_shader: returns a glboolean indicating whether the uni
form block is referenced by the fragment shader. return value depends on which in
formation is requested using the pname parameter. if an error occurs, null is returned. examples var blocksize = gl.getactiveuni
formblockparameter(program, blockindex, gl.uni
form_block_data_size); specifications specification status comment webgl 2.0the definition of 'getactiveuni
formblockparameter' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgetactiveuni
formblockiv' in that specification. standard man...
Accessibility Information for Web Authors - Accessibility
goes into greater depth. in 30 days, you will know why your website should be accessible and how to make it more accessible. automated checking & repair cynthia says™ from hisoftware® company "cynthia says™" is a free online webpage accessibility validation service that is designed to identify errors in webpage related to section 508 standards and/or the wcag guidelines. it can per
form a "complete webpage quality check" for accessibility, privacy, searchability, metadata and even alt text attribute quality. the web author chooses the guidelines (as a basis for errors and warnings) to be used by "cynthia says™": section 508, wcag priorities 1, 2 and 3. the output data report is displayed in a clear and well structured table where each and all checkpoints are identified and des...
...ility validation service that identifies accessibility errors and reports accessibility warnings about webpage related to section 508 standards and/or the wcag guidelines. its purpose is to aid humans in the web accessibility evaluation process. rather than providing a complex technical report, wave 4.0 shows the original web page with embedded icons and indicators that reveal the accessibility in
formation within your page. you can get accessibity report for errors, warnings. you can view the structure and order view of the document. you can see a text-only view and and outline view of the document. you can install a custom wave toolbar in firefox for a quick, easy and convenient evaluation of web pages directly within firefox. you can also add a wave bookmarklet in firefox or even wave dir...
...olor brightness difference? color contrast analyzer is an excellent tool for such task. effective color contrast and effective color brightness difference have a decisive importance for reading, furthermore for people with partial color deficiency (see the excellent examples in effective color contrast by lighthouse international). a study has established that about 8 percent of all men have some
form of color deficiency. color contrast analyzer algorithm is based on the
formula provided in techniques for accessibility evaluation and repair tools from w3c. the juicy studio css analyzer will also analyze and report the color contrast and color brightness differences involved in your stylesheets. the future: accessible dhtml dhtml accessibility roadmap: a peek into how dhtml will be made...
...ity evaluation and repair tools from w3c. the juicy studio css analyzer will also analyze and report the color contrast and color brightness differences involved in your stylesheets. the future: accessible dhtml dhtml accessibility roadmap: a peek into how dhtml will be made accessible in the future. this document gives a plan which is being developed by ibm, mozilla and wai protocols and
formats working group (pfwg) to address the issue of accessible dhtml. dynamic web content is not accessible, because it uses vanilla <div>'s and <span>'s combined with javascript rather than declarative markup to describe the behavior of custom widgets such as menus and tree views. these widgets are usually not even keyboard focusable. furthermore, assistive technologies do not understand what these...
Using device orientation with 3D transforms - Developer guides
this article provides tips on how to use device orientation in
formation in tandem with css 3d trans
forms. using orientation to rotate an element the easiest way to convert orientation data to a 3d trans
form is basically to use the alpha, gamma, and beta values as rotatez, rotatex and rotatey values. there are however two corrections that should be applied to those values: the initial alpha value is 180 (device flat on the back, top of the screen pointing 12:00), so the rotatez value should be alpha - 180 the y axis of the screen coordinate system is inverted, such that translatey(100px) moves an element 100px down, so the rotatey value should be -gamma finally, the order of the three different rotations is very important to accurately convert an orientation to a 3d rotation: ro...
...n, so the rotatey value should be -gamma finally, the order of the three different rotations is very important to accurately convert an orientation to a 3d rotation: rotatez, then rotatex and then rotatey. here's a simple code snippet to sum it up: var elem = document.getelementbyid("view3d"); window.addeventlistener("deviceorientation", function(e) { // remember to use vendor-prefixed trans
form property elem.style.trans
form = "rotatez(" + ( e.alpha - 180 ) + "deg) " + "rotatex(" + e.beta + "deg) " + "rotatey(" + ( -e.gamma ) + "deg)"; }); orientation compensation compensating the orientation of the device can be useful to create parallax effects or augmented reality. this is achieved by inverting the previous order of rotations and negating the alpha value: var elem = ...
... + ( -e.gamma ) + "deg)"; }); orientation compensation compensating the orientation of the device can be useful to create parallax effects or augmented reality. ...
...orientation compensation compensating the orientation of the device can be useful to create parallax effects or augmented reality. ...
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 truetype, opentype, and open font
format, but adds metadata and private-use data structures, including predefined fields allowing foundries and vendors to provide license in
formation if desired. there are three main benefits to using woff: the font data is compressed, so sites using woff will use less bandwidth and will load faster than if they used equivalent uncompressed truetype or opentype files. many font vendors that are unwilling to license their truetype or opentype
format fonts for use on the web will license woff
format fonts. this improves availability of fon...
...ed, so sites using woff will use less bandwidth and will load faster than if they used equivalent uncompressed truetype or opentype files. many font vendors that are unwilling to license their truetype or opentype
format fonts for use on the web will license woff
format fonts. this improves availability of fonts to site designers. both proprietary and free software browser vendors like the woff
format, so it has the potential of becoming a truly universal, interoperable font
format for the web, unlike other current font
formats. there are two versions of woff; woff and woff2, they mostly differ in regard to the compression algorithm used. in @font-face they are identified by the 'woff' and respectively 'woff2'
format descriptor. using woff you can use the @font-face css property to use w...
...ormat for the web, unlike other current font
formats. there are two versions of woff; woff and woff2, they mostly differ in regard to the compression algorithm used. in @font-face they are identified by the 'woff' and respectively 'woff2'
format descriptor. using woff you can use the @font-face css property to use woff fonts for text in web content. it works exactly like opentype and truetype
format fonts do, except it will likely let your content download more efficiently due to the addition of compression. tools for working with woff fonts tools for working with woff fonts are available. sfnt2woff and woff2sfnt convert between woff and opentype. ...
...ntent. it works exactly like opentype and truetype
format fonts do, except it will likely let your content download more efficiently due to the addition of compression. tools for working with woff fonts tools for working with woff fonts are available. sfnt2woff and woff2sfnt convert between woff and opentype. specifications specification status comment woff file
format 2.0 recommendation new compression algorithm woff file
format 1.0 recommendation initial specification. ...
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
the text is typically rendered using a non-proportional ("monospace") font. whitespace inside this element is displayed as written. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. ...
...e overflow must happen. in modern browser this hint is ignored and no visual effect results in its present; to achieve such an effect, use css white-space instead. example html <p>using css to change the font color is easy.</p> <pre> body { color: red; } </pre> result accessibility concerns it is important to provide an alternate description for any images or diagrams created using pre
formatted text. the alternate description should clearly and concisely describe the image or diagram's content. people experiencing low vision conditions and browsing with the aid of assistive technology such as a screen reader may not understand what the pre
formatted text characters are representing when they are read out in sequence. a combination of the <figure> and <figcaption> elements, supplem...
... example <figure role="img" aria-labelledby="cow-caption"> <pre> ___________________________ < i'm an expert in my field. ...
...e <figure role="img" aria-labelledby="cow-caption"> <pre> ___________________________ < i'm an expert in my field. > --------------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || </pre> <figcaption id="cow-caption"> a cow saying, "i'm an expert in my field." the cow is illustrated using pre
formatted text characters. </figcaption> </figure> mdn understanding wcag, guideline 1.1 explanations h86: providing text alternatives for ascii art, emoticons, and leetspeak | w3c techniques for wcag 2.0 specifications specification status comment html living standardthe definition of '<pre>' in that specification. living standard no significant change from...
URIError: malformed URI sequence - JavaScript
an argument given to either the decodeuri, encodeuri, encodeuricomponent, or decodeuricomponent function was not valid, so that the function was unable encode or decode properly. examples encoding encoding replaces each instance of certain characters by one, two, three, or four escape sequences representing the utf-8 encoding of the character. ...
...t valid, so that the function was unable encode or decode properly. examples encoding encoding replaces each instance of certain characters by one, two, three, or four escape sequences representing the utf-8 encoding of the character. ...
...operly. examples encoding encoding replaces each instance of certain characters by one, two, three, or four escape sequences representing the utf-8 encoding of the character. an urierror will be thrown if there is an attempt to encode a surrogate which is not part of a high-low pair, for example: encodeuri('\ud800'); // "urierror: mal
formed uri sequence" encodeuri('\udfff'); // "urierror: mal
formed uri sequence" a high-low pair is ok. ...
...rror: mal
formed uri sequence" encodeuri('\udfff'); // "urierror: mal
formed uri sequence" a high-low pair is ok. for example: encodeuri('\ud800\udfff'); // "%f0%90%8f%bf" decoding decoding replaces each escape sequence in the encoded uri component with the character that it represents. ...
SyntaxError: missing formal parameter - JavaScript
your function declaration is missing valid parameters. in the declaration of a function, the parameters must be identifiers, not any value like numbers, strings, or objects. declaring functions and calling functions are two separate steps. declarations require identifier as parameters, and only when calling (invoking) the function, you provide the values the function should use. ...
...art with a digit. an identifier differs from a string in that a string is data, while an identifier is part of the code. examples provide proper function parameters function parameters must be identifiers when setting up a function. ...
...dentifier is part of the code. examples provide proper function parameters function parameters must be identifiers when setting up a function. ...
...s must be identifiers when setting up a function. ...
Intl.ListFormat.supportedLocalesOf() - JavaScript
the intl.list
format.supportedlocalesof() method returns an array containing those of the provided locales that are supported in date and time
formatting without having to fall back to the runtime's default locale. syntax intl.list
format.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings. for the general
form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for in
formation about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in date a...
...t, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for in
formation about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in date and time
formatting without having to fall back to the runtime's default locale. description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in date and time
formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using sup...
...subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in date and time
formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in date and time
formatting, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is neither relevant to date and time
formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the "lookup" algorithm here — a "best fit" matcher might decide that indonesian is an adequate match for balinese s...
...unlikely to be supported. note the specification of the "lookup" algorithm here — a "best fit" matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore return the balinese language tag as well. const locales = ['ban', 'id-u-co-pinyin', 'de-id']; const options = { localematcher: 'lookup' }; console.log(intl.list
format.supportedlocalesof(locales, options).join(', ')); // → "id-u-co-pinyin, de-id" specifications specification intl.list
formatthe definition of 'supportedlocalesof()' in that specification. ...
Intl.RelativeTimeFormat.prototype.resolvedOptions() - JavaScript
the intl.relativetime
format.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and relative time
formatting options computed during initialization of this relativetime
format object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax relativetime
format.resolvedoptions() return value a new object with properties reflecting the locale and number
formatting options computed during the initialization of the given relativetime
format object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if a...
...7 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. style the length of the internationalized message. possible values are: "long" (default, e.g., in 1 month) "short" (e.g., in 1 mo.), or "narrow" (e.g., in 1 mo.). the narrow style could be similar to the short style for some locales. ...
... numeric the
format of output message. possible values are: "always" (default, e.g., 1 day ago), or "auto" (e.g., yesterday). the "auto" value allows to not always have to use numeric values in the output. numberingsystem the value requested using the unicode extension key "nu" or filled in as a default. ...
... stage 4 ...
patternTransform - SVG: Scalable Vector Graphics
the patterntrans
form attribute defines a list of trans
form definitions that are applied to a pattern tile. only one element is using this attribute: <pattern> html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- apply a trans
form on the tile --> <pattern id="p1" width=".25" height=".25" patterntrans
form="rotate(20) skewx(30) scale(1 0.5)"> <circle cx="10" cy="10" r="10" /> </pattern> <!-- apply the trans
formed pattern tile --> <rect x="10" y="10" width="80" height="80" fill="url(#p1)" /> </svg> pattern for <pattern>, patterntrans
form defines a list of trans
form definitions that are applied to a pattern tile. note: as of svg2, it is also allowe...
... scale(1 0.5)"> <circle cx="10" cy="10" r="10" /> </pattern> <!-- apply the trans
formed pattern tile --> <rect x="10" y="10" width="80" height="80" fill="url(#p1)" /> </svg> pattern for <pattern>, patterntrans
form defines a list of trans
form definitions that are applied to a pattern tile. note: as of svg2, it is also allowed to use the css trans
form property. however, the current state of implementation isn't very good. for backward compatibility reason, it is highly suggested to keep using the patterntrans
form attribute. ...
...p1)" /> </svg> pattern for <pattern>, patterntrans
form defines a list of trans
form definitions that are applied to a pattern tile. note: as of svg2, it is also allowed to use the css trans
form property. however, the current state of implementation isn't very good. for backward compatibility reason, it is highly suggested to keep using the patterntrans
form attribute. value <trans
form-list> default value identity trans
form animatable yes trans
form functions to know more about the definition of trans
form functions, see the trans
form attribute definition. specifications specification status comment scalable vector graphics (svg) 2the definition of 'patterntrans
form' in that specification. candidate recommendation ...
... functions to know more about the definition of trans
form functions, see the trans
form attribute definition. specifications specification status comment scalable vector graphics (svg) 2the definition of 'patterntrans
form' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the definition of 'patterntrans
form' in that specification. recommendation initial definition ...
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
an instruction, on the other hand, is associated with a template. a stylesheet may include several templates. a third type of element, not discussed here, is the literal result element (lre). an lre also appears in a template. ...
...anation of the degree of present gecko support. use the {{listsubpages}} macro once the bcd for <xsl:fallback>, <xsl:import>, <xsl:namespace-alias>, <xsl:number>, <xsl:output>, <xsl:stylesheet>, <xsl:text> and <xsl:value-of> is fully migrated. ...
...e-set><xsl:attribute><xsl:call-template><xsl:choose><xsl:comment><xsl:copy-of><xsl:copy><xsl:decimal-
format><xsl:element><xsl:fallback><xsl:for-each><xsl:if><xsl:import><xsl:include><xsl:key><xsl:message><xsl:namespace-alias><xsl:number><xsl:otherwise><xsl:output><xsl:param><xsl:preserve-space><xsl:processing-instruction><xsl:sort><xsl:strip-space><xsl:stylesheet><xsl:template><xsl:text><xsl:trans
form><xsl:value-of><xsl:variable><xsl:when><xsl:with-param> <xsl:apply-imports> <xsl:apply-templates> <xsl:attribute> <xsl:attribute-set> <xsl:call-template> <xsl:choose> <xsl:comment> <xsl:copy> <xsl:copy-of> <xsl:decimal-
format> <xsl:element> <xsl:fallback> (not supported) <xsl:for-each> <xsl:if> <xsl:import> (mostly supported) <xsl:include> <xsl:key> <xsl:message> <xsl:namespac...
... <xsl:import> (mostly supported) <xsl:include> <xsl:key> <xsl:message> <xsl:namespace-alias> (not supported) <xsl:number> (partially supported) <xsl:otherwise> <xsl:output> (partially supported) <xsl:param> <xsl:preserve-space> <xsl:processing-instruction> <xsl:sort> <xsl:strip-space> <xsl:stylesheet> (partially supported) <xsl:template> <xsl:text> (partially supported) <xsl:trans
form> <xsl:value-of> (partially supported) <xsl:variable> <xsl:when> <xsl:with-param> ...
Basic Example - XSLT: Extensible Stylesheet Language Transformations
figure 4 : xml file <?xml version="1.0"?> <myns:article xmlns:myns="http://devedge.netscape.com/2002/de"> <myns:title>my article</myns:title> <myns:authors> <myns:author company="foopy corp.">mr. foo</myns:author> <myns:author>mr. bar</myns:author> </myns:authors> <myns:body> the <b>rain</b> in <u>spain</u> stays mainly in the plains. ...
...myns:title> <myns:authors> <myns:author company="foopy corp.">mr. foo</myns:author> <myns:author>mr. bar</myns:author> </myns:authors> <myns:body> the <b>rain</b> in <u>spain</u> stays mainly in the plains. ...
...xsl:copy> </xsl:template> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet> the example loads using synchronous xmlhttprequest both the .xsl (xslstylesheet) and the .xml (xmldoc) files into memory. the .xsl file is then imported (xsltprocessor.importstylesheet(xslstylesheet)) and the trans
formation run (xsltprocessor.trans
formtofragment(xmldoc, document)). this allows fetching of data after the page has been loaded, without initiating a fresh page load. figure 6 : example var xslstylesheet; var xsltprocessor = new xsltprocessor(); var mydom; var xmldoc; function init(){ // load the xslt file, example1.xsl var myxmlhttprequest = new xmlhttprequest(); myxmlhttprequest.open("ge...
..."example1.xsl", false); myxmlhttprequest.send(null); xslstylesheet = myxmlhttprequest.responsexml; xsltprocessor.importstylesheet(xslstylesheet); // load the xml file, example1.xml myxmlhttprequest = new xmlhttprequest(); myxmlhttprequest.open("get", "example1.xml", false); myxmlhttprequest.send(null); xmldoc = myxmlhttprequest.responsexml; var fragment = xsltprocessor.trans
formtofragment(xmldoc, document); document.getelementbyid("example").innerhtml = ""; mydom = fragment; document.getelementbyid("example").appendchild(fragment); } ...
XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes extensible stylesheet language trans
formations (xslt) is an xml-based language used, in conjunction with specialized processing software, for the trans
formation of xml documents. although the process is referred to as "trans
formation," the original document is not changed; rather, a new xml document is created based on the content of an existing document. then, the new document may be serialized (output) by the processor in standard xml syntax or in another
format, such as html or plain text. ...
...w xml document is created based on the content of an existing document. then, the new document may be serialized (output) by the processor in standard xml syntax or in another
format, such as html or plain text. xslt is most often used to convert data between different xml schemas or to convert xml data into web pages or pdf documents. documentation xslt element reference reference. ...
...ocument. then, the new document may be serialized (output) by the processor in standard xml syntax or in another
format, such as html or plain text. xslt is most often used to convert data between different xml schemas or to convert xml data into web pages or pdf documents. documentation xslt element reference reference. trans
forming xml with xslt xslt allows a stylesheet author to trans
form a primary xml document in two significant ways: manipulating and sorting the content, including a wholesale reordering of it if so desired, and trans
forming the content into a different
format. using the mozilla javascript interface to xsl trans
formations this document describes the javascript interface to the xslt processing engine in mozilla 1.2 and up. specifying parameters using processing...
...g instructions firefox allows stylesheet parameters to be specified when using the <?xml-stylesheet?> processing instruction. this is done using the <?xslt-param?> pi described in this document. xslt & xpath tutorial the topxml xslt tutorial introduces you to the basics of xslt concepts, syntax, and programming. xslt tutorial this w3schools tutorial teaches the reader how to use xslt to trans
form xml documents into other
formats, like xhtml. what is xslt? this extensive introduction to xslt and xpath assumes no prior knowledge of the technologies and guides the reader through background, context, structure, concepts and introductory terminology. common xslt errors this article lists some common problems using xslt in firefox. xslt 2.0 (new) view all... community view mozilla ...
Getting File Information - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file in
formation | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the plat
form (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. the nsifile object has a number of useful attrib...
...pcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. the nsifile object has a number of useful attributes which may be used to retrieve in
formation about a file. two useful attributes filesize and lastmodifiedtime (nsifile.attributes) provide a means of retrieving the size of a file and the time when the file was last changed. file size the filesize (nsifile.attributes) attribute holds the size of a file in bytes. if the file does not exist, a 'file not found' exception will occur. you can catch this exception with a try-catch block, ...
... ...
Well-Formed Web - Archive of obsolete content
getting started a guided tutorial that will help you get started with the well-
formed web rss module. the well-
formed web rss module provides facilities for <item> level commenting: for linking to comments contained in an external rss feed, and for posting new comments. documentation selected articles why well-
formed web rss module is popular - syndicating your comments charles iliya krempeaux talks about the rss well-
formed web module, why it is popular among some, and how it is used to link to your comments (2005-08-22). ...
...contained in an external rss feed, and for posting new comments. documentation selected articles why well-
formed web rss module is popular - syndicating your comments charles iliya krempeaux talks about the rss well-
formed web module, why it is popular among some, and how it is used to link to your comments (2005-08-22). ...
...
formed web module, why it is popular among some, and how it is used to link to your comments (2005-08-22). ...
Developing Mozilla XForms - Archive of obsolete content
often you'll find the first starting points here or in the error console. schema validation problems the schema-validation extension contains a logging facility that can show some internals on the schema processing. ...
...often you'll find the first starting points here or in the error console. schema validation problems the schema-validation extension contains a logging facility that can show some internals on the schema processing. ...
...often you'll find the first starting points here or in the error console. schema validation problems the schema-validation extension contains a logging facility that can show some internals on the schema processing. ...
RFE to the XForms API - Archive of obsolete content
introduction this page contains requests for enhancement to the x
forms api. the term x
forms api can fall into two categories. these are x
forms dom and x
forms interfaces that are exposed by x
forms dom. x
forms dom is a list of interfaces that are available from x
forms elements directly. this means those interfaces available to be queried from the x
forms element that resides in the dom. for example, every visual x
forms element exposes the nsix
formsdelegate interface. if you need some additional functionality that shouldn't be exposed from the x
forms element directly, then you should think which interface of the x
forms element is more appropriate to expose it. mozilla x
forms doens't offer any service you can get via xpcom. ...
...s element that resides in the dom. for example, every visual x
forms element exposes the nsix
formsdelegate interface. if you need some additional functionality that shouldn't be exposed from the x
forms element directly, then you should think which interface of the x
forms element is more appropriate to expose it. mozilla x
forms doens't offer any service you can get via xpcom. as an example, the nsix
formsaccessors interface which allows a user to get/set the value of an instance node and get the state of an instance node, is exposed by the nsix
formsdelegate interface using the accessors property. x
forms dom put here your requirements how to improve x
forms dom api. reflect attributes to properties for the elements that can contain the incremental or selection attributes, it makes sense to ex...
...ows a user to get/set the value of an instance node and get the state of an instance node, is exposed by the nsix
formsdelegate interface using the accessors property. x
forms dom put here your requirements how to improve x
forms dom api. reflect attributes to properties for the elements that can contain the incremental or selection attributes, it makes sense to expose analogous properties. x
forms functional interfaces put here your requirements to improve existing x
forms interfaces or to add a new one. ability to get nsix
formsaccessors for instance node we need the ability to get to the nsix
formsaccessors interface on a node by specifying the node via an xpath expression or by specifying the instance node directly (see bug 312956). ...
XForms Label Element - Archive of obsolete content
introduction specifies the label (short description) for the x
forms control (see the spec). every
form control other than the output and choices elements must contain a label element. it is valid for a
form control to have an empty label element. the label text can be specified in instance data, in a remote document, or as inline text. if more than one source of label text is specified for this element, the order of precedence is: single node binding attributes, linking attributes, inline text. ui behavior accesskey support - if the accesskey attribute is specified on labeled x
forms controls or on the label element itself then the label text for the control will contain an indicator as to what the access key is in a standard way. usually by underlining the accesskey character in the lab...
... ui behavior accesskey support - if the accesskey attribute is specified on labeled x
forms controls or on the label element itself then the label text for the control will contain an indicator as to what the access key is in a standard way. usually by underlining the accesskey character in the label text. focus behavior - when a label element is clicked or its accesskey is activated then the
form control that contains the label will be given the focus. attributes ui common accesskey - used to specify the keyboard shortcut for focusing the parent
form control. single-node binding linking src - url of a document whose contents will be retrieved by the label element and used to provide label text for the containing
form control. type restrictions the label element can be bound...
...he focus. attributes ui common accesskey - used to specify the keyboard shortcut for focusing the parent
form control. single-node binding linking src - url of a document whose contents will be retrieved by the label element and used to provide label text for the containing
form control. type restrictions the label element can be bound to any simple content. representations the x
forms label element is represented by the text retrieved from instance data, a document or the label element's own inline content. ...
XForms Message Element - Archive of obsolete content
lement can be bound to any simple content. ...
... to any simple content. ...
...presentations it may be represented in the following ways: modal window - if level attribute value is modal modeless window - if level attribute value is modeless tooltip window - if level attribute value is ephemeral note: message element doesn't define a default presentation. therefore you should always specify a level attribute. example <x
forms:trigger> <x
forms:label>it's a button</x
forms:label> <x
forms:message level="modal" ev:event="domactivate">hello</x
forms:message> </x
forms:trigger> ...
XForms Select1 Element - Archive of obsolete content
e spec). the list of pre-defined items can be specified by either item (see the spec) or itemset (see the spec) elements. you can visually group these pre-defined items by using the choices (see the spec) element to contain them. note, some representations of the select1 element do not support visual grouping. attributes ui common appearance - the value of this attribute gives a hint to the x
forms 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 selection - this attribute, when set to 'open', allows the user to provide free entry to the list. possible values are open and closed, default is closed (see #representations section to refer if the attribute is s...
...ation). incremental - supported, default value is true properties selection - see corresponding attribute incremental - see corresponding attribute type restrictions the select1 element can be bound to a node containing simple content. ...
...n to simple content may be relaxed when an itemset element is used, which allows the available choices to be obtained from an x
forms model. the relaxation happens when the itemset element specifies the item value using a copy (see spec) element. this is because a copy element can be used to add a subtree of nodes underneath the element that the select1 control is bound to. representations the x
forms select1 element can be represented by the following widgets for the specified appearance attribute values: combobox - default representation (xhtml/xul) listbox - used when appearance = 'compact' (xhtml/xul) radio group - used when appearance = 'full' (xhtml/xul) combobox displaying a combobox is the default representation (xhtml/xul). xhtml widget characteristics analogous widgets is <...
XForms Trigger Element - Archive of obsolete content
introduction allows the user to initiate actions (see the spec). actions are described by the x
forms action module (see the spec). attributes ui common appearance - the value of this attribute gives a hint to the x
forms processor as to which type of widget(s) to use to represent this control accesskey - used to specify the keyboard shortcut for focusing this control single-node binding type restrictions the trigger element can be bound to a node containing data of any type. actually, the trigger element doesn't interact with the data in the bound node. however, relevant model item property on the bound node has an effect on a trigger. ...
...r focusing this control single-node binding type restrictions the trigger element can be bound to a node containing data of any type. actually, the trigger element doesn't interact with the data in the bound node. however, relevant model item property on the bound node has an effect on a trigger. if the bound node is irrelevant, then the trigger will be hidden. representations the x
forms trigger element can be represented by the following widgets for the specified appearance attribute values: button - default representation (xhtml/xul) link/clickable text - used when appearance = 'minimal' (xhtml only) button displaying a button is the default presentation (xhtml/xul). characteristics analogous widgets are <html:input type="button"/> and <xul:button/> link/clickabl...
...characteristics appearance attribute contains the value minimal analogue widget is <xhtml:a/>. ...
Test your skills: Form structure - Learn web development
this aim of this skill test is to assess whether you've understood our how to structure a web
form article. note: you can try out the solution in the interactive editor below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page.
form structure 1 in this task we want you to structure the provided
form features: separate out the first two and second two
form fields into two distinct containers, each with a descriptive legend (use "personal details" for the first two, and "comment in
formation" for the second two). mark up each text label with an appropriate element so that it is semantically assoc...
... add a suitable set of structural elements around the label/field pairs to separate them out. download the starting point for this task to work in your own editor or in an online editor. assessment or further help you can practice this example in the interactive editor above. ...
...r are stuck and want to ask for help: put your work into an online shareable editor such as codepen, jsfiddle, or glitch. you can write the code yourself, or use the starting point files linked to in the above sections. write a post asking for assessment and/or help at the mdn discourse forum learning category. your post should include: a descriptive title such as "assessment wanted for
form structure 1 skill test". details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. a link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see the...
Performance
this highlights some per
formance pitfalls related to frame scripts/message manager usage and alternative approaches to avoid them. key points to keep in mind scripts registered during addon startup get executed during session restore. the more expensive they are to execute the longer it will take for the browser to become responsive after startup. frame scripts also get executed on non-restored tabs. all their overhead is thus not just incurred by active tabs but by the total number of tabs in a session. the following examples omit some boilerplate code for the sake of brevity the "better" examples also omit some best practices and only demonstrate how to fix the problem described in their respective subtopics. ...
...ive after startup. frame scripts also get executed on non-restored tabs. all their overhead is thus not just incurred by active tabs but by the total number of tabs in a session. the following examples omit some boilerplate code for the sake of brevity the "better" examples also omit some best practices and only demonstrate how to fix the problem described in their respective subtopics. per
formance best practices declaring stateless functions once per process bad: // addon.js services.mm.loadframescript("framescript.js", true) // framescript.js const precomputedconstants = // ... function helper(window, action) { // ... do some work on the window } function dosomething(message) { result = helper(content, message.data) sendasyncmessage("my-addon:response-from-child", {some...
...age-collected immediately after execution. as long as it the action does not happen frequently the memory and startup savings should outstrip the added cost of script evaluation. delaying the script registration until the session is restored my provide some middle ground for some addons. it does not provide the same memory footprint reductions but it improves application startup. beam down in
formation in advance to avoid synchronous calls to the parent bad: // processscript.js function contentpolicy() { // ... } object.assign(contentypolicy.prototype, { classdescription: ..., classid: ..., contractid: ..., queryinterface: xpcomutils.generateqi([ci.nsicontentpolicy]), shouldload: function(type, location, origin, context) { let resultlist = services.cpmm.sendsyncm...
Automated performance testing and sheriffing
we have several test harnesses that test firefox for various per
formance characteristics (page load time, startup time, etc.). we also generate some metrics as part of the build process (like installer size) that are interesting to track over time. currently we aggregate this in
formation in the perfherder web application where per
formance sheriffs watch for significant regressions, filing bugs as appropriate. ...
... time, etc.). we also generate some metrics as part of the build process (like installer size) that are interesting to track over time. currently we aggregate this in
formation in the perfherder web application where per
formance sheriffs watch for significant regressions, filing bugs as appropriate. ...
...eresting to track over time. currently we aggregate this in
formation in the perfherder web application where per
formance sheriffs watch for significant regressions, filing bugs as appropriate. ...
JSErrorFormatString
this article covers features introduced in spidermonkey 17 represent error message and type. syntax typedef struct jserror
formatstring { const char *
format; uint16_t argcount; int16_t exntype; } jserror
formatstring; name type description
format const char * the error
format string in ascii. argcount uint16_t the number of arguments to expand in the
formatted error message. exntype int16_t one of the jsexntype constants. ...
...matstring { const char *
format; uint16_t argcount; int16_t exntype; } jserror
formatstring; name type description
format const char * the error
format string in ascii. argcount uint16_t the number of arguments to expand in the
formatted error message. exntype int16_t one of the jsexntype constants. description jserror
formatstring is a struct to represent error message and type, returned by js_reporterrornumber function. ...
...
format const char * the error
format string in ascii. argcount uint16_t the number of arguments to expand in the
formatted error message. exntype int16_t one of the jsexntype constants. description jserror
formatstring is a struct to represent error message and type, returned by js_reporterrornumber function. ...
CanvasRenderingContext2D.currentTransform - Web APIs
the canvasrenderingcontext2d.currenttrans
form property of the canvas 2d api returns or sets a dommatrix (current specification) or svgmatrix (old specification) object for the current trans
formation matrix. syntax ctx.currenttrans
form [= value]; value a dommatrix or svgmatrix object to use as the current trans
formation matrix. examples manually changing the matrix this example uses the currenttrans
form property to set a trans
formation matrix. a rectangle is then drawn using that trans
formation. ...
...ix object to use as the current trans
formation matrix. examples manually changing the matrix this example uses the currenttrans
form property to set a trans
formation matrix. a rectangle is then drawn using that trans
formation. ...
...ample uses the currenttrans
form property to set a trans
formation matrix. a rectangle is then drawn using that trans
formation. ...
HTMLFormControlsCollection.namedItem() - Web APIs
the html
formcontrolscollection.nameditem() method returns the radionodelist or the element in the collection whose name or id match the specified name, or null if no node matches. note that this version of nameditem() hides the one inherited from htmlcollection. like that one, in javascript, using the array bracket syntax with a string, like collection["value"] is equivalent to collection.nameditem("value"). syntax var item = collection.nameditem(str); var item = collection[str]; parameters str is a domstring return value item is a radionodelist , element, or null. ...
... of nameditem() hides the one inherited from htmlcollection. like that one, in javascript, using the array bracket syntax with a string, like collection["value"] is equivalent to collection.nameditem("value"). syntax var item = collection.nameditem(str); var item = collection[str]; parameters str is a domstring return value item is a radionodelist , element, or null. example html <
form> <input id="my-
form-control" type="textarea"> </
form> javascript // returns the htmlinputelement representing #my-
form-control elem1 = document.
forms[0]['my-
form-control']; specifications specification status comment html living standardthe definition of 'html
formcontrolscollection.nameditem()' in that specification. living standard html5the defini...
...="my-
form-control" type="textarea"> </
form> javascript // returns the htmlinputelement representing #my-
form-control elem1 = document.
forms[0]['my-
form-control']; specifications specification status comment html living standardthe definition of 'html
formcontrolscollection.nameditem()' in that specification. living standard html5the definition of 'html
formcontrolscollection' in that specification. recommendation in this snapshot of html living standard, the html
formcontrolscollections is defined for the first time. ...
HTMLFormElement.length - Web APIs
the html
formelement.length read-only property returns the number of controls in the <
form> element. you can access the list of the
form's controls using the elements property. this includes both elements that are descendents of the <
form> element as well as elements that are made members of the
form using their
form property. the elements included by html
formelement.elements and html
formelement.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. ...
...elements and html
formelement.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. syntax numcontrols =
form.length; value numcontrols is the number of
form controls within the <
form>. this is the same as the number of the elements in the html
formcontrolscollection returned by the elements property. ...
...e included in the list returned by elements, which makes it an excellent way to get at the elements most important when processing
forms. syntax numcontrols =
form.length; value numcontrols is the number of
form controls within the <
form>. this is the same as the number of the elements in the html
formcontrolscollection returned by the elements property. example if (document.getelementbyid('
form1').length > 1) { // more than one
form control here } specifications specification status comment html living standardthe definition of 'html
formelement: length' in that specification. living standard ...
HTMLSelectElement.form - Web APIs
the htmlselectelement.
form read-only property returns a html
formelement representing the
form that this element is associated with. if the element is not associated with of a <
form> element, then it returns null. syntax edit a
form = 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. ...
... 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. ...
...nput 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. living standard html5the definition of ...
onMSVideoFormatChanged - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. onmsvideo
formatchanged is an event which occurs when the video
format changes. this proprietary property is specific to internet explorer and microsoft edge. ...
...web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. onmsvideo
formatchanged is an event which occurs when the video
format changes. this proprietary property is specific to internet explorer and microsoft edge. ...
...en implementations and the behavior may change in the future. onmsvideo
formatchanged is an event which occurs when the video
format changes. this proprietary property is specific to internet explorer and microsoft edge. ...
NetworkInformation.downlinkMax - Web APIs
examples the following example monitors the connection using the change event and logs changes as they occur. ...
... examples the following example monitors the connection using the change event and logs changes as they occur. ...
... draft initial definition ...
performance.setResourceTimingBufferSize() - Web APIs
the setresourcetimingbuffersize() method sets the browser's resource timing buffer size to the specified number of "resource" per
formance entry type objects. a browser's recommended resource timing buffer size is at least 150 per
formance entry objects. note: this feature is available in web workers. syntax per
formance.setresourcetimingbuffersize(maxsize); arguments maxsize a number representing the maximum number of per
formance entry objects the browser should hold in its per
formance entry buffer. return value none this method has no return value. ...
... entry objects. note: this feature is available in web workers. syntax per
formance.setresourcetimingbuffersize(maxsize); arguments maxsize a number representing the maximum number of per
formance entry objects the browser should hold in its per
formance entry buffer. return value none this method has no return value. example function setresourcetimingbuffersize(maxsize) { if (per
formance === undefined) { log("browser does not support web per
formance"); return; } var supported = typeof per
formance.setresourcetimingbuffersize == "function"; if (supported) { log("... ...
...objects the browser should hold in its per
formance entry buffer. return value none this method has no return value. example function setresourcetimingbuffersize(maxsize) { if (per
formance === undefined) { log("browser does not support web per
formance"); return; } var supported = typeof per
formance.setresourcetimingbuffersize == "function"; if (supported) { log("... per
formance.setresourcetimingbuffersize() = yes"); per
formance.setresourcetimingbuffersize(maxsize); } else { log("... per
formance.setresourcetimingbuffersize() = not supported"); } } specifications specification status comment resource timing level 1the definition of 'setresourcetimingbuffersize()' in that specification. candidate recommendation initial defin...
PerformanceNavigation - Web APIs
this interface is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancenavigation interface represents in
formation about how the navigation to the current document was done. an object of this type can be obtained by calling the per
formance.navigation read-only attribute. properties the per
formancenavigation interface doesn't inherit any properties. per
formancenavigation.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. type_reload (1) the page was accessed by clicking the reloa...
...lues 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. type_reload (1) the page was accessed by clicking the reload button or via the location.reload() method. type_back_forward (2) the page was accessed by navigating into the history. type_reserved (255) any other way. per
formancenavigation.redirectcount read only an unsigned short representing the number of redirects done before reaching the page. methods the per
formance interface doesn't inherit any methods. per
formancenavigation.tojson() is a jsonizer returning a json object representing the per
formancenavigation object. specifications specification status comment navigation tim...
...unt read only an unsigned short representing the number of redirects done before reaching the page. methods the per
formance interface doesn't inherit any methods. per
formancenavigation.tojson() is a jsonizer returning a json object representing the per
formancenavigation object. specifications specification status comment navigation timingthe definition of 'per
formancenavigation' in that specification. recommendation initial definition. ...
PerformanceObserver() - Web APIs
the per
formanceobserver() constructor creates a new per
formanceobserver object with the given observer callback. the observer callback is invoked when per
formance entry events are recorded for the entry types that have been registered, via the observe() method. syntax var observer = new per
formanceobserver(callback); parameters callback a per
formanceobservercallback callback that will be invoked when observed per
formance events are recorded. when the callback is invoked, its first parameter is a list of per
formance observer entries and the second parameter is the observer object. return value a new per
formanceobserver object which will call the specified callback when observed per
formance events occur. ...
...manceobservercallback callback that will be invoked when observed per
formance events are recorded. when the callback is invoked, its first parameter is a list of per
formance observer entries and the second parameter is the observer object. return value a new per
formanceobserver object which will call the specified callback when observed per
formance events occur. ...
...d callback when observed per
formance events occur. example var observer = new per
formanceobserver(function(list, obj) { var entries = list.getentries(); for (var i=0; i < entries.length; i++) { // process "mark" and "frame" events } }); observer.observe({entrytypes: ["mark", "frame"]}); function perf_observer(list, observer) { // process the "measure" event } var observer2 = new per
formanceobserver(perf_observer); observer2.observe({entrytypes: ["measure"]}); specifications specification status comment per
formance timeline level 2the definition of 'per
formanceobserver()' in that specification. candidate recommendation initial definition of per
formanceobserver() constructor. ...
PerformanceObserver.takeRecords() - Web APIs
the takerecords() method of the per
formanceobserver interface returns the current list of per
formance entries stored in the per
formance observer, emptying it out. syntax var per
formanceentry[] = per
formanceobserver.takerecords(); parameters none. return value a list of per
formanceentry objects. ...
... the takerecords() method of the per
formanceobserver interface returns the current list of per
formance entries stored in the per
formance observer, emptying it out. syntax var per
formanceentry[] = per
formanceobserver.takerecords(); parameters none. return value a list of per
formanceentry objects. ...
... candidate recommendation initial definition of takerecords() method. ...
PerformanceResourceTiming.connectStart - Web APIs
server to retrieve the resource. note: this feature is available in web workers. syntax resource.connectstart; return value a domhighrestimestamp immediately before the browser starts to establish the connection to the server to retrieve the resource. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...ource.connectstart; return value a domhighrestimestamp immediately before the browser starts to establish the connection to the server to retrieve the resource. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... of the *start and *end properties of all "resource" type events are logged. ...
PerformanceResourceTiming.domainLookupEnd - Web APIs
the domainlookupend read-only property returns the timestamp immediately after the browser finishes the domain name lookup for the resource. if the user agent has the domain in
formation in cache, domainlookupstart and domainlookupend represent the times when the user agent starts and ends the domain data retrieval from the cache. note: this feature is available in web workers. syntax resource.domainlookupend; return value a domhighrestimestamp representing the time immediately after the browser finishes the domain name lookup for the resource. ...
...ain data retrieval from the cache. note: this feature is available in web workers. syntax resource.domainlookupend; return value a domhighrestimestamp representing the time immediately after the browser finishes the domain name lookup for the resource. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...source.domainlookupend; return value a domhighrestimestamp representing the time immediately after the browser finishes the domain name lookup for the resource. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
PerformanceResourceTiming.domainLookupStart - Web APIs
browser starts the domain name lookup for the resource. note: this feature is available in web workers. syntax resource.domainlookupstart; return value a domhighrestimestamp immediately before the browser starts the domain name lookup for the resource. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... workers. syntax resource.domainlookupstart; return value a domhighrestimestamp immediately before the browser starts the domain name lookup for the resource. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... of the *start and *end properties of all "resource" type events are logged. ...
PerformanceResourceTiming.encodedBodySize - Web APIs
applied content-codings. syntax resource.encodedbodysize; return value a number representing the size (in octets) received from the fetch (http or cache), of the payload body, before removing any applied content-codings. example the following example, the value of the size properties of all "resource" type events are logged. function log_sizes(perfentry){ // check for support of the per
formanceentry.*size properties and print their values // if supported. if ("decodedbodysize" in perfentry) console.log("decodedbodysize = " + perfentry.decodedbodysize); else console.log("decodedbodysize = not supported"); if ("encodedbodysize" in perfentry) console.log("encodedbodysize = " + perfentry.encodedbodysize); else console.log("encodedbodysize = not supported"); ...
... working draft initial definition. ...
... working draft initial definition. ...
PerformanceResourceTiming.fetchStart - Web APIs
ely before the user agent starts to fetch the final resource in the redirection. note: this feature is available in web workers. syntax resource.fetchstart; return value a domhighrestimestamp immediately before the browser starts to fetch the resource. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...ature is available in web workers. syntax resource.fetchstart; return value a domhighrestimestamp immediately before the browser starts to fetch the resource. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... of the *start and *end properties of all "resource" type events are logged. ...
PerformanceResourceTiming.initiatorType - Web APIs
the initiatortype read-only property is a string that represents the type of resource that initiated the per
formance event. the value of this string is as follows: if the initiator is a element, the property returns the element's localname. if the initiator is a css resource, the property returns "css". if the initiator is a xmlhttprequest object, the property returns "xmlhttprequest". if the initiator is a per
formancenavigationtiming object, the property returns an empty string (""). note: this feature is available in web workers. ...
...r is a css resource, the property returns "css". if the initiator is a xmlhttprequest object, the property returns "xmlhttprequest". if the initiator is a per
formancenavigationtiming object, the property returns an empty string (""). note: this feature is available in web workers. syntax resource.initiatortype; return value a string representing the type of resource that initiated the per
formance event, as specified above. ...
...or is a xmlhttprequest object, the property returns "xmlhttprequest". if the initiator is a per
formancenavigationtiming object, the property returns an empty string (""). note: this feature is available in web workers. syntax resource.initiatortype; return value a string representing the type of resource that initiated the per
formance event, as specified above. example function print_per
formanceentries() { // use getentriesbytype() to just get the "resource" events var p = per
formance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_initiatortype(p[i]); } } function print_initiatortype(perfentry) { // print this per
formance entry object's initiatortype value var value = "initiatortype" in perfentry; if (value) console.log("... initiatortype...
PerformanceResourceTiming.redirectEnd - Web APIs
yte of the response of the last redirect; otherwise, zero is returned. note: this feature is available in web workers. syntax resource.redirectend; return value a timestamp immediately after receiving the last byte of the response of the last redirect. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...vailable in web workers. syntax resource.redirectend; return value a timestamp immediately after receiving the last byte of the response of the last redirect. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... of the *start and *end properties of all "resource" type events are logged. ...
PerformanceResourceTiming.redirectStart - Web APIs
g time of the fetch that initiates the redirect; otherwise, zero is returned. note: this feature is available in web workers. syntax resource.redirectstart; return value a timestamp representing the start time of the fetch which initiates the redirect. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...re is available in web workers. syntax resource.redirectstart; return value a timestamp representing the start time of the fetch which initiates the redirect. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... of the *start and *end properties of all "resource" type events are logged. ...
PerformanceResourceTiming.requestStart - Web APIs
re is no end property for requeststart. note: this feature is available in web workers. 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. ...
...x 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. ...
... of the *start and *end properties of all "resource" type events are logged. ...
PerformanceResourceTiming.responseEnd - Web APIs
is feature is available in web workers. syntax resource.responseend; return value a domhighrestimestamp immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...hrestimestamp immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... of the *start and *end properties of all "resource" type events are logged. ...
PerformanceResourceTiming.responseStart - Web APIs
response from the server, cache, or local resource. note: this feature is available in web workers. syntax resource.responsestart; return value a domhighrestimestamp immediately after the browser receives the first byte of the response from the server. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...kers. syntax resource.responsestart; return value a domhighrestimestamp immediately after the browser receives the first byte of the response from the server. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... of the *start and *end properties of all "resource" type events are logged. ...
PerformanceResourceTiming.secureConnectionStart - Web APIs
ionstart; return value if the resource is fetched over a secure connection, a domhighrestimestamp immediately before the browser starts the handshake process to secure the current connection. if a secure connection is not used, this property returns zero. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...stamp immediately before the browser starts the handshake process to secure the current connection. if a secure connection is not used, this property returns zero. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... of the *start and *end properties of all "resource" type events are logged. ...
PerformanceResourceTiming.transferSize - Web APIs
this property returns zero. syntax resource.transfersize; return value a number representing the size (in octets) of the fetched resource. the size includes the response header fields plus the response payload body (rfc7230). example the following example, the value of size properties of all "resource" type events are logged. function log_sizes(perfentry){ // check for support of the per
formanceentry.*size properties and print their values // if supported. if ("decodedbodysize" in perfentry) console.log("decodedbodysize = " + perfentry.decodedbodysize); else console.log("decodedbodysize = not supported"); if ("encodedbodysize" in perfentry) console.log("encodedbodysize = " + perfentry.encodedbodysize); else console.log("encodedbodysize = not supported"); ...
... working draft initial definition. ...
... working draft initial definition. ...
PerformanceTiming.domInteractive - Web APIs
this property can be used to measure the speed of loading web sites that users feels. ...
... this property can be used to measure the speed of loading web sites that users feels. ...
...e event is thrown. this property can be used to measure the speed of loading web sites that users feels. nevertheless there are a few caveats that happens if scripts are blocking rendering and not loaded asynchronously or with custom web fonts. check if you are in one of these cases before using this property as a proxy for the user experience of a web site's speed of loading. syntax time = per
formancetiming.dominteractive; specifications specification status comment navigation timingthe definition of 'per
formancetiming.dominteractive' in that specification. recommendation initial definition. ...
SVGAnimateTransformElement - Web APIs
the svganimatetrans
formelement interface corresponds to the <animatetrans
form> element. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><li...
...e="#d4dde4" stroke-width="2px" /><text x="386" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svganimationelement</text></a><polyline points="291,89 281,84 281,94 291,89" stroke="#d4dde4" fill="none"/><line x1="281" y1="89" x2="251" y2="89" stroke="#d4dde4"/><a xlink:href="/docs/web/api/svganimatetrans
formelement" target="_top"><rect x="-9" y="65" width="260" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="121" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svganimatetrans
formelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties t...
.../div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent, svganimationelement. methods this interface has no methods but inherits methods from its parent, svganimationelement. specifications specification status comment svg animations level 2the definition of 'svganimatetrans
formelement' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'svganimatetrans
formelement' in that specification. recommendation initial definition ...
SVGAnimatedTransformList - Web APIs
svg animated trans
form list interface the svganimatedtrans
formlist interface is used for attributes which take a list of numbers and which can be animated. interface overview also implement none methods none properties readonly svgtrans
formlist baseval readonly svgtrans
formlist animval normative document svg 1.1 (2nd edition) properties name type description baseval svgtrans
formlist the base value of the given attribute before applying any animations. animval svgtrans
formlist a read only svgtrans
formlist representing the current animated value of the given attribute. ...
... svg 1.1 (2nd edition) properties name type description baseval svgtrans
formlist the base value of the given attribute before applying any animations. animval svgtrans
formlist a read only svgtrans
formlist representing the current animated value of the given attribute. if the given attribute is not currently being animated, then the svgtrans
formlist will have the same contents as baseval. the object referenced by animval will always be distinct from the one referenced by baseval, even when the attribute is not animated. methods the svganimatedtrans
formlist interface doesn't provide any specific methods. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to t...
.... browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
WebGL2RenderingContext.getInternalformatParameter() - Web APIs
the webgl2renderingcontext.getinternal
formatparameter() method of the webgl 2 api returns in
formation about implementation-dependent support for internal
formats. syntax any gl.getinternal
formatparameter(target, internal
format, pname); parameters target a glenum specifying the target renderbuffer object. possible values: gl.renderbuffer: buffer data storage for single images in a renderable internal
format. internal
format a glenum specifying the internal
format about which to retrieve in
formation (must be a color-renderable, depth-renderable or stencil-renderable
format). pname a glenum specifying the type of in
formation to query. possible values: gl.samples: returns a int32array containing sample counts supported for internal
format in descending order. ...
...l
format a glenum specifying the internal
format about which to retrieve in
formation (must be a color-renderable, depth-renderable or stencil-renderable
format). pname a glenum specifying the type of in
formation to query. possible values: gl.samples: returns a int32array containing sample counts supported for internal
format in descending order. return value depends on the requested in
formation (as specified with pname). it is an int32array if pname is gl.samples. examples var samples = gl.getinternal
formatparameter(gl.renderbuffer, gl.rgba8, gl.samples); specifications specification status comment webgl 2.0the definition of 'getinternal
formatparameter' in that specification. editor's draft initial defin...
...ples. examples var samples = gl.getinternal
formatparameter(gl.renderbuffer, gl.rgba8, gl.samples); specifications specification status comment webgl 2.0the definition of 'getinternal
formatparameter' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgetinternal
formativ' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getUniformBlockIndex() - Web APIs
the webgl2renderingcontext.getuni
formblockindex() method of the webgl 2 api retrieves the index of a uni
form block within a webglprogram. syntax gluint gl.getuni
formblockindex(program, uni
formblockname); parameters program a webglprogram containing the uni
form block. uni
formname a domstring specifying the name of the uni
form block to whose index to retrieve. return value a gluint indicating the uni
form block index. ...
... editor's draft initial definition for webgl. ...
...ogram a webglprogram containing the uni
form block. uni
formname a domstring specifying the name of the uni
form block to whose index to retrieve. return value a gluint indicating the uni
form block index. examples // assuming a shader with the following declaration: // uni
form ubodata { // mat4 foo; // } instancename; // use the block name, not the instance name: var blockindex = gl.getuni
formblockindex(program, 'ubodata'); specifications specification status comment webgl 2.0the definition of 'getuni
formblockindex' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgetuni
formblockindex' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.getShaderPrecisionFormat() - Web APIs
the webglrenderingcontext.getshaderprecision
format() method of the webgl api returns a new webglshaderprecision
format object describing the range and precision for the specified shader numeric
format. syntax webglshaderprecision
format gl.getshaderprecision
format(shadertype, precisiontype); parameters shadertype either a gl.fragment_shader or a gl.vertex_shader. precisiontype a precision type value. either gl.low_float, gl.medium_float, gl.high_float, gl.low_int, gl.medium_int, or gl.high_int. return value a webglshaderprecision
format object or null, if an error occurs. exceptions gl.invalid_enum if the shader or precision types aren't recognized. gl.invalid_operation if the shader compiler isn't supported. ...
...pe a precision type value. either gl.low_float, gl.medium_float, gl.high_float, gl.low_int, gl.medium_int, or gl.high_int. return value a webglshaderprecision
format object or null, if an error occurs. exceptions gl.invalid_enum if the shader or precision types aren't recognized. gl.invalid_operation if the shader compiler isn't supported. examples the following code gets the precision
format of a gl.vertex_shader with a gl.medium_float precision type. ...
...or null, if an error occurs. exceptions gl.invalid_enum if the shader or precision types aren't recognized. gl.invalid_operation if the shader compiler isn't supported. examples the following code gets the precision
format of a gl.vertex_shader with a gl.medium_float precision type. var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.getshaderprecision
format(gl.vertex_shader, gl.medium_float); // webglshaderprecision
format { rangemin: 127, rangemax: 127, precision: 23 } specifications specification status comment webgl 1.0the definition of 'getshaderprecision
format' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgetshaderprecision
format' in that specification. ...
XRReferenceSpaceEvent.transform - Web APIs
the read-only xrreferencespaceevent property trans
form indicates the position and orientation of the affected referencespace's native origin after the changes the event represents are applied. the trans
form is defined using the old coordinate system, which allows it to be used to convert coordinates from the pre-event coordinate system to the post-event coordiante system. syntax let refspace = xrreferencespaceevent.trans
form; value an xrrigidtrans
form object providing a trans
form that can be used to convert coordinates from the pre-event coordinate system to the post-event coordinate system. usage notes upon receiving a reset event, you can apply the trans
form to cached position or orientation in
formation to shift them into the updated coordinate system. alternatively, you can just di...
... value an xrrigidtrans
form object providing a trans
form that can be used to convert coordinates from the pre-event coordinate system to the post-event coordinate system. usage notes upon receiving a reset event, you can apply the trans
form to cached position or orientation in
formation to shift them into the updated coordinate system. alternatively, you can just discard any cached positional in
formation and recompute from scratch. the approach you take will depend on your needs. for details on what causes a reset event and how to respond, see the reset event's documentation. examples this example handles the reset event by walking through all the objects in a scene, updating each object's position by multiplying it with the event's given trans
form. the scene is represented by a scene obj...
... examples this example handles the reset event by walking through all the objects in a scene, updating each object's position by multiplying it with the event's given trans
form. the scene is represented by a scene object, with all the objects in an array called objects within it. xrreferencespace.addeventlistener("reset", event => { for (let obj of scene.objects) { mat4.multiply(obj.trans
form, obj.trans
form, event.trans
form); } }); specifications specification status comment webxr device apithe definition of 'xrreferencespaceevent.trans
form' in that specification. working draft initial definition. ...
Feature-Policy: legacy-image-formats - HTTP
'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
... 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
... 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
203 Non-Authoritative Information - HTTP
the http 203 non-authoritative in
formation response status indicates that the request was successful but the enclosed payload has been modified by a trans
forming proxy from that of the origin server's 200 (ok) response . the 203 response is similar to the value 214, meaning trans
formation applied, of the warning header code, which has the additional advantage of being applicable to responses with any status code. ...
... status indicates that the request was successful but the enclosed payload has been modified by a trans
forming proxy from that of the origin server's 200 (ok) response . the 203 response is similar to the value 214, meaning trans
formation applied, of the warning header code, which has the additional advantage of being applicable to responses with any status code. ...
... that of the origin server's 200 (ok) response . the 203 response is similar to the value 214, meaning trans
formation applied, of the warning header code, which has the additional advantage of being applicable to responses with any status code. ...
SyntaxError: redeclaration of formal parameter "x" - JavaScript
redeclaring the same variable within the same function or block scope using let is not allowed in javascript. examples redeclared argument in this case, the variable "arg" redeclares the argument. ...
...redeclaring the same variable within the same function or block scope using let is not allowed in javascript. examples redeclared argument in this case, the variable "arg" redeclares the argument. ...
...the same variable name occurs as a function parameter and is then redeclared using a let assignment in a function body again. redeclaring the same variable within the same function or block scope using let is not allowed in javascript. examples redeclared argument in this case, the variable "arg" redeclares the argument. function f(arg) { let arg = 'foo'; } // syntaxerror: redeclaration of
formal parameter "arg" if you want to change the value of "arg" in the function body, you can do so, but you do not need to declare the same variable again. in other words: you can omit the let keyword. if you want to create a new variable, you need to rename it as conflicts with the function parameter already. function f(arg) { arg = 'foo'; } function f(arg) { let bar = 'foo'; } ...
Intl.ListFormat.prototype.resolvedOptions() - JavaScript
description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. ...
... description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. ...
...tyle the value provided for this property in the options argument of the constructor or the default value ("long"). its value is either "long", "short", or "narrow". type the value provided for this property in the options argument of the constructor or the default value ("conjunction"). its value is either "conjunction", "disjunction", or "unit". examples using resolvedoptions const delist
formatter = new intl.list
format("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.list
formatthe definition of 'resolvedoptions()' in that specification. ...
Using dns-prefetch - Web Performance
ource from a (third party) server, that cross-origin’s domain name must be resolved to an ip address before the browser can issue the request. this process is known as dns resolution. while dns caching can help to reduce this latency, dns resolution can add significant latency to requests. for websites that open connections to many third parties, this latency can significantly reduce loading per
formance. dns-prefetch helps developers mask dns resolution latency. the html <link> element offers this functionality by way of a rel attribute value of dns-prefetch. the cross-origin domain is then specified in the href attribute: syntax <link rel="dns-prefetch" href="https://fonts.gstatic.com/" > examples <html> <head> <link rel="dns-prefetch" href="https://fonts.gstatic.com/"> <!--...
...n. this is because the ip behind your site’s domain will have already been resolved by the time the browser sees the hint. second, it’s also possible to specify dns-prefetch (and other resources hints) as an http header by using the http link field: link: <https://fonts.gstatic.com/>; rel=dns-prefetch third, consider pairing dns-prefetch with the preconnect hint. while dns-prefetch only per
forms a dns lookup, preconnect establishes a connection to a server. this process includes dns resolution, as well as establishing the tcp connection, and per
forming the tls handshake—if a site is served over https. combining the two provides an opportunity to further reduce the perceived latency of cross-origin requests. you can safely use them together like so: <link rel="preconnect" href="https:...
... ...
The Netscape XSLT/XPath Reference - XSLT: Extensible Stylesheet Language Transformations
ndation. development of the xslt processor is ongoing, and this document will be updated as functionality is expanded. ...
...age (supported) xsl:namespace-alias (not supported) xsl:number (partially supported) xsl:otherwise (supported) xsl:output (partially supported) xsl:param (supported) xsl:preserve-space (supported) xsl:processing-instruction xsl:sort (supported) xsl:strip-space (supported) xsl:stylesheet (partially supported) xsl:template (supported) xsl:text (partially supported) xsl:trans
form (supported) xsl:value-of (partially supported) xsl:variable (supported) xsl:when (supported) xsl:with-param (supported) axes ancestor ancestor-or-self attribute child descendant descendant-or-self following following-sibling namespace (not supported) parent preceding preceding-sibling self functions boolean() (supported) ceiling() (supported) concat() (supported)...
...child descendant descendant-or-self following following-sibling namespace (not supported) parent preceding preceding-sibling self functions boolean() (supported) ceiling() (supported) concat() (supported) contains() (supported) count() (supported) current() (supported) document() (supported) element-available() (supported) false() (supported) floor() (supported)
format-number() (supported) function-available() (supported) generate-id() (supported) id() (partially supported) key() (supported) lang() (supported) last() (supported) local-name() (supported) name() (supported) namespace-uri() (supported) normalize-space() (supported) not() (supported) number() (supported) position() (supported) round() (supported) starts-with() (supp...
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
alue is set using xsltprocessor.setparameter(). the xslt file has a parameter called myorder that javascript sets to change the sorting method. the xsl:sort element's order attribute can access the value of the parameter using $myorder. however, the value needs to be an xpath expression and not a string, so {$myorder} is used. using {} evaluates the content as an xpath expression. once the trans
formation is complete, the result is appended to the document, as shown in this example. figure 7: sorting based on div contentview example // xhtml fragment: <div id="example"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> <div>6</div> <div>7</div> <div>8</div> <div>9</div> <div>10</div> </div> // javascript var xslref; var xslloaded = false; var xsltproces...
...tnode(mynode, true); // after cloning, we append xmlref.appendchild(clonednode); // set the sorting parameter in the xsl file var sortval = xsltprocessor.getparameter(null, "myorder"); if (sortval == "" || sortval == "descending") xsltprocessor.setparameter(null, "myorder", "ascending"); else xsltprocessor.setparameter(null, "myorder", "descending"); // initiate the trans
formation var fragment = xsltprocessor.trans
formtofragment(xmlref, document); // clear the contents document.getelementbyid("example").innerhtml = ""; mydom = fragment; // add the new content from the trans
formation document.getelementbyid("example").appendchild(fragment) } // xsl stylesheet: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/...
...nts document.getelementbyid("example").innerhtml = ""; mydom = fragment; // add the new content from the trans
formation document.getelementbyid("example").appendchild(fragment) } // xsl stylesheet: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/xsl/trans
form"> <xsl:output method="html" indent="yes" /> <xsl:param name="myorder" /> <xsl:template match="/"> <xsl:apply-templates select="/div//div"> <xsl:sort select="." data-type="number" order="{$myorder}" /> </xsl:apply-templates> </xsl:template> <xsl:template match="div"> <xsl:copy-of select="." /> </xsl:template> </xsl:stylesheet> ...
Converting WebAssembly text format to wasm - WebAssembly
webassembly has an s-expression-based textual representation, an intermediate
form designed to be exposed in text editors, browser developer tools, etc. this article explains a little bit about how it works, and how to use available tools to convert text
format files to the .wasm assembly
format. note: text
format files are usually saved with a .wat extension. historically, a .wast extension was also used, however that's now used for the scripting language used by the webassembly testsuite. ...
...owser developer tools, etc. this article explains a little bit about how it works, and how to use available tools to convert text
format files to the .wasm assembly
format. note: text
format files are usually saved with a .wat extension. historically, a .wast extension was also used, however that's now used for the scripting language used by the webassembly testsuite. ...
...ted_func is exported for use in our environment (e.g. the web app in which we are using our webassembly module). when it is called, it calls an imported javascript function called imported_func, which is run with the value (42) provided as a parameter. converting the text .wat into a binary .wasm file let’s have a go at converting the above .wat text representation example into .wasm assembly
format. to start with, make a copy of the above listing inside a text file; call it simple.wat. we need to assemble this textual representation into the assembly language the browser actually reads before we can use it. to do this, we can use the wabt tool, which includes compilers to convert between webassembly’s text representation and wasm, and vice versa, plus more besides. go to https://git...
Actionscript Performance Tests - Archive of obsolete content
similar to the acceptance tests set the environment variables avm, asc, builtinabc. the runtests.py test harness works by parsing the abc stdout for lines like: 'metric time 566'. the testconfig.txt file defines groups of tests to run (e.g. sunspider, scimark, language). by default the time for each test is output. use the --memory flag to capture the maximum private bytes memory (high water mark) for a test. by default each test is run a single time. to run each test multiple times use the --iterations flag. when the number of iterations is greater than 2 all times are displayed in [], faster time is displayed in the output column, and the 95% confidence interval is calculated. ...
... the mean value to fall within 95% of the measured results. for example if the mean is 100 and the 95% confidence interval is 2%, 95% of the expected values should fall between 98 and 102. to compare two vms against each other export avm2=<path to 2nd vm> or use --avm2=<path to 2nd vm>. the percentage difference is calculated between the two vms. see the --help usage for more details about per
formance tests. # to run a group of tests (e.g. sunspider) $ ./runtests.py sunspider/*.as sunspider/as3/*.as test avm metric sunspider/access-binary-trees.as 584 time sunspider/access-fannkuch.as 364 time ... # to set vm args (e.g. interp) $ ./runtests.py --vmargs="-dinterp" sunspider/*.as test ...
performInstall - Archive of obsolete content
summary per
forms the actual installation of the software. moves all components to their final locations, launches any pending executions, and registers the package and all of its subcomponents in the client version registry. method of install syntax int per
forminstall(); parameters none. returns an integer error code. for a list of possible values, see return codes. in some situations the method may return other errors. in a few cases you may get a registry error. example use the following code to abort or to finalize an installation, based on a variable you set earlier in your code: initinstall("royal airways tripplanner", "/royalairways/tripplanner", "1.0.0.0"); ... ...
... list of possible values, see return codes. ...
mozilla-dev-platform - Archive of obsolete content
about newsgroup summary for mozilla.dev.plat
form (google groups link) is for people working on the mozilla application framework ("mozilla-the-plat
form"). ...
...n the mozilla application framework ("mozilla-the-plat
form"). ...
Developing cross-browser and cross-platform pages - Archive of obsolete content
as a web author, you understandably want to avoid script errors and page layout problems and you may want to ensure your scripts reach as wide an audience as possible. there are 2 known approaches for such goals: the browser identification approach (also known as useragent string detection and often referred as "browser sniffing") and the object/feature support detection approach. the browser identification approach is now known to be complicated, unreliable and difficult to maintain. ...
...ternet explorer uses the windows registry safari, konqueror and icab browsers can mask their browser identity under internet explorer or netscape labels a user or browser distributor can put what they want in the navigator.useragent string and this may trick your code into executing a "wrong" block of code. moreover, there are many cases where even the accurately-identified browser does not per
form as it is reputed/expected to. so if "browser sniffing" is unreliable and difficult, then how do you code safely for different browsers and different browser versions? ... using object/feature support detection approach: best and overall most reliable when you use object/feature support detection, you only implement those features whose support you have first tested and verified on the visiting...
XForms Range Element - Archive of obsolete content
control. single-node binding special incremental - supported, default value is false start - lower bound of possible values end - upper bound of possible values step - is used for incrementing/decrementing values start/end/step attributes if the value of the bound instance node is outside the range of values specified by the start and end attributes, then the range element receives a x
forms-out-of-range event. if the bound value then becomes in range, the range element receives a x
forms-in-range event. start specifies the lower bound of possible values, i.e. values can't be less than the value of this attribute. if this attribute is omitted, then it is assumed to be 0. end specifies the upper bound of possible values, i.e. values can't be greater than the value of this attribute. i...
... changed upon user interaction. if this attribute is omitted, then it is assumed to be the value of end - start / 20. type restrictions the range element can be bound to a node of type xsd:duration, xsd:date, xsd:time, xsd:datetime, xsd:gyearmonth, xsd:gyear, xsd:gmonthday, xsd:gday, xsd:gmonth, xsd:float, xsd:decimal or xsd:double or any type derived from one of these. representations the x
forms range element is represented by a slider widget (xhtml only). characteristics analogous widget is <xul:scale/>, which is available in fx 3.0 only if the incremental attribute has the value true, the value of the bound node will be updated upon each movement of the slider's thumb. ...
XForms Secret Element - Archive of obsolete content
ccesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special inputmode - isn't supported. incremental - supported. the default value is false. 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. representations the x
forms secret element is represented by a password field. the password field is a text field, the value of which is hidden by asterisks (xhtml/xul). 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. please keep in mind that...
...text field, the value of which is hidden by asterisks (xhtml/xul). 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. please keep in mind that the instance data will hold exactly what the user gave as input. any other x
form control bound to that data will show that data 'as is'. ...
XForms Switch Module - Archive of obsolete content
the module defines for this switch, case and toggle elements. switch element the element (see the spec) is used in conjunction with case and toggle elements. the switch element contains case elements which in turn contain markup. only the contents of a single case may be displayed at one time. the toggle element is an action that when triggered will make a case selected and visible and thereby hiding all other case elements contained by the same switch. attributes single-node binding type restrictions the switch element can be bound to a node containing data of any type. ...
..., having a relevant model item property on the bound node has an effect on a switch. binding a switch to a data node will also set a context that the expressions contained inside the case elements can build upon. representations the switch element doesn't have a visual representation. case element this element (see the spec) encloses markup to be conditionally rendered. the content elements (e.g.
form controls, groups, switches, repeats and host language elements) within a non-selected case are not rendered. correspondingly, content elements in a case that becomes selected are visible. attributes special selected - determines the initial selected state of the case. if multiple cases within a switch are marked as selected="true", the first selected case will appear and all others ...
XForms Upload Element - Archive of obsolete content
introduction provides a means for the user to select a file (see the spec) from the file system. 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 x
forms author can set the filter by using the mediatype attribute directly on the upload element or by placing a mediatype element (see the spec) as a direct child of the upload element. attributes ui common appearance - isn't supported. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special mediatype - supported. incremental - isn't supported. type restrictions the upload element can be bound to a node of type xsd:anyuri, xsd:base64bina...
...tributes ui common appearance - isn't supported. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special mediatype - supported. incremental - isn't supported. type restrictions the upload element can be bound to a node of type xsd:anyuri, xsd:base64binary or xsd:hexbinary or any type derived from one of these. representations the x
forms upload element is represented by visually combining three widgets: a text field that shows the uri of the selected file, a button to open the file picker dialog which allows the user to select a file, and a button to clear the text field and the reference to the file from the bound node (xhtml only). characteristics analogous widget is <xhtml:input type="file"/> ...
Using XForms and PHP - Archive of obsolete content
to do that, you need to use the header() php function: <?php header("content-type: application/xhtml+xml; charset=utf-8"); ... ?> but remember this (quote from php documentation): remember that header() must be called before any actual output is sent, either by normal html tags, blank lines in a file, or from php. it is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. ...
...either by normal html tags, blank lines in a file, or from php. it is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. the same problem exists when using a single php/html file. parsing submitted data depending on the submission type, you might get different data
formats on the server side. to really use the power of x
forms (/xml) you would probably submit xml. there is some help in getting to the raw xml on the php documentation site. how to actually parse and use the xml data depends heavily on what you want to achieve and on the php version. to get a dom document on php 4 i usually do something like this: $data = $http_raw_post_data; $dom = domxml_open_mem...
Information architecture - MDN Web Docs Glossary: Definitions of Web-related terms
in
formation architecture, as applied to web design and development, is the practice of organizing the in
formation / content / functionality of a web site so that it presents the best user experience it can, with in
formation and services being easily usable and findable. ...
... in
formation architecture, as applied to web design and development, is the practice of organizing the in
formation / content / functionality of a web site so that it presents the best user experience it can, with in
formation and services being easily usable and findable. ...
Web performance - MDN Web Docs Glossary: Definitions of Web-related terms
web per
formance is the objective time from when a request for content is made until the requested content is displayed in the user's browser, objective render times, and the subjective user experience of load time and runtime. objectively, it is measurable time, in milliseconds, it takes for the web page or web application to be downloaded, painted in the user's web browser, and become responsive and interactive. it is the frames per second and times the main thread is not available for user interactions. subjectively, it is the user's perception of whether the time it takes between the time the user requests the content and the time until the user feels the content requested is available and usable feels slow or fast. ...
...s web browser, and become responsive and interactive. it is the frames per second and times the main thread is not available for user interactions. subjectively, it is the user's perception of whether the time it takes between the time the user requests the content and the time until the user feels the content requested is available and usable feels slow or fast. learn more learn about web per
formance perceived per
formance ...
XForms - MDN Web Docs Glossary: Definitions of Web-related terms
x
forms is a convention for building web
forms and processing
form data in the xml
format. no major browser supports x
forms any longer—we suggest using html5
forms instead. ...
... x
forms is a convention for building web
forms and processing
form data in the xml
format. no major browser supports x
forms any longer—we suggest using html5
forms instead. ...
Test your skills: Images and Form elements - Learn web development
note: you can try out solutions in the interactive editors below, however, it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. task one in this task, you have an image that is overflowing the box. ...
...wing the box. we want the image to scale down to fit inside the box without any extra white space, but we do not mind if some part of the image is cropped. in the example below see if you can match the image above. for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. task two in this task, you have a simple
form. your task is to make the following changes to the way this
form looks: use attribute selectors to target the search field and button inside .my
form. make the
form field and button use the same text size as the rest of the
form. give the
form field and button 10 px of padding. give the button a purple background (i used rebeccapurple), white foreground, no border and rounded corners of 5px.
Accessibility information for UI designers and developers
1.5 times the font size set spacing following paragraphs to at least 2 times the font size set letter spacing (tracking) to at least 0.12 times the font size set word spacing to at least 0.16 times the font size this does not mean that your page needs to offer controls to make such changes, merely that if someone does these things in a custom stylesheet, they should not break the interface.
forms in
forms, provide labels for all controls. this includes
form elements like inputs and select boxes, but also buttons. for
form elements, it should be clear what kind of input is expected. placeholders are best avoided for this, as they are often too low in contrast. it is more helpful to describe what an input element is for in text just above or underneath the input. error recovery when yo...
...th a keyboard, it lets people type a character, say ‘k’, to jump directly to options starting with ‘k’. it is recommended to use native controls, visibly or under the hood. links vs buttons to keep your interface in line with user expectations, use links for interactions that go somewhere (on the current page or another page) and buttons for interactions that do something (like submit a
form or open an overlay). links can be styled as buttons and vice versa, but designers are advised to avoid this where possible. motion on pages with transitions and animations, note that some users could experience distraction, dizziness or nausea. pages with a parallax effect can particularly cause troubles. to help these users, you could offer a setting to turn off animations, or wrap the css i...
Information for users
firefox 2 now has help topics (from the menubar: ? ...
... firefox accessibility features this page defines most of the accessibility features possible in firefox. features include assistive technology support on windows (like window-eyes, jaws, etc.), firefox keyboard support, available accessibility extensions like fire vox and other extensions. assistive technology compatibility this is a wiki page which users can edit to provide up to date in
formation on any issues related to compatibility with assistive technologies such as screen readers, screen magnifiers, voice input software and on screen keyboards. planning ahead for accessibility this document is intended to help testers and designers understand and plan what still needs to be added to our ui for full usable accessibility. please give us feedback on the discussion list! fir...
Firefox Operational Information Database: SQLite
a large amount of operational in
formation about websites visited and browser configuration is stored in relational databases in sqlite used by firefox. the sqlite manager add-on allows convenient browsing of this in
formation. (install the sqlite mangager add-on, click tools -> sqlite manager. ...
...e database you want to explore in the '(select profile database)' pulldown, click 'go', select one of the tables listed in the left column and see the current contents of the database in the 'browse & search' tab.) some databases are used by the browser itself, others are used by applications that you have installed or used; for example: content-prefs.sqlite cookies.sqlite download.sqlite
formhistory.sqlite persmissions.sqlite places.sqlite search.sqlite signons.sqlite webappstore.sqlite ...
Localization formats
o, which many localizers who are familiar with linux and other projects understand mozilla has a basic tool called main.lang checker, which can show any untranslated files to the localizer no need to compile to .mo file so a localizer can see his/her changes more quickly creating simple diffs .lang files will be cached which will reduce any slowness effect disadvantage to .lang no plural
forms no context for localizers unless you provide good comments no styling by localizers if it is needed may be slower because file is not compiled into binaries not used as a standard by any other localization project no tools to validate syntax, so a localizer may cause accidental errors that can cause breakage (level of breakage depends on level of error) cannot use po editor, which most loc...
...with this arrangement, content for localization is presented in the following manner: msgid "coming soon" msgstr "bientôt disponible" where the value in the "" of the msgid is the english content, and the value in the "" of the msgstr is the translation. msgstr can be longer translations than just the exact above. for example, below is the entire introduction used for...
GPU performance
apitrace - open source, works ok. pvrtrace - doesn't seem to emit traces on android/nexus s. ...
...st i checked required a special build to be used. nvidia parallel nsight - haven't tried. amd gpu shaderanalyzer - will compile a shader and show the machine code and give static pipeline estimations. not that useful for firefox because all of our shaders are pretty simple. amd gpu perfstudio - i had trouble getting this to work, and can't remember whether i actually did or not. intel graphics per
formance analyzers - haven't tried. apitrace - open source, works ok. pvrtrace - doesn't seem to emit traces on android/nexus s. looks like it's designed for x11-based linux-arm devices, omap3 is mentioned a lot in the docs ... guides accurately profiling direct3d api calls (direct3d 9)- suggests avoiding normal profilers like xperf and instead measuring the time to flush the command buffer. os x - be...
Measuring performance using the PerfMeasurement.jsm code module
note: the perfmeasurement.jsm javascript code module can only be used from chrome -- that is, from within the application itself or an add-on. the first thing you need to do is to import the module into your scope: components.utils.import("resource://gre/modules/perfmeasurement.jsm") you can then create a perfmeasurement object. you give the constructor a bit-mask of events you're interested in; see note: at present, perfmeasurement.jsm is only functional on linux, but it is planned to add support for windows (bug 583322) and osx (bug 583323) as well, and we welcome patches for other operating systems. ...
...benchmark a function that is pretty fast (but not fast enough), so we run it several thousand times: for (let i = 0; i < 10000; i++) { set_up_some_state(); monitor.start(); code_to_be_benchmarked(); monitor.stop(); clean_up_afterward(); } we call the perfmeasurement object's start() method when we want to start recording, and stop() when we want to stop recording. this lets us record in
formation only for the specific code section we want to measure. since we enable monitoring immediately before calling code_to_be_benchmarked(), and disable it as soon as it returns, the code in set_up_some_state() and clean_up_afterward() is not measured. the monitor object automatically accumulates counts over start/stop cycles (that is, it doesn't automatically zero the counters each time you sta...
NSS Key Log Format
uild.sh are not affected). distributors can re-enable it at compile time though (using the nss_allow_sslkeylogfile=1 make variable) which is done for the official firefox binaries. (see bug 1188657.) notably, debian does not have this option enabled, see debian bug 842292. this key log file is a series of lines. comment lines begin with a sharp character ('#') and are ignored. secrets follow the
format <label> <space> <clientrandom> <space> <secret> where: <label> describes the following secret. <clientrandom> is 32 bytes random value from the client hello message, encoded as 64 hexadecimal characters. <secret> depends on the label (see below). the following labels are defined, followed by a description of the secret: rsa: 48 bytes for the premaster secret, encoded as 96 hexadecimal...
...cation traffic secret for the client side (for tls 1.3) server_traffic_secret_0: the first hex-encoded application traffic secret for the server side (for tls 1.3) early_exporter_secret: the hex-encoded early exporter secret (for tls 1.3, used for 0-rtt keys in older quic drafts). exporter_secret: the hex-encoded exporter secret (for tls 1.3, used for 1-rtt keys in older quic drafts) the rsa
form allows ciphersuites using rsa key-agreement to be logged and was the first
form supported by wireshark 1.6.0. it has been superseded by client_random which also works with other key-agreement algorithms (such as those based on diffie-hellman) and is supported since wireshark 1.8.0. the tls 1.3 lines are supported since nss 3.34 (bug 1287711) and wireshark 2.4 (early_exporter_secret exists since ...
nsIAuthInformation
netwerk/base/public/nsiauthin
formation.idlscriptable a object that holds authentication in
formation. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) the caller of nsiauthprompt2.promptusernameandpassword() or nsiauthprompt2.promptpasswordasync() provides an object implementing this interface; the prompt implementation can then read the values here to prefill the dialog. after the user entered the authentication in
formation, it should set the attributes of this object to indicate to the caller what was entered by the user. attributes attribute type description authenticationscheme autf8string the authentication scheme used for this request, if applicable. if the protocol f...
...sed to prefill the dialog or be shown in some other way to the user. on return, this parameter should contain the username entered by the user. this field can only be changed if the #only_password flag is not set. constants constant value description auth_host 1 this dialog belongs to a network host. auth_proxy 2 this dialog belongs to a proxy. need_domain 4 this dialog needs domain in
formation. the user interface should show a domain field, prefilled with the domain attributes value. only_password 8 this dialog only asks for password in
formation. authentication prompts should not show a username field. attempts to change the username field will have no effect. nsiauthprompt2 implementations should, however, show its initial value to the user in some
form. for example, a paragra...
nsIXFormsNSInstanceElement
nsix
formsnsinstanceelement is implemented by all x
forms <instance/> elements, defining mozilla extensions. extensions/x
forms/nsix
formsnsinstanceelement.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) interface code [scriptable, uuid(80669b92-8331-4f92-aaf8-06e80e6827b3)] interface nsix
formsnsinstanceelement : nsisupports { nsidomdocument getinstancedocument(); }; methods getinstancedocument nsidomdocument getinstancedocument(); getinstancedocument returns a dom document that corresponds to the instance data associated with the instance element. essentially it is just a shortcut to nsix
formsmodelelement::getinstancedocument() for the given instance element. ...
... ...
nsIXFormsNSModelElement
nsix
formsnsmodelelement is implemented by all x
forms <model/> elements. it defines mozilla extensions to the nsix
formsmodelelement interface. extensions/x
forms/nsix
formsnsmodelelement.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) interface code [scriptable, uuid(85fd60c7-1db7-40c0-ae8d-f723fdd1eea8)] interface nsix
formsnsmodelelement : nsisupports { nsidomnodelist getinstancedocuments(); }; methods getinstancedocuments nsidomnodelist getinstancedocuments(); getinstancedocuments returns a nsidomnodelist containing all the instance documents for the model, making it possible to enumerate over instances in the model without knowing their names. ...
...c0-ae8d-f723fdd1eea8)] interface nsix
formsnsmodelelement : nsisupports { nsidomnodelist getinstancedocuments(); }; methods getinstancedocuments nsidomnodelist getinstancedocuments(); getinstancedocuments returns a nsidomnodelist containing all the instance documents for the model, making it possible to enumerate over instances in the model without knowing their names. related interfaces nsix
formsmodelelement example code none. ...
Using dynamic styling information - Web APIs
in many cases, and where possible, it really is best practice to dynamically manipulate classes via the classname property since the ultimate appearance of all of the styling hooks can be controlled in a single stylesheet. ...
...click here to change background color. </p> <!-- passes the 'p1' id of another element's style to modify. --> <button onclick="resetstyle('p1');">reset background color</button> </body> </html> the getcomputedstyle() method on the document.defaultview object returns all styles that have actually been computed for an element. see example 6: getcomputedstyle in the examples chapter for more in
formation on how to use this method. dom style object the style object represents an individual style statement. unlike the individual rules available from the document.stylesheets collection, the style object is accessed from the document or from the elements to which that style is applied. it represents the in-line styles on a particular element. more important than the two properties noted here ...
FormDataEvent() - Web APIs
the
formdataevent() constructor creates a new
formdataevent object instance. syntax new
formdataevent(type[,
formeventinit]); values type a domstring representing the name of the event.
formeventinit optional a
formeventinit dictionary, which can take the following optional fields: bubbles: a boolean indicating whether the event bubbles. the default is false. cancelable: a boolean indicating whether the event can be cancelled. the default is false. composed: a boolean indicating whether the event will trigger listeners outside of a shadow root (see event.composed for more details). the default is false.
formdata: a
formdata object to pre-populate the
formdataevent with. this would then be accessed through the
formdataevent.
formdata property. examples let fd = new for...
...lt is false. composed: a boolean indicating whether the event will trigger listeners outside of a shadow root (see event.composed for more details). the default is false.
formdata: a
formdata object to pre-populate the
formdataevent with. this would then be accessed through the
formdataevent.
formdata property. examples let fd = new
formdata(); fd.append('test', 'test'); let fdev = new
formdataevent('
formdata', {
formdata: fd }); for (let value of fdev.
formdata.values()) { console.log(value); } specifications specification status comment html living standardthe definition of '
formdataevent' in that specification. living standard initial definition ...
HTMLFormElement.submit() - Web APIs
the html
formelement.submit() method submits a given <
form>. this method is similar, but not identical to, activating a
form's submit <button>. when invoking this method directly, however: no submit event is raised. in particular, the
form's onsubmit event handler is not run. constraint validation is not triggered. the html
formelement.requestsubmit() method is identical to activating a
form's submit <button> and does not have these differences. if a
form control (such as a submit button) has a name or id of submit, this method will mask the
form's submit method. <input> with attribute type="submit" will not be submitted with the
form when using html
formelement.submit(), but it would be submitted when you do it with original html
form submit. ...
...tical to activating a
form's submit <button> and does not have these differences. if a
form control (such as a submit button) has a name or id of submit, this method will mask the
form's submit method. <input> with attribute type="submit" will not be submitted with the
form when using html
formelement.submit(), but it would be submitted when you do it with original html
form submit. syntax html
formelement.submit() example document.
forms["my
form"].submit(); specifications specification status comment html living standardthe definition of 'html
formelement: submit' in that specification. living standard ...
NavigatorID.platform - Web APIs
returns a string representing the plat
form of the browser. the specification allows browsers to always return the empty string, so don't rely on this property to get a reliable answer. syntax plat
form = navigator.plat
form value a domstring identifying the plat
form on which the browser is running, or an empty string if the browser declines to (or is unable to) identify the plat
form. plat
form is a string that must be an empty string or a string representing the plat
form on which the browser is executing. for example: "macintel", "win32", "freebsd i386", "webtv os" example console.log(navigator.plat
form); usage notes most browsers, including chrome, edge, and firefox 63 and later, return "win32" even if running on a 64-bit version of windows. internet explorer and versions of firefox p...
..." example console.log(navigator.plat
form); usage notes most browsers, including chrome, edge, and firefox 63 and later, return "win32" even if running on a 64-bit version of windows. internet explorer and versions of firefox prior to version 63 still report "win64". specifications specification status comment html living standardthe definition of 'navigatorid.plat
form' in that specification. living standard initial definition. ...
NetworkInformation.downlink - Web APIs
the downlink read-only property of the networkin
formation interface returns the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds. this value is based on recently observed application layer throughput across recently active connections, excluding connections made to a private address space. in the absence of recent bandwidth measurement data, the attribute value is determined by the properties of the underlying connection technology. note that chrome-based browsers do not con
form to the specification, and arbitrarily cap the reported downlink at a maximum of 10 mbps as an anti-fingerprinting measure. similar caps exist for the reported latency. syntax var downlink = networkin
formation.downlink value a double. specifications...
...underlying connection technology. note that chrome-based browsers do not con
form to the specification, and arbitrarily cap the reported downlink at a maximum of 10 mbps as an anti-fingerprinting measure. similar caps exist for the reported latency. syntax var downlink = networkin
formation.downlink value a double. specifications specification status comment network in
formation apithe definition of 'downlink' in that specification. draft initial definition. ...
Performance.onresourcetimingbufferfull - Web APIs
the onresourcetimingbufferfull property is an event handler that will be called when the resourcetimingbufferfull event is fired. this event is fired when the browser's resource timing per
formance buffer is full. note: this feature is available in web workers. syntax callback = per
formance.onresourcetimingbufferfull = buffer_full_cb; return value callback an eventhandler that is invoked when the resourcetimingbufferfull event is fired. examples the following example sets a callback function on the onresourcetimingbufferfull property. ...
...n web workers. syntax callback = per
formance.onresourcetimingbufferfull = buffer_full_cb; return value callback an eventhandler that is invoked when the resourcetimingbufferfull event is fired. examples the following example sets a callback function on the onresourcetimingbufferfull property. function buffer_full(event) { console.log("warning: resource timing buffer is full!"); per
formance.setresourcetimingbuffersize(200); } function init() { // set a callback if the resource buffer becomes filled per
formance.onresourcetimingbufferfull = buffer_full; } <body onload="init()"> specifications specification status comment resource timing level 1the definition of 'onresourcetimingbufferfull' in that specification. candidate recommendation initial...
Performance: resourcetimingbufferfull event - Web APIs
red when the browser's resource timing buffer is full. bubbles yes cancelable yes interface event event handler property onresourcetimingbufferfull examples the following example sets a callback function on the onresourcetimingbufferfull property. ...
... event event handler property onresourcetimingbufferfull examples the following example sets a callback function on the onresourcetimingbufferfull property. function buffer_full(event) { console.log("warning: resource timing buffer is full!"); per
formance.setresourcetimingbuffersize(200); } function init() { // set a callback if the resource buffer becomes filled per
formance.onresourcetimingbufferfull = buffer_full; } <body onload="init()"> note that you could also set up the handler using the addeventlistener() function: per
formance.addeventlistener('resourcetimingbufferfull', buffer_full); specifications specification status comment resource timing level 1the definition of 'onresourcetimingbufferfull' in that specification. candi...
PerformanceNavigationTiming.toJSON() - Web APIs
the tojson() method is a serializer - it returns a json representation of the per
formancenavigationtiming object. syntax json = resourceperfentry.tojson(); arguments none return value json a json object that is the serialization of the per
formancenavigationtiming object as a map with entries from the closest inherited interface and with entries for each of the serializable attributes. ...
... - it returns a json representation of the per
formancenavigationtiming object. syntax json = resourceperfentry.tojson(); arguments none return value json a json object that is the serialization of the per
formancenavigationtiming object as a map with entries from the closest inherited interface and with entries for each of the serializable attributes. example // get a resource per
formance entry var perfentries = per
formance.getentriesbytype("navigation"); var entry = perfentries[0]; // get the json and log it var json = entry.tojson(); var s = json.stringify(json); console.log("per
formancenavigationtiming.tojson() = " + s); specifications specification status comment navigation timing level 2the definition of 'tojson()' in that specification. wor...
PerformanceNavigationTiming.type - Web APIs
reload navigation is through the browser's reload operation or location.reload(). back_forward navigation is through the browser's history traversal operation. prerender navigation is initiated by a prerender hint. ...
...s history traversal operation. prerender navigation is initiated by a prerender hint. this property is read only . syntax perfentry.type; return value a string which is one of the values listed above. example the following example illustrates this property's usage. ...
PerformanceObserver - Web APIs
the per
formanceobserver interface is used to observe per
formance measurement events and be notified of new per
formance entries as they are recorded in the browser's per
formance timeline. note: this feature is available in web workers. constructor per
formanceobserver() creates and returns a new per
formanceobserver object. methods per
formanceobserver.observe() specifies the set of entry types to observe. the per
formance observer's callback function will be invoked when a per
formance entry is recorded for one of the specified entrytypes per
formanceobserver.disconnect() stops the per
formance observer callback from receiving per
formance entries. per
formanceobserver.takerecords() returns the current list of per
formance entries stored in the per
formance observer, emptying it out. ...
...d for one of the specified entrytypes per
formanceobserver.disconnect() stops the per
formance observer callback from receiving per
formance entries. per
formanceobserver.takerecords() returns the current list of per
formance entries stored in the per
formance observer, emptying it out. example function perf_observer(list, observer) { // process the "measure" event } var observer2 = new per
formanceobserver(perf_observer); observer2.observe({entrytypes: ["measure"]}); specifications specification status comment per
formance timeline level 2the definition of 'per
formanceobserver' in that specification. candidate recommendation initial definition of per
formanceobserver interface. ...
PerformanceResourceTiming.connectEnd - Web APIs
ion, as well as other time intervals such as ssl handshake and socks authentication. note: this feature is available in web workers. syntax resource.connectend; return value a domhighrestimestamp representing the time after a connection is established. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...s feature is available in web workers. syntax resource.connectend; return value a domhighrestimestamp representing the time after a connection is established. example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
PerformanceResourceTiming.nextHopProtocol - Web APIs
rotocol. otherwise, this property returns the alpn protocol id of the first hop to the proxy. note: this feature is available in web workers. syntax resource.nexthopprotocol; return value a string representing the network protocol used to fetch the resource, as identified by the alpn protocol id (rfc7301). example the following example uses the nexthopprotocol property. ...
...note: this feature is available in web workers. syntax resource.nexthopprotocol; return value a string representing the network protocol used to fetch the resource, as identified by the alpn protocol id (rfc7301). example the following example uses the nexthopprotocol property. ...
PerformanceResourceTiming.toJSON() - Web APIs
the tojson() method is a serializer that returns a json representation of the per
formanceresourcetiming object. syntax json = resourceperfentry.tojson(); arguments none return value json a json object that is the serialization of the per
formanceresourcetiming object as a map with entries from the closest inherited interface and with entries for each of the serializable attributes. ...
...izer that returns a json representation of the per
formanceresourcetiming object. syntax json = resourceperfentry.tojson(); arguments none return value json a json object that is the serialization of the per
formanceresourcetiming object as a map with entries from the closest inherited interface and with entries for each of the serializable attributes. example // get a resource per
formance entry var perfentries = per
formance.getentriesbytype("resource"); var entry = perfentries[0]; // get the json and log it var json = entry.tojson(); var s = json.stringify(json); console.log("per
formanceentry.tojson = " + s); specifications specification status comment resource timing level 2the definition of 'tojson' in that specification. working draft ...
PerformanceTiming.connectEnd - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.connectend read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the connection is opened network. if the transport layer reports an error and the connection establishment is started again, the last connection establisment end time is given. if a persistent connection is used, the value will be the same as per
formancetiming.fetchstart. ...
...nection is opened network. if the transport layer reports an error and the connection establishment is started again, the last connection establisment end time is given. if a persistent connection is used, the value will be the same as per
formancetiming.fetchstart. a connection is considered as opened when all secure connection handshake, or socks authentication, is terminated. syntax time = per
formancetiming.connectend; specifications specification status comment navigation timingthe definition of 'per
formancetiming.connectend' in that specification. recommendation initial definition. ...
PerformanceTiming.connectStart - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.connectstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the request to open a connection is sent to the network. if the transport layer reports an error and the connection establishment is started again, the last connection establisment start time is given. if a persistent connection is used, the value will be the same as per
formancetiming.fetchstart. ...
...gned long long representing the moment, in miliseconds since the unix epoch, where the request to open a connection is sent to the network. if the transport layer reports an error and the connection establishment is started again, the last connection establisment start time is given. if a persistent connection is used, the value will be the same as per
formancetiming.fetchstart. syntax time = per
formancetiming.connectstart; specifications specification status comment navigation timingthe definition of 'per
formancetiming.connectstart' in that specification. recommendation initial definition. ...
WebGL2RenderingContext.beginTransformFeedback() - Web APIs
the webgl2renderingcontext.begintrans
formfeedback() method of the webgl 2 api starts a trans
form feedback operation. syntax void gl.begintrans
formfeedback(primitivemode); parameters primitivemode a glenum specifying the output type of the primitives that will be recorded into the buffer objects that are bound for trans
form feedback. possible values: gl.points gl.lines gl.triangles return value none. examples var trans
formfeedback = gl.createtrans
formfeedback(); gl.bindtrans
formfeedback(gl.trans
form_feedback, trans
formfeedback); gl.begintrans
formfeedback(gl.triangles); gl.drawarrays(gl.triangles, 0, 3); specifications specification status comment webgl 2.0the definition of 'begintrans
formfeedback' in that specification. editor's ...
...ck(); gl.bindtrans
formfeedback(gl.trans
form_feedback, trans
formfeedback); gl.begintrans
formfeedback(gl.triangles); gl.drawarrays(gl.triangles, 0, 3); specifications specification status comment webgl 2.0the definition of 'begintrans
formfeedback' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glbegintrans
formfeedback' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.bindTransformFeedback() - Web APIs
the webgl2renderingcontext.bindtrans
formfeedback() method of the webgl 2 api binds a passed webgltrans
formfeedback object to the current gl state. syntax void gl.bindtrans
formfeedback(target, trans
formfeedback); parameters target a glenum specifying the target (binding point). must be gl.trans
form_feedback. trans
formfeedback a webgltrans
formfeedback object to bind. return value none. examples var trans
formfeedback = gl.createtrans
formfeedback(); gl.bindtrans
formfeedback(gl.trans
form_feedback, trans
formfeedback); specifications specification status comment webgl 2.0the definition of 'bindtrans
formfeedback' in that specification. editor's draft initial definition for webgl. ...
...eturn value none. examples var trans
formfeedback = gl.createtrans
formfeedback(); gl.bindtrans
formfeedback(gl.trans
form_feedback, trans
formfeedback); specifications specification status comment webgl 2.0the definition of 'bindtrans
formfeedback' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glbindtrans
formfeedback' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.deleteTransformFeedback() - Web APIs
the webgl2renderingcontext.deletetrans
formfeedback() method of the webgl 2 api deletes a given webgltrans
formfeedback object. syntax void gl.deletetrans
formfeedback(trans
formfeedback); parameters trans
formfeedback a webgltrans
formfeedback object to delete. return value none. examples gl must be a webgl2renderingcontext. webgltrans
formfeedback objects are not available in webgl 1. var trans
formfeedback = gl.createtrans
formfeedback(); // ... gl.deletetrans
formfeedback(trans
formfeedback); specifications specification status comment webgl 2.0the definition of 'deletetrans
formfeedback' in that specification. editor's draft initial definition for webgl. ...
...bjects are not available in webgl 1. var trans
formfeedback = gl.createtrans
formfeedback(); // ... gl.deletetrans
formfeedback(trans
formfeedback); specifications specification status comment webgl 2.0the definition of 'deletetrans
formfeedback' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gldeletetrans
formfeedbacks' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getActiveUniformBlockName() - Web APIs
the webgl2renderingcontext.getactiveuni
formblockname() method of the webgl 2 api retrieves the name of the active uni
form block at a given index within a webglprogram. syntax domstring gl.getactiveuni
formblockname(program, uni
formblockindex); parameters program a webglprogram containing the uni
form block. uni
formblockindex a gluint specifying the index of the uni
form block to whose name to retrieve. return value a domstring indicating the active uni
form block name. examples var blockname = gl.getactiveuni
formblockname(program, 0); specifications specification status comment webgl 2.0the definition of 'getactiveuni
formblockname' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gl...
...rieve. return value a domstring indicating the active uni
form block name. examples var blockname = gl.getactiveuni
formblockname(program, 0); specifications specification status comment webgl 2.0the definition of 'getactiveuni
formblockname' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgetactiveuni
formblockname' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getUniformIndices() - Web APIs
the webgl2renderingcontext.getuni
formindices() method of the webgl 2 api retrieves the indices of a number of uni
forms within a webglprogram. syntax sequence<gluint> gl.getuni
formindices(program, uni
formnames); parameters program a webglprogram containing uni
forms whose indices to query. uni
formnames an array of domstring specifying the names of the uni
forms to query. return value an array of gluint containing the uni
form indices. examples var uni
formindices = gl.getuni
formindices(program, ['ubored', 'ubogreen', 'uboblue']); specifications specification status comment webgl 2.0the definition of 'getuni
formindices' in that specification. editor's draft initial definition for webgl. ...
...rn value an array of gluint containing the uni
form indices. examples var uni
formindices = gl.getuni
formindices(program, ['ubored', 'ubogreen', 'uboblue']); specifications specification status comment webgl 2.0the definition of 'getuni
formindices' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgetuni
formindices' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.isTransformFeedback() - Web APIs
the webgl2renderingcontext.istrans
formfeedback() method of the webgl 2 api returns true if the passed object is a valid webgltrans
formfeedback object. syntax glboolean gl.istrans
formfeedback(trans
formfeedback); parameters trans
formfeedback a webgltrans
formfeedback object to test. return value a glboolean indicating whether the given object is a valid webgltrans
formfeedback object (true) or not (false). examples gl must be a webgl2renderingcontext. webgltrans
formfeedback objects are not available in webgl 1. var trans
formfeedback = gl.createtrans
formfeedback(); // ... gl.istrans
formfeedback(trans
formfeedback); specifications specification status comment webgl 2.0the definition of 'istrans
formfeedback' in that specification. editor's draft...
...rmfeedback objects are not available in webgl 1. var trans
formfeedback = gl.createtrans
formfeedback(); // ... gl.istrans
formfeedback(trans
formfeedback); specifications specification status comment webgl 2.0the definition of 'istrans
formfeedback' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glistrans
formfeedback' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.resumeTransformFeedback() - Web APIs
the webgl2renderingcontext.resumetrans
formfeedback() method of the webgl 2 api resumes a trans
form feedback operation. syntax void gl.resumetrans
formfeedback(); parameters none. return value none. examples var trans
formfeedback = gl.createtrans
formfeedback(); gl.bindtrans
formfeedback(gl.trans
form_feedback, trans
formfeedback); gl.begintrans
formfeedback(gl.triangles); gl.pausetrans
formfeedback(); //... gl.resumetrans
formfeedback(); gl.drawarrays(gl.triangles, 0, 3); gl.endtrans
formfeedback(); specifications specification status comment webgl 2.0the definition of 'resumetrans
formfeedback' in that specification. editor's draft initial definition for webgl. ...
...dback(gl.triangles); gl.pausetrans
formfeedback(); //... gl.resumetrans
formfeedback(); gl.drawarrays(gl.triangles, 0, 3); gl.endtrans
formfeedback(); specifications specification status comment webgl 2.0the definition of 'resumetrans
formfeedback' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glresumetrans
formfeedback' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.uniformBlockBinding() - Web APIs
the webgl2renderingcontext.uni
formblockbinding() method of the webgl 2 api assigns binding points for active uni
form blocks. syntax void gl.uni
formblockbinding(program, uni
formblockindex, uni
formblockbinding); parameters program a webglprogram containing the active uni
form block whose binding to assign. uni
formblockindex a gluint specifying the index of the active uni
form block within the program. uni
formblockbinding a gluint specifying the binding point to which to bind the uni
form block. return value none. examples gl.uni
formblockbinding(program, 0, 1); specifications specification status comment webgl 2.0the definition of 'uni
formblockbinding' in that specification. editor's draft initial definition for webgl. opengl es 3.0...
...mblockbinding a gluint specifying the binding point to which to bind the uni
form block. return value none. examples gl.uni
formblockbinding(program, 0, 1); specifications specification status comment webgl 2.0the definition of 'uni
formblockbinding' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gluni
formblockbinding' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.uniformMatrix[234]fv() - Web APIs
the webglrenderingcontext.uni
formmatrix[234]fv() methods of the webgl api specify matrix values for uni
form variables. the three versions of this method (uni
formmatrix2fv(), uni
formmatrix3fv(), and uni
formmatrix4fv()) take as the input value 2-component, 3-component, and 4-component square matrices, respectively. they are expected to have 4, 9 or 16 floats. syntax webglrenderingcontext.uni
formmatrix2fv(location, transpose, value); webglrenderingcontext.uni
formmatrix3fv(location, transpose, value); webglrenderingcontext.uni
formmatrix4fv(location, transpose, value); parameters location a webgluni
formlocation object containing the location of the uni
form attribute to modify. the location is obtained using getuni
formlocation(). transpose a glboolean specifying whether to transpose the...
... location a webgluni
formlocation object containing the location of the uni
form attribute to modify. the location is obtained using getuni
formlocation(). transpose a glboolean specifying whether to transpose the matrix. must be false. value a float32array or sequence of glfloat values. the values are assumed to be supplied in column major order. return value undefined examples gl.uni
formmatrix2fv(loc, false, [2,1, 2,2]); specifications specification status comment webgl 1.0the definition of 'uni
formmatrix' in that specification. recommendation initial definition. opengl es 2.0the definition of 'gluni
form' in that specification. standard man page of the opengl api. ...
WebGLShaderPrecisionFormat - Web APIs
the webglshaderprecision
format interface is part of the webgl api and represents the in
formation returned by calling the webglrenderingcontext.getshaderprecision
format() method. properties webglshaderprecision
format.rangemin read only the base 2 log of the absolute value of the minimum value that can be represented. webglshaderprecision
format.rangemax read only the base 2 log of the absolute value of the maximum value that can be represented. webglshaderprecision
format.precision read only the number of bits of precision that can be represented. for integer
formats this value is always 0. examples a webglshaderprecision
format object is returned by the webglrenderingcontext.getshaderprecision
format() method. var canvas = document.getelementbyid('canvas'); var gl = canvas.getcont...
...n be represented. webglshaderprecision
format.precision read only the number of bits of precision that can be represented. for integer
formats this value is always 0. examples a webglshaderprecision
format object is returned by the webglrenderingcontext.getshaderprecision
format() method. var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.getshaderprecision
format(gl.vertex_shader, gl.medium_float); // webglshaderprecision
format { rangemin: 127, rangemax: 127, precision: 23 } specifications specification status comment webgl 1.0the definition of 'webglshaderprecision
format' in that specification. recommendation initial definition. ...
XRRigidTransform.orientation - Web APIs
the read-only xrrigidtrans
form property orientation is a dompointreadonly containing a normalized quaternion (also called a unit quaternion or versor) specifying the rotational component of the trans
form represented by the object. if you specify a quaternion whose length is not exactly 1.0 meters, it will be normalized for you. syntax let orientation = xrrigidtrans
form.orientation; value a dompointreadonly object which contains a unit quaternion providing the orientation component of the trans
form. as a unit quaternion, the length of the returned quaternion is always 1.0 meters. ...
...tion; value a dompointreadonly object which contains a unit quaternion providing the orientation component of the trans
form. as a unit quaternion, the length of the returned quaternion is always 1.0 meters. examples to create a reference space which is oriented to look straight up, positioned 2 meters off of ground level: xrreferencespace = refspace.getoffsetreferencespace( new xrrigidtrans
form({y: -2}, {x: 0.0, y: 1.0, z: 0.0, w: 1.0}); ); the unit quaternion specified here is [0.0, 1.0, 0.0, 1.0] to indicate that the object should be facing directly along the y axis. specifications specification status comment webxr device apithe definition of 'xrrigidtrans
form.orientation' in that specification. working draft initial definition. ...
-webkit-transform-2d - CSS: Cascading Style Sheets
the -webkit-trans
form-2d boolean css media feature is a chrome extension whose value is true if vendor-prefixed css 2d trans
forms are supported. apple has a description in safari css reference. syntax -webkit-trans
form-2d is a boolean css media feature whose value is true if the browser supports -webkit prefixed css 2d trans
forms. values true the browser supports the 2d css trans
forms with the -webkit prefix. false the 2d css trans
forms prefixed with -webkit are not supported by the browser. examples basic example @media (-webkit-trans
form-2d) { div { -webkit-trans
form: translate(100px, 100px); } } this media feature is only supported by webkit. ...
...e browser supports the 2d css trans
forms with the -webkit prefix. false the 2d css trans
forms prefixed with -webkit are not supported by the browser. examples basic example @media (-webkit-trans
form-2d) { div { -webkit-trans
form: translate(100px, 100px); } } this media feature is only supported by webkit. if possible, use an @supports feature query instead: @supports (-webkit-trans
form: translate(100px, 100px)) { div { -webkit-trans
form: translate(100px, 100px); } } specifications not part of any standard. ...
-webkit-transform-3d - CSS: Cascading Style Sheets
the -webkit-trans
form-3d boolean css media feature is a chrome extension whose value is true if vendor-prefixed css 3d trans
forms are supported. note: this media feature is only supported by webkit and blink. if possible, use an @supports feature query instead. syntax -webkit-trans
form-3d is a boolean css media feature whose value is true if the browser supports -webkit prefixed css 3d trans
forms. values true the browser supports the 3d css trans
forms with the -webkit prefix. false the 3d css trans
forms prefixed with -webkit are not supported by the browser. ...
... if possible, use an @supports feature query instead. syntax -webkit-trans
form-3d is a boolean css media feature whose value is true if the browser supports -webkit prefixed css 3d trans
forms. values true the browser supports the 3d css trans
forms with the -webkit prefix. false the 3d css trans
forms prefixed with -webkit are not supported by the browser. examples @media (-webkit-trans
form-3d) { .foo { trans
form-style: preserve-3d; } } @media (-webkit-trans
form-3d: 1) { .foo { trans
form-style: preserve-3d; } } specifications specification status comment compatibility standardthe definition of '-webkit-trans
form-3d' in that specification. living standard initial standardization safari css reference 'media query extens...
Inline formatting context - CSS: Cascading Style Sheets
this article explains the inline
formatting context core concepts the inline
formatting context is part of the visual rendering of a web page. inline boxes are laid out one after the other, in the direction sentences run in the writing mode in use: in a horizontal writing mode, boxes are laid out horizontally, starting on the left. in a vertical writing mode they would be laid out vertically starting at the top. in the example below, the two (<div>) elements with the black borders
form a block
formatting context, inside which each word participates in an inline
formatting context. the boxes in the horizontal writing mode run horizontally, and the vertical writing mode boxes run vertically. boxes
forming a line are contained by a rectangular area called a line box. this box w...
... the inline direction, the text-align property can be used to align the inline boxes within their line box. try changing the value of text-align below to end. effect of floats line boxes usually have the same size in the inline direction, therefore the same width if working in a horizontal writing mode, or height if working in a vertical writing mode. if there is a float within the same block
formatting context however, the float will cause the line boxes that wrap the float to become shorter. ...
transform-origin - SVG: Scalable Vector Graphics
the trans
form-origin svg attribute sets the origin for an item’s trans
formations. note: as a presentation attribute in svg, trans
form-origin corresponds in syntax and behavior to the trans
form-origin property in css, and can be used as css property to style svg. see the css trans
form-origin property for more in
formation. usage notes values [ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?where <length-percentage> = <length> | <percentage> default value 50%, 50% animatable yes the trans
form-origin property may be specified using one, two, or three values, where each value represents an offset. offsets that are not ex...
...e of the keywords left, center, and right. the other value must be a <length>, a <percentage>, or one of the keywords top, center, and bottom. three-value syntax: the first two values are the same as for the two-value syntax. the third value must be a <length>. it always represents the z offset. specifications specification status comment css trans
forms level 1the definition of 'trans
form-origin' in that specification. working draft scalable vector graphics (svg) 2the definition of 'trans
form-origin' in that specification. candidate recommendation ...
<xsl:output> - XSLT: Extensible Stylesheet Language Transformations
sed. as of 7.0, method="text" works as expected. syntax <xsl:output method="xml" | "html" | "text" version=string encoding=string omit-xml-declaration="yes" | "no" standalone="yes" | "no" doctype-public=string doctype-system=string cdata-section-elements=list-of-names indent="yes" | "no" media-type=string /> required attributes none. optional attributes method specifies output
format. version specifies the value of the version attribute of the xml or html declaration in the output document. this attribute is only used when method="html" or method="xml". encoding specifies the value of the encoding attribute in the output document. omit-xml-declaration indicates whether or not to include an xml declaration in the output. acceptable values are "yes" or "no". ...
...cument. cdata-section-elements lists elements whose text contents should be written as cdata sections. elements should be whitespace separated. indent (not supported.) specifies if the output should be indented to indicate its hierarchic structure. media-type (not supported.) specifies the output document mime type. type top-level, must be the child <xsl:stylesheet> or <xsl:trans
form>. defined xslt, section 16. gecko support partial support. see comments above. ...
Fast Graphics Performance With HTML - Archive of obsolete content
ad of <div><div style="position:fixed">simple</div>lots of text...</div> make the content of scrollable sub frames opaque e.g. use <div style="overflow:scroll><div style="background:white"><p>this is some text</p><p>and some more</p></div></div> instead of <div style="overflow:scroll><p>this is some text</p><p>and some more</p></div> animating 'trans
form' and 'opacity' properties can be done with the compositor which makes them efficient to animate ...
Measuring add-on startup performance - Archive of obsolete content
this article describes an add-on that is no longer supported. using about:startup the about startup add-on provides a much simpler way to measure startup per
formance. once installed, it will gather startup data and display it in the about:startup page. the add-on is very lightweight, so it shouldn't have a noticeable negative effect on your baseline and add-on tests. to test with about:startup, you should set up a new firefox profile, install this add-on, and then open and quit firefox repeatedly. if you want to match talos, you should do this 20 times. then look at the results in the about:startup page. this should provide your baseline numbers. then repeat the process with both about startup and your add-on installed. the overhead can be calculated using the same
formula. the a...
mozilla.dev.platform FAQ - Archive of obsolete content
faq for questions asked on mozilla.dev.plat
form xulrunner q: xulrunner on mac os x a: instead of using /path/to/xulrunner-bin.ini, applications on a mac must be in an application bundle (foo.app). then unpack the xul app into the mac structure with xulrunner -install-app q: can you build xulrunner with newer (>1.5) features, such as storage? a: xulrunner trunk and 1.8 (but not 1.8.0) build storage by default, and anything can be built with storage if you put in you <tt>mozconfig --enable-storage</tt> q: program received signal exc_bad_instruction, illegal instruction/operand. 0x00016b50 in xre_createappdata () a: when you <tt>--disable-libxul</tt>, the xpcom glue doesn't have in
formation about how to load all the dependent libraries like <tt>libgfx.dylib</tt>. in order to use xr ...
XForms Group Element - Archive of obsolete content
introduction the group element is used as a container for defining a hierarchy of
form controls. groups can be nested to create complex hierarchies. attributes single-node binding type restrictions the group element can be bound to a node containing data of any type. actually, the group element doesn't interact with the data in the bound node. however, having a relevant model item property on the bound node has an effect on a group. all content elements (e.g. core
form controls, groups, switches, repeats and host language content) within a non-relevant group are handled as non-relevant. if a group is non-relevant, then the rendering approach used to signify non-relevance is applied to the entire content of the group. representations the group element doesn't have visual presentatio...
XForms Help Element - Archive of obsolete content
introduction specifies contextual help for the containing
form control (see the spec). the help message will be displayed if the f1 key is pressed while the containing
form control has focus or if the containing
form control recieves a x
forms-help event. the message of the help element can exist in instance data, in a remote document, or as inline text. if more than one source of message is specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text. attributes single-node binding linking src - url of a document whose contents will be retrieved by the help element and used to provide a help message for the containing
form control. type restrictions the help element can be bound to any simple content. representations is ...
XForms Hint Element - Archive of obsolete content
introduction similar to a tooltip (see the spec). the hint is displayed when the mouse moves and pauses over the containing
form control. the hint will also be displayed if the containing
form control recieves a x
forms-hint event. the message of the hint element can exist in instance data, in a remote document, or as inline text. if more than one source of message is specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text. attributes single-node binding linking src - url of a document whose contents will be retrieved by the hint element and used to provide hint text for the containing
form control. type restrictions the hint element can be bound to any simple content. representations is represented by a tooltip wind...
XForms Textarea Element - Archive of obsolete content
the spec). attributes ui common appearance - isn't supported. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special inputmode - isn't supported. incremental - supported. the default value is false. type restrictions the textarea element can be bound to a node of type xsd:string or any type derived from it. representations the x
forms textarea element is represented by a multiline text field (xhtml/xul). characteristics analogous widgets are <xhtml:textarea/> and <xul:textbox multiline="true"/> if the incremental attribute has the value true, then the bound instance node is updated on every user input. ...
XForms Config Variables - Archive of obsolete content
a description of the about:config preferences that x
forms uses. preference default description x
forms.disablepopup false disables x
forms engine popup error messages x
forms.enableexperimentalfeatures false enable experimental features. for now it only enables the x
forms 1.1 soap action feature, and only on trunk. ...
omni.ja (formerly omni.jar)
this article covers the contents of the archive and techniques for inspecting those contents. note: starting with firefox 10 and thunderbird 10, the file extension .ja is used because windows system restore does not back up files with the .jar extension, but it does back up .ja files. this change was needed to prevent firefox from becoming corrupted. inspecting and repacking omni.ja note: when extracting omni.ja, you may incorrectly get false warnings from some virus protection software. ...
Accessibility Information for Core Gecko Developers
tive markup to describe the behavior of custom widgets such as menus and tree views. these widgets are often not even keyboard focusable, and assistive technologies do not understand these widgets. this document shows several interactive desktop-style widgets that are accessible by keyboards and assistive technologies, and outlines a plan being developed by ibm, mozilla, and the wai protocols and
formats working group (pfwg) to address the issue of dhtml accessibility. mozilla accessibility architecture this document explains how we implement the cross-plat
form accessibility layer in mozilla. it contains a class hierararchy and an explanation of the accessibility cache. unix accessibility project this document describes the sun accessibility project. join the mozilla accessibilit...
Information for Assistive Technology Vendors
please read this page if you're interested in an alternative accessible browser. keyboard documentation this lists mozilla's keyboard docs in a single long document. gecko info for windows accessibility vendors mozilla supports msaa (microsoft active accessibility) in html and in our user interface (based on xul technology). this makes it possible for the vendors of windows accessibility software, such as screen readers, voice dictation packages and screen magnifiers to provide support for mozilla. ...
Information for External Developers Dealing with Accessibility
a document for developers who need to support microsoft active accessibility (msaa) in a desktop application, in order to make it accessible with 3rd party assistive technologies, containing practical tips and the details of mozilla's implementation. accessibility api cross reference should be helpful at anyone looking at implementing accessibility api support for a product on multiple plat
forms. contains info on accessible roles, states and events. accessible toolkit checklist a list of what needs to be done for accessibility when building new toolkits, widget by widget. in addition, here is a list of official keyboard ui guidelines for each desktop: windows keys: guidelines on keyboard ui design and on implementing keyboard shortcuts: an excellent resource from micros...
browser.urlbar.formatting.enabled
type:boolean default value: true exists by default: yes application support:firefox 6.0 status: active; last updated 2012-04-03 introduction: pushed to nightly on 2011-05-03 bugs: bug 451833 values true (default) the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey. ...
Performance Hints
ar i=0; i < a.length; i++) result += a[i]; return result; } this is not equivalent code because the second version does not modify global variables result and i. however, if you don't intend for any other function to access these variables, then storing them globally is probably wrong anyway (what if you called another function that had a loop like the one in sum!). arrays use the
forms of the array constructor that specify a size or take a list of initial elements. for example, the code var a = new array(); for (var i=0; i < n; i++) a[i] = i; could be sped up by changing the constructor call to new array(n). a constructor call like that indicates to the runtime that a javascript array should be used for the first n entries of the array. similarly, new array("a", "b",...
Performance Analysis - Firefox Developer Tools
(alternatively, if you have only just opened the network monitor, so it's not yet populated with the list of requests, you'll get a stopwatch icon in the main window.) the network monitor then loads the site twice: once with an empty browser cache, and once with a primed browser cache. this simulates the first time a user visits your site, and subsequent visits. ...
Body.formData() - Web APIs
the
formdata() method of the body mixin takes a response stream and reads it to completion. it returns a promise that resolves with a
formdata object. note: this is mainly relevant to service workers. if a user submits a
form and a service worker intercepts the request, you could for example call
formdata() on it to obtain a key-value map, modify some fields, then send the
form onwards to the server (or use it locally). syntax response.
formdata() .then(function(
formdata) { // do something with your
formdata }); parameters none. return value a promise that resolves with a
formdata object. example tbd. specifications specification status comment fetchthe definition of '
formdata()' in that specification. living standard ...
FormData.delete() - Web APIs
the delete() method of the
formdata interface deletes a key and its value(s) from a
formdata object. note: this method is available in web workers. syntax
formdata.delete(name); parameters name the name of the key you want to delete. returns void. example the following line creates an empty
formdata object and prepopulates it with key/value pairs from a
form: var
formdata = new
formdata(my
form); you can delete keys and their values using delete():
formdata.delete('username'); specifications specification status comment xmlhttprequestthe definition of 'delete()' in that specification. living standard ...
FormData.entries() - Web APIs
the
formdata.entries() method returns an iterator allowing to go through all key/value pairs contained in this object. the key of each pair is a usvstring object; the value either a usvstring, or a blob. note: this method is available in web workers. syntax
formdata.entries(); return value returns an iterator. example // create a test
formdata object var
formdata = new
formdata();
formdata.append('key1', 'value1');
formdata.append('key2', 'value2'); // display the key/value pairs for(var pair of
formdata.entries()) { console.log(pair[0]+ ', '+ pair[1]); } the result is: key1, value1 key2, value2 specifications specification status comment xmlhttprequestthe definition of 'entries() (as iterator<>)' in that specification. living standard initial d...
FormData.keys() - Web APIs
the
formdata.keys() method returns an iterator allowing to go through all keys contained in this object. the keys are usvstring objects. note: this method is available in web workers. syntax
formdata.keys(); return value returns an iterator. example // create a test
formdata object var
formdata = new
formdata();
formdata.append('key1', 'value1');
formdata.append('key2', 'value2'); // display the keys for (var key of
formdata.keys()) { console.log(key); } the result is: key1 key2 specifications specification status comment xmlhttprequestthe definition of 'keys() (as iterator<>)' in that specification. living standard initial definition ...
FormData.values() - Web APIs
the
formdata.values() method returns an iterator allowing to go through all values contained in this object. the values are usvstring or blob objects. note: this method is available in web workers. syntax
formdata.values(); return value returns an iterator. example // create a test
formdata object var
formdata = new
formdata();
formdata.append('key1', 'value1');
formdata.append('key2', 'value2'); // display the values for (var value of
formdata.values()) { console.log(value); } the result is: value1 value2 specifications specification status comment xmlhttprequestthe definition of 'values() (as iterator<>)' in that specification. living standard initial definition ...
FormDataEntryValue - Web APIs
a string or file that represents a single value from a set of
formdata key-value pairs. this type is returned by the
formdata.get() and
formdata.getall() methods. the
formdata.get() method returns a single value while
formdata.getall() returns an array of
formdataentryvalues. note that the
formdata.append() and
formdata.set() methods allow passing a blob value, which is converted to a file in the process. ...
HTMLFormElement.acceptCharset - Web APIs
the html
formelement.acceptcharset property represents a list of the supported character encodings for the given <
form> element. this list can be comma-separated or space-separated. syntax var string =
form.acceptcharset;
form.acceptcharset = string; example inputs = document.
forms['my
form'].acceptcharset; specifications specification status comment html living standardthe definition of 'html
formelement: acceptcharset' in that specification. living standard ...
HTMLFormElement.action - Web APIs
the html
formelement.action property represents the action of the <
form> element. the action of a
form is the program that is executed on the server when the
form is submitted. this property can be retrieved or set. syntax var string =
form.action;
form.action = string; example
form.action = '/cgi-bin/publish'; specifications specification status comment html living standardthe definition of 'html
formelement: action' in that specification. living standard ...
HTMLFormElement.enctype - Web APIs
the html
formelement.enctype property is the mime type of content that is used to submit the
form to the server. possible values are: application/x-www-
form-urlencoded: the initial default type. multipart/
form-data: the type that allows file <input> element(s) to upload file data. text/plain: a type introduced in html5. this value can be overridden by a
formenctype attribute on a <button> or <input> element. syntax var string =
form.enctype;
form.enctype = string; example
form.enctype = 'application/x-www-
form-urlencoded'; specifications specification status comment html living standardthe definition of 'html
formelement: enctype' in that specification. living standard ...
HTMLFormElement.method - Web APIs
the html
formelement.method property represents the http method used to submit the <
form>. unless explicitly specified, the default method is 'get'. syntax var string =
form.method;
form.method = string; example document.
forms['my
form'].method = 'post'; const
formelement = document.createelement("
form"); // create a
form document.body.appendchild(
formelement); console.log(
formelement.method); // 'get' specifications specification status comment html living standardthe definition of 'html
formelement: method' in that specification. living standard ...
HTMLFormElement.name - Web APIs
the html
formelement.name property represents the name of the current <
form> element as a string. if your <
form> element contains an element named name then that element overrides the
form.name property, so that you can't access it. internet explorer (ie) does not allow the name attribute of an element created using createelement() to be set or modified using the name property. syntax var string =
form.name;
form.name = string; example var
form1name = document.getelementbyid('
form1').name; if (
form1name != document.
form.
form1) { // browser doesn't support this
form of reference } specifications specification status comment html living standardthe definition of 'html
formelement: name' in that specification. living standard ...
HTMLFormElement.reportValidity() - Web APIs
the html
formelement.reportvalidity() method returns true if the element's child controls satisfy their validation constraints. when false is returned, cancelable invalid events are fired for each invalid child and validation problems are reported to the user. syntax html
formelement.reportvalidity() return value boolean example document.
forms['my
form'].addeventlistener('submit', function() { document.
forms['my
form'].reportvalidity(); }, false); specifications specification status comment html living standardthe definition of 'html
formelement.reportvalidity()' in that specification. living standard html 5.1the definition of 'html
formelement.reportvalidity()' in that specification. recommendation initial definition ...
HTMLFormElement.reset() - Web APIs
the html
formelement.reset() method restores a
form element's default values. this method does the same thing as clicking the
form's reset button. if a
form control (such as a reset button) has a name or id of reset it will mask the
form's reset method. it does not reset other attributes in the input, such as disabled. syntax html
formelement.reset() example document.getelementbyid('my
form').reset(); specifications specification status comment html living standardthe definition of 'html
formelement: reset' in that specification. living standard ...
HTMLFormElement.target - Web APIs
the target property of the html
formelement interface represents the target of the
form's action (i.e., the frame in which to render its output). syntax string = html
formelement.target html
formelement.target = string example my
form.target = document.frames[1].name; specifications specification status comment html living standardthe definition of 'html
formelement: target' in that specification. living standard ...
HTMLLabelElement.form - Web APIs
the read-only htmllabelelement.
form property returns an html
formelement object which represents the
form of which the label's associated control is a part, or null if there is either no associated control, or if that control isn't in a
form. this property is just a shortcut for htmllabelelement.control.
form. syntax
form = htmllabelelement.
form value an html
formelement which represents the
form with which the label's control is associated. if control is null (meaning the label isn't associated with a control), or if the control isn't part of a
form, this property returns null. specifications specification status comment html living standardthe definition of '
form' in that specification. living standard initial definition ...
NetworkInformation.effectiveType - Web APIs
the effectivetype read-only property of the networkin
formation interface returns the effective type of the connection meaning one of 'slow-2g', '2g', '3g', or '4g'. this value is determined using a combination of recently observed, round-trip time and downlink values. syntax var effectivetype = networkin
formation.effectivetype value a string containing one of 'slow-2g', '2g', '3g', or '4g'. specifications specification status comment network in
formation apithe definition of 'effectivetype' in that specification. draft initial definition. ...
NetworkInformation.onchange - Web APIs
the networkin
formation.onchange event handler contains the code that is fired when connection in
formation changes, and the change is received by the networkin
formation object. syntax netinfo.onchange = function() { ... } examples // get the connection type. var type = navigator.connection.type; function changehandler(e) { // handle change of connection type here. } // register for event changes: navigator.connection.onchange = changehandler; // another way: navigator.connection.addeventlistener('change', changehandler); specifications specification status comment network in
formation apithe definition of 'onchange' in that specification. draft initial definition ...
NetworkInformation.rtt - Web APIs
the networkin
formation.rtt read-only property returns the estimated effective round-trip time of the current connection, rounded to the nearest multiple of 25 milliseconds. this value is based on recently observed application-layer rtt measurements across recently active connections. it excludes connections made to a private address space. if no recent measurement data is available, the value is based on the properties of the underlying connection technology. note: this feature is available in web workers. syntax rtt = networkin
formation.rtt return value a number. specifications specification status comment network in
formation apithe definition of 'rtt' in that specification. draft initial definition ...
PerformanceNavigationTiming.redirectCount - Web APIs
context. this property is read only . syntax perfentry.redirectcount; return value a number representing the number of redirects since the last non-redirect navigation under the current browsing context. example the following example illustrates this property's usage. ...
PerformanceNavigationTiming.unloadEventEnd - Web APIs
perty value is 0. syntax perfentry.unloadeventend; return value a timestamp representing a time value equal to the time immediately after the user agent finishes the unload event of the previous document. example the following example illustrates this property's usage. ...
PerformanceNavigationTiming.unloadEventStart - Web APIs
rty returns 0. syntax perfentry.unloadeventstart; return value a timestamp representing the time value equal to the time immediately before the user agent starts the unload event of the previous document. example the following example illustrates this property's usage. ...
PerformanceResourceTiming.serverTiming - Web APIs
the servertiming read-only property returns an array of per
formanceservertiming entries containing server timing metrics. syntax resource.servertiming; specifications specification status comment server timingthe definition of 'servertiming' in that specification. working draft initial definition. ...
PerformanceServerTiming.toJSON - Web APIs
return value a domstring containing json. exceptions none. specifications specification status comment server timingthe definition of 'tojson' in that specification. ...
PerformanceTiming.domComplete - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.domcomplete read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the parser finished its work on the main document, that is when its document.readystate changes to 'complete' and the corresponding readystatechange event is thrown. syntax time = per
formancetiming.domcomplete; specifications specification status comment navigation timingthe definition of 'per
formancetiming.domcomplete' in that specification. recommendation initial definition. ...
PerformanceTiming.domContentLoadedEventEnd - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.domcontentloadedeventend read-only property returns an unsigned long long representing the moment, in milliseconds since the unix epoch, right after all the scripts that need to be executed as soon as possible, in order or not, has been executed. syntax time = per
formancetiming.domcontentloadedeventend; specifications specification status comment navigation timingthe definition of 'per
formancetiming.domcontentloadedeventend' in that specification. recommendation initial definition. ...
PerformanceTiming.domContentLoadedEventStart - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.domcontentloadedeventstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, right before the parser sent the domcontentloaded event, that is right after all the scripts that need to be executed right after parsing has been executed. syntax time = per
formancetiming.domcontentloadedeventstart; specifications specification status comment navigation timingthe definition of 'per
formancetiming.domcontentloadedeventstart' in that specification. recommendation initial definition. ...
PerformanceTiming.domLoading - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.domloading read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the parser started its work, that is when its document.readystate changes to 'loading' and the corresponding readystatechange event is thrown. syntax time = per
formancetiming.domloading; specifications specification status comment navigation timingthe definition of 'per
formancetiming.domloading' in that specification. recommendation initial definition. ...
PerformanceTiming.domainLookupEnd - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.domainlookupend read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the domain lookup is finished. if a persistent connection is used, or the in
formation is stored in a cache or a local resource, the value will be the same as per
formancetiming.fetchstart. syntax time = per
formancetiming.domainlookupend; specifications specification status comment navigation timingthe definition of 'per
formancetiming.domainlookupend' in that specification. recommendation initial definition. ...
PerformanceTiming.domainLookupStart - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.domainlookupstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the domain lookup starts. if a persistent connection is used, or the in
formation is stored in a cache or a local resource, the value will be the same as per
formancetiming.fetchstart. syntax time = per
formancetiming.domainlookupstart; specifications specification status comment navigation timingthe definition of 'per
formancetiming.domainlookupstart' in that specification. recommendation initial definition. ...
PerformanceTiming.fetchStart - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.fetchstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, the browser is ready to fetch the document using an http request. this moment is before the check to any application cache. syntax time = per
formance.timing.fetchstart; specifications specification status comment navigation timingthe definition of 'per
formancetiming.fetchstart' in that specification. recommendation initial definition. ...
PerformanceTiming.loadEventEnd - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface's per
formancenavigationtiming.loadeventend read-only property instead. the legacy per
formancetiming.loadeventend read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the load event handler terminated, that is when the load event is completed. if this event has not yet been sent, or is not yet completed, it returns 0. syntax time = per
formancetiming.loadeventend; specifications specification status comment navigation timingthe definition of 'per
formancetiming.loadeventend' in that specification. recommendation initial definition. ...
PerformanceTiming.loadEventStart - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface's per
formancenavigationtiming.loadeventstart read-only property instead.. the legacy per
formancetiming.loadeventstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the load event was sent for the current document. if this event has not yet been sent, it returns 0. syntax time = per
formancetiming.loadeventstart; specifications specification status comment navigation timingthe definition of 'per
formancetiming.loadeventstart' in that specification. recommendation initial definition. ...
PerformanceTiming.navigationStart - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.navigationstart read-only property returns an unsigned long long representing the moment, in milliseconds since the unix epoch, right after the prompt for unload terminates on the previous document in the same browsing context. if there is no previous document, this value will be the same as per
formancetiming.fetchstart. syntax time = per
formancetiming.navigationstart; specifications specification status comment navigation timingthe definition of 'per
formancetiming.navigationstart' in that specification. recommendation initial definition. ...
PerformanceTiming.redirectEnd - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.redirectend read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, the last http redirect is completed, that is when the last byte of the http response has been received. if there is no redirect, or if one of the redirect is not of the same origin, the value returned is 0. syntax time = per
formancetiming.redirectend; specifications specification status comment navigation timingthe definition of 'per
formancetiming.redirectend' in that specification. recommendation initial definition. ...
PerformanceTiming.redirectStart - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.redirectstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, the first http redirect starts. if there is no redirect, or if one of the redirect is not of the same origin, the value returned is 0. syntax time = per
formancetiming.redirectstart; specifications specification status comment navigation timingthe definition of 'per
formancetiming.redirectstart' in that specification. recommendation initial definition. ...
PerformanceTiming.requestStart - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.requeststart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the browser sent the request to obtain the actual document, from the server or from a cache. if the transport layer fails after the start of the request and the connection is reopened, this property will be set to the time corresponding to the new request. syntax time = per
formancetiming.requeststart; specifications specification status comment navigation timingthe definition of 'per
formancetiming.requeststart' in that specification. recommendation ...
PerformanceTiming.responseEnd - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.responseend read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the browser received the last byte of the response, or when the connection is closed if this happened first, from the server from a cache or from a local resource. syntax time = per
formancetiming.responseend; specifications specification status comment navigation timingthe definition of 'per
formancetiming.responseend' in that specification. recommendation initial definition. ...
PerformanceTiming.responseStart - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.responsestart read-only property returns an unsigned long long representing the moment in time (in milliseconds since the unix epoch) when the browser received the first byte of the response from the server, cache, or local resource. syntax time = per
formancetiming.responsestart; specifications specification status comment navigation timingthe definition of 'per
formancetiming.responsestart' in that specification. recommendation initial definition. ...
PerformanceTiming.secureConnectionStart - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.secureconnectionstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the secure connection handshake starts. if no such connection is requested, it returns 0. syntax time = per
formancetiming.secureconnectionstart; specifications specification status comment navigation timingthe definition of 'per
formancetiming.secureconnectionstart' in that specification. recommendation initial definition. ...
PerformanceTiming.unloadEventEnd - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.unloadeventend read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, the unload event handler finishes. if there is no previous document, or if the previous document, or one of the needed redirects, is not of the same origin, the value returned is 0. syntax time = per
formancetiming.unloadeventend; specifications specification status comment navigation timingthe definition of 'per
formancetiming.unloadeventend' in that specification. recommendation initial definition. ...
PerformanceTiming.unloadEventStart - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the per
formancenavigationtiming interface instead. the legacy per
formancetiming.unloadeventstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, the unload event has been thrown. if there is no previous document, or if the previous document, or one of the needed redirects, is not of the same origin, the value returned is 0. syntax time = per
formancetiming.unloadeventstart; specifications specification status comment navigation timingthe definition of 'per
formancetiming.unloadeventstart' in that specification. recommendation initial definition. ...
WebGL2RenderingContext.createTransformFeedback() - Web APIs
the webgl2renderingcontext.createtrans
formfeedback() method of the webgl 2 api creates and initializes webgltrans
formfeedback objects. syntax webgltrans
formfeedback gl.createtrans
formfeedback(); parameters none. return value a webgltrans
formfeedback object. examples gl must be a webgl2renderingcontext. webgltrans
formfeedback objects are not available in webgl 1. var trans
formfeedback = gl.createtrans
formfeedback(); specifications specification status comment webgl 2.0the definition of 'createtrans
formfeedback' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgentrans
formfeedbacks' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.endTransformFeedback() - Web APIs
the webgl2renderingcontext.endtrans
formfeedback() method of the webgl 2 api ends a trans
form feedback operation. syntax void gl.endtrans
formfeedback(); parameters none. return value none. examples var trans
formfeedback = gl.createtrans
formfeedback(); gl.bindtrans
formfeedback(gl.trans
form_feedback, trans
formfeedback); gl.begintrans
formfeedback(gl.triangles); gl.drawarrays(gl.triangles, 0, 3); gl.endtrans
formfeedback(); specifications specification status comment webgl 2.0the definition of 'endtrans
formfeedback' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glendtrans
formfeedback' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getTransformFeedbackVarying() - Web APIs
the webgl2renderingcontext.gettrans
formfeedbackvarying() method of the webgl 2 api returns in
formation about varying variables from webgltrans
formfeedback buffers. syntax webglactiveinfo gl.gettrans
formfeedbackvarying(program, index); parameters program a webglprogram. index a gluint specifying the index of the varying variable whose in
formation to retrieve. return value a webglactiveinfo object. examples activeinfo = gl.gettrans
formfeedbackvarying(program, 0); specifications specification status comment webgl 2.0the definition of 'gettrans
formfeedbackvarying' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glgettrans
formfeedbackvarying' in that specification. standard ...
WebGL2RenderingContext.pauseTransformFeedback() - Web APIs
the webgl2renderingcontext.pausetrans
formfeedback() method of the webgl 2 api pauses a trans
form feedback operation. syntax void gl.pausetrans
formfeedback(); parameters none. return value none. examples var trans
formfeedback = gl.createtrans
formfeedback(); gl.bindtrans
formfeedback(gl.trans
form_feedback, trans
formfeedback); gl.begintrans
formfeedback(gl.triangles); gl.pausetrans
formfeedback(); //... gl.resumetrans
formfeedback(); gl.drawarrays(gl.triangles, 0, 3); gl.endtrans
formfeedback(); specifications specification status comment webgl 2.0the definition of 'pausetrans
formfeedback' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glpausetrans
formfeedback' in that specification. s...
WebGLShaderPrecisionFormat.precision - Web APIs
the read-only webglshaderprecision
format.precision property returns the number of bits of precision that can be represented. for integer
formats this value is always 0. examples var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.getshaderprecision
format(gl.vertex_shader, gl.medium_float).precision; // 23 gl.getshaderprecision
format(gl.fragment_shader, gl.low_int).precision; // 0 specifications specification status comment webgl 1.0the definition of 'webglshaderprecision
format.precision' in that specification. recommendation initial definition. ...
WebGLShaderPrecisionFormat.rangeMax - Web APIs
the read-only webglshaderprecision
format.rangemax property returns the base 2 log of the absolute value of the maximum value that can be represented. examples var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.getshaderprecision
format(gl.vertex_shader, gl.medium_float).rangemax; // 127 gl.getshaderprecision
format(gl.fragment_shader, gl.low_int).rangemax; // 24 specifications specification status comment webgl 1.0the definition of 'webglshaderprecision
format.rangemax' in that specification. recommendation initial definition. ...
WebGLShaderPrecisionFormat.rangeMin - Web APIs
the read-only webglshaderprecision
format.rangemin property returns the base 2 log of the absolute value of the minimum value that can be represented. examples var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.getshaderprecision
format(gl.vertex_shader, gl.medium_float).rangemin; // 127 gl.getshaderprecision
format(gl.fragment_shader, gl.low_int).rangemin; // 24 specifications specification status comment webgl 1.0the definition of 'webglshaderprecision
format.rangemin' in that specification. recommendation initial definition. ...
WebGLUniformLocation - Web APIs
the webgluni
formlocation interface is part of the webgl api and represents the location of a uni
form variable in a shader program. description the webgluni
formlocation object does not define any methods or properties of its own and its content is not directly accessible. when working with webgluni
formlocation objects, the following methods of the webglrenderingcontext are useful: webglrenderingcontext.getuni
formlocation() webglrenderingcontext.uni
form() examples getting an uni
form location var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var location = gl.getuni
formlocation(webglprogram, 'uni
formname'); specifications specification status comment webgl 1.0the definition of 'webgluni
formlocation' in that specification. ...
Window.performance - Web APIs
the window interface's per
formance property returns a per
formance object, which can be used to gather per
formance in
formation about the current document. it serves as the point of exposure for the per
formance timeline api, the high resolution time api, the navigation timing api, the user timing api, and the resource timing api. syntax per
formancedata = window.per
formance; value a per
formance object offering access to the per
formance and timing-related in
formation offered by the apis it exposes. specifications specification status comment high resolution timethe definition of 'window.per
formance' in that specification. recommendation defines now() method. ...
CSS Transforms - CSS: Cascading Style Sheets
css trans
forms is a module of css that defines how elements styled with css can be trans
formed in two-dimensional or three-dimensional space. reference properties backface-visibility perspective perspective-origin rotate scale trans
form trans
form-box trans
form-origin trans
form-style translate data types <trans
form-function> guides using css trans
forms step-by-step tutorial about how to trans
form elements styled with css. specifications specification status comment css trans
forms level 1 working draft initial definition. css trans
forms level 2 editor's draft adds individual trans
forms. ...
Optimization and performance - Developer guides
when building modern web apps and sites, it's important to make your content per
form well. that is, to make it work quickly and efficiently. this lets it work effectively both for users of powerful desktop systems as well as for handheld devices with less power. there are several tools available to check the per
formance of a website or blog. the most notable tools are listed below. google pagespeed insights lighthouse webpagetest browser developer tools the above resources also include web per
formance best practices. making web per
formance a priority by considering web per
formance throughout the development process is important in ensuring users get the best user experience possible. there are no subpages at this time. ...
<style>: The Style Information element - HTML: Hypertext Markup Language
it contains css, which is applied to the contents of the document containing the <style> element. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the <style> element must be included inside the <head> of the document. in general, it is better to put your styles in external stylesheets and apply them using <link> elements. ...
x-ms-format-detection - HTML: Hypertext Markup Language
the x-ms-
format-detection attribute determines whether data
formats within the element’s text, like phone numbers, are automatically converted to followable links. existing links, such as ones with the tel: scheme, are unaffected. links created through
format detection do not appear in the dom. this proprietary property is specific to internet explorer and microsoft edge. syntax <html x-ms-
format-detection="none"> value all all supported data
formats are detected. none
format detection is turned off. phone phone number patterns are autolinked. ...
MathML: Deriving the Quadratic Formula - MathML
this page outlines the derivation of the quadratic
formula. we take a quadratic equation in its general
form, and solve for x: a x 2 + b x + c = 0 a x 2 + b x = - c x 2 + b a x = -c a divide out leading coefficient. x 2 + b a x + b 2 a 2 = - c ( 4 a ) a ( 4 a ) + b 2 4 a 2 complete the square. ( x + b 2 a ) ( x + b 2 a ) = b 2 - 4 a c 4 a 2 discriminant revealed. ( x + b 2 a ) 2 = b 2 - 4 a c 4 a 2 x + b 2 a = b 2 - 4 a c 4 a 2 x = -b 2 a ±{c} b 2 - 4 a c 4 a 2 there's the vertex
formula. x = - b ±{c} b 2 - 4 a c 2 a ...
Lazy loading - Web Performance
n't render any processed content until the cssom is constructed. css must be thin, delivered as quickly as possible, and the usage media types and queries are advised to unblock rendering. <link href="style.css" rel="stylesheet" media="all"> <link href="portrait.css" rel="stylesheet" media="orientation:portrait"> <link href="print.css" rel="stylesheet" media="print"> it is possible to per
form some css optimizations to achieve that. fonts by default, font requests are delayed until the render tree is constructed, which can result in delayed text rendering. it is possible to override the default behaviour and preload web font resources using <link rel="preload">, the css font-display property, and the font loading api. see also: element link images and iframes very often, webpa...
arabic-form - SVG: Scalable Vector Graphics
the arabic-
form attribute indicates which of the four possible
forms an arabic glyph represents. only one element is using this attribute: <glyph> context notes value initial | medial | terminal | isolated default value isolated animatable no initial this value indicates that the glyph represents the initial
form. medial this value indicates that the glyph represents the medial
form. terminal this value indicates that the glyph represents the terminal
form. isolated this value indicates that the glyph represents the isolated
form. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'arabic-
form' in that specification. recommendation initial ...
<font-face-format> - SVG: Scalable Vector Graphics
the <font-face-
format> svg element describes the type of font referenced by its parent <font-face-uri>. usage context categoriesfont elementpermitted contentempty attributes global attributes core attributes specific attributes string dom interface this element implements the svgfontface
formatelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of '<font-face-
format>' in that specification. recommendation initial definition ...
Information Security Basics - Web security
a basic understanding of in
formation security can help you avoid unnecessarily leaving your software and sites insecure and vulnerable to weaknesses that can be exploited for financial gain or other malicious reasons. these articles can help you learn what you need to know. with this in
formation, you can be aware of the role and importance of security throughout the web development cycle and beyond into deployment of your content. confidentiality, integrity, and availability describes the primary security objectives, which are absolutely fundamental to understanding security security controls defines major categories of security controls and discusses their potential disadvantages tcp/ip security an overview of the tcp/ip model, ...
format-number - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the
format-number function evaluates a number and returns a string representing the number in a given
format. syntax
format-number(number ,pattern [,decimal-
format] ) arguments number the number to be
formatted pattern a string in the
format of the jdk 1.1 decimal
format class. (the documentation for jdk 1.1 is not available online. here is the java se 6 decimal
format.) decimal-
format (optional) the name of an xsl:decimal-
format element that defines the number
format to be used. if omitted, the default decimal-
format will be used. returns a string representing the number in the new
format. notes this function is an xslt-specific addition to xpath. it is not a part of the co...
Common XSLT Errors - XSLT: Extensible Stylesheet Language Transformations
s to send both the source and the stylesheet with a xml mime type, text/xml or application/xml. to find out the current type, load the file in mozilla and look at the page info. or use a download tool, those usually tell the mime type. in firefox 6 and forward, you can also use the official xslt mimetype: application/xslt+xml. namespace the xslt 1.0 namespace is http://www.w3.org/1999/xsl/trans
form. older versions of ie used a different namespace. however these versions also used a draft version of xslt which is incompatible with what eventually became the xslt 1.0 specification. firefox only supports the official xslt 1.0 version. missing features there are some features in the xslt 1.0 specification which firefox unfortunately does not yet support. specifically: the namespace:: axis ...
<xsl:attribute-set> - XSLT: Extensible Stylesheet Language Transformations
quired attributes name specifies the name of the attribute set. the name must be a valid qname. optional attributes use-attribute-sets builds an attribute set from other attribute sets. the names of the contributing sets must be separated with whitespace characters and must not directly or indirectly embed themselves. type top-level, must be the child of <xsl:stylesheet> or <xsl:trans
form>. defined xslt, section 7.1.4. gecko support supported. ...
<xsl:import> - XSLT: Extensible Stylesheet Language Transformations
stylesheet. this is in contrast to <xsl:include> where the contents of the included stylesheet have exactly the same precedence as the contents of the including stylesheet. syntax <xsl:import href=uri /> required attributes href specifies the uri of the stylesheet to import. optional attributes none. type top-level, must appear before any other child of <xsl:stylesheet> or <xsl:trans
form> in the importing stylesheet. defined xslt, section 2.6.2. gecko support mostly supported with a few issues with top level variables and parameters as of mozilla 1.0. ...
Index - Web APIs
nsor, sensor apis, sensors, illuminance the illuminance property of the ambientlightsensor interface returns the current light level in lux of the ambient light level around the hosting device. 51 analysernode api, analysernode, interface, reference, web audio api the analysernode interface represents a node able to provide real-time frequency and time-domain analysis in
formation. it is an audionode that passes the audio stream unchanged from the input to the output, but allows you to take the generated data, process it, and create audio visualizations. 52 analysernode.analysernode() api, analysernode, audio, constructor, media, reference, web audio api the analysernode constructor of the web audio api creates a new analysernode object instance. ...
...audio, constructor, media, reference, web audio api the analysernode constructor of the web audio api creates a new analysernode object instance. 53 analysernode.fftsize api, analysernode, property, reference, web audio api, fftsize the fftsize property of the analysernode interface is an unsigned long value and represents the window size in samples that is used when per
forming a fast fourier trans
form (fft) to get frequency domain data. 54 analysernode.frequencybincount api, analysernode, property, reference, web audio api, frequencybincount the frequencybincount read-only property of the analysernode interface is an unsigned integer half that of the analysernode.fftsize. this generally equates to the number of data values you will have to play ...
...ence(2), web audio api the getbytefrequencydata() method of the analysernode interface copies the current frequency data into a uint8array (unsigned byte array) passed into it. 56 analysernode.getbytetimedomaindata() api, analysernode, method, reference, référence(2), web audio api the getbytetimedomaindata() method of the analysernode interface copies the current wave
form, or time-domain, data into a uint8array (unsigned byte array) passed into it. 57 analysernode.getfloatfrequencydata() api, analysernode, method, reference, référence(2), web audio api the getfloatfrequencydata() method of the analysernode interface copies the current frequency data into a float32array array passed into it. 58 analysernode.getfloattimedomaindata()...
...And 598 more matches
Index - Archive of obsolete content
perhaps your target audience is people that are using older hardware, for example, and can't upgrade to the latest and greatest browsers. or for "reasons," your company is required to use very old software and you need to build web content that runs on that software. ...
...ent/core the event/core module allows the creation of apis to broadcast and subscribe to events. 83 event/target create objects that broadcast events. 84 frame/hidden-frame creates firefox frames (i.e. xul <iframe> elements) that are not displayed to the user. 85 frame/utils provides helper functions for working with plat
form internals like frames and browsers. 86 fs/path provides access to the local filesystem with the nodejs path module api. 87 io/byte-streams provides streams for reading and writing bytes. 88 io/file provides access to the local filesystem. 89 io/text-streams provides streams for reading and writing text. ...
...pts in them. 94 net/url no summary! 95 net/xhr provides access to xmlhttprequest functionality. 96 places/bookmarks create, modify, and retrieve bookmarks. 97 places/favicon helper functions for working with favicons. 98 places/history access the user's browsing history. 99 plat
form/xpcom implement xpcom objects, factories, and services. 100 preferences/event-target add-on sdk listen to changes to the preferences system in firefox. 101 preferences/service add-on sdk, jetpack, sdk access the preferences system in firefox. 102 remote/child module, reference, sdk enables an sdk module loaded into a child ...
...And 217 more matches
Index
applications built with nss can support ssl v3, tls, pkcs #5, pkcs #7, pkcs #11, pkcs #12, s/mime, x.509 v3 certificates, and other security standards. ...
... its own implementation of security protocols and cryptographic algorithms, originally called netscape security services, nowadays called network security services (nss). nss is a library written in the c programming language. it's free and open source software, and many other software projects have decided to use it. in order to support multiple operating systems (os), it is based on a cross plat
form portability layer, called the netscape portable runtime (nspr), which provides cross plat
form application programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreaded programming. nss offers lots of functionality; we'll walk through the list of modules, design principles, and important relevant standards. in order to...
...r), which provides cross plat
form application programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreaded programming. nss offers lots of functionality; we'll walk through the list of modules, design principles, and important relevant standards. in order to allow interoperability between software and devices that per
form cryptographic operations, nss con
forms to a standard called pkcs#11. (note that it's important to look at the number 11, as there are other pkcs standards with different numbers that define quite different topics.) a software or hardware module con
forming to the pkcs#11 standard implements an interface of c calls, which allow querying the characteristics and offered services of the module. mul...
...And 161 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
other metadata to html to cater to users of assistive technology. 7 arpa glossary, infrastructure .arpa (address and routing parameter area) is a top-level domain used for internet infrastructure purposes, especially reverse dns lookup (i.e., find the domain name for a given ip address). 8 ascii glossary, infrastructure ascii (american standard code for in
formation interchange) is one of the most popular coding method used by computers for converting letters, numbers, punctuation and control codes into digital
form. since 2007, utf-8 superseded it on the web. 9 atag atag, accessibility, authoring tool accessibility guidelines, glossary atag (authoring tool accessibility guidelines) is a w3c recommendation for building accessible-au...
... computer programming is a way to reduce complexity and allow efficient design and implementation in complex software systems. it hides the technical complexity of systems behind simpler apis. 11 accessibility accessibility, glossary web accessibility (a11y) refers to best practices for keeping a website usable despite physical and technical restrictions. web accessibility is
formally defined and discussed at the w3c through the web accessibility initiative (wai). 12 accessibility tree (aom) aom, accessibility, dom, glossary, reference the accessibility tree, or accessibility object model (aom), contains accessibility-related in
formation for most html elements. 13 adobe flash adobe, codingscripting, flash, glossary, infrastructure ...
...ser plug-in. 14 ajax ajax, codingscripting, glossary, infrastructure, l10n:priority ajax, which initially stood for asynchronous javascript and xml, is a programming practice of building complex, dynamic webpages using a technology known as xmlhttprequest. 15 algorithm codingscripting, glossary an algorithm is a self-contained series of instructions to per
form a function. 16 alignment container alignment container, css, glossary, alignment the alignment container is the rectangle that the alignment subject is aligned within. this is defined by the layout mode; it is usually the alignment subject’s containing block, and assumes the writing mode of the box establishing the containing block. 17 alignment subject align...
...And 141 more matches
Bytecode Descriptions
tack: ⇒ val push the 64-bit floating-point immediate operand as a doublevalue. if the operand is a nan, it must be the canonical nan (see js::detail::canonicalizenan). bigint operands: (uint32_t bigintindex) stack: ⇒ bigint push the bigint constant script->getbigint(bigintindex). string operands: (uint32_t atomindex) stack: ⇒ string push the string constant script->getatom(atomindex).
format: jof_atom symbol operands: (uint8_t symbol (the js::symbolcode of the symbol to use)) stack: ⇒ symbol push a well-known symbol. symbol must be in range for js::symbolcode. expressions unary operators void stack: val ⇒ undefined pop the top value on the stack, discard it, and push undefined. implements: the void operator, step 3. typeof, typeofexpr stack: val ⇒ (typeof val) the ...
...gname instruction! this is how we implement typeof step 2, making typeof nonexistingvariable return "undefined" instead of throwing a referenceerror. in a global scope: typeof x compiles to getgname "x"; typeof. typeof (0, x) compiles to getgname "x"; typeofexpr. emitting the same bytecode for these two expressions would be a bug. per spec, the latter throws a referenceerror if x doesn't exist.
format: jof_ic pos stack: val ⇒ (+val) the unary + operator. +val doesn't do any actual math. it just calls tonumber(val). the conversion can call .tostring()/.valueof() methods and can throw. the result on success is always a number. (per spec, unary - supports bigints, but unary + does not.)
format: jof_ic neg stack: val ⇒ (-val) the unary - operator. convert val to a numeric value, then p...
...). the conversion can call .tostring()/.valueof() methods and can throw. the result on success is always a number. (per spec, unary - supports bigints, but unary + does not.)
format: jof_ic neg stack: val ⇒ (-val) the unary - operator. convert val to a numeric value, then push -val. the conversion can call .tostring()/.valueof() methods and can throw. the result on success is always numeric.
format: jof_ic bitnot stack: val ⇒ (~val) the bitwise not operator (~). val is converted to an integer, then bitwise negated. the conversion can call .tostring()/.valueof() methods and can throw. the result on success is always an int32 or bigint value.
format: jof_ic not stack: val ⇒ (!val) the logical not operator (!). val is first converted with toboolean, then logically negated. the resu...
...And 103 more matches
Index
found 1275 pages: # page tags and summary 1 xpcom add-ons, extensions, landing, mozilla, xpcom xpcom is a cross plat
form component object model, similar to microsoft com. it has multiple language bindings, allowing xpcom components to be used and implemented in javascript, java, and python in addition to c++. 2 accessing the windows registry using xpcom add-ons, code snippets, extensions, needsclassification, windows registry when implementing windows-specific functionality, it is often useful to access the windows registry for in
formation about the environment or other installed programs. to this end, there exist xpcom interfaces to read and write registry data. this article will show you how to use the available interfaces in ...
...ucts. 3 aggregating the in-memory datasource rdf no summary! 4 binary compatibility xpcom if mozilla decides to upgrade to a compiler that does not have the same abi as the current version, any built component may fail. it is a possiblity that is introduced when upgrading to a new compiler without recompiling everything. effectively, it is a different plat
form. 5 bundling multiple binary components binary xpcom components are sometimes required to implement low-level features for extensions. since binary components are linked against a single gecko sdk, a dependency to a particular version of gecko is created. if the component uses only "frozen" xpcom interfaces, there is a good chance the same binary component will work with diff...
...s 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. add-ons can (and should) be identified with ids of the
form extensionname@organization.tld since firefox 1.5. 9 generic factory xpcom most xpcom factories can be very simple. rick potts wrote a templated-based generic factory (nsfactory<t>) that simplifies the factory creation process that just requires writing a createinstance() method. the new nsigenericfactory interface takes this a step further, by providing a single interface tha...
...And 93 more matches
HTML documentation index - HTML: Hypertext Markup Language
el" elements or "inline-level" elements. by default, a block-level element occupies the entire space of its parent element (container), thereby creating a "block." this article helps to explain what this means. 5 dash adaptive streaming for html 5 video guide, html, html5 dynamic adaptive streaming over http (dash) is an adaptive streaming protocol. 6 date and time
formats used in html date, element,
format, html, iso 8601, input, reference, string, time, week, datetime, datetime-local, del, ins, month, month-year, week-year certain html elements use date and/or time values. the
formats of the strings that specify these values are described in this article. 7 global attributes attribute, html, reference, web global attributes are a...
...g if the element should be editable by the user. if so, the browser modifies its widget to allow editing. 12 contextmenu deprecated, global attributes, html, reference, contextmenu the contextmenu global attribute is the id of a <menu> to use as the contextual menu for this element. 13 data-* global attributes, html, reference the data-* global attributes
form a class of attributes called custom data attributes, that allow proprietary in
formation to be exchanged between the html and its dom representation by scripts. 14 dir bidi, global attributes, html, reference the dir global attribute is an enumerated attribute that indicates the directionality of the element's text. 15 draggable global attributes, html, referenc...
... page that can't be used until the login process has been completed. 18 id global attributes, html, reference, web, id the id global attribute defines an identifier (id) which must be unique in the whole document. its purpose is to identify the element when linking (using a fragment identifier), scripting, or styling (with css). 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. 20 is global attributes, html, reference, is the is global attribute allows you to specify that a stand...
...And 79 more matches
Index - Learn web development
6 test your skills: css and javascript accessibility accessibility, assessment, beginner, html, jaavscript, learn, test your skills this aim of this skill test is to assess whether you've understood our css and javascript accessibility best practices article. 7 html: a good basis for accessibility at, accessibility, article, beginner, buttons, codingscripting,
forms, html, learn, links, a11y, assistive technology, keyboard, screenreader, semantics you should now be well-versed in writing accessible html for most occasions. our wai-aria basics article will help to fill gaps in this knowledge, but this article has taken care of the basics. next up we'll explore css and javascript, and how accessibility is affected by their good or bad use. 8 ...
..., test your skills this aim of this skill test is to assess whether you've understood our html: a good basis for accessibility article. 10 wai-aria basics aria, accessibility, article, beginner, codingscripting, guide, html, javascript, learn, wai-aria, semantics this article has by no means covered all that's available in wai-aria, but it should have given you enough in
formation to understand how to use it, and know some of the most common patterns you will encounter that require it. 11 test your skills: wai-aria accessibility, assessment, beginner, learn, wai-aria, test your skills this aim of this skill test is to assess whether you've understood our wai-aria basics article. 12 what is accessibility? at, accessibility, article, ...
...e times when you'll get stuck and feel frustrated — even professional web developers feel like this regularly — and it pays to know about the most effective ways to try and get help so you can progress in your work. this article provides some hints and tips in both of these areas that will help you get more out of learning web development, as well as further reading so you can find out more in
formation about each sub-topic should you wish.. 14 common questions codingscripting, infrastructure, learn, web, webmechanics this section of the learning area is designed to provide answers to common questions that may come up, which are not necessarily part of the structured core learning pathways (e.g. the html or css learning articles.) these articles are designed to work on ...
...And 77 more matches
sslfnc.html
if you are inclined to help with this migration, your help would be very much appreciated. upgraded documentation may be found in the current nss reference ssl functions chapter 4 ssl functions this chapter describes the core ssl functions. ssl initialization functions ssl export policy functions ssl configuration functions ssl communication functions ssl functions used by callbacks ssl handshake functions nss shutdown function deprecated functions ssl initialization functions this section describes the initialization functions that are specific to ssl. ...
...functions listed in ssl export policy functions must also be called during nss initialization. nss_init nss_initreadwrite nss_nodb_init ssl_optionsetdefault ssl_optiongetdefault ssl_cipherprefsetdefault ssl_cipherprefgetdefault ssl_clearsessioncache ssl_configserversessionidcache ssl_configmpserversidcache ssl_inheritmpserversidcache nss_init sets up configuration files and per
forms other tasks required to run network security services. database files are opened read-only. syntax #include "nss.h" secstatus nss_init(char *configdir); parameter this function has the following parameter: configdir a pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside. ...
...urns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to retrieve the error code. description nss_init opens the certn.db, keyn.db, and secmod.db files (wheren is a numeric digit) in the specified directory. nss_init isnot idempotent, so call it only once. nss_init opens the database files read-only. ...
...And 62 more matches
UI pseudo-classes - Learn web development
previous overview:
forms next in the previous articles, we covered the styling of various
form controls, in a general manner. this included some usage of pseudo-classes, for example using :checked to target a checkbox only when it is selected. in this article, we will explore in detail the different ui pseudo-classes available to us in modern browsers for styling
forms in different states. prerequisites: basic computer literacy, and a basic understanding of html and css, including general knowledge of pseudo-classes and pseudo-elements. objective: to understand what parts of
forms are hard to style, and why; to learn what can be done to customize them. what pseudo-classes do we have available? the original pseudo-classes available to us (as of ...
... :focus: selects an element only when it is focused (i.e. by being tabbed to via the keyboard). ...
...d (i.e. by being tabbed to via the keyboard). :active: selects an element only when it is being activated (i.e. while it is being clicked on, or when the return/enter key is being pressed down in the case of a keyboard activation). these basic pseudo-classes should be familiar to you now. ...
...And 53 more matches
Localization and Plurals
you're likely here because you're localizing a .properties file and it had a link to this page. this page is to help explain how to localize these strings so that the correct plural
form is shown to the user. for example, "1 page" vs "2 pages". if you're here to make your code (e.g., extensions) localizable for plural
forms, you can jump straight to developing with plural
form. you may also need to localize the initial strings for your code, so it would be good to read through at least the usage section as well. ...
... may also need to localize the initial strings for your code, so it would be good to read through at least the usage section as well. usage here are a couple terms used in this page to help keep things clear: plural rule: for a given language, there is a grammatical rule on how to change words, depending on the number qualifying the word. different languages can have different rules. ...
...de, so it would be good to read through at least the usage section as well. usage here are a couple terms used in this page to help keep things clear: plural rule: for a given language, there is a grammatical rule on how to change words, depending on the number qualifying the word. different languages can have different rules. plural
form: for a particular plural rule, there can be multiple
forms of a word, such as "page" and "pages". ...
...And 52 more matches
Web audio codec guide - Web media technologies
/decoder). in this article, we look at audio codecs used on the web to compress and decompress audio, what their capabilities and use cases are, and offer guidance when choosing audio codecs to use for your content. additionally, webrtc implementations generally use a subset of these codecs for their encoding and decoding of media, and may support additional codecs as well, for optimal cross-plat
form support of video and audio conferencing, and to integrate better with legacy telecommunication solutions. see codecs used by webrtc for details. for in
formation about the fundamental concepts behind how digital audio works, see the article digital audio concepts. common codecs the list below denotes the codecs most commonly used on the web and which containers (file types) support them. if all...
... for each factor that affects the encoded audio, there is a simple rule that is nearly always true: because the fid...
... [1] when mpeg-1 audio layer iii codec data is stored in an mpeg file, and there is no video track on the file, the file is typically referred to as an mp3 file, even though it's still an mpeg
format file. factors affecting the encoded audio there are two general categories of factors that affect the encoded audio which is output by an audio codec's encoder: details about the source audio's
format and contents, and the codec and its configuration during the encoding process. for each factor that affects the encoded audio, there is a simple rule that is nearly always true: because the fidelity of digital audio is determined by the granularity and precision of the samples taken to convert it into a data stream, the more data used to represent the digital version of the audio, the more clo...
...And 51 more matches
HTTP Index - HTTP
of the internet, now carrying images, videos in high resolution and 3d. 8 identifying resources on the web domain, http, path, scheme, syntax, uri, url, url syntax, web, fragment, port, query, resources the target of an http request is called a "resource", whose nature isn't defined further; it can be a document, a photo, or anything else. ...
... 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. ...
...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. 11 resource urls guide, http, intermediate, resource resource urls, urls prefixed with the resource: scheme, are used by firefox and firefox browser extensions to load resources internally, but some of the in
formation is available to sites the browser connects to as well. 12 browser detection using the user agent compatibility, http, web development serving different web pages or services to different browsers is usually a bad idea. the web is meant to be accessible to everyone, regardless of which browser or device they're using. there are ways to develop your website to progressivel...
...And 49 more matches
Using XMLHttpRequest - Web APIs
in this guide, we'll take a look at how to use xmlhttprequest to issue http requests in order to exchange data between the web site and a server. examples of both common and more obscure use cases for xmlhttprequest are included. to send an http request, create an xmlhttprequest object, open a url, and send the request. after the transaction completes, the object will contain useful in
formation such as the response body and the http status of the result. 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 typ...
...s page. do not use synchronous requests outside web workers. note: starting with gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27), synchronous requests on the main thread have been deprecated due to the negative effects to the user experience. note: the constructor function xmlhttprequest isn't limited to only xml documents. it starts with "xml" because when it was created the main
format that was originally used for asynchronous data exchange were xml handling responses there are several types of response attributes defined by the living standard specification for the xmlhttprequest() constructor. these tell the client making the xmlhttprequest important in
formation about the status of the response. some cases where dealing with non-text response types may involve some manipu...
...ad", transfercomplete); oreq.addeventlistener("error", transferfailed); oreq.addeventlistener("abort", transfercanceled); oreq.open(); // ... // progress on transfers from the server to the client (downloads) function updateprogress (oevent) { if (oevent.lengthcomputable) { var percentcomplete = oevent.loaded / oevent.total * 100; // ... ...
...And 46 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
ryptography and related standards and techniques underlie the security features of many products such as signed and encrypted email, single sign-on, and secure sockets layer (ssl) communications. this document introduces the basic concepts of public-key cryptography. ...
...sl." for an overview of encryption and decryption, see "encryption and decryption." in
formation on digital signatures is available from "digital signatures." public-key cryptography is a set of well-established techniques and standards for protecting communications from eavesdropping, tampering, and impersonation attacks. encryption and decryption allow two communicating parties to disguise in
formation they send to each other. the sender encrypts, or scrambles, in
formation before sending it. the receiver decrypts, or unscrambles, the in
formation after receiving it. while in transit, the encrypted in
formation is unintelligible to an intruder. tamper detection allows the recipient of in
formation to verify that it has not been modified in transit. any attempt to modify data or substitute a f...
... the sections that follow introduce the concepts of public-key cryptography that underlie these capabilities. ...
...And 41 more matches
NSS tools : modutil
modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create certificate, key, and module security database files. ...
...ach planned operation to check for warnings and to ensure that bypassing the prompts will cause no security lapses or loss of database integrity. -jar jar-file add a new pkcs #11 module to the database using the named jar file. use this command with the -installdir and -tempdir arguments. the jar file uses the nss pkcs #11 jar
format to identify all the files to be installed, the module's name, the mechanism flags, and the cipher flags, as well as any files to be installed on the target machine, including the pkcs #11 module library file and other files such as documentation. this is covered in the jar installation file section in the man page, which details ...
...e files to be installed, the module's name, the mechanism flags, and the cipher flags, as well as any files to be installed on the target machine, including the pkcs #11 module library file and other files such as documentation. this is covered in the jar installation file section in the man page, which details the special script needed to per
form an installation through a server or with modutil. -list [modulename] display basic in
formation about the contents of the secmod.db file. specifying a modulename displays detailed in
formation about a particular module and its slots and tokens. -rawadd add the module spec string to the secmod.db database. -rawlist disp...
...And 40 more matches
Web video codec guide - Web media technologies
and a 2-hour movie would take almost 1.79 tb (that is, 1790 gb). not only is the required storage space enormous, but the network bandwidth needed to transmit an uncompressed video like that would be enormous, at 249 mb/sec—not including audio and overhead. this is where video codecs come in. just as audio codecs do for the sound data, video codecs compress the video data and encode it into a
format that can later be decoded and played back or edited. most video codecs are lossy, in that the decoded video does not precisely match the source. some details may be lost; the amount of loss depends on the codec and how it's configured, but as a general rule, the more compression you achieve, the more loss of detail and fidelity will occur. some lossless codecs do exist, but they are typically ...
... the simplest guideline is this: anything that makes the encoded video look more like the original, uncompressed, video will generally make the resulting data larger as well. thus, it's always a tradeoff of size versus quality. in some situations, a greater sacrifice of quality in order to bring ...
...deo will generally make the resulting data larger as well. thus, it's always a tradeoff of size versus quality. in some situations, a greater sacrifice of quality in order to bring down the data size is worth that lost quality; other times, the loss of quality is unacceptable and it's necessary to accept a codec configuration that results in a correspondingly larger file. effect of source video
format on encoded output the degree to which the
format of the source video will affect the output varies depending on the codec and how it works. if the codec converts the media into an internal pixel
format, or otherwise represents the image using a means other than simple pixels, the
format of the original image doesn't make any difference. however, things such as frame rate and, obviously, resolu...
...And 40 more matches
NSS tools : modutil
modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. ...
...modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. ...
...un from a script. use this option only after manually testing each planned operation to check for warnings and to ensure that bypassing the prompts will cause no security lapses or loss of database integrity. -jar jar-file add a new pkcs #11 module to the database using the named jar file. use this command with the -installdir and -tempdir arguments. ...
...And 37 more matches
NSS Tools modutil
you can use the tool to add and delete pkcs #11 modules, change passwords, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create key3.db, cert8.db, and secmod.db security database files. ...
...nt are part of a process that typically also involves managing key databases (key3.db files) and certificate databases (cert8.db files). the key, certificate, and pkcs #11 module management process generally begins with creating the keys and key database necessary to generate and manage certificates and the certificate database. this document discusses security module database management. for in
formation on certificate database and key database management, see using the certificate database tool. availability this tool is known to build on solaris 2.5.1 (sunos 5.5.1) and windows nt 4.0. 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 secti...
...ion arguments modify an action. the options and arguments for the modutil command are defined as follows: options -create create new secmod.db, key3.db, and cert8.db files. use the -dbdir directory argument to specify a directory. if any of these databases already exist in a specified directory, the security module database tool displays an error message. -list [modulename] display basic in
formation about the contents of the secmod.db file. use modulename to display detailed in
formation about a particular module and its slots and tokens. -add modulename add the named pkcs #11 module to the database. use this option with the -libfile, -ciphers, and -mechanisms arguments. -jar jar-file add a new pkcs #11 module to the database using the named jar file. use this option with the -instal...
...And 35 more matches
Inputs and input sources - Web APIs
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. these devices include but aren't limited to: screen taps (particularly but not necessarily only on phones or tablets) can be used to simultaneously per
form both targeting and selection. motion-sensing controllers, which use accelerometers, magnetometers, and other sensors for motion tracking and targeting and may additionally include any number of buttons, joysticks, thumbpads, touchpads, force sensors, and so on to provide additional input sources for both targeting and selection. squeezable triggers or glove grip pads to provide squeeze actions.
...ptic gloves can provide both targeting and squeeze actions, as well as selection if outfitted with buttons or other sources of selection actions. single-button click devices. gaze tracking (following the movements of the eye to choose targets). input sources each source of webxr input data is represented by an xrinputsource object which describes the input source and its current state. the in
formation for each input source includes which hand it's held in (if applicable), what targeting method it uses, xrspaces that can be used to draw the targeting ray and to find the targeted object or location as well as to draw objects in the user's hands, and profile strings specifying the preferred way to represent the controller in the user's viewing area as well as how the input operates. the fun...
... represent the controller in the user's viewing area as well as how the input operates. the fundamental capabilities of an input source are: targeting monitoring directional controls (either a motion-sensing pointer or a joystick or trackpad, for example) to aim in a direction, possibly at a target, though targeting is left to you to implement yourself. see facing and targeting for further in
formation. selecting using the main "select" button or other input on the controller to choose the targeted direction (or the object at which it points), or to otherwise engage an action. for details on the primary action, see primary action. squeezing squeezing the controller or a mechanism on the controller to engage a secondary action. the section primary squeeze action describes this in more d...
...And 35 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
the scene. there are a few articles about the fundamental math, geometry, and other concepts behind webgl and webxr which may be useful to read before or while reading this one, including: explaining basic 3d theory matrix math for the web webgl model view projection geometry and reference spaces in webxr ed. note: most diagrams used in this article to show how the camera moves while per
forming standard movements was taken from an article on the filmmakeriq web site; namely, from this image which is found all over the web, however, and though we assume these are under a permissive license due to their frequent reuse, ownership is not certain. we hope that it's freely usable; if not, and you're the owner, please let us know and we'll find or produce new diagrams. or, if you're happy t...
...nt reuse, ownership is not certain. we hope that it's freely usable; if not, and you're the owner, please let us know and we'll find or produce new diagrams. or, if you're happy to let us continue to use the images, please let us know so we can credit you properly! cameras and relative movement when a classic live-action movie is filmed, the actors are on a set and move about the set as they per
form, with one or more cameras watching their moves. the cameras may be fixed in place, but they may also be set up to move around as well, tracking the movement of the per
formers, dollying in and out to achieve emotional impact, and so forth. virtual cameras in webgl (and by extension, in webxr), there is no camera object we can move and rotate, so we have to find a way to fake these movements. sin...
...pact, and so forth. virtual cameras in webgl (and by extension, in webxr), there is no camera object we can move and rotate, so we have to find a way to fake these movements. since there is no camera, we have to find a way to fake it. fortunately, physicists like galileo, newton, lorentz, and einstein have given us the principle of relativity, which states that the laws of physics have the same
form in every frame of reference. that is, no matter where you're standing, the laws of physics work in the same way. by extension, if you and another person are standing in an empty field of solid stone with nothing else visible as far as the eye can see, if you move three meters toward the other person, the result looks the same as if the other person had moved three meters toward you. there is no ...
...And 34 more matches
WAI-ARIA basics - Learn web development
role="navigation" (<nav>) or role="complementary" (<aside>), but there are also others that describe different pages structures, such as role="banner", role="search", role="tabgroup", role="tab", etc., which are commonly found in uis. properties — these define properties of elements, which can be used to give them extra meaning or semantics. as an example, aria-required="true" specifies that a
form input needs to be filled in to be valid, whereas aria-labelledby="label" allows you to put an id on an element, then reference it as being the label for anything else on the page, including multiple elements, which is not possible using <label for="input">. as an example, you could use aria-labelledby to specify that a key description contained in a <div> is the label for multiple table cells, or...
...ows you to put an id on an element, then reference it as being the label for anything else on the page, including multiple elements, which is not possible using <label for="input">. as an example, you could use aria-labelledby to specify that a key description contained in a <div> is the label for multiple table cells, or you could use it as an alternative to image alt text — specify existing in
formation on the page as an image's alt text, rather than having to repeat it inside the alt attribute. you can see an example of this at text alternatives. states — special properties that define the current conditions of elements, such as aria-disabled="true", which specifies to a screenreader that a
form input is currently disabled. states differ from properties in that properties don't change t...
...ements, such as aria-disabled="true", which specifies to a screenreader that a
form input is currently disabled. states differ from properties in that properties don't change throughout the lifecycle of an app, whereas states can change, generally programmatically via javascript. an important point about wai-aria attributes is that they don't affect anything about the web page, except for the in
formation exposed by the browser's accessibility apis (where screenreaders get their in
formation from). wai-aria doesn't affect webpage structure, the dom, etc., although the attributes can be useful for selecting elements by css. note: you can find a useful list of all the aria roles and their uses, with links to futher in
formation, in the wai-aria spec — see definition of roles. the spec also c...
...And 32 more matches
Mozilla Crypto FAQ - Archive of obsolete content
in this document i try to answer some frequently asked questions about the mozilla web browser and mail/news client and its support for ssl, s/mime, and related features based on cryptographic technology. note that this document is for your in
formation only and is not intended as legal advice. if you wish to develop and distribute cryptographic software, particularly for commercial sale or distribution, then you should consult an attorney with expertise in the particular laws and regulations that apply in your jurisdiction. ...
...articularly for commercial sale or distribution, then you should consult an attorney with expertise in the particular laws and regulations that apply in your jurisdiction. i've updated this version of the mozilla crypto faq to discuss the situation now that the rsa public key algorithm is in the public domain and a full open source crypto implementation is being added to the mozilla code base. in
formation in the faq also reflects the new u.s. encryption export regulations published on january 14, 2000, the release on february 11, 2000, of source code for ssl, s/mime, and general pki functionality for use in the mozilla project, and the "bernstein advisory" issued by the bureau of export administration on february 17, 2000. the questions in this faq address mozilla's support for encryption an...
...ew u.s. encryption export regulations published on january 14, 2000, the release on february 11, 2000, of source code for ssl, s/mime, and general pki functionality for use in the mozilla project, and the "bernstein advisory" issued by the bureau of export administration on february 17, 2000. the questions in this faq address mozilla's support for encryption and related security functionality, in
formation important to mozilla contributors relating to encryption functionality in mozilla, and general questions on u.s. regulation of encryption technology. cryptographic functionality in mozilla have all the issues with mozilla and crypto now been resolved? almost. now that the rsa patent is in the public domain, mozilla crypto development can proceed with minimal restrictions. in the near futu...
...And 31 more matches
Index - Archive of obsolete content
this xulnote presents some of the key concepts and terms in the xul development environment. the purpose of this article is not to describe these items in any great detail but to define what they are in simple terms. i selected items for this group because they seemed to be either shrouded in mystery, misused as concepts or terms, or underestimated according to their role in xul and cross-plat
form development. in contrast to the mozilla jargon file, this article describes items of specific interest to the web or content developer looking to establish a context for understanding mozilla's new technologies -- and in particular mozilla's xml-based user interface language, xul. 4 accessibility/xul accessibility reference accessibility, xul this table is designed to show ho...
... no summary! 189 menu xul attributes, xul reference no summary! 190 menuactive xul attributes, xul reference no summary! 191 menuitem.key xul attributes, xul reference no summary! 192 menuitem.name xul attributes, xul reference no summary! 193 menuitem.type xul attributes, xul reference more in
formation on adding checkmarks to menus in the xul tutorial 194 min xul attributes, xul reference no summary! 195 minheight xul attributes, xul reference no summary! 196 minresultsforpopup xul attributes, xul reference no summary! 197 minwidth xul attributes, xul reference no summary! 198 mode no ...
...markup reference, xul {many elements on this page are wrongly marked as deprecated, this page needs review} 423 dynamically modifying xul-based user interface add-ons, dom, extensions, xul this article discusses manipulating xul interfaces, using dom and other apis. ...
...And 31 more matches
Index
y the spidermonkey garbage collector (gc) will be changing a lot in the future. this page is intended to explain the changes that are happening, with a focus on how they will affect gecko code that uses jsapi. at a high level, there are three issues to be aware of: 8 getting spidermonkey source code guide, spidermonkey you can get the spidermonkey source code in gzipped
form or directly from the mercurial repository. 9 hacking tips spidermonkey this page list a few tips to help you investigate issues related to spidermonkey. all tips listed here are dealing with the javascript shell obtained at the end of the build documentation of spidermonkey. it is separated in 2 parts, one section related to debugging and another section related to drafting o...
..., javascript, spidermonkey, tutorial see also jsapi user guide. in particular, it has more and better code examples! 11 index index, mdn meta, spidermonkey found 550 pages: 12 introduction to the javascript shell spidermonkey to get the spidermonkey javascript shell, see the spidermonkey build documentation or download a compiled binary for your plat
form from the nightly builds. 13 jit optimization outcomes beginner, firefox, intro, needscontent, spidermonkey spidermonkey's optimizing jit, ionmonkey, uses different optimization strategies to speed up various operations. the most typical operations that are relevant for fast program execution are property accesses and function calls. 14 jit optimization strategies ...
...pidermonkey here, ptr represents the private member of js::rooted<t>, typed with t. 67 js::setlargeallocationfailurecallback jsapi reference, reference, référence(2), spidermonkey if a large allocation fails when calling pod_{calloc,realloc}cangc, the js engine may call the large-allocation- failure callback, if set, to allow the embedding to flush caches, possibly per
form shrinking gcs, etc. to make some room. the allocation will then be retried (and may still fail.) 68 js::setoutofmemorycallback jsapi reference, reference, référence(2), spidermonkey unlike the error reporter, which is only called if the exception for an oom bubbles up and is not caught, the js::outofmemorycallback is called immediately at the oom site to allow the embedding...
...And 30 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
now imagine being able to develop web apps using javascript server-side too. ...
...ife for us developers? full circle if you were part of the early web's big bang in the mid-1990s you might recall that being able to use javascript both client-side and server-side was core to netscape's original vision for web apps. netscape livewire was the first server-side javascript engine. now more than 10 years later, with netscape's technology group having been trans
formed into the mozilla foundation, server-side javascript is seeing a strong resurgence because of the simplicity it provides to web developers reinvigorated by the fact that today's cpus can process javascript more than 10x faster than the cpus of the mid-90's ever could. and just like before, it's the mozilla team that's at the core of this latest evolution of the web. in fact, the next javascript ...
...strong resurgence because of the simplicity it provides to web developers reinvigorated by the fact that today's cpus can process javascript more than 10x faster than the cpus of the mid-90's ever could. and just like before, it's the mozilla team that's at the core of this latest evolution of the web. ...
...And 29 more matches
Python binding for NSS
nss project page. netscape portable runtime. ...
...sl and used extensively by major software projects. nss is fips-140 certified. nss is built upon nspr because nspr provides an abstraction of common operating system services, particularly in the areas of networking and process management. python also provides an abstraction of common operating system services but because nss and nspr are tightly bound python-nss exposes elements of nspr. for in
formation on nss and nspr, see the following: network security services (nss). nss project page. netscape portable runtime. nspr project page. nspr reference. nspr api documentation. design goals nss and nspr are c language api's which python-nss "wraps" and exposes to python programs. the design of python-nss follows these basic guiding principles: be a thin layer with almost a one-to-one ...
...ord) parameters freeing the python programmer from having to specify all parameters yet allowing them to be overriden when necessary. error codes are never returned from methods/functions. python-nss follows the existing python exception mechanism. any error reported by nss/nspr is converted into a python exception and raised. the exact error code, error description, and often contextual error in
formation will be present in the exception object. enumerated constants used in the nss/nspr api's are available in the python module under the exact same name as they appear in the c header files of nss/nspr. convenience functions are provided to translate between the numeric value of an enumerated constant and it's string representation and visa versa. python-nss internally supports utf-8. string...
...And 28 more matches
sslerr.html
if you are inclined to help with this migration, your help would be very much appreciated. upgraded documentation may be found in the current nss reference nss and ssl error codes chapter 8 nss and ssl error codes nss error codes are retrieved using the nspr function pr_geterror. in addition to the error codes defined by nspr, pr_geterror retrieves the error codes described in this chapter. ...
... disallowed by cipher export policy, (c) the socket is configured to handshake as a server, but the certificate associated with that socket is inappropriate for the key exchange algorithm selected. ssl_error_bad_block_padding -12264 "ssl received a record with bad block padding." ssl was using a block cipher, and the last block in an ssl record had incorrect padding in
formation in it. this usually indicates that the client and server have failed to come to agreement on the set of keys used to encrypt the application data and to check message integrity. if this occurs frequently on a server, an active attack (such as the "million question" attack) may be underway against the server. ssl_error_rx_record_too_long -12263 "ssl received a record that e...
...e peer, reporting that the remote peer has chosen to end the connection. the receipt of this alert is an error only if it occurs while a handshake is in progress. ssl_error_pub_key_size_limit_exceeded -12210 "ssl server attempted to use domestic-grade public key with export cipher suite." on a client socket, this error reports that the remote server has failed to per
form an "ssl step down" for an export cipher. it has sent a certificate bearing a domestic-grade public key, but has not sent a serverkeyexchange message containing an export-grade public key for the key exchange algorithm. such a connection cannot be permitted without violating u.s. export policies. on a server socket, this indicates a failure of the local library. ssl_error_no_server_ke...
...And 28 more matches
Cognitive accessibility - Accessibility
may be momentary, temporary, or permanent conditions. for example, dementia and alzheimer's are permanent cognitive impairments that get progressively worse. other permanent cognitive impairments include aphasia, speech and language, autism, add/adhd, dyslexia, and dyscalculia. an example of a temporary cognitive impairment could be people affected by substances such as alcohol or drugs. another
form it can take is depression, such as when mourning the loss of a loved one, or being momentarily saddened by a tweet or video they just saw online. a third example could be sleep deprivation. it may seem like an overwhelming challenge to address the wide range of cognitive differences, especially when solutions for two different people may be conflicting. one way to handle this is to focus on cogn...
... wcag guidelines wcag, web content accessibility guidelines, includes several guidelines to improve cognitive accessibility. these guidelines are published by the web accessibility initiative (wai) of the world wide web consortium (w3c), the main international standards organization for the internet. this group is a...
...owing scenarios: people with attention or anxiety disorders. people who have a poor short-term memory, or who are multitasking. people who are less technologically literate. people who have poor wireless reception. people who have motor control issues. adaptability guideline 1.3 states "content should be adaptable." create content that can be presented in different ways without losing in
formation or structure. for example, provide responsive layouts, with a single column mobile design. all in
formation, including structure and relationships conveyed through the presentation, should be available in a
form that can be perceived by all users to achieve this goal. for example, the in
formation could be spoken aloud via a narration tool. making your content capable of being understood by t...
...And 28 more matches
Client-Server Overview - Learn web development
most website server-side code handles requests and responses in similar ways, this will help you understand what you need to do when writing most of your own code. prerequisites: basic computer literacy. a basic understanding of what a web server is. objective: to understand client-server interactions in a dynamic website, and in particular what operations need to be per
formed by server-side code. there is no real code in the discussion because we haven't yet chosen a web framework to use to write our code! this discussion is however still very relevant, because the described behaviour must be implemented by your server-side code, irrespective of which programming language or web framework you select. web servers and http (a primer) web browsers communicate ...
...amework to use to write our code! this discussion is however still very relevant, because the described behaviour must be implemented by your server-side code, irrespective of which programming language or web framework you select. web servers and http (a primer) web browsers communicate with web servers using the hypertext transfer protocol (http). when you click a link on a web page, submit a
form, or run a search, the browser sends an http request to the server. this request includes: a url identifying the target server and resource (e.g. an html file, a particular data point on the server, or a tool to run). a method that defines the required action (for example, to get a file or to save or update some data). the different methods/verbs and their associated actions are listed below:...
... this request includes: a url identifying the target server and resource (e.g. an html file, a particular data point on the server, or a tool to run). a method that defines the required action (for example, to get a file or to save or update some data). the different methods/verbs and their associated actions are listed below: get: get a specific resource (e.g. an html file containing in
formation about a product, or a list of products). post: create a new resource (e.g. add a new article to a wiki, add a new contact to a database). head: get the metadata in
formation about a specific resource without getting the body like get would. you might for example use a head request to find out the last time a resource was updated, and then only use the (more "expensive") get request to...
...And 27 more matches
Handling common accessibility problems - Learn web development
prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross browser testing. objective: to be able to diagnose common accessibility problems, and use appropriate tools and techniques to fix them. ...
... cross browser testing makes sure that your sites can be used by as many people as possible. what is accessibility? defines accessibility more completely and thoroughly than this article does. that said, this article will cover cross browser and testing issues surrounding people with disabilities, and how they use the web. we've already talked about other spheres such as responsive design and per
formance in other places in the module. note: like many things in web development, accessibility isn't about 100% success or not; 100% accessibility is pretty much impossible to achieve for all content, especially as sites get more complex. instead, it is more about making a reasonable effort to make as much of your content accessible to as many people as possible via defensive coding and sticking t...
...ee if your sites are going in the right direction. note: accessibility is morally the right thing to do, and good for business (numbers of disabled users, users on mobile devices, etc. present significant market segments), but it is also a legal requirement in many parts of the world to make web content accessible to people with disabilities. read accessibility guidelines and the law for more in
formation. html semantic html (where the elements are used for their correct purpose) is accessible right out of the box — such content is readable by sighted viewers (provided you don't do anything silly like make the text way too small or hide it using css), but will also be usable by assistive technologies like screen readers (apps that literally read out a web page to their user), and confer ...
...And 26 more matches
<input type="image"> - HTML: Hypertext Markup Language
methods none. ...
...han text. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. value none — the value attribute should not be specified. events none. supported common attributes alt, src, width, height,
formaction,
formenctype,
formmethod,
formnovalidate,
formtarget idl attributes none. methods none. value <input type="image"> elements do not accept value attributes. the path to the image to be displayed is specified in the src attribute. additional attributes in addition to the attributes shared by all <input> elements, image button inputs support the following attr...
...e <input type="image"> elements do not accept value attributes. the path to the image to be displayed is specified in the src attribute. ...
...And 26 more matches
Layout System Overview - Archive of obsolete content
these layout modes are referred to as 'standards' and 'navquirks' modes. ...
...these layout modes are referred to as 'standards' and 'navquirks' modes. ...
...these layout modes are referred to as 'standards' and 'navquirks' modes. (doctype and modes are explained in more detail in article mozilla's doctype sniffing. ...
...And 25 more matches
Creating a Microsummary - Archive of obsolete content
nts in their <head> elements. generators can also be independently downloaded and installed by users if they include a list of pages to which they apply. in this tutorial we're going to create a microsummary generator for the spread firefox home page that displays the current firefox download count along with the label fx downloads; for example: 174475447 fx downloads. we'll build the xslt trans
form sheet that converts that page into its microsummary, learn how to specify that the generator applies to that page, and find out how to make the generator available for download and installation. in each step of revising the trans
form sheet and other code in this tutorial, new material added will be shown in boldface so you can follow along more easily. note: if you are a web site developer, and...
...new empty text file and add an xml declaration and empty <generator> tag to it: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1"> </generator> giving it a name generators should have name attributes which are arbitrary descriptions of the microsummaries the generator creates. ...
...nough to give users a good idea what in
formation the microsummaries will provide. since our generator will be creating microsummaries displaying the firefox download count, let's give it the name "firefox download count": <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> </generator> adding an xslt trans
form sheet generators must include an xslt trans
form sheet (also known as an xslt stylesheet) which trans
forms the page content into its microsummary. xslt is a powerful language for trans
forming documents into different representations of the same in
formation. ...
...And 24 more matches
CSS and JavaScript accessibility best practices - Learn web development
u should: select sensible font sizes, line heights, letter spacing, etc. to make your text logical, legible, and comfortable to read. make sure your headings stand out from your body text, typically big and bold like the default styling. your lists should look like lists. your text color should contrast well with your background color. see html text fundamentals and styling text for more in
formation. emphasised text inline markup that confers specific emphasis to the text that it wraps: <p>the water is <em>very hot</em>.</p> <p>water droplets collecting on surfaces is called <strong>condensation</strong>.</p> you might want to add some simple coloring to your emphasised text: strong, em { color: #a60000; } you will however rarely need to style emphasis elements in any significa...
... the highlight in both firefox (a dotted outline) and chrome (a blue outline): you can be creative with link styles, as long as you keep giving users feedback when they interact with the links. something should definitely happen when states change, and you shouldn't get rid of the pointer cursor or the outline — both are very important accessibility aids for those using keyboard controls.
form elements elements to allow users to input data into websites: <div> <label for="name">enter your name</label> <input type="text" id="name" name="name"> </div> you can see some good example css in our
form-css.html example (see it live also). most of the css you'll write for
forms will be for sizing the elements, lining up labels and inputs, and getting them looking neat and tidy. you sho...
...div> <label for="name">enter your name</label> <input type="text" id="name" name="name"> </div> you can see some good example css in our
form-css.html example (see it live also). most of the css you'll write for
forms will be for sizing the elements, lining up labels and inputs, and getting them looking neat and tidy. you shouldn't however deviate too much from the expected visual feedback
form elements receive when they are focused, which is basically the same as links (see above). you could style
form focus/hover states to make this behaviour more consistent across browsers or fit in better with your page design, but don't get rid of it altogether — again, people rely on these clues to help them know what is going on. tables tables for presenting tabular data. you can see a good,...
...And 24 more matches
Using the User Timing API - Web APIs
the user timing interface allows the developer to create application specific timestamps that are part of the browser's per
formance timeline. there are two types of user defined timing entry types: the "mark" entry type and the "measure" entry type. mark events are named by the application and can be set at any location in an application. measure events are also named by the application but they are placed between two marks thus they are effectively a midpoint between two marks. this document shows how to create mark and measure per
formance entry types and how to use user timing methods (which are extensions of the per
formance interface) to retrieve and remove entries from the browser's per
formance timeline. a live version of the examples is available on github, as is the source code. pull...
...tween two marks. this document shows how to create mark and measure per
formance entry types and how to use user timing methods (which are extensions of the per
formance interface) to retrieve and remove entries from the browser's per
formance timeline. a live version of the examples is available on github, as is the source code. pull requests, enhancement requests and bug reports are welcome. per
formance marks a per
formance mark is a named per
formance entry that is created by the application at some location in an application. the mark is a timestamp in the browser's per
formance timeline. creating a per
formance mark the per
formance.mark() method is used to create a per
formance mark. the method takes one argument, the name of the mark, as shown in the following example. function create_mar...
...ormance mark is a named per
formance entry that is created by the application at some location in an application. the mark is a timestamp in the browser's per
formance timeline. creating a per
formance mark the per
formance.mark() method is used to create a per
formance mark. the method takes one argument, the name of the mark, as shown in the following example. ...
...And 24 more matches
WebGL model view projection - Web APIs
ic matrix math using translation, scale, and rotation matrices. it explains the three core matrices that are typically used when composing a 3d scene: the model, view and projection matrices. note: this article is also available as an mdn content kit. it also uses a collection of utility functions available under the mdn global object. the model, view, and projection matrices individual trans
formations of points and polygons in space in webgl are handled by the basic trans
formation matrices like translation, scale, and rotation. these matrices can be composed together and grouped in special ways to make them useful for rendering complicated 3d scenes. these composed matrices ultimately move the original model data around into a special coordinate space called clip space. this is a 2 unit ...
... to see. the sections below offer an in-depth look into the ideas behind and implementation of the model, view, and projection matrices. these matrices are core to moving data around on the screen, and are concepts that transcend individual frameworks and engines. clip space in a webgl program, data is typically uploaded to the gpu with its own coordinate system and then the vertex shader trans
forms those points into a special coordinate system known as clip space. any data which extends outside of the clip space is clipped off and not rendered. however, if a triangle straddles the border of this space then it is chopped up into new triangles, and only the parts of the new triangles that are in clip space are kept. the above graphic is a visualization of the clip space that all of the po...
...ube is the point (0,0,0). this 8 cubic meter coordinate system used by clip space is known as normalized device coordinates (ndc). you may encouter that term from time to time while researching and wokring with webgl code. for this section we will put our data into the clip space coordinate system directly. normally model data is used that is in some arbitrary coordinate system, and is then trans
formed using a matrix, converting the model coordinates into the clip space coordinate system. for this example, it's easiest to illustrate how clip space works by simply using model coordinate values ranging from (-1,-1,-1) to (1,1,1). the code below will create 2 triangles that will draw a square on the screen. the z depth in the squares determines what gets drawn on top when the squares share the s...
...And 24 more matches
filter - CSS: Cascading Style Sheets
blur(5px) <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="col">svg equivalent</th> <th style="text-align: left;" scope="col">static example</th> </tr> </thead> <tbody> <tr> <td><img alt="test_
form.jpg" id="img1" class="internal default" src="/files/3710/test_
form_2.jpg" style="width: 100%;" /></td> <td><img alt="test_
form.jpg" id="img2" class="internal default" src="/files/3710/test_
form_2.jpg" style="width: 100%;" /></td> <td> <div class="svg-container"> <svg id="img3" overflow="visible" viewbox="0 0 212 161" color-interpolation-filters="srgb"> <f...
...jpg" style="width: 100%;" /></td> <td> <div class="svg-container"> <svg id="img3" overflow="visible" viewbox="0 0 212 161" color-interpolation-filters="srgb"> <filter id="svgblur" x="-5%" y="-5%" width="110%" height="110%"> <fegaussianblur in="sourcegraphic" stddeviation="3.5"/> </filter> <image xlink:href="/files/3710/test_
form_2.jpeg" filter="url(#svgblur)" width="212px" height="161px"/> </svg> </div> </td> <td><img alt="test_
form_s.jpg" id="img4" class="internal default" src="/files/3711/test_
form_2_s.jpg" style="width: 100%;" /></td> </tr> </tbody> </table> html { height:100%; } body { font: 14px/1.286 "lucida grande", "lucida sans unicode", "dejavu sans", lucida, arial, helve...
...lter> </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="col">svg equivalent</th> <th style="text-align: left;" scope="col">static example</th> </tr> </thead> <tbody> <tr> <td><img alt="test_
form.jpg" id="img1" class="internal default" src="/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="brightnes...
...And 24 more matches
<input type="month"> - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... control's ui varies in general from browser to browser; at the moment support is patchy, with only chrome/opera and edge on desktop — and most modern mobile browser versions — having usable implementations. 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. for those of you using a browser that doesn't support month, the screenshot below shows what it looks like in chrome and opera. clicking the down arrow on the right hand side brings up a date picker that lets you select the month and year. the microsoft edge month control looks like this: value a domstring representing a month and year, or empty. even...
...ntrol looks like this: value a domstring representing a month and year, or empty. events change and input supported common attributes autocomplete, list, readonly, and step. idl attributes value methods select(), stepdown(), stepup(). value a domstring representing the value of the month and year entered into the input, in the
form yyyy-mm (four or more digit year, then a hyphen ("-"), followed by the two-digit month). the
format of the month string used by this input type is described in
format of a valid local month string in date and time
formats used in html. you can set a default value for the input control by including a month and year inside the value attribute, like so: <label for="bday-month">what month were you...
...And 24 more matches
<input type="time"> - HTML: Hypertext Markup Language
egrades gracefully to <input type="text">. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. appearance chrome and opera in chrome/opera the time control is simple, with slots to enter hours and minutes in 12 or 24-hour
format depending on operating system locale, and up and down arrows to increment and decrement the currently selected component. in some versions, an "x" button is provided to clear the control's value. 12-hour 24-hour chrome 83 in chrome 83, the ui controls have been updated with a new look and feel. the new element is functionally identical to the old one, but has a similar ui to edge. 24-h...
..." button is provided to clear the control's value. 12-hour 24-hour chrome 83 in chrome 83, the ui controls have been updated with a new look and feel. the new element is functionally identical to the old one, but has a similar ui to edge. 24-hour firefox firefox's time control is very similar to chrome's, except that it doesn't have the up and down arrows. ...
...control is very similar to chrome's, except that it doesn't have the up and down arrows. it also uses a 12- or 24-hour
format for inputting times, based on system locale. an "x" button is provided to clear the control's value. 12-hour 24-hour edge the edge time control is somewhat more elaborate, opening up an hour and minute picker with sliding reels. it, like chrome, uses a 12- or 24-hour
format for inputting times, based on system locale: 12-hour 24-hour value a domstring representing a time, or empty. events change and input supported common attributes autocomplete, list, readonly, and step idl attributes value, valueasdate, valueasnumber, and list. methods select(), stepdown(), and stepup(). value a domstring ...
...And 24 more matches
Link types - HTML: Hypertext Markup Language
list of the defined link types and their significance in html link type description allowed in these elements not allowed in these elements alternate if the element is <link> and the rel attribute also contains the stylesheet type, the link defines an alternative style sheet; in that case the title attribute must be present and not be the empty string. if the type is set to application/rss+xml or application/atom+xml, the link defines a syndication feed. ...
...f the type is set to application/rss+xml or application/atom+xml, the link defines a syndication feed. the first one defined on the page is the default. otherwise, the link defines an alternative page, of one of these types: for another medium, like a handheld device (if the media attribute is set) in another language (if the hreflang attribute is set), in another
format, such as a pdf (if the type attribute is set) a combination of these <a>, <area>, <link> <
form> archives defines a hyperlink to a document that contains an archive link to this one. for example, a blog entry could link to a monthly index page this way. note: although recognized, the singular archive is incorrect and must be avoided. <...
...he type attribute is set) a combination of these <a>, <area>, <link> <
form> archives defines a hyperlink to a document that contains an archive link to this one. for example, a blog entry could link to a monthly index page this way. note: although recognized, the singular archive is incorrect and must be avoided. <a>, <area>, <link> <
form> author defines a hyperlink to a page describing the author or providing a way to contact the author. note: this may be a mailto: hyperlink, but this is not recommended on public pages as robot harvesters will quickly lead to a lot of spam sent to the address. in that case, it is better to lead to a page containing a contact
form. although recognized, the rev attribu...
...And 24 more matches
XUL accessibility guidelines - Archive of obsolete content
mozilla project that will be happy to help you with any concerns or questions you have in regards to making your xul applications fully accessible. there is also a xul accessibility tool which can help test some of these guidelines, but please be aware that no tool can replace human judgement for accessibility, and understanding the guidelines is vital. learn more accessibility plat
form features mozilla community software accessibility - where are we today? intro to accessibility, assistive technologies, and mozilla resources. introduction to web accessibility. overview of web accessibility from webaim. dive into accessibility. downloadable book on web accessibility with tips and character sketches. assistive technology compatibility. list of popular as...
...s should be done sparingly and thoroughly tested whenever it is used. the navigation order should be logical, generally left to right, top to bottom. navigation order may vary depending on the nature of the application or the reading direction of the language. ensure that tab order is logical and all interactive elements can be accessed simply without the use of a mouse. you should be able to per
form all functionality either directly in the application or through menu items or the context menu. trees provide alternative functionality for inaccessible operations. the column picker and column headers in xul trees are not keyboard accessible, consistent with the standard tree behavior on most contemporary operating systems. it is therefore necessary to provide a keyboard accessible alternative...
...xul trees are not keyboard accessible, consistent with the standard tree behavior on most contemporary operating systems. it is therefore necessary to provide a keyboard accessible alternative for accessing this functionality. the firefox "bookmarks manager" provides an example of how to make trees more accessible. the bookmark manager allows users to sort bookmarks by a particular column of in
formation and choose which columns to display. because column headers and the column picker, in the upper right hand corner of the tree, can not receive focus, they are not operable with a keyboard. in the bookmark manager this functionality is available under the view menu which is accessible to a keyboard user. toolbarbuttons by default, toolbar buttons cannot receive focus with a keyboard. the re...
...And 23 more matches
WebGL constants - Web APIs
that you use them as gl.constant_name: var canvas = document.getelementbyid('mycanvas'); var gl = canvas.getcontext('webgl'); gl.getparameter(gl.line_width); some constants are also provided by webgl extensions. a list is provided below. var debuginfo = gl.getextension('webgl_debug_renderer_info'); var vendor = gl.getparameter(debuginfo.unmasked_vendor_webgl); the webgl tutorial has more in
formation, examples, and resources on how to get started with webgl. table of contents standard webgl 1 constants standard webgl 2 constants webgl extension constants standard webgl 1 constants these constants are defined on the webglrenderingcontext interface. clearing buffers constants passed to webglrenderingcontext.clear() to clear buffer masks. constant name value descr...
...lendequationseparate to set an addition blend function. func_subtract 0x800a passed to blendequation or blendequationseparate to specify a subtraction blend function (source - destination). func_reverse_subtract 0x800b passed to blendequation or blendequationseparate to specify a reverse subtraction blend function (destination - source). getting gl parameter in
formation constants passed to webglrenderingcontext.getparameter() to specify what in
formation to return. constant name value description blend_equation 0x8009 passed to getparameter to get the current rgb blend function. blend_equation_rgb 0x8009 passed to getparameter to get the current rgb blend function. same as blend_equation blend_equat...
... depth_bits 0x0d56 stencil_bits 0x0d57 polygon_offset_units 0x2a00 polygon_offset_factor 0x8038 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(), webglrenderingco...
...And 23 more matches
Web audio spatialization basics - Web APIs
is coming from the boombox speaker at the front, so when we rotate it, we can alter the sound's direction — i.e. make it project to the back when the boombox is rotated 180 degrees and facing away from us. we need to set up a few things for the interface. ...
...nts we want to move, then we'll store references to the values we'll change when we set up css trans
forms to actually do the movement. ...
...move, then we'll store references to the values we'll change when we set up css trans
forms to actually do the movement. ...
...And 23 more matches
Accessibility documentation index - Accessibility
r to display a discreet alert or notification which does not require user interaction. while these changes are usually visually apparent to users who can see the page, they may not be obvious to users of assistive technologies. aria live regions fill this gap and provide a way to programmatically expose dynamic content changes in a way that can be announced by assistive technologies. 8
forms aria, accessibility the following pages provide various techniques for improving the accessibility of web
forms: 9 alerts aria, accessibility,
forms, web you have a
form — a contact
form, for example — that you want to put some accessible error checking into. examples of common problems include e-mail addresses which are not valid, or a name field which does no...
...s techniques for improving the accessibility of web
forms: 9 alerts aria, accessibility,
forms, web you have a
form — a contact
form, for example — that you want to put some accessible error checking into. examples of common problems include e-mail addresses which are not valid, or a name field which does not contain at least a first name or a surname. 10 basic
form hints aria, accessibility,
forms when implementing
forms using traditional html
form-related elements, it is important to provide labels for controls, and explicitly associate a label with its control. 11 multipart labels: using aria for labels with embedded fields inside them aria, accessibility, ben millard, firefox, guide, help, html, html 4, jaws, needscontent, aria-l...
...elements, with these divided into roles (defining a type of user interface element) and states and properties that are supported by a role. authors must assign an aria role and the appropriate states and properties to an element during its life-cycle, unless the element already has appropriate aria semantics (via use of an appropriate html element). addition of aria semantics only exposes extra in
formation to a browser's accessibility api, and does not affect a page's dom. 14 aria technique template accessibility no summary! 15 using the alert role aria, accessibility, advanced, css, example, html, needscontent, alert, alert role, alertrole, alerts, assitive technology, role configuration, wcag1.2.1, wcag3.3.1 the alert role is used to communicate an i...
...And 23 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
value a domstring representing a date and time (in the local time zone), or empty. events change and input supported common attributes autocomplete, list, readonly, and step idl attributes list, value, valueasnumber. methods select(), stepdown(), stepup() value a domstring representing the value of the date entered into the input. the
format of the date and time value used by this input type is described in local date and time strings in date and time
formats used in html. you can set a default value for the input by including a date and time inside the value attribute, like so: <label for="party">enter a date and time for your party booking:</label> <input id="party" type="datetime-local" name="partydate" value="2017-06-01t08:30...
...when the above value submitted to the server, for example, it will look like partydate=2017-06-01t08:30. ...
... html. you can set a default value for the input by including a date and time inside the value attribute, like so: <label for="party">enter a date and time for your party booking:</label> <input id="party" type="datetime-local" name="partydate" value="2017-06-01t08:30"> one thing to note is that the displayed date and time
formats differ from the actual value; the displayed date and time are
formatted according to the user's locale as reported by their operating system, whereas the date/time value is always
formatted yyyy-mm-ddthh:mm. when the above value submitted to the server, for example, it will look like partydate=2017-06-01t08:30. note: also bear in mind that if such data is submitted via http get, the colon character will need to be escaped for inclusion in the url parameters, e...
...And 23 more matches
SVG documentation index - SVG: Scalable Vector Graphics
vg, svg attribute the alphabetic attribute defines the lower baseline of a font. it has the same syntax and semantics as the baseline descriptor within an @font-face. 24 amplitude needscompattable, svg, svg attribute the amplitude attribute controls the amplitude of the gamma function of a component transfer element when its type attribute is gamma. 25 arabic-
form deprecated, svg, svg attribute the arabic-
form attribute indicates which of the four possible
forms an arabic glyph represents. 26 ascent deprecated, needsexample, svg, svg attribute the ascent attribute defines the maximum unaccented height of the font within the font coordinate system. 27 attributename needscompattable, svg, svg attribute the ...
...r attributes. 45 color-interpolation needsexample, svg, svg attribute the color-interpolation attribute specifies the color space for gradient interpolations, color animations, and alpha compositing. 46 color-interpolation-filters needsexample, svg, svg attribute the color-interpolation-filters attribute specifies the color space for imaging operations per
formed via filter effects. 47 color-profile deprecated, needsexample, svg, svg attribute the color-profile attribute is used to define which color profile a raster image included through the <image> element should use. 48 color-rendering svg, svg attribute the color-rendering attribute provides a hint to the svg user agent about how to optimize its color inter...
...e the x-axis coordinate of a center point. 53 cy svg, svg attribute the cy attribute define the y-axis coordinate of a center point. 54 d svg, svg attribute the d attribute defines a path to be drawn. 55 data-* attribute, svg the data-* svg attributes are called custom data attributes. they let svg markup and its resulting dom share in
formation that standard attributes can't, usually for scripting purposes. their custom data are available via the svgelement interface of the element the attributes belong to, with the svgelement.dataset property. 56 descent deprecated, svg, svg attribute the descent attribute defines the maximum unaccented depth of the font. 57 diffuseconstant filters, svg, svg att...
...And 23 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
lication. related: xulrunner:what xulrunner provides, xulrunner hall of fame ui in mozilla mozilla's philosophy of using "the right tool for the right job" is manifested most prominently in the design of the user interface. we provide an xml-based language called xul for defining the user interface of your application. ...
...d's are used to localize the textual in
formation - making your application extremely flexible and able to be utilized across the globe. javascript, considered by many to be the best scripting language ever designed is ideal for specifying the behavior of your interface widgets. where speed is the foremost consideration, we provide c++ libraries with multi-language interfaces for comprehensive, per
formant access to networking, filesystem, content, rendering, and much more. what this means to you as the developer is this: you can take advantage of skills you already have with xml or web technologies to design and implement anything from a simple text editor to a comprehensive ide - complete with all of the interface widgets that you would find in virtually any major application framework. anothe...
...the developer is this: you can take advantage of skills you already have with xml or web technologies to design and implement anything from a simple text editor to a comprehensive ide - complete with all of the interface widgets that you would find in virtually any major application framework. another benefit of this standards-based approach to ui development is that your application is cross-plat
form "out of the box". imagine not having to re-write your application 3 times, or not supporting a less popular plat
form simply because you do not have the resources for parallel development! unlike many other application frameworks, you are not limited to the widget set we provide, nor limited to the "look and feel" of the native os. you can create applications using our framework that either...
...And 22 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. prerequisites: basic computer literacy, and a basic understanding of html. objective: to understand the newer input type values available to create native
form controls, and how to implement them using html. note: most of the features discussed in this article have wide support across browsers. we'll note any exceptions. ...
...basic computer literacy, and a basic understanding of html. objective: to understand the newer input type values available to create native
form controls, and how to implement them using html. note: most of the features discussed in this article have wide support across browsers. we'll note any exceptions. if you want more detail on browser support, you should consult our html
forms element reference, and in particular our extensive <input> types reference. because html
form control appearance may be quite different from a designer's specifications, web developers sometimes build their own custom
form controls. we cover this in an advanced tutorial: how to build custom
form widgets. e-mail address field this type of field is set using the value email for the type attrib...
...you can see this in action in the below screenshot. ...
...And 22 more matches
Using the Resource Timing API - Web APIs
reports are welcome. resource loading phases an application can get timestamps for the various phases of resource loading such as redirection, dns lookup, and tcp connection setup. those phases and their property names are illustrated in figure 1. figure 1. resource timing properties an application developer can use the property values to calculate the length of time a phase takes and that in
formation can help diagnose per
formance issues. timing resource loading phases the following example illustrates using the resource timing properties to calculate the amount of time the following phases take: redirection (redirectstart and redirectend ), dns lookup (domainlookupstart and domainlookupend), tcp handshake (connectstart and connectend), and response (responsestart and responseend). this...
...pend), tcp handshake (connectstart and connectend), and response (responsestart and responseend). this example also calculates the time from the start of the fetch and request start phases (fetchstart and requeststart, respectively), until the response has ended (responseend). ...
...nsestart and responseend). this example also calculates the time from the start of the fetch and request start phases (fetchstart and requeststart, respectively), until the response has ended (responseend). this timing data provides a detailed profile of the resource loading phases and this data can be used to help identify per
formance bottlenecks. ...
...And 22 more matches
<input type="search"> - HTML: Hypertext Markup Language
ed completely. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. you should also include other explanatory text nearby. see the section specifying a pattern for details and an example. ...
...hat kind of in
formation is expected in the field. it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message. the text must not include carriage returns or line feeds. if the control's content has one directionality (ltr or rtl) but needs to present the placeholder in the opposite directionality, you can use unicode bidirectional algorithm
formatting characters to override directionality within the placeholder; see overriding bidi using unicode control characters in the unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your
form, and can cause unexpected technical issues with your content. see labels and placehold...
...de directionality within the placeholder; see overriding bidi using unicode control characters in the unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your
form, and can cause unexpected technical issues with your content. see labels and placeholders in <input>: the input (
form input) element for more in
formation. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also specified. size ...
...And 22 more matches
Plug-in Development Overview - Gecko Plugin API Reference
t make sure that you have the necessary files from the plugin sdk. create a plug-in project. write your plug-in code and implement the appropriate plug-in api methods for basic plug-in operation. you'll find an overview of the plug-in api methods in this chapter, as well as separate chapters for all of the major functional areas of the plug-in api. ...
...to see your plug-in in action, simply display the html page that calls it in the browser. registering plug-ins gecko identifies a plug-in by the mime type it supports. ...
...at type), from a separate non-html file of that mime type, or from the server. the server looks for the mime type registered by a plug-in, based on the file extension, and starts sending the file to the browser. the browser looks up the media type, and if it finds a plug-in registered to that type, loads the plug-in software. when it starts up, the browser checks for plug-in modules for the plat
form and registers them. it determines which plug-ins are installed and which types they support through a combination of user preferences that are private to the browser, the contents of the plug-ins directory, or the registry on windows. a mime type is made up of a major type (such as application or image) and a minor type, for example, image/jpeg. if you define a new mime type for a plug-in, you m...
...And 21 more matches
Multimedia: Images - Learn web development
this is a high-level introduction to optimizing multimedia delivery on the web, covering general principles and techniques. ...
... this is a high-level introduction to optimizing multimedia delivery on the web, covering general principles and techniques. ...
... this is a high-level introduction to optimizing multimedia delivery on the web, covering general principles and techniques. ...
...And 21 more matches
Mozilla
add-ons allow developers to extend and modify the functionality of firefox. adding a new css property this page describes how to add a new css property to the style system. the style system is the part of the code in gecko that is responsible for producing a computed value for every property for every element. see the gecko overview for more in
formation about the style system. adding a new event this draft document covers how to add a new event to the mozilla (firefox) source code. adding a new word to the en-us dictionary occasionally bugs are filed pointing out situations where perfectly legitimate words are missing from the english spell check dictionary in firefox. thi...
...he url the channel is about to load. it synchronously returns an nsiapplicationcache object representing the most recent cache version from the most recent cache group containing the entry under the url or a matching namespace. benchmarking debug builds (--enable-debug) and non-optimized builds (--disable-optimize) are much slower. any per
formance metrics gathered by such builds are largely unrelated to what would be found in a release browser. browser chrome tests the browser chrome test suite is an automated testing framework designed to allow testing of application chrome windows using javascript. it currently allows you to run javascript code in the same scope as the main firefox brows...
... creating a login manager storage module the login manager manages and stores user passwords. extensions can replace the built-in password storage with their own implementation. this can be useful if you want to integrate a gecko application's password management with an existing password management system, or use your own password storage
format or database. so for example, on kde is is desirable to fully employ the kde wallet manager, rather than any secondary replacements of kdewallet. creating a spell check dictionary add-on this page describes how to package a hunspell spell check dictionary as a firefox add-on, or how to update your existing add-on, so that it can be installed, uninstalled and upd...
...And 21 more matches
Plug-in Development Overview - Plugins
t make sure that you have the necessary files from the plugin sdk. create a plug-in project. write your plug-in code and implement the appropriate plug-in api methods for basic plug-in operation. you'll find an overview of the plug-in api methods in this chapter, as well as separate chapters for all of the major functional areas of the plug-in api. ...
...to see your plug-in in action, simply display the html page that calls it in the browser. registering plug-ins gecko identifies a plug-in by the mime type it supports. ...
...at type), from a separate non-html file of that mime type, or from the server. the server looks for the mime type registered by a plug-in, based on the file extension, and starts sending the file to the browser. the browser looks up the media type, and if it finds a plug-in registered to that type, loads the plug-in software. when it starts up, the browser checks for plug-in modules for the plat
form and registers them. it determines which plug-ins are installed and which types they support through a combination of user preferences that are private to the browser, the contents of the plug-ins directory, or the registry on windows. a mime type is made up of a major type (such as application or image) and a minor type, for example, image/jpeg. if you define a new mime type for a plug-in, you m...
...And 21 more matches
Gecko info for Windows accessibility vendors
ation? the msaa tree and the dom tree are parallel structures, although the msaa tree is a subset of the dom tree. queryservice() can be used to switch between the interfaces (iaccessible, isimpledomdocument, isimpledomnode and isimpledomtext). if there is no msaa node for a dom node, or vice-versa, queryservice() will return null. anything that is focusable or conveys important in
formation about the structure of the document is exposed in the msaa tree of iaccessibles. windows applications based on the gecko layout engine gecko is a rendering engine that mozilla, netscape and other new browsers use. gecko can render a variety of content, not just html and supports key web standards such as cascading style sheets, javascript and the w3c dom. gecko also handles the users ...
...ows controls for their user interface -- the area outside of the client content window, plus the context menu. mfcembed testing client: this is a very simple package, great for testing basic html accessibility with your products and the gecko rendering engine. k-meleon: a light, ultra-fast and more advanced (fully configurable) gecko-based web browser available on the windows plat
form xul-based clients (support msaa) xul-based clients make full use of the gecko architecture, not only for html content, as well as for menus, dialogs and the entire user interface via an xml language called xul (extensible user-interface language). none of the user interface contains standard windows controls -- not even the menus! this is done to ensure a common look and feel acr...
...lients (support msaa) xul-based clients make full use of the gecko architecture, not only for html content, as well as for menus, dialogs and the entire user interface via an xml language called xul (extensible user-interface language). none of the user interface contains standard windows controls -- not even the menus! this is done to ensure a common look and feel across all supported plat
forms, and to allow for different skins (appearances). firefox (please use version 1.1 alpha builds or later) thunderbird (please use version 1.1 alpha builds or later) mozilla seamonkey (please use 1.8 alpha builds or later) how to find the content window and load the document screen readers need to find the content window so that they know where to start grabbing t...
...And 20 more matches
An overview of NSS Internals
its own implementation of security protocols and cryptographic algorithms, originally called netscape security services, nowadays called network security services (nss). nss is a library written in the c programming language. it's free and open source software, and many other software projects have decided to use it. in order to support multiple operating systems (os), it is based on a cross plat
form portability layer, called the netscape portable runtime (nspr), which provides cross plat
form application programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreaded programming. nss offers lots of functionality; we'll walk through the list of modules, design principles, and important relevant standards. in order to...
...r), which provides cross plat
form application programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreaded programming. nss offers lots of functionality; we'll walk through the list of modules, design principles, and important relevant standards. in order to allow interoperability between software and devices that per
form cryptographic operations, nss con
forms to a standard called pkcs#11. (note that it's important to look at the number 11, as there are other pkcs standards with different numbers that define quite different topics.) a software or hardware module con
forming to the pkcs#11 standard implements an interface of c calls, which allow querying the characteristics and offered services of the module. mul...
...rface, and nss makes use of this interface when talking to those modules. this strategy allows nss to work with many hardware devices (e.g., to speed up the calculations required for cryptographic operations, or to access smartcards that securely protect a secret key) and software modules (e.g., to allow to load such modules as a plugin that provides additional algorithms or stores key or trust in
formation) that implement the pkcs#11 interface. a core element of nss is freebl, a base library providing hash functions, big number calculations, and cryptographic algorithms. softoken is an nss module that exposes most freebl functionality as a pkcs#11 module. some cryptography uses the same secret key for both encrypting and decrypting, for example password based encryption (pbe). this is...
...And 20 more matches
Plug-in Basics - Plugins
next » how plug-ins are used plug-ins offer a rich variety of features that can increase the flexibility of gecko-based browsers. plug-ins like these are now available: multimedia viewers such as adobe flash and adobe acrobat utilities that provide object embedding and compression/decompression services applications that range from personal in
formation managers to games the range of possibilities for using plug-in technology seems boundless, as shown by the growing numbers of independent software vendors who are creating new and innovative plug-ins. 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 da...
...ser by consulting the installed plug-ins page. go to the help menu, and click help and then about plug-ins. 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. notice in view-source that this in
formation is simply gathered from the javascript. because plug-ins are plat
form-specific, you must port them to every operating system and processor plat
form upon which you want to deploy your plug-in. plug-ins and helper applications before plug-ins, there were helper applications. a helper application is a separate, free-standing application that can be started from the browser. like a plug-in, t...
...like a plug-in, a helper application runs separately from the browser in its own application space and does not interact with the browser or the web. when the browser encounters a mime type, it always searches for a registered plug-in first. if there are no matches for the mime type, it looks for a helper application. plug-ins and helper applications fill different application needs. ...
...And 20 more matches
Index - Firefox Developer Tools
s mode, you can see your page presented in a 3d view in which nested blocks of html are increasingly "tall," projecting outward from the bottom of the page. this view makes it easy to visualize the nesting of your content. 3 accessibility inspector accessibility, accessibility inspector, devtools, guide, tools the accessibility inspector provides a means to access important in
formation exposed to assistive technologies on the current page via the accessibility tree, allowing you to check what's missing or otherwise needs attention. this article takes you through the main features of the accessibility inspector and how to use it. 4 color vision simulation accessibility, accessibility inspector, color blindness, devtools, guide, simulation, tools the sim...
...rwise needs attention. this article takes you through the main features of the accessibility inspector and how to use it. 4 color vision simulation accessibility, accessibility inspector, color blindness, devtools, guide, simulation, tools the simulator in the accessibility inspector in firefox developer tools lets you see what a web page would look like to users with various
forms of color vision deficiency (better known as "color blindness"), as well as contrast sensitivity loss. 5 add-ons web development, web development:tools developer tools that are not built into firefox, but ship as separate add-ons. 6 dom inspector dom, dom:tools, dom_inspector, extensions, extensions:tools, themes, themes:tools, tools, web development, web devel...
...er can access them only through methods like debugger.object.prototype.getownpropertydescriptor and debugger.object.prototype.defineproperty, ensuring that the debugger will not inadvertently invoke the referent’s getters and setters. 23 debugger.script a debugger.script instance may refer to a sequence of bytecode in the debuggee or to a block of webassembly code. for the
former, it is the debugger api’s presentation of a jsapi jsscript object. the two cases are distinguished by their
format property being "js" or "wasm". 24 debugger.source a debugger.source instance represents either a piece of javascript source code or the serialized text of a block of webassembly code. the two cases are distinguished by the latter having its introductiontype ...
...And 20 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
d on windows operating systems to support assistive technologies for users with disabilities. third party assistive technology, such as screen readers, screen magnifiers and voice input software, want to track what's happening inside mozilla. they need to know about focus changes and other events, and it needs to know what objects are contained in the current document or dialog box. using this in
formation, a screen reader will speak out loud important changes to the document or ui, and allow the user to track where they navigate. the screen reader user can navigate the web page using screen reader commands or browser commands, and the two pieces of software must remain in sync. some screen readers can even show in
formation on a refreshable braille display. screen magnifiers will zoom to the f...
...times, or even allow the user to enter a special low vision document reading mode, with a variety of features such as ticker mode where text is streamed on a single line. finally, voice dictation software needs to know what's in the current document or ui in order to implement "say what you see" kinds of features. on microsoft windows, these kinds of assistive technology acquire this necessary in
formation via a combination of hacks, msaa and proprietary doms. msaa is supposed to be the "right way" for accessibility aids to get in
formation, but sometimes the hacks are more effective. for example, screen readers look for screen draws of a vertical blinking line, to determine the location of the caret. without doing this, screen readers would not be able to let the user know where there caret ha...
...the location of the caret. without doing this, screen readers would not be able to let the user know where there caret has moved to in most programs, because so many applications do not use the system caret (gecko does not). this is so commonly done, that no one even bothers to support the msaa caret, after all the hack is general solution works with pretty much all applications. msaa provides in
formation in several different ways: a com interface (iaccessible) that allows applications to expose the tree of data nodes that make up each window in the user interface currently being interacted with and custom interface extensions via interfaces via queryinterface and queryservice. this can provide assistive technology with contextual in
formation specific to your object model. for example, ge...
...And 20 more matches
<input type="email"> - HTML: Hypertext Markup Language
address, or, if the multiple attribute is specified, a list of e-mail addresses. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the input value is automatically validated to ensure that it's either empty or a properly-
formatted e-mail address (or list of addresses) before the
form can be submitted. the :valid and :invalid css pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid e-mail address or not. on browsers that don't support inputs of type email, a email input falls back to being a standard text input. value a domstring repr...
...in simple terms, this means username@domain or usern...
...orted 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 con
forming to e-mail syntax. more specifically, there are three possible value
formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was removed. a single properly-
formed e-mail address. this doesn't necessarily mean the e-mail address exists, but it is at least
formatted correctly. in simple terms, this means username@domain or username@domain.tld. there's more to it than that, of course; see validation for ...
...And 20 more matches
<input type="file"> - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. value a domstring representing the path to the selected file. ...
...esent, indicates that the user may choose more than one file accept the accept attribute value is a string that defines the file types the file input should accept. this string is a comma-separated list of unique file type specifiers. ...
...iven 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 a given
format. for instance, there are a number of ways microsoft word files can be identified, so a site that accepts word files might use an <input> like this: <input type="file" id="docpicker" accept=".doc,.docx,application/msword,application/vnd.openxml
formats-officedocument.wordprocessingml.document"> capture the capture attribute value is 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. a value of user indicates that the user-facing camera and/or microphone should be used. a value of environment specifies that the outward-facing camer...
...And 20 more matches
MIME types (IANA media types) - HTTP
it is defined and standardized in ietf's rfc 6838. the internet assigned numbers authority (iana) is responsible for all official mime types, and you can find the most up-to-date and complete list at their media types page. important: browsers use the mime type, not the file extension, to determine how to process a url, so it's important that web servers send the correct mime type in the response's content-type header. ...
... mime type audio/example can be used to indicate that the type is a placeholder and should be replaced with an appropriate one when using the code in the real world. font list at iana font/typeface data. common examples include font/woff, font/ttf, and font/otf. image list at iana image or graphical data including both bitmap and vector still images as well as animated versions of still image
formats such as animated gif or apng. common examples are image/jpeg, image/png, and image/svg+xml. model list at iana model data for a 3d object or scene. examples include model/3mf and model/vml. text list at iana text-only data including any human-readable content, source code, or textual data such as comma-separated value (csv)
formatted data. examples include text/plain, text/csv, and text/ht...
... specific or known subtype, application/octet-stream should be used. multipart types multipart types indicate a category of document broken into pieces, often with different mime types; they can also be used — especially in email scenarios — to represent multiple, separate files which are all part of the same transaction. they represent a composite document. with the exception of multipart/
form-data, used in the post method of html
forms, and multipart/byteranges, used with 206 partial content to send part of a document, http doesn't handle multipart documents in a special way: the message is transmitted to the browser (which will likely show a "save as" window if it doesn't know how to display the document). there are two multipart types: message list at iana a message that encaps...
...And 20 more matches
Digital audio concepts - Web media technologies
representing audio in digital
form involves a number of steps and processes, with multiple
formats available both for the raw audio and the encoded or compressed audio which is actually used on the web. this guide is an overview examining how audio is represented digitally, and how codecs are used to encode and decode audio for use on the web. sampling audio audio is an inherently analog feature of the natural world. as an object vibrates, it causes the molecules surrounding it to vibrate as well. these molecules affect the ones adjacent to them, and so forth, propagating the vibration in the
form of a wave outward from the source until the amplitude of the wave (its volume) fades away with distance. the granularity of an audio wave in the real world, then, is that of an individual molecule...
...) of the wave, the louder the sound is at that instant. the shorter the wavelength (the closer together the crests of the wave are), the higher the frequency (or pitch) of the sound that's produced. computers, however, are digital. in order to represent a sound wave in a way computers can manipulate and work with (let alone transmit over a network), the sound has to be converted into a digital
form. this process is called analog to digital conversion (a/d for short). the first factor affecting the fidelity of the captured audio is the audio bandwidth; that is, the range of audio frequencies the a/d converter is capable of capturing and converting into digital
form. the audio bandwidth is also affected by the codec, if it chooses to discard any frequency bands while encoding the sound. sou...
...rt). the first factor affecting the fidelity of the captured audio is the audio bandwidth; that is, the range of audio frequencies the a/d converter is capable of capturing and converting into digital
form. the audio bandwidth is also affected by the codec, if it chooses to discard any frequency bands while encoding the sound. sound enters the computer through a microphone or other input in the
form of a stream of electrons whose voltage varies to represent the amplitude of the sound wave. this analog signal is then converted into digital
form by a circuit that captures the incoming wave's amplitude at regular intervals, converting that data into a number in a
form that is understood by the audio recording system. each of these captured moments is a sample. by chaining all the samples togeth...
...And 20 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. for that reason, the codecs parameter can be added to the mime type describing media content. with it, container-specific in
formation can be provided. this in
formation may include things like the profile of the video codec, the type used for the audio tracks, and so forth. this guide briefly examines the syntax of the media type codecs parameter and how i...
... tracks, and so forth. this guide briefly examines the syntax of the media type codecs parameter and how it's used with the mime type string to provide details about the contents of audio or video media beyond simply indicating the container type. general syntax a basic mime media type is expressed by stating the type of media (audio, video, etc), then a slash character (/), then the container
format used to contain the media: audio/mpeg an audio file using the mpeg file type, such as an mp3. video/ogg a video file using the ogg file type. video/mp4 a video file using the mpeg-4 file type. video/quicktime a video file in apple's quicktime
format. as noted elsewhere, this
format was once commonly used on the web but no longer is, since it required a plugin to use. however, each o...
...ut no longer is, since it required a plugin to use. however, each of these mime types is vague. all of these file types support a variety of codecs, and those codecs may have any number of profiles, levels, and other configuration factors. for this reason, you can add the codecs parameter to the media type. to do so, append a semicolon (;) followed by codecs= and then the string describing the
format of the contents of the file. some media types only let you specify the names of the codecs to use, while others allow you to specify various constraints on those codecs as well. you can specify multiple codecs by separating them with commas. audio/ogg; codecs=vorbis an ogg file containing a vorbis audio track. video/webm; codecs="vp8, vorbis" a webm file containing vp8 video and/or vorbis...
...And 20 more matches
SVG and CSS - SVG: Scalable Vector Graphics
r over the flower.</text> <g id="flower"> <circle id="overlay" cx="0" cy="0" r="200" stroke="none" fill="url(#fade)"/> <g id="outer-petals"> <g class="quadrant"> <g class="segment"> <path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" trans
form="rotate(18)"> <path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" trans
form="rotate(36)"> <path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g cla...
... <path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" trans
form="rotate(36)"> <path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" trans
form="rotate(54)"> <path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" trans
form="rotate(72)"> <path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> </g> ...
...,0 v-200 a40,40 0 0,0 -62,10 z"/> <path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" trans
form="rotate(72)"> <path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> </g> <g class="quadrant"> <g class="segment" trans
form="rotate(90)"> <path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g class="segment" trans
form="rotate(108)"> <path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g cl...
...And 20 more matches
JavaScript Daemons Management - Archive of obsolete content
the following daemons management framework is the major version of setinterval – a little framework. introduction sometimes a page uses dozens and dozens of animations. in such a condition it is difficult and unnatural to keep track of all events started and then to stop them when appropriate through the cleartimeout() function. a possible approach to solve this problem is to nest all the in
formation needed by each animation to start, stop, etc. in different objects (daemons) and then to create a constructor for such a class of objects (daemon) in order to standardize and simplify the instantiation of them. note: a minimalistic version of it (minidaemon) is published here. this more complex version of it is nothing but a big and scalable collection of methods for the daemon constructor.
...or some of them, * depending on your needs. if you want to remove them and are using the daemon.safe subsystem you * should also remove the daemon.safe global object methods that require them. ...
... daemon.safe subsystem you * should also remove the daemon.safe global object methods that require them. ...
...And 19 more matches
Enhanced Extension Installation - Archive of obsolete content
it is very difficult for a third party application with its own managed install process to install an extension into firefox. first it must locate the firefox executable, then run it with the -install-global-extension command line flag, which installs from a xpi into the firefox application directory. aside from the work of locating the firefox executable in the first place (which varies from plat
form to plat
form), this is very limiting because: it forces the third party application to package its firefox integration hooks as a xpi. it forces it to have write access to the firefox directory in order to be installed, which may not always be the case. it forces its items to be located in different places on the user's disk - some vendors wish to keep all of their installed content wi...
...sions/extensions.rdf - an xml/rdf datasource listing all the extensions installed at that location. <location>/extensions.ini - an ini manifest listing the directories for all the extensions and themes at the location (used by the component manager, preferences system, chrome registry etc to locate files during the startup process). in the profile directory, the file compatibility.ini stores in
formation about the version of the application (build info) that last started this profile - during startup this file is checked and if the version info held by the running app disagrees with the info held by this file, a compatibility check is run on all installed items. when changes are made to the extensions datasource - new items are installed, old items uninstalled, enabled or disabled, a .autor...
... as well, which tells the startup code that the system has been modified, so that it destroys the component registries, finishes pending transactions and regenerates metadata appropriately. datasource structure the extension manager implements a rdf datasource which contains a composite of the two xml/rdf datasources at the two install locations. ...
...And 19 more matches
Extension Versioning, Update and Compatibility - Archive of obsolete content
how applications determine compatibility when installing add-ons applications look at the targetapplication entries in the add-on's install.rdf. an entry must exist with an id matching the id of the application. ...
... how applications determine compatibility when installing add-ons applications look at the targetapplication entries in the add-on's install.rdf. an entry must exist with an id matching the id of the application. ...
... how applications determine compatibility when installing add-ons applications look at the targetapplication entries in the add-on's install.rdf. an entry must exist with an id matching the id of the application. ...
...And 19 more matches
Index of archived content - Archive of obsolete content
ame 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 plat
form/xpcom preferences/event-target preferences/service remote/child remote/parent stylesheet/style stylesheet/utils system/child_process system/environment system/events system/runtime system/unload system/xul-app tabs/ut...
...e bookmarks boxes canvas code snippets cookies customizing the download progress bar delayed execution dialogs and prompts downloading files drag & drop embedding svg examples and demos from articles file i/o finding window handles
forms related code snippets html in xul for rich tooltips html to dom isdefaultnamespace js xpcom javascript debugger service javascript timers javascript daemons management label and description lookupnamespaceuri lookupprefix...
... initialization and cleanup prerequisites walkthrough webextensions for firefox for android listening to events in firefox extensions migrating from internal linkage to frozen linkage migrating raw components to add-ons multiple item extension packaging offering a context menu for
form controls overlay extensions firefox addons developer guide appendix: what you should know about open-source software licenses chapter 1: introduction to extensions chapter 2: technologies used in developing extensions chapter 3: introduction to xul—how to build a mor...
...And 19 more matches
Editor Embedding Guide - Archive of obsolete content
etcommandstate "state_attribute" (cstring) docommand "state_attribute" (cstring) note there must be a clear undo stack or this will not work. cmd_copy copies current selection. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this will not really give you any concrete in
formation on the state of the command. cmd_cut cuts current selection. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this will not really give you any concrete in
formation on the state of the command. cmd_delete deletes current selection. getcommandstate "state_enabled"...
...ill return whether or not it is possible to call docommand. this will not really give you any concrete in
formation on the state of the command. cmd_delete deletes current selection. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this will not really give you any concrete in
formation on the state of the command. cmd_paste pastes into current selection or if there is no selection at the cursor position. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this will not really give you any concrete in
formation on the state of the command. cmd_cutordelet...
...ether or not it is possible to call docommand. this will not really give you any concrete in
formation on the state of the command. cmd_cutordelete cuts or deletes current selection. getcommandstate "state_enabled" (boolean) docommand no parameter note getcommandstate in these cases will return whether or not it is possible to call docommand. this will not really give you any concrete in
formation on the state of the command. cmd_deletecharbackward deletes one character backward relative to the current selection end point. acts like backspace key. ...
...And 19 more matches
Skinning XUL Files by Hand - Archive of obsolete content
in the very near future, it will be possible to skin xul files dynamically and completely -- by pressing a button, selecting a skin from a menu, or by accepting a skin from over the web. ...
...sses for all of the interested elements. the skin will reside in a single css file, appropriately named drxul.css. as you will see, css provides a lot of flexibility for defining styles to individual elements, to classes of elements, to pseudo-classes, and to anonymous classes. by the way, in contrast to the term skin, "chrome" refers to the skin and the content and whatever localization and plat
form-specific files are necessary for a particular part of the application or window. the skin is just the style or appearance of an interface, where the chrome is the style, content, and structure. the chrome is everything in the front end of an application. much of what makes xul look (and act!) the way it does comes from the css for each xul element. css2, for example, gives you control over the a...
...n { border: 0px !important; } the global skin, in which styles for these several button classes and dozens of other elements are defined, is described in the following section. if you want to use the classes already defined in mozilla's global skin to style your elements, you may do so. but you may also want to define new classes of buttons particular to your xul file, in which case the style in
formation will be wholly defined within your custom css file. reading the global skin it's very important to familiarize yourself with the basic style definitions in the global skin before you set out creating your own stylesheet. css can quickly become complicated. the ability to apply styles to elements of a type, to specifically identified elements, and to classes of elements creates the potentia...
...And 19 more matches
Introduction to SSL - Archive of obsolete content
etf) standard protocol called transport layer security (tls) is based on ssl. the details of the protocol are available in request for comments (rfc): 2246,the tls protocol version 1.0. some red hat products already support tls. most other red hat products plan to support the protocol in future versions. this document is primarily intended for administrators of red hat server products, but the in
formation it contains may also be useful for developers of applications that support ssl. the document assumes that you are familiar with the basic concepts of public-key cryptography, as summarized in "introduction to public-key cryptography." the ssl protocol the transmission control protocol/internet protocol (tcp/ip) governs the transport and routing of data over the internet. other protocols, s...
... server to confirm a user's identity. using the same techniques as those used for server authentication, ssl-enabled server software can check that a client's certificate and public id are valid and have been issued by a certificate authority (ca) listed in the server's list of trusted cas. this confirmation might be important if the server, for example, is a bank sending confidential financial in
formation to a customer and wants to check the recipient's identity. an encrypted ssl connection requires all in
formation sent between a client and a server to be encrypted by the sending software and decrypted by the receiving software, thus providing a high degree of confidentiality. confidentiality is important for both parties to any private transaction. in addition, all data sent over an encrypt...
...ity is important for both parties to any private transaction. in addition, all data sent over an encrypted ssl connection is protected with a mechanism for detecting tampering-that is, for automatically determining whether the data has been altered in transit. the ssl protocol includes two sub-protocols: the ssl record protocol and the ssl handshake protocol. the ssl record protocol defines the
format used to transmit data. the ssl handshake protocol involves using the ssl record protocol to exchange a series of messages between an ssl-enabled server and an ssl-enabled client when they first establish an ssl connection. this exchange of messages is designed to facilitate the following actions: authenticate the server to the client. allow the client and server to select the cryptographic ...
...And 19 more matches
Client-side storage - Learn web development
to download the music files once — on subsequent visits they would be retrieved from the database instead. note: there are limits to the amount of data you can store using client-side storage apis (possibly both per individual api and cumulatively); the exact limit varies depending on the browser and possibly based on user settings. see browser storage limits and eviction criteria for more in
formation. old school: cookies the concept of client-side storage has been around for a long time. since the early days of the web, sites have used cookies to store in
formation to personalize user experience on websites. they're the earliest
form of client-side storage commonly used on the web. these days, there are easier mechanisms available for storing client-side data, therefore we won't be te...
...age commonly used on the web. these days, there are easier mechanisms available for storing client-side data, therefore we won't be teaching you how to use cookies in this article. however, this does not mean cookies are completely useless on the modern-day web — they are still used commonly to store data related to user personalization and state, e.g. session ids and access tokens. for more in
formation on cookies see our using http cookies article. new school: web storage and indexeddb the "easier" features we mentioned above are as follows: the web storage api provides a very simple syntax for storing and retrieving smaller, data items consisting of a name and a corresponding value. this is useful when you just need to store some simple data, like the user's name, whether they are lo...
...e to give you an idea of how web storage can be used. our example will allow you enter a name, after which the page will update to give you a personalized greeting. this state will also persist across page/browser reloads, because the name is stored in web storage. you can find the example html at personal-greeting.html — this contains a simple website with a header, content, and footer, and a
form for entering your name. let's build up the example, so you can understand how it works. first, make a local copy of our personal-greeting.html file in a new directory on your computer. next, note how our html references a javascript file called index.js (see line 40). we need to create this and write our javascript code into it. create an index.js file in the same directory as your...
...And 19 more matches
React interactivity: Events and state - Learn web development
has special meaning here: it tells react to run a given function when the user clicks on the button. there are a couple of other things to note: the camel-cased nature of onclick is important — jsx will not recognize onclick (again, it is already used in javascript for a specific purpose, which is related but different — standard onclick handler properties). all browser events follow this
format in jsx – on, followed by the name of the event. let's apply this to our app, starting in the
form.js component. handling
form submission at the top of the
form() component function, create a function named handlesubmit(). this function should prevent the default behavior of the submit event. after that, it should trigger an alert(), which can say whatever you’d like. it should end up lo...
...e
form() component function, create a function named handlesubmit(). this function should prevent the default behavior of the submit event. after that, it should trigger an alert(), which can say whatever you’d like. it should end up looking something like this: function handlesubmit(e) { e.preventdefault(); alert('hello, world!'); } to use this function, add an onsubmit attribute to the <
form> element, and set its value to the handlesubmit function: <
form onsubmit={handlesubmit}> now if you head back to your browser and click on the "add" button, your browser will show you an alert dialog with the words "hello, world!" — or whatever you chose to write there. callback props in react applications, interactivity is rarely confined to just one component: events that happen in one co...
...d click on the "add" button, your browser will show you an alert dialog with the words "hello, world!" — or whatever you chose to write there. callback props in react applications, interactivity is rarely confined to just one component: events that happen in one component will affect other parts of the app. ...
...And 19 more matches
OS.File for the main thread
existing if true, the file must already exist. if the file does not exist, throw an error. cannot be used with create. append if true, the file will be opened for appending, meaning the equivalent of .setposition(0, pos_end) is executed before each write. the default is true, i.e. opening a file for appending. specify append: false to open the file in regular mode. optionsoptional plat
form-specific options for opening the file. for advanced users only. most users will never have need of these options. to specify options, pass an object that may contain some of the following flags: unixflags (ignored under non-unix plat
forms) if specified, file opening flags, as per libc function open. if unspecified, build these flags from the contents of mode. you can build these flags from ...
...sers will never have need of these options. to specify options, pass an object that may contain some of the following flags: unixflags (ignored under non-unix plat
forms) if specified, file opening flags, as per libc function open. if unspecified, build these flags from the contents of mode. you can build these flags from values os.constants.libc.o_*. unixmode (ignored under non-unix plat
forms) if specified, file creation mode, as per libc function open. if unspecified, files are created with a default mode of 0600 (file is private to the user, the user can read and write). you can build this mode from values os.constants.libc.s_i*. winshare (ignored under non-windows plat
forms) if specified, a sharing policy, as per windows function createfile. if unspecified, files are opened wi...
...gnored under non-windows plat
forms) if specified, a sharing policy, as per windows function createfile. if unspecified, files are opened with a default sharing policy (file is not protected against being read/written/removed by another process or another use in the same process). you can build this policy from constants os.constants.win.file_share_*. winsecurity (ignored under non-windows plat
forms) if specified, a security policy, as per windows function createfile. if unspecified, no security attributes. winaccess (ignored under non-windows plat
forms) if specified, access mode, as per windows function createfile. this also requires option windisposition and this replaces argument mode. if unspecified, value is built from mode. ...
...And 19 more matches
NSS tools : certutil
s, create or change the password, generate new public and private key pairs, display the contents of the key database, or delete key pairs within the key database. certificate issuance, part of the key and certificate management process, requires that keys and certificates be created in the key database. this document discusses certificate and key database management. for in
formation on the security module database management, see the modutil manpage. options and arguments running certutil always requires one and only one command option to specify the type of certificate operation. each option may take arguments, anywhere from none to multiple arguments. the command option -h will list all the command options available and their relevant argumen...
... -h display a list of the options and arguments used by the certificate database tool. -k list the key id of keys in the key database. a key id is the modulus of the rsa key or the publicvalue of the dsa key. ids are displayed in hexadecimal ("0x" is not shown). -l list all the certificates, or display in
formation about a named certificate, in a certificate database. use the -h tokenname argument to specify the certificate database on a particular hardware or software token. -m modify a certificate's trust attributes using the values of the -t argument. -n create new certificate and key databases. -o print t...
...abases into one. --upgrade-merge upgrade an old database and merge it into a new database. this is used to migrate legacy nss databases (cert8.db and key3.db) into the newer sqlite databases (cert9.db and key4.db). arguments arguments modify a command option and are usually lower case, numbers, or symbols. ...
...And 19 more matches
certutil
assword, generate new public and private key pairs, display the contents of the key database, or delete key pairs within the key database. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database. this document discusses certificate and key database management. for in
formation security module database management, see the modutil manpages. options and arguments running certutil always requires one (and only one) option to specify the type of certificate operation. each option may take arguments, anywhere from none to multiple arguments. run the command option and -h to see the arguments available for each command option. options options spe...
... overwritten. -h display a list of the options and arguments used by the certificate database tool. -k list the key id of keys in the key database. a key id is the modulus of the rsa key or the publicvalue of the dsa key. ids are displayed in hexadecimal ("0x" is not shown). -l list all the certificates, or display in
formation about a named certificate, in a certificate database. use the -h tokenname argument to specify the certificate database on a particular hardware or software token. -m modify a certificate's trust attributes using the values of the -t argument. -n create new certificate and key databases. -o print the ...
...o the newer sqlite databases (cert9.db and key4.db). --upgrade-merge upgrade an old database and merge it into a new database. this is used to migrate legacy nss databases (cert8.db and key3.db) into the newer sqlite databases (cert9.db and key4.db). arguments option arguments modify an action and are lowercase. ...
...And 19 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
this will help to solidify your understanding of how the geometry of 3d graphics and vr work, as well as to help ensure you understand the way the functions and data that are used during xr rendering work together. screenshot of this example in action the core of this example—the spinning, textured, lighted cube—is taken from our webgl tutorial series; namely, the penultimate article in the series, covering lighting in webgl. ...
...ways displays what it renders on the screen, even if using immersive-vr mode. this lets you compare any differences in rendering between the two modes, and lets you see output from immersive mode even if you don't have a headset. ...
...e being rendered. radians_per_degreee is the value to multiply an angle in degrees by to convert the angle into radians. the last four variables declared are storage for references to the <div> elements into which we'll output the matrices when we want to show them to the user. logging errors a function called logglerror() is implemented to provide an easily customized way to output logging in
formation for errors that occur while executing webgl functions. function logglerror(where) { let err = gl.geterror(); if (err) { console.error(`webgl error returned by ${where}: ${err}`); } } this takes as its only input a string, where, which is used to indicate what part of the program generated the error, since similar errors can have in multiple situations. the vertex and fragment s...
...And 19 more matches
HTML attribute: rel - HTML: Hypertext Markup Language
the rel attribute defines the relationship between a linked resource and the current document. valid on <link>, <a>, <area>, and <
form>, the supported values depend on the element on which the attribute is found. 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. every keyword within a space seperated value should be unique within that value. values for the rel attribute, and the elements for which each is relevant rel value description <link> <a> and <area> <
form> alternate alternate representations of the current document. link link not allowed author author of the current ...
... document. link link not allowed author author of the current document or article. link link not allowed bookmark permalink for the nearest ancestor section. not allowed link not allowed canonical preferred url for the current document. link not allowed not allowed dns-prefetch tells the browser to preemptively per
form dns resolution for the target resource's origin external resource not allowed not allowed external referenced document is not part of the same site as the current document. not allowed annotation annotation help link to context-sensitive help. link link link icon icon representing the current document. external resource not allo...
... be used to search through the current document and its related pages. link link link stylesheet imports a style sheet. external resource not allowed not allowed tag gives a tag (identified by the given address) that applies to the current document. not allowed link not allowed the rel attribute is relevant to the <link>, <a>, <area>, and <
form> elements, but some values only relevant to a subset of those elements. like all html keyword attribute values, these values are case-insenstive. the rel attribute has no default value. if the attribute is omitted or if none of the values in the attribute are supported, then the document has no particular relationship with the destination resource other than there being a hyperlink between the t...
...And 19 more matches
<input type="text"> - HTML: Hypertext Markup Language
nored completely. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. you should also include other explanatory text nearby. see specifying a pattern for further details and an example. ...
...hat kind of in
formation is expected in the field. it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message. the text must not include carriage returns or line feeds. if the control's content has one directionality (ltr or rtl) but needs to present the placeholder in the opposite directionality, you can use unicode bidirectional algorithm
formatting characters to override directionality within the placeholder; see overriding bidi using unicode control characters in the unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your
form, and can cause unexpected technical issues with your content. see labels and placehold...
...de directionality within the placeholder; see overriding bidi using unicode control characters in the unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your
form, and can cause unexpected technical issues with your content. see labels and placeholders in <input>: the input (
form input) element for more in
formation. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also specified. size ...
...And 19 more matches
Handling common HTML and CSS problems - Learn web development
trouble with html and css lies with the fact that both languages are fairly simple, and often developers don't take them seriously, in terms of making sure the code is well-crafted, efficient, and semantically describes the purpose of the features on the page. in the worst cases, javascript is used to generate the entire web page content and style, which makes your pages inaccessible, and less per
formant (generating dom elements is expensive). in other cases, nascent features are not supported consistently across browsers, which can make some features and styles not work for some users. responsive design problems are also common — a site that looks good in a desktop browser might provide a terrible experience on a mobile device, because the content is too small to read, or perhaps the site i...
...make sure your code is working generally, before going on to concentrate on the cross browser issues. in our debugging html and debugging css articles, we provided some really basic guidance on debugging html/css — if you are not familiar with the basics, you should definitely study these articles before carrying on. basically, it is a matter of checking whether your html and css code is well
formed and doesn't contain any syntax errors. note: one common problem with css and html arises when different css rules begin to conflict with one another. this can be especially problematic when you are using third party code. for example, you might use a css framework and find that one of the class names it uses clashes with one you've already used for a different purpose. or you might find that ...
...nts besides. linters can generally be customized to be stricter or more relaxed in their error/warning reporting. there are many online linter applications, the best of which are probably dirty markup (html, css, javascript), and css lint (css only). these allows you to paste your code into a window, and it will flag up any errors with crosses, which can then be hovered to get an error message in
forming you what the problem is. dirty markup also allows you to make fixes to your markup using the clean button. however, it is not very convenient to have to copy and paste your code over to a web page to check its validity several times. what you really want is a linter that will fit into your standard workflow with the minimum of hassle. many code editors have linter plugins. github's atom co...
...And 18 more matches
Web Replay
points cannot have side-effects or diverge from the recording in any othe way in this mode. default false. devtools.recordreplay.logging when enabled, firefox will log web replay's internal actions to the terminal, which is helpful when debugging hangs and crashes. default false architecture there are several main components to the project: the record/replay infrastructure records enough in
formation during recording so that the replayed process can run and produce the same observable behaviors. ipc integration allows a replaying process to communicate with the chrome process using ipdl and shared memory. the rewind infrastructure allows a replaying process to restore a previous state, while still maintaining communication with the chrome process. debugger integration allows the js de...
...g so that the replayed process can run and produce the same observable behaviors. ipc integration allows a replaying process to communicate with the chrome process using ipdl and shared memory. the rewind infrastructure allows a replaying process to restore a previous state, while still maintaining communication with the chrome process. debugger integration allows the js debugger to read the in
formation it needs from a replaying process and control the process's execution (resume/rewind). the debugger is not allowed to change the replaying process's observable state. record/replay infrastructure broadly, reliable record/replay is achieved by controlling for non-determinism in the browser. this non-determinism originates from two sources: intra-thread and inter-thread. intra-thread non...
..., and which always behave the same given the same interleaving. intra-thread non-determinism is recorded and later replayed for each thread. these behaviors mainly originate from system calls (i/o and such). inter-thread non-determinism is handled by first assuming the program is data race free: shared memory accesses which would otherwise race are either protected by locks or use apis that per
form atomic operations. if we record and later replay the order in which threads acquire locks (and, by extension, release locks and use condvars) then accesses on lock-protected memory will occur in the same order. atomic variables can be handled by treating reads and writes as if they were wrapped by a lock acquire/release during recording. it is not enough, however, to just record all these non-...
...And 18 more matches
WebGLRenderingContext.texImage2D() - Web APIs
the webglrenderingcontext.teximage2d() method of the webgl api specifies a two-dimensional texture image. ...
... the webglrenderingcontext.teximage2d() method of the webgl api specifies a two-dimensional texture image. ...
... the webglrenderingcontext.teximage2d() method of the webgl api specifies a two-dimensional texture image. ...
...And 18 more matches
WebGL best practices - Web APIs
our users run. general topics address and eliminate webgl errors your application should run without generating any webgl errors (as returned by geterror). every webgl error is reported in the web console as a javascript warning with a descriptive message. after too many errors (32 in firefox), webgl stops generating descriptive messages, which really hinders debugging. the only errors a well-
formed page generates are out_of_memory and context_lost. know your limits (and extensions) the availability of most webgl extensions depends on the client system. when using webgl extensions, if possible, try to make them optional by gracefully adapting to the case there they are not supported. likewise the limits of your system will be different than your clients' systems! don't assume you can us...
...bgl are quite low. ...
...set up your hot framebuffers ahead...
...And 18 more matches
Geometry and reference spaces in WebXR - Web APIs
at a fundamental level, rendering of scenes for webxr presentation in either augmented reality or virtual reality contexts is per
formed using webgl, so the two apis share much of the same design language. however, in order to provide the ability to present scenes in true 3d using xr headsets and other such equipment, webxr has additional concepts that must be understood. in this article, we introduce the ways in which webxr expands upon the geometry of webgl, and how the positions and orientations of objects—both physical and virtual—are described in relation to one another using spaces and, in particular, reference spaces. ...
...nd other such equipment, webxr has additional concepts that must be understood. in this article, we introduce the ways in which webxr expands upon the geometry of webgl, and how the positions and orientations of objects—both physical and virtual—are described in relation to one another using spaces and, in particular, reference spaces. the article spatial tracking in webxr builds upon the in
formation provided here to cover how the physical position and orientation of the user's head, as well as potentially other parts of their body such as the hands, are mapped into the digital world, as well as how the relative positions of both physical and virtual objects are tracked as they move around, so that the scene can be properly rendered and composited. fundamentals of 3d geometry while we'...
... meters wide, two meters tall, and two meters deep. each of the three axes has a minimum value of -1.0 and a maximum of 1.0, with the center of the cube located at (0, 0, 0). this two cubic meter space encompasses the entire universe for the purposes of your code. everything you draw must have its coordinates mapped to fit into this space, either explicitly within your code, or by using a trans
form to adjust the coordinates of all vertices. the most efficient way, of course, is to design your objects and code to use the same coordinate system as webgl does. the webgl coordinates and lengths are trans
formed automatically at render time to the size of the viewport in which the scene is being rendered. angles angles are specified using radians. to convert degrees to radians, simply multiply...
...And 18 more matches
Structure of an installable bundle - Archive of obsolete content
xulrunner applications, extensions, and themes all share a common directory structure, and in some cases the same bundle can be used as a standalone xulrunner application as well as an installable application extension. basic structure of a bundle a bundle may include any of the following files: path from the root of the bundle description version in
formation /install.rdf extension/theme install manifest /application.ini application launch manifest /bootstrap.js the bootstrap script for extensions not requiring a restart (those with <em:bootstrap>true</em:bootstrap> in their install.rdf). note that other files and directories (e.g. chrome.manifest, components, defaults) in bootstrapped extensions are not processed by a...
... /searchplugins/*.xml mozsearch and opensearch plugins firefox 2 and greater /dictionaries/*.{aff|dic} myspell dictionaries firefox 2 and greater of course, an extension need not (and normally won't) have all of these directories. themes are limited for security reasons, and can normally only provide a chrome.manifest which registers the theme and a jar file. plat
form-specific files gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) removed support for plat
form-specific subdirectories, described below. instead, you need to use manifest flags, such as the os and abi flags, in your chrome manifest to specify components that should be loaded for specific plat
forms. for example: binary-component components/windows/mycomponent.dll abi=winnt_x86-msvc binary-...
...omponents that should be loaded for specific plat
forms. for example: binary-component components/windows/mycomponent.dll abi=winnt_x86-msvc binary-component components/mac/mycomponent.dylib abi=darwin_x86-gcc3 binary-component components/mac/mycomponent64.dylib abi=darwin_x86_64-gcc3 binary-component components/linux/mycomponent.so abi=linux_x86-gcc3 this also means you can no longer have plat
form-specific preference files in your bundle. plat
form-specific subdirectories: gecko 1.9.2.x and earlier note: plat
form-specific subdirectory support was removed in gecko 2.0. see the section plat
form-specific files to learn how to use plat
form-specific files. ...
...And 17 more matches
Tamarin build documentation - Archive of obsolete content
tamarin source versions the following instructions are for obtaining and building the tamarin central source code. for instructions on tamarin tracing, please see tamarin tracing build documentation. supported plat
forms tamarin currently supports the following operating systems and/or architectures. windows 32 and 64 bit mac osx 10.4, 10.5 on ppc mac osx 10.5, 10.6 on intel linux 32 and 64 bit solaris 10 on sparc android 2.2 on arm windows mobile 6.5 mips (linux) sh4 (linux) getting the tamarin source the tamarin source resides in mercurial at tamarin central. active development source resides at tamarin redux. in this document replace instances of tamarin-central with tamarin-redux to operate in the redux repository. use the following command to create a copy of th...
... redux repository. use the following command to create a copy of the tamarin repository: $ hg clone http://hg.mozilla.org/tamarin-central tamarin-central tips for working with mercurial can be found here. building tamarin building tamarin will create all the libraries for the avmplus and garbage collector (mmgc), and create a standalone executable (shell) for executing files in the abc file
format. running the shell without any arguments will list the available options. note that additional command-line arguments are only available in the debug configuration. the tamarin codebase contains a cross-plat
form build system for mozilla developers. the cross-plat
form build system is used for daily automated build testing so it is the most reliable system. the tamarin codebase has the ability ...
...ated build testing so it is the most reliable system. the tamarin codebase has the ability to build additional code which supports debugging hooks. in the xcode project, this is the debug_debugger and release_debugger configurations. the flash player builds tamarin with the debugging hooks off for codesize reasons, but the mozilla client will build tamarin with the debugging hooks on. cross-plat
form build (general instructions - non-android) prerequisites: you need python 2.5 or later and gnu make 3.81 or later. (gnu make 3.80 does not work. nor does any other brand of make.) with the right prerequisites, use these commands to build tamarin: $ hg clone http://hg.mozilla.org/tamarin-redux/ $ cd tamarin-redux $ mkdir objdir-release $ cd objdir-release $ python ../configure.py $ make ...
...And 17 more matches
Learn XPI Installer Scripting by Example - Archive of obsolete content
uses the installer script from browser.xpi install package as the basis for discussing xpi installations in general. this installer script is relatively short, but it exercises most of the important features of the xpinstall api, and it can easily be used as a template for other more general software installations. ...
...eneral. this installer script is relatively short, but it exercises most of the important features of the xpinstall api, and it can easily be used as a template for other more general software installations. in this article, we use the unix install file, but the installers for all the plat
forms are quite similar, and you can easily take what you learn here and apply it to installations on any plat
form that mozilla supports. about browser.xpi browser.xpi is the xpi archive in which the main components of the mozilla browser are archived for installation. mozilla cross-plat
form installations use the xpi
format as a way to organize, compress, and automate software installations and software updates. a xpi is a pkzip-compressed archive (like zip and jar files) with a special script at the highes...
...hive itself, though it's possible to rearrange things arbitrarily upon installation--to create new directories, to install files in system folders and other areas. overview of the install script xpi install scripts are written in javascript using xpinstall engine syntax defined in the xpinstall api reference. ...
...And 17 more matches
The Joy of XUL - Archive of obsolete content
these applications are easily customized with alternative text, graphics, and layout so they can be readily branded or localized for various markets. ...
...these applications are easily customized with alternative text, graphics, and layout so they can be readily branded or localized for various markets. ...
...ications are easily customized with alternative text, graphics, and layout so they can be readily branded or localized for various markets. web developers already familiar with dynamic html (dhtml) will learn xul quickly and can start building applications right away. also described are some reasons application developers might choose to leverage xul and mozilla technology for building cross-plat
form applications. this same investigation will provide sufficient explanation of mozilla's motivation to build xul and why the mozilla plat
form is constructed using it. the key features and benefits of xul will be explored followed by an examination of supporting mozilla technologies. finally, a mini case study of a calendar application written in xul will reinforce the benefits of building applicati...
...And 17 more matches
Chrome registration
ption comes from the content provider, and it can be any file type viewable from within mozilla. it will typically be a xul file, since xul is designed for describing the contents of windows and dialogs. the javascript files that define the user interface are also contained within the content packages, as well as most xbl binding files. locale localizable applications keep all their localized in
formation in locale providers. this allows translators to plug in a different chrome package to translate an application without altering the rest of the source code. the two main types of localizable files are dtd files and java-style properties files. skin a skin provider is responsible for providing a complete set of files that describe the visual appearance of the chrome. typically a skin provid...
...the gecko runtime maintains a service known as the chrome registry that provides mappings from chrome package names to the physical location of chrome packages on disk. this chrome registry is configurable and persistent, and thus a user can install different chrome providers, and select a preferred skin and locale. this is accomplished through xpinstall and the extension manager. in order to in
form the chrome registry of the available chrome, a text manifest is used: this manifest is "chrome.manifest" in the root of an extension, or theme, or xulrunner application. the plaintext chrome manifests are in a simple line-based
format. each line is parsed individually; if the line is parsable the chrome registry takes the action identified by that line, otherwise the chrome registry ignores that...
...est instructions comments # this line is a comment - you can put here whatever you want a line is a comment if it begins with the character '#'. any following character in the same line is ignored. manifest manifest subdirectory/foo.manifest [flags] this will load a secondary manifest file. this can be useful for separating component and chrome registration instructions, or separate plat
form-specific registration data. binary-component binary-component components/mycomponent.dll [flags] instructs mozilla to register and use a binary component. it should be combined with the abi flag, since binary components are abi-specific. prior to firefox 4, files in the components directory were registered automatically. interfaces interfaces component/mycomponent.xpt [flags] instruct...
...And 17 more matches
Drawing and Event Handling - Plugins
e window) on a web page. a windowed plug-in is opaque, hiding the part of the page beneath its display window. this type of plug-in determines when it draws itself. a windowless plug-in does not require a native window. it is drawn in a target called a drawable, which corresponds to either the browser window or an off-screen bitmap. a drawable can be defined in several ways, depending on the plat
form. windowless plug-ins can be opaque or transparent. a windowless plug-in draws itself only in response to a paint message from the browser. for in
formation about the way html determines plug-in display mode, see using html to display plug-ins. note: windowless plug-ins were not supported on the x window system plat
form prior to gecko 1.9 alpha 7 (bug 137189). the npwindow structure when a p...
...e: windowless plug-ins were not supported on the x window system plat
form prior to gecko 1.9 alpha 7 (bug 137189). the npwindow structure when a plug-in is loaded, it is drawn into a target area. this target is either the windowed plug-in's native window, or the drawable of a windowless plug-in. the npwindow structure represents either the native window or a drawable. this structure contains in
formation about coordinate position, size, the state of the plug-in (windowed or windowless), and some plat
form-specific in
formation. note: when a plug-in is drawn to a window, the plug-in is responsible for preserving state in
formation and ensuring that the original state is restored. for windowless plug-ins, the browser calls the npp_setwindow method with an npwindow structure that represents a ...
... windowless plug-ins, the browser calls the npp_setwindow method with an npwindow structure that represents a drawable. for windowed plug-ins, the browser calls the npp_setwindow method with an npwindow structure that represents a window. ...
...And 17 more matches
BluetoothCharacteristicProperties - Web APIs
perties experimentalchrome full support 56notes full support 56notes notes chromeos and macos only. full support 56notes disabled notes linux and versions of windows earlier than 10.disabled from version 56: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes edgeos and macos only. full support ...
... windows 10.edge full support ≤79notes full support ≤79notes notes edgeos and macos only. full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). full support ≤79notes notes windows 10.firefox no support noie no support noopera full support yessafari no support nowebv...
...dwrites experimentalchrome full support 56notes full support 56notes notes chromeos and macos only. full support 56notes disabled notes linux and versions of windows earlier than 10.disabled from version 56: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes edgeos and macos only. full support ...
...And 17 more matches
Using the CSS Typed Object Model - Web APIs
this article provides an introduction to all of its main features. ...
... this article provides an introduction to all of its main features. ...
... this article provides an introduction to all of its main features. ...
...And 17 more matches
Using the Frame Timing API - Web APIs
the per
formanceframetiming interface provides frame timing data about the browser's event loop. a frame represents the amount of work a browser does in one event loop iteration such as processing dom events, resizing, scrolling, rendering, css animations, etc. a frame rate of 60 fps (frames per second) for a 60 hz refresh rate is a common target for a good responsive user experience. this means the browser should process a frame in about 16.7ms. an application can register a per
formanceobserver for "frame" per
formance entry types and the observer will have data about the duration of each frame event. this data can be used to help identify areas that take too long to provide a good user experience. ...
... a good responsive user experience. this means the browser should process a frame in about 16.7ms. an application can register a per
formanceobserver for "frame" per
formance entry types and the observer will have data about the duration of each frame event. this data can be used to help identify areas that take too long to provide a good user experience. this document describes how to use the per
formanceframetiming interfaces including example code. for an overview of these interfaces see frame timing api. frame observers the per
formance observer interfaces allow an application to register an observer for specific per
formance event types. ...
...ke too long to provide a good user experience. this document describes how to use the per
formanceframetiming interfaces including example code. for an overview of these interfaces see frame timing api. frame observers the per
formance observer interfaces allow an application to register an observer for specific per
formance event types. when one of those event types is added to the browser's per
formance timeline, the application is notified of the event via the observer's callback function that was specified when the observer was created. creating an observer to observe "frame" per
formance entry types, the application first creates a per
formanceobserver object with a specific frame observer callback. ...
...And 17 more matches
Codecs used by WebRTC - Web media technologies
to communicate, the two devices need to be able to agree upon a mutually-understood codec for each track so they can successfully communicate and present the shared media. this guide reviews the codecs that browsers are required to implement as well as other codecs that some or all browsers support for webrtc. ...
...her, without a container or even a mediastream associated with the tracks. which codecs can be within those tracks is not mandated by the webrtc specification. however, rfc 7742 specifies that all webrtc-compatible browsers must support vp8 and h.264's constrained baseline profile for video, and rfc 7874 specifies that browsers must support at least the opus codec as well as g.711's pcma and pcmu
formats. these two rfcs also lay out options that must be supported for each codec, as well as specific user comfort features such as echo cancelation. this guide reviews the codecs that browsers are required to implement as well as other codecs that some or all browsers support for webrtc. while compression is always a necessity when dealing with media on the web, it's of additional importance when...
...r codecs that some or all browsers support for webrtc. while compression is always a necessity when dealing with media on the web, it's of additional importance when videoconferencing in order to ensure that the participants are able to communicate without lag or interruptions. of secondary importance is the need to keep the video and audio synchronized, so that the movements and any ancillary in
formation (such as slides or a projection) are presented at the same time as the audio that corresponds. general codec requirements before looking at codec-specific capabilities and requirements, there are a few overall requirements that must be met by any codec configuration used with webrtc. unless the sdp specifically signals otherwise, the web browser receiving a webrtc video stream must be abl...
...And 17 more matches
Install Manifests - Archive of obsolete content
the file must be called install.rdf and live at the top level of an add-on's xpi file. ...
... the file must be called install.rdf and live at the top level of an add-on's xpi file. ...
... the file must be called install.rdf and live at the top level of an add-on's xpi file. ...
...And 16 more matches
Mozilla release FAQ - Archive of obsolete content
see the mozilla ftp mirror section for ftp sites under which license terms was mozilla released? mozilla is released under the npl/mpl (netscape/mozilla public licenses) which are in some ways similar to the gnu gpl, and in some ways similar to a bsd-style license. take a look at mozilla.org's npl area for details. what are all of the codenames given to various netscape/mozilla projects? gecko (
formerly raptor) is the new html rendering engine in mozilla. it features speed improvements, a more modular nature, and significantly less plat
form-dependant code. it is more suitable for being embedded in other applications than the previous rendering engine. gemini was a previous rendering engine project, renamed nglayout aurora is the navigation center in mozilla and navigator5 seamonkey re...
...the mozilla newsgroups are intended to be used by people who will be working with mozilla, either in an organizational fashion, suggesting features, or coding. visit netscape's website for help on that software. i went and made a suggestio...
...the mozilla newsgroups are intended to be used by people who will be working with mozilla, either in an organizational fashion, suggesting features, or coding. visit netscape's website for help on that software. i went and made a suggestion and people were rude t...
...And 16 more matches
Video and audio content - Learn web development
port the <video> element, allowing us to provide a fallback for older browsers. this can be anything you like; in this case, we've provided a direct link to the video file, so the user can at least access it some way regardless of what browser they are using. the embedded video will look something like this: you can try the example live here (see also the source code.) using multiple source
formats to improve compatibility there's a problem with the above example, which you may have noticed already if you've tried to access the live link above with an older browser like internet explorer or even an older version of safari. the video won't play, because different browsers support different video (and audio)
formats. fortunately, there are things you can do to help prevent this from being...
...ve noticed already if you've tried to access the live link above with an older browser like internet explorer or even an older version of safari. the video won't play, because different browsers support different video (and audio)
formats. fortunately, there are things you can do to help prevent this from being a problem. contents of a media file first, let's go through the terminology quickly.
formats like mp3, mp4 and webm are called container
formats. they define a structure in which the audio and/or video tracks that make up the media are stored, along with metadata describing the media, what codecs are used to encode its channels, and so forth. a webm file containing a movie which has a main video track and one alternate angle track, plus audio for both english and spanish, in addition...
...ternate angle track, plus audio for both english and spanish, in addition to audio for an english commentary track can be conceptualized as shown in the diagram below. also included are text tracks containing closed captions for the feature film, spanish subtitles for the film, and english captions for the commentary. ...
...And 16 more matches
Introduction to the server side - Learn web development
stored on a server and sent to the client to be displayed via some code (e.g. html and javascript). perhaps the most significant benefit of server-side code is that it allows you to tailor website content for individual users. dynamic sites can highlight content that is more relevant based on user preferences and habits. it can also make sites easier to use by storing personal preferences and in
formation — for example reusing stored credit card details to streamline subsequent payments. it can even allow interaction with users of the site, sending notifications and updates via email or through other channels. all of these capabilities enable much deeper engagement with users. in the modern world of web development, learning about server-side development is highly recommended. what is se...
...ns and updates via email or through other channels. all of these capabilities enable much deeper engagement with users. in the modern world of web development, learning about server-side development is highly recommended. what is server-side website programming? web browsers communicate with web servers using the hypertext transfer protocol (http). ...
...wsers communicate with web servers using the hypertext transfer protocol (http). when you click a link on a web page, submit a
form, or run a search, an http request is sent from your browser to the target server. the request includes a url identifying the affected resource, a method that defines the required action (for example to get, delete, or post the resource), and may include additional in
formation encoded in url parameters (the field-value pairs sent via a query string), as post data (data sent by the http post method), or in associated cookies. web servers wait for client request messages, process them when they arrive, and reply to the web browser with an http response message. the response contains a status line indicating whether or not the request succeeded (e.g. "http/1.1 200 o...
...And 16 more matches
Setting up your own test automation environment - Learn web development
kage or framework that will install webdriver and the bindings required to communicate with webdriver using this language, for example, java, c#, ruby, python, javascript (node), etc. see setting up a selenium-webdriver project for more details of selenium setups for different languages. different browsers require different drivers to allow webdriver to communicate with and control them. ...
...driver and the bindings required to communicate with webdriver using this language, for example, java, c#, ruby, python, javascript (node), etc. see setting up a selenium-webdriver project for more details of selenium setups for different languages. different browsers require different drivers to allow webdriver to communicate with and control them. see plat
forms supported by selenium for more in
formation on where to get browser drivers from, etc. we will cover writing and running selenium tests using node.js, as it is quick and easy to get started, and a more familiar environment for front end devs. note: if you want to find out how to use webdriver with other server-side environments, also check out plat
forms supported by selenium for some useful links. setting up selenium in node t...
...you must enable the 'allow remote automation' option in safari's develop menu to control safari via webdriver." if you get this, follow the given instruction and try again. so here we've done the test as before, except that this time we've wrapped it inside a function, searchtest(). we've created new browser instances for multiple browsers, then passed each one to the function so the test is per
formed on all three browsers! fun huh? let's move on, look at the basics of webdriver syntax, in a bit more detail. webdriver syntax crash course let's have a look at a few key features of the webdriver syntax. for more complete details, you should consult the selenium-webdriver javascript api reference for a detailed reference, and the selenium main documentation's selenium webdriver and webdriver...
...And 16 more matches
IME handling guide
preedit string), suggests a list of what the user attempts to input, commits composition string as a selected item off the list and commits composition string without any conversion. ...
...preedit string), suggests a list of what the user attempts to input, commits composition string as a selected item off the list and commits composition string without any conversion. ...
...nversion. ime is used by chinese, japanese, korean and taiwan users for inputting chinese characters because the number of them is beyond thousands and cannot be input from the keyboard directly. however, especially on mobile devices nowadays, ime is also used for inputting latin languages like autocomplete. additionally, ime may be used for handwriting systems or speech input systems on some plat
forms. if ime is available on focused elements, we call that state "enabled". if ime is not fully available(i.e., user cannot enable ime), we call this state "disabled". if ime is enabled but users use direct input mode (e.g., for inputting latin characters), we call it "ime is closed". otherwise, we call it "ime is open". (fyi: "open" is also called "active" or "turned on". "closed" is also called ...
...And 16 more matches
Profiling with the Firefox Profiler
the firefox profiler is a profiler that is built into firefox and is available at profiler.firefox.com. it has tighter integration with firefox than external profilers, and has more of a plat
form focus than the devtools per
formance panel. it can be used in a variety of situations where external profilers are not available, and can provide more in
formation and insight into what the browser is doing. using the firefox profiler visit profiler.firefox.com to get started. it has instructions for enabling the profiler menu button, and getting going. ...
...o what the browser is doing. using the firefox profiler visit profiler.firefox.com to get started. it has instructions for enabling the profiler menu button, and getting going. there are also product docs available at profiler.firefox.com/docs/. in addition to profiler.firefox.com, the firefox devtools have a simplified interface targeted towards web developers, but does not include as much in
formation as the firefox profiler web app. it is available from the menu at tools > web developer > per
formance. understanding profiles the firefox profiler has more current documentation available at profiler.firefox.com/docs/. however the following could have some potentially useful in
formation for gecko-specific problems. you can check out some frequently asked questions about the firefox prof...
...ofiler web app. it is available from the menu at tools > web developer > per
formance. understanding profiles the firefox profiler has more current documentation available at profiler.firefox.com/docs/. however the following could have some potentially useful in
formation for gecko-specific problems. you can check out some frequently asked questions about the firefox profilers. reporting a per
formance problem has a step-by-step guide for obtaining a profile when requested by firefox developers. interface 1. timeline the timeline has several rows of tracing markers (colored segments) which indicate interesting events. hover over them to see more in
formation. below the tracing markers are rows corresponding with activity on a variety of threads. tip: threads that are annotated with "[...
...And 16 more matches
Accessibility Inspector - Firefox Developer Tools
the accessibility inspector provides a means to access important in
formation exposed to assistive technologies on the current page via the accessibility tree, allowing you to check what's missing or otherwise needs attention. this article takes you through the main features of the accessibility inspector and how to use it. a (very) brief guide to accessibility accessibility is the practice of making your websites usable by as many people as possible. this means trying your best to not lock anyone out of accessing in
formation because of any disability they may have, or any other personal circumstances such as the device they are using, the speed of their network connection, or their geographic location or locale. ...
...ssibility accessibility is the practice of making your websites usable by as many people as possible. this means trying your best to not lock anyone out of accessing in
formation because of any disability they may have, or any other personal circumstances such as the device they are using, the speed of their network connection, or their geographic location or locale. you can find more extensive in
formation in the accessibility section of mdn web docs. here we are mainly talking about exposing in
formation to people with visual disabilities — this is done via the accessibility apis available inside web browsers, which expose in
formation on what roles the different elements on your page play (e.g., are they just text, or are they buttons, links,
form elements, etc.?). semantic dom elements ha...
...elements, etc.?). semantic dom elements have roles assigned to them by default that hint at what their purpose is. sometimes, however, you need to use some non-semantic markup (e.g., <div>s) to build a complex custom control, and the control won't have a default role that reflects its purpose. in such a situation, you can use wai-aria role attributes to provide your own roles. ...
...And 16 more matches
BluetoothRemoteGATTDescriptor - Web APIs
interface interface bluetoothremotegattdescriptor { readonly attribute bluetoothgattcharacteristic characteristic; readonly attribute uuid uuid; readonly attribute arraybuffer? value; promise<arraybuffer> readvalue(); promise<void> writevalue(buffersource value); }; properties bluetoothremotegattdescriptor.characteristicread only returns the bluetoothremotegattcharacteristic this descriptor belongs to. ...
...remotegattdescriptor experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ...
...notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). full support ≤79notes notes windows 10.firefox no support noie no support noopera full support 44notes full support 44not...
...And 16 more matches
Signaling and video calling - Web APIs
webrtc allows real-time, peer-to-peer, media exchange between two devices. a connection is established through a discovery and negotiation process called signaling. this tutorial will guide you through building a two-way video-call. webrtc is a fully peer-to-peer technology for the real-time exchange of audio, video, and data, with one central caveat. a
form of discovery and media
format negotiation must take place, as discussed elsewhere, in order for two devices on different networks to locate one another. this process is called signaling and involves both devices connecting to a third, mutually agreed-upon server. through this third server, the two devices can locate one another, and exchange negotiation messages. in this article, we will further enhance the websocket chat first created ...
...imeout period; the glitch instance is for quick experiments and testing only. the signaling server establishing a webrtc connection between two devices requires the use of a signaling server to resolve how to connect them over the internet. a signaling server's job is to serve as an intermediary to let two peers find and establish a connection while minimizing exposure of potentially private in
formation as much as possible. how do we create this server and how does the signaling process actually work? first we need the signaling server itself. webrtc doesn't specify a transport mechanism for the signaling in
formation. you can use anything you like, from websocket to xmlhttprequest to carrier pigeons to exchange the signaling in
formation between the two peers. it's important to note that t...
...portant to note that the server doesn't need to understand or interpret the signaling data content. although it's sdp, even this doesn't matter so much: the content of the message going through the signaling server is, in effect, a black box. what does matter is when the ice subsystem instructs you to send signaling data to the other peer, you do so, and the other peer knows how to receive this in
formation and deliver it to its own ice subsystem. all you have to do is channel the in
formation back and forth. the contents don't matter at all to the signaling server. readying the chat server for signaling our chat server uses the websocket api to send in
formation as json strings between each client and the server. the server supports several message types to handle tasks, such as registering ne...
...And 16 more matches
Constraint validation - Developer guides
the creation of web
forms has always been a complex task. while marking up the
form itself is easy, checking whether each field has a valid and coherent value is more difficult, and in
forming the user about the problem may become a headache. 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. basic, usual constraints can be checked, without the need for javascript, by setting new attributes; more complex constraints can be tested using the constraint validation api. for a basic introduction to these concepts, with examples, see the
form validation tutorial. note: html5 constraint validation doesn't remove the need for validation on the server side. ev...
...ide. basic, usual constraints can be checked, without the need for javascript, by setting new attributes; more complex constraints can be tested using the constraint validation api. for a basic introduction to these concepts, with examples, see the
form validation tutorial. note: html5 constraint validation doesn't remove the need for validation on the server side. even though far fewer invalid
form requests are to be expected, invalid ones can still be sent by non-compliant browsers (for instance, browsers without html5 and without javascript) or by bad people trying to trick your web application. therefore, like with html4, you need to also validate input constraints on the server side, in a way that is consistent with what is done on the client side. intrinsic and basic constraints in h...
...tic 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. typemismatch constraint violation <input type="email"> the value must be a syntactically valid email address, which generally has the
format username@hostname.tld. typemismatch constraint violation for both of these input types, if the multiple attribute is set, several values can be set, as a comma-separated list, for this input. if any of these do not satisfy the condition described here, the type mismatch constraint violation is triggered. note that most input types don't have intrinsic constraints, as some are simply ...
...And 16 more matches
<input type="date"> - HTML: Hypertext Markup Language
er; see browser compatibility for further details. in unsupported browsers, the control degrades gracefully to <input type="text">. ...
... value a domstring representing a date in yyyy-mm-dd
format, or empty events change and input supported common attributes autocomplete, list, readonly, and step idl attributes list, value, valueasdate, valueasnumber. methods select(), stepdown(), stepup() value a domstring representing the date entered in the input. the date is
formatted according to iso8601, described in
format of a valid date string in date and time
formats used in html. ...
... methods select(), stepdown(), stepup() value a domstring representing the date entered in the input. the date is
formatted according to iso8601, described in
format of a valid date string in date and time
formats used in html. you can set a default value for the input with a date inside the value attribute, like so: <input type="date" value="2017-06-01"> the displayed date
format will differ from the actual value — the displayed date is
formatted based on the locale of the user's browser, but the parsed value is always
formatted yyyy-mm-dd. you can get and set the date value in javascript with the input element's value and valueasnumber properties. for example: var datecontrol = document.queryselector('input[type="date"]'); datecontrol.value = '2017-06-01'; console...
...And 16 more matches
<input type="submit"> - HTML: Hypertext Markup Language
<input type="submit" value="send request"> value a domstring used as the button's label events click supported common attributes type and value idl attributes value methods none value an <input type="submit"> element's value attribute contains a domstring which is displayed as the button's label. buttons do not have a true value otherwise. ...
...hosen by the user agent. ...
... to be something along the lines of "submit" or "submit query." here's an example of a submit button with a default label in your browser: <input type="submit"> additional attributes in addition to the attributes shared by all <input> elements, submit button inputs support the following attributes: attribute description
formaction the url to which to submit the
form's data; overrides the
form's action attribute, if any
formenctype a string specifying the encoding type to use for the
form data
formmethod the http method (get or post) to use when submitting the
form.
formnovalidate a boolean which, if present, means the
form's fields will not be subjected to constraint validation before submitting the data to the server ...
...And 16 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. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the input value is automatically validated to ensure that it's either empty or a properly-
formatted url before the
form can be submitted. the :valid and :invalid css pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid url or not. on browsers that don't support inputs of type url, a url input falls back to being a standard text input. value a domstring representing a url, or empty events change and...
...ge and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes list, value, selectionend, selectiondirection methods select(), setrangetext() and setselectionrange(). value the <input> element's value attribute contains a domstring which is automatically validated as con
forming to url syntax. more specifically, there are two possible value
formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was removed. a single properly-
formed absolute url. this doesn't necessarily mean the url address exists, but it is at least
formatted correctly. in simple terms, this means urlscheme://restofurl. see valid...
...
formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was removed. a single properly-
formed absolute url. this doesn't necessarily mean the url address exists, but it is at least
formatted correctly. in simple terms, this means urlscheme://restofurl. see validation for details on how urls are validated to ensure that they're
formatted properly. 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 a...
...And 16 more matches
Index - HTTP
found 122 pages: # page tags and summary 1 http headers http, http header, networking, overview, reference http headers allow the client and the server to pass additional in
formation with the request or the response. an http header consists of its case-insensitive name followed by a colon ':', then by its value (without line breaks). leading white space before the value is ignored. 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 in
forms the client of its choice with the content-type response header. browsers set adequate value...
... css stylesheet a different value is set for the request than when fetching an image, video or a script. 3 accept-charset content negotiation, http, http header, reference, request header the accept-charset request http header advertises which character set the client is able to understand. using content negotiation, the server then selects one of the proposals, uses it and in
forms the client of its choice within the content-type response header. browsers usually don't set this header as the default value for each content type is usually correct and transmitting it would allow easier fingerprinting. 4 accept-encoding content negotiation, http, http header, reference, request header the accept-encoding request http header advertises which content encodi...
...usually correct and transmitting it would allow easier fingerprinting. 4 accept-encoding content negotiation, http, http header, reference, request header the accept-encoding request http header advertises which content encoding, usually a compression algorithm, the client is able to understand. using content negotiation, the server selects one of the proposals, uses it and in
forms the client of its choice with the content-encoding response header. 5 accept-language content negotiation, http, http header, reference, request header the accept-language request http header advertises which languages the client is able to understand, and which locale variant is preferred. (by languages, we mean natural languages, such as english, and not programming langua...
...And 16 more matches
passwords - Archive of obsolete content
typically a credential consists of a username and a password. using this module you can: search for credentials which have been stored in the password manager. you can then use the credentials to access their related service (for example, by logging into a web site). store credentials in the password manager. you can store different sorts of credentials, as outlined in the "credentials" section below. remove stored credentials from the password manager. ...
...oth the properties you should define on credential objects and the properties you can expect on credential objects returned by the api. all credential objects include username and password properties. different sorts of stored credentials include various additional properties, as outlined in this section. ...
... you don't supply this value when storing an add-on credential: it is automatically generated for you. however, you can use it to work out which stored credentials belong to your add-on by comparing it with the uri property of the self module. ...
...And 15 more matches
List of Mozilla-Based Applications - Archive of obsolete content
the following is a list of all known active applications that are built using mozilla technologies. this list is likely to be incomplete since we think there are many dark matter projects that we don't know about. if you have in
formation about a new project or extra in
formation about an existing project, please feel free to update this page. a list of
former mozilla-based applications is also available. name description additional in
formation 389 directory server ldap server uses nss a380 seatback entertainment system media software this blog post mentions a reference to mozilla being used but i couldn't find more in
formation about it. abstract accounting tool adobe acrobat and adobe reader portable document for...
...software aliwal geocoder geocoding & data on a map amarok xul remote remote control for amarok music player ample sdk javascript gui-framework aol instant messenger im client uses nss apache web server doesn't use nss by default, but can be configured to use nss with mod_nss ssl module apicawatch site per
formance monitoring tool uses firefox as part of its monitoring package astyle css editor editing tool atmail webmail client aviva for java mainframe connectivity product uses mozilla rhino babelgum internet tv service basilisk pre-servo xul-based web browser uses most of the firefox 55 source code batik java-...
... couchdb document-oriented database uses spidermonkey courtanet benefit (fr) underwriting software for french insurance brokers crosscheck browserless testing framework uses mozilla rhino crowbar server tool cycloctopus screen scraping console cyclone3 content management system danger mobile plat
form uses gecko on the server side -- no longer active? desktop 2 internal browser and portal client expeditors international of washington, inc. dogtag certificate system uses nss dojo javascript toolkit uses mozilla rhino in shrinksafe eclipse plat
form open development plat
form the ajax toolkit framework, standard widget toolkit and ecli...
...And 15 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
unwanted white space reappeared unfortunately the 'blank space bug' has reappeared in thunderbird 1.0.2. see bug 229271. although it was corrected in mozilla mainstream: mozilla/extensions/pref/autoconfig/src/nsldapsyncquery.cpp 1.7.2.1 by late 2004, it is still prese...
...p (moz_ldap_xpcom=1). you need to recompile the package to get it, cf. bug 295329. add autoconfig and ldap support in firefox 1.0.x add pref extension (--enable-extensions=pref) and remove --disable-ldap from mozconfig file. ...
...ng -pedantic -pthread -pipe c++ gcc version 3.4.3 20050227 (red hat 3.4.3-22.fc3) -fno-rtti -fno-exceptions -wall -wconversion -wpointer-arith -wcast-align -woverloaded-virtual -wsynth -wno-ctor-dtor-privacy -wno-non-virtual-dtor -wno-long-long -pedantic -fshort-wchar -pthread -pipe -i/usr/x11r6/include configure arguments --disable-mailnews --enable-extensions=cookie,xml-rpc,xmlextras,pref,trans
formiix,universalchardet,webservices,inspector,gnomevfs,negotiateauth --enable-crypto --disable-composer --enable-single-profile --disable-profilesharing --with-system-jpeg --with-system-zlib --with-system-png --with-pthreads --disable-tests --disable-jsd --disable-installer '--enable-optimize=-os -g -pipe -m32 -march=i386 -mtune=pentium4' --enable-xft --enable-xinerama --enable-default-toolkit=gtk2 -...
...And 15 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
many browsers, such as internet explo...
...many browsers, such as internet explorer, also support pre-w3c apis and have never added extensive support for the w3c-compliant ones. before i go into the differences between mozilla and internet explorer, i'll cover some basic ways you can make a web application extensible in order to add new browser support later. ...
...t = document.layers[aid]; else if (isie4) element = document.all[aid]; return element; } the above code still has the issue of browser sniffing, or detecting which browser the user is using. browser sniffing is usually done through the useragent, such as: mozilla/5.0 (x11; u; linux i686; en-us; rv:1.5) gecko/20031016 while using the useragent to sniff the browser provides detailed in
formation on the browser in use, code that handles useragents often can make mistakes when new browser versions arrive, thus requiring code changes. it is much better and more reliable to sniff by browser capability or object feature support. you can usually do this by testing the required functionality in javascript. for example, rather than: if (ismozilla || isie5) you would use: if (document.g...
...And 15 more matches
A XUL Bestiary - Archive of obsolete content
this xulnote presents some of the key concepts and terms in the xul development environment. the purpose of this article is not to describe these items in any great detail but to define what they are in simple terms. i selected items for this group because they seemed to be either shrouded in mystery, misused as concepts or terms, or underestimated according to their role in xul and cross-plat
form development. in contrast to the mozilla jargon file, this article describes items of specific interest to the web or content developer looking to establish a context for understanding mozilla's new technologies -- and in particular mozilla's xml-based user interface language, xul. chrome some of the most powerful and frequently misunderstood features of xul and the mozilla browser have to do wi...
...nterface language, xul. chrome some of the most powerful and frequently misunderstood features of xul and the mozilla browser have to do with chrome. the term chrome is used in different contexts to mean different things. in general, chrome refers to a xul interface and all of its supporting files; chrome means the xul content and structure, plus the css skin, plus whatever localization and plat
form-specific files are part of that xul interface. by contrast, the skin is just the css and referenced graphics for a xul file, the localization strings are just a dtd, and the content is just the xul. the chrome url this concept of a chrome as an integrated, dynamic thing in some way divorced from the "appcore" is realized in the use of the chrome url to point to chunks of xul and their related f...
...om the command line with the -chrome flag, you can specify a chrome just as you would in the previous example: mozilla -chrome chrome://help/content/help.xul brings up the help package mentioned in the previous example as a "stand-alone" chrome. ...
...And 15 more matches
The Implementation of the Application Object Model - Archive of obsolete content
guage in order to allow the markup language to reference local data and to indicate how and when it would like to be annotatable with local data. the case for the xul/rdf approach what is xul? xul (pronounced zool) used to be a ravening demon intent upon taking over the earth in ghost busters. in recent years, xul dropped the z from its name and replaced it with an x, and upon doing so, trans
formed into something far worse than a demon. it became a markup language. xul stands for "extensible user interface language". it is an xml-based language for describing the contents of windows and dialogs. xul has language constructs for all of the typical dialog controls, as well as for widgets like toolbars, trees, progress bars, and menus. where html describes the contents of a single document, x...
...uck up data from a local source, it can take the remote data and combine it with local data. you'll often hear people refer to this as rdf's local/remote merging capability. this capability is desirable for two reasons. what is local/remote merging good for? the first reason to have local/remote merging is that a remote file must be able to reference local data and have it merged in with the in
formation that it specified. an example of this feature is a downloadable file that describes the user's main bookmarks folder. because the file lives remotely, it can be updated whenever the owner of the web site sees fit. a site admin could add new bookmarks to the file, and then the user would pick them up. however, in order for this to work, the local bookmarks have to be merged in with the remote...
...at the user actually ends up viewing. forget xul! let's just use serialized rdf! well, that's just plain cool! i say forget xul! let's just use serialized rdf to represent the ui! that would be an unwise decision for a variety of reasons. rdf is a graph structure, and windows and dialogs are actually content trees. because rdf can express arbitrary relationships between nodes, the serialized
form of rdf in xml has to contain extra syntax. in other words, the traditional relationship of "containment" is not the only kind of relationship expressible in rdf. in html or xul, when you put one tag inside another tag, a relationship of containment can safely be assumed. not so with rdf. for rdf, an extra tag has to be inserted between two other tags to indicate exactly what kind of relationship ...
...And 15 more matches
Componentizing our Svelte app - Learn web development
previous overview: client-side javascript frameworks next in the last article we started developing our todo list app. the central objective of this article is to look at how to break our app into manageable components and share in
formation between them. we'll componentize our app, then add more functionality to allow users to update existing components. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. objective: to learn how to break our app into components and share in
formation among them. code along with us git clone the github rep...
...n.svelte: the all, active, and completed buttons that allow you to apply filters to the displayed todo items. todosstatus.svelte: the "x out of y items completed" heading. todo.svelte: an individual todo item. each visible todo item will be displayed in a separate copy of this component. moreactions.svelte: the check all and remove completed buttons at the bottom of the ui that allow you to per
form mass actions on the todo items. in this article we will concentrate on creating the filterbutton and todo components; we'll get to the others in future articles. let's get started. note: in the process of creating our first couple of components, we will also learn different techniques to communicate between components, and the pros and cons of each. extracting our filter component we'll...
...prop, but changes occurring in the filterbutton component don't flow back up to its parent — the data binding is one-way by default. let's look at a way to solve this. sharing data between components: passing a handler as a prop one way to let child components notify their parents of any changes is to pass a handler as a prop. the child component will execute the handler, passing the needed in
formation as a parameter, and the handler will modify the parent's state. in our case, the filterbutton component will receive an onclick handler from its parent. whenever the user clicks on any filter button, the child will call the onclick handler, passing the selected filter as a parameter, back up to its parent. we will just declare the onclick prop assigning a dummy handler to prevent errors, l...
...And 15 more matches
Vue conditional rendering: editing existing todos - Learn web development
the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn how to do conditional rendering in vue. creating an editing component we can start by creating a separate component to handle the editing functionality. ...
... render functions), you'll need a terminal with node + npm installed. objective: to learn how to do conditional rendering in vue. creating an editing component we can start by creating a separate component to handle the editing functionality. in your components directory, create a new file called todoitemedit
form.vue. ...
...omplete="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); } }, oncan...
...And 15 more matches
The Firefox codebase: CSS Guidelines
this document contains guidelines defining how css inside the firefox codebase should be written, it is notably relevant for firefox front-end engineers. basics here are some basic tips that can optimize reviews if you are changing css: avoid !important but if you have to use it, make sure it's obvious why you're using it (ideally with a comment). the overriding css section contains more in
formation about this. avoid magic numbers; prefer automatic sizing or alignment methods. some examples to avoid: absolutely positioned elements hardcoded values such as: vertical-align: -2px; . the reason you should avoid such "hardcoded" values is that, they don't necessarily work for all font-size configurations. avoid setting styles in javascript. it's generally better to set a clas...
...most of the time, the common component already follows the a11y/theme standards defined in this guide. so, when possible, always prefer editing common components to writing your own. also, it is good practice to introduce a common class when the new element you are styling reuses some styles from another element, this allows the maintenance cost and the amount of code duplication to be reduced.
formatting spacing & indentation 2 spaces indentation is preferred add a space after each comma, except within color functions: linear-gradient(to bottom, black 1px, rgba(255,255,255,0.2) 1px) always add a space before !important. omit units on 0 values do this: margin: 0; not this: margin: 0px; use expanded syntax it is often harder to understand what the shorthand is doin...
.... but camelcase is also used sometimes. try to follow the style of existing or related code. other tips assume ="true" in attribute selectors. example: use option[checked], not option[checked="true"]. avoid id selectors unless it is really the wanted goal, since ids have higher specificity and therefore are harder to override. using descendant selectors is good practice for per
formance when possible: for example: .autocomplete-item[selected] > .autocomplete-item-title would be more efficient than .autocomplete-item[selected] .autocomplete-item-title overriding css before overriding any css rules, check whether overriding is really needed. sometimes, when copy-pasting older code, it happens that the code in question contains unnecessary overrides. this could b...
...And 15 more matches
NSS tools : signtool
ng tool, signtool, creates digital signatures and uses a java archive (jar) file to associate the signatures with files in a directory. electronic software distribution over any network involves potential security problems. to help address some of these problems, you can associate digital signatures with the files in a jar archive. digital signatures allow ssl-enabled clients to per
form two important operations: * confirm the identity of the individual, company, or other entity whose digital signature is associated with the files * check whether the files have been tampered with since being signed if you have a signing certificate, you can use netscape signing tool to digitally sign files and package them as a jar file. an object-signing certificate is a spe...
... the public-key cryptography standard known as pkcs #12, which governs key portability. you can, for example, move an object-signing certificate and its associated private key from one computer to another on a credit-card-sized device called a smart card. options -b basename specifies the base filename for the .rsa and .sf files in the meta-inf directory to con
form with the jar
format. for example, -b signatures causes the files to be named signatures.rsa and signatures.sf. the default is signtool. -c# specifies the compression level for the -j or -z option. the symbol # represents a number from 0 to 9, where 0 means no compression and 9 means maximum compression. the higher the level of...
...".class" to sign only java class files. 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. -f commandfile specifies a text file containing netscape signing tool options and arguments in keyword=value
format. all options and arguments can be expressed through this file. for more in
formation about the syntax used with this file, see "tips and techniques". -i scriptname specifies the name of an installer script for smartupdate. this script installs files from the jar archive in the local system after smartupdate has validated the digital sig...
...And 15 more matches
An Overview of XPCOM
is chapter provides a quick tour of xpcom - an introduction to the basic concepts and technologies in xpcom and component development. the brief sections in this chapter introduce the concepts at a very high level, so that we can discuss and use them with more familiarity in the tutorial itself, which describes the creation of a mozilla component called weblock. the xpcom solution the cross plat
form component object module (xpcom) is a framework which allows developers to break up monolithic software projects into smaller modularized pieces. these pieces, known as components, are then assembled back together at runtime. the goal of xpcom is to allow different pieces of software to be developed and built independently of one another. in order to allow interoperability between components with...
...developed and built independently of one another. in order to allow interoperability between components within an application, xpcom separates the implementation of a component from the interface, which we discuss in interfaces. but xpcom also provides several tools and libraries that enable the loading and manipulation of these components, services that help the developer write modular cross-plat
form code, and versioning support, so that components can be replaced or upgraded without breaking or having to recreate the application. using xpcom, developers create components that can be reused in different applications or that can be replaced to change the functionality of existing applications. xpcom not only supports component software development, it also provides much of the functionality t...
...support, so that components can be replaced or upgraded without breaking or having to recreate the application. using xpcom, developers create components that can be reused in different applications or that can be replaced to change the functionality of existing applications. xpcom not only supports component software development, it also provides much of the functionality that a development plat
form provides, such as: component management file abstraction object message passing memory management we will discuss the above items in detail in the coming chapters, but for now, it can be useful to think of xpcom as a plat
form for component development, in which features such as those listed above are provided. gecko although it is in some ways structurally similar to microsoft com, xpco...
...And 15 more matches
Lighting a WebXR setting - Web APIs
however, there are issues and details to keep in mind while creating your lighting code, especially for augmented reality (ar) applications. this guide discusses these topics. and while this article provides brief reminders as to how lighting works in general, it is not by any means a tutorial in lighting or a guide to how to create a properly-lit 3d scene. ...
...light waves cause the light source to take on specific characteristics. for the most part, any real-world light source can be simulated using one or more of these light source types. ambient light sources an ambient light source is a light source describing the level and color of ambient light in a scene. while there may be more than one of these in a scene, you can probably slightly improve per
formance by combining them into one on your own, since each one will always affect every pixel evenly anyway. ambient light sources generally don't correspond to any object within the scene, and have no real-world analogues, either. earth and moon both half-lit by the sun's directional lighting. directional light sources a directional light source is a light source that comes from a specif...
...e light cone, the light ceases to affect the surface at all. computational costs of lighting to be visible, a scene must include lighting of some sort, so all or nearly all scenes will have at least one light source and may have a great many of them. each light source substantially increases the amount of calculation needed to determine the final color and brightness of each displayed pixel. per
forming the shading for each of these light source types is more computationally demanding than the one before it; so ambient light is the least expensive to apply, followed by directional light sources, point lights, and finally spotlights. additionally, the more accurate the lighting is designed to be, the more computationally expensive it becomes. increased shadow detail, volumetric light (that is...
...And 15 more matches
Rendering and the WebXR frame animation callback - Web APIs
ce in the rendering loop, using the xrsession to obtain an xrframe object representing each frame, which is then used to prepare the framebuffer for delivery to the xr device. before you can render the virtual environment, you need to establish a webxr session by creating an xrsession using the navigator.xr.requestsession() method; you also need to associate the session with a framebuffer and per
form other setup tasks. these setup tasks are described in the article setting up and shutting down a webxr session. preparing the renderer once the xr session has been set up, with the webgl framebuffer connected and webgl primed with the data it needs in order to render the scene, you can set up the renderer to start running. this begins with getting the reference space in which you want to draw, ...
... it needs a framebuffer to render your scene. this is done by calling the xrsession method requestanimationframe(). ...
... then the first animation frame is scheduled by calling the xrsession method requestanimationframe(), providing a callback function, mydrawframe(), whose job is to render the frame. ...
...And 15 more matches
Rich-Text Editing in Mozilla - Developer guides
xbdesignmode, which is a wrapper for the designmode feature which hides the differences between ie and mozilla. event handling disabled a further difference for mozilla is that once a document is switched to designmode, all events on that particular document are disabled. once designmode is turned off however (as this now seems possible in mozilla 1.5) the events become active again. more in
formation can be found in the rich text editing section of migrate apps from internet explorer to mozilla. examples please note: the example files are still being migrated from another site. they are not available at this time. --fumble 18:13, 24 apr 2005 (pdt) example 1 the first example is an html document setting its own designmode to "on". this makes the entire document editable in mozilla 1.3...
...cument('editorwindow').execcommand(aname,false, aarg); document.getelementbyid('editorwindow').contentwindow.focus() } example: a simple but complete rich text editor <!doctype html> <html> <head> <title>rich text editor</title> <script type="text/javascript"> var odoc, sdeftxt; function initdoc() { odoc = document.getelementbyid("textbox"); sdeftxt = odoc.innerhtml; if (document.comp
form.switchmode.checked) { setdocmode(true); } } function
formatdoc(scmd, svalue) { if (validatemode()) { document.execcommand(scmd, false, svalue); odoc.focus(); } } function validatemode() { if (!document.comp
form.switchmode.checked) { return true ; } alert("uncheck \"show html\"."); odoc.focus(); return false; } function setdocmode(btosource) { var ocontent; if (btosource) { oc...
...e type="text/css"> .intlink { cursor: pointer; } img.intlink { border: 0; } #toolbar1 select { font-size:10px; } #textbox { width: 540px; height: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textbox #sourcetext { padding: 0; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </style> </head> <body onload="initdoc();"> <
form name="comp
form" 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"...
...And 15 more matches
<input type="tel"> - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...is ignored completely. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. you should also include other explanatory text nearby. see pattern validation below for details and an example. ...
...And 15 more matches
<input type="week"> - HTML: Hypertext Markup Language
value a domstring representing a week and year, or empty events change and input supported common attributes autocomplete, list, readonly, and step idl attributes value, valueasdate, valueasnumber, and list. methods select(), stepdown(), and stepup() value a domstring representing the value of the week/year entered into the input. the
format of the date and time value used by this input type is described in
format of a valid week string in date and time
formats used in html. you can set a default value for the input by including a value inside the value attribute, like so: <label for="week">what week would you like to start?</label> <input id="week" type="week" name="week" value="2017-w01"> one thing to note is that the displa...
...when the above value is submitted to the server, for example, browsers may display it as week 01, 2017, but the submitted value will always look like week=2017-w01. ...
...when the above value is submitted to the server, for example, browsers may display it as week 01, 2017, but the submitted value will always look like week=2017-w01. ...
...And 15 more matches
Archived Mozilla and build documentation - Archive of obsolete content
automated testing tips and tricks automatic mozilla configurator ankh8 automatically handle failed asserts in debug builds as of 2004-12-8, it is now possible to automatically handle failed asserts in debug builds of mozilla for windows. blackconnect blackwood bonsai it is a tool that lets you per
form queries on the contents of a cvs archive; you can: get a list of checkins, see what checkins have been made by a given person, or on a given cvs branch, or in a particular time period. it also includes tools for looking at checkin logs (and comments); doing diffs between various versions of a file; and finding out which person is responsible for changing a particular line of code ("cvsbl...
...urfer has bookmarks, of course, and power surfers usually have hundreds stuffed into folders within folders. in addition to being handy pointers to useful resources, bookmarks in mozilla can be used to make the address bar itself a power tool. searches, lookups, package tracking, and even word definitions can all be retrieved from user-customized bookmarks. building trans
formiix standalone calicalendarview an object implementing calicalendarview is generally intended to serve as a way of manipulating a set of dom nodes corresonding to a visual representation of calievent and calitodo objects. because of this close association between methods and attributes on the one hand, and content on the other, calicalendarview implement...
...o practical obstacle to the interface being implemented by any javascript object associated with a group of dom nodes, even non-anonymous xul nodes. calicalendarviewcontroller a calicalendarviewcontroller provides a way for a calicalendarview to create, modify, and delete items. implementing a calicalendarviewcontroller allows for these actions to be per
formed in a manner consistent with the rest of the application in which the calicalendarview is included. califiletype the califiletype interface provides in
formation about a specific file type. chromeless [this project may not be active — check github https://github.com/mozilla/chromeless] creating a firefox sidebar extension this article des...
...And 14 more matches
RDF in Mozilla FAQ - Archive of obsolete content
general where do i start? rdf serves two primary purposes in mozilla. first, it is a simple, cross-plat
form database for small data stores. second, and more importantly, the rdf model is used along with xul templates as an abstract "api" for displaying in
formation. rdf in fifty words or less is a quick, high-level description of what rdf does in mozilla. the rdf back-end architecture document describes in more detail how mozilla's rdf implementation works, and gives a quick overview of the interfaces that are involved. where do i find in
formation on open directory ("dmoz")? unfortunately, not here! well, here's a little... start at http://www.dmoz.org/ for more in
formation on the open directory. the open directory dataset is available as a (huge) rdf/xml dump. it describes thousand...
... if you have problems with the dmoz and chefmoz data, it's best to contact those projects directly. but if you do something interesting with this content (eg. have mozilla use it, eg. by loading chunks of it into a xul ui from a remote site), don't forget to let mozilla-rdf and the rdf interest group lists know. ...
...le you may decide that you need to "manually" create an rdf/xml datasource if you want to force it to load synchronously. how do i reload an rdf/xml datasource? you can force an rdf/xml datasource (or any datasource that supports nsirdfremotedatasource) to reload using the refresh() method of nsirdfremotedatasource. refresh() takes a single parameter that indicates whether you'd like it to per
form its operation synchronously ("blocking") or asynchrounously ("non-blocking"). you should never do a synchronous load unless you really know what you're doing: this will freeze the ui until the load completes! how can i tell if an rdf/xml datasource has loaded? using the nsirdfremotedatasource interface, it is possible to immediately query the loaded property to determine if the datasource has l...
...And 14 more matches
The Business Benefits of Web Standards - Archive of obsolete content
introduction and context doing more with less seems to be the mission impossible for web designers: addressing more customers, a broader audience, more diversity in terms of browsers, more accessibility, users asking for more speed, while spending less to maintain or redesign a web site. caught between a rock and a hard place, web designers face a
formidable challenge. yet they are finding an unsuspected ally in the battle: web standards. this article discusses how adhering to web standards, and leaving behind proprietary markup and technologies, can contribute to a company's business goals. site wide consistent look and feel by separating structure (or content) from presentation, web designers have a lot to gain. specifically, presentation is defined using layout-oriented css lang...
...tml (as opposed to the often-used transitional html markup), forces the designer not to use presentation tags in the html documents, naturally enforcing the separation of content from presentation. by locating all the style and design issues in one document - the style sheet - whole sites can be rethemed in one go. the blogging community are particularly dynamic in this respect where on many plat
forms including wordpress, textpattern and habari, the site theme is a complete and discrete entity in its own right. improved user experience: less bandwidth and fast loads html code is often much more compact (therefore easier to read and maintain) when used in conjunction with css. according to various reports, case studies, and andy king, author of speed up your web site: web site optimization, ...
...n and habari, the site theme is a complete and discrete entity in its own right. improved user experience: less bandwidth and fast loads html code is often much more compact (therefore easier to read and maintain) when used in conjunction with css. according to various reports, case studies, and andy king, author of speed up your web site: web site optimization, css has made it possible to trans
form table-based layouts into css-based layouts. typically this reduces page size by 25 to 50%. this translates into better user experience, according to usability guru jakob nielsen, who notes that users tend to close a web page when it takes more than 10 seconds to load. the style sheet only needs to load once and then it is cached. the payload might be slightly higher for the first page. but for a...
...And 14 more matches
Componentizing our React app - Learn web development
> component gives every task an id attribute of todo-0. this is bad html because id attributes must be unique (they are used as unique identifiers for document fragments, by css, javascript, etc.). this means we should give our component an id prop that takes a unique value for each todo. to follow the same pattern we had initially, let's give each instance of the <todo /> component an id in the
format of todo-i, where i gets larger by one every time: <todo name="eat" completed={true} id="todo-0" /> <todo name="sleep" completed={false} id="todo-1" /> <todo name="repeat" completed={false} id="todo-2" /> now go back to todo.js and make use of the id prop. it needs to replace the value of the id attribute of the <input /> element, as well as the value of its label's htmlfor attribute: <div cl...
...good use of react so far, but we could do better! our code is repetitive. the three lines that render our <todo /> component are almost identical, with only one difference: the value of each prop. we can clean up our code with one of javascript's core abilities: iteration. to use iteration, we should first re-think our tasks. tasks as data each of our tasks currently contains three pieces of in
formation: its name, whether it has been checked, and its unique id. this data translates nicely to an object. since we have more than one task, an array of objects would work well in representing this data. in src/index.js, make a new const beneath the final import, but above reactdom.render(): const data = [ { id: "todo-0", name: "eat", completed: true }, { id: "todo-1", name: "sleep", complet...
...ops.tasks. you can console.log() it to check, if you’d like. note: all_caps constant names have no special meaning in javascript; they’re a convention that tells other developers "this data will never change after being defined here”. rendering with iteration to render our array of objects, we have to turn each one into a <todo /> component. javascript gives us an array method for trans
forming data into something else: array.prototype.map(). above the return statement of app(), make a new const called tasklist and use map() to trans
form it. let's start by turning our tasks array into something simple: the name of each task: const tasklist = props.tasks.map(task => task.name); let’s try replacing all the children of the <ul> with tasklist: <ul role="list" classname="todo-li...
...And 14 more matches
Introducing a complete toolchain - Learn web development
previous overview: understanding client-side tools next in the final couple of articles in the series we will solidify your tooling knowledge by walking you through the process of building up a sample case study toolchain. we'll go all the way from setting up a sensible development environment and putting trans
formation tools in place to actually deploying your app on netlify. in this article we'll introduce the case study, set up our development environment, and set up our code trans
formation tools. prerequisites: familiarity with the core html, css, and javascript languages. objective: to solidify what we've learnt so far by working through a complete toolchain case study. there really are unlimited combinations of tools and ways to use them, what yo...
...t of syntax extensions that allow you to do things like defining component structures inside javascript. you won't need to know react to follow this tutorial, but we've included this to give you an idea of how a non-native web language could be integrated into a toolchain. the latest built-in javascript features (at time of writing), such as import. useful development tools such as prettier for
formatting and eslint for linting. postcss to provide css nesting capabilities. parcel to build and minify our code, and to write a bunch of configuration file content automatically for us. github to manage our source code control. netlify to automate our deployment process. you may not be familiar with all the above features and tools or what they are doing, but don't panic — we'll explain ea...
...eed to connect your netlify account to your github repository to deploy this project; we'll see how to do that in the next chapter. three stages of tools as we talked about in chapter 1, the toolchain will be structured into the following phases: safety net: making the software development experience stable and more efficient. we might also refer to this as our development environment. trans
formation: tooling that allows us to use the latest features of a language (e.g. javascript) or another language entirely (e.g. jsx or typescript) in our development process, and then trans
forms our code so that the production version still runs on a wide variety of browsers, modern and older. post development: tooling that comes into play after you are done with the body of development to ensure tha...
...And 14 more matches
Creating localizable web applications
ted below are good practices and recommendations that should be followed in order to make your content easily localizable. note: most of the code snippets used in the examples below come from an early version of the getpersonas.com website. in some cases, the code snippets were slightly changed to better illustrate the recommendations or for clarity. cheatsheet don't hardcode english text,
formats (numbers, dates, addresses, etc.), word order or sentence structure. don't put text or numbers in images. don't forget about right-to-left locales. take advantage of printf() (or equivalents) and use variables in the english strings. write semantic code (e.g. don't use text and <img/> for decorations; instead, use css). document your code so that localizers know what they're translating (...
...are well-designed, you may want to use the url to do something in the code depending on where the user is. take the url structure of the getpersonas.com website for example. the url http://getpersonas.com/nature/popular/2 points to the second page of the listing of the popular personas in the "nature" category. you could easily use list($category, $tab, $page) = explode('/', $path); to get this in
formation directly from the url. after that, it is tempting to use the $category or $tab variables in the interface. however, this is problematic for localization. you probably don't want to localize the urls to keep them uni
form across locales as well as to avoid issues with non-latin and/or rtl characters. so in order to display a localized label of a category or a tab, you should create a mapping ...
...able content. the logic of the website should not be exposed directly in the localization files, to avoid any accidental changes by localizers. snippet 1. bad: require_once('lib/user.php'); $user = new personauser(); snippet 2. good: require_once('templates/footer.php'); if it's not possible to remove the app logic code, you should consider using gettext. gettext extracts localizable content
form the source files, thus making it impossible for localizers to accidentally change them. you can learn more about the choice of the
format for your project at file
formats. text messages don't hardcode english content allow localizers to localize english content, such as: text messages, number
formats, date
formats, word order and sentence structure. note that some strings might be hidd...
...And 14 more matches
Gecko Profiler FAQ
is documents lists a number of questions asked by people in preparation for a tutorial session about the gecko profiler. mstange and ehsan tried to respond to some of the questions in advance in writing, and you can find the answers below. is it possible to locate hot spots occurring within a single function? the gecko profiler currently doesn’t have the ability to show you in
formation about line numbers, neither for js code nor for native code. for js code, the profiler plat
form doesn’t capture any in
formation about lines. it only knows what function was executed and what line this function starts at. for native code, the profiler captures the necessary in
formation but doesn’t have a way to display it. similarly it also can’t show...
... neither for js code nor for native code. for js code, the profiler plat
form doesn’t capture any in
formation about lines. it only knows what function was executed and what line this function starts at. for native code, the profiler captures the necessary in
formation but doesn’t have a way to display it. similarly it also can’t show you instruction level in
formation about where each sample was captured (this is why there is no support for line-level sampling for native code either.) at this point the granularity of each sample it displays is a native function. therefore the gecko profiler is not a suitable tool for finding hotspots within a single function. ...
...n level in
formation about where each sample was captured (this is why there is no support for line-level sampling for native code either.) at this point the granularity of each sample it displays is a native function. therefore the gecko profiler is not a suitable tool for finding hotspots within a single function. for this purpose you should try to use a native profiler on your plat
form of choice (for example xperf/vtune on windows, instruments on osx, and perf/zoom on linux.) one workaround is to break the hot function into several explicitly-non-inline helpers, recompile, and re-profile. this can change some per
formance characteristics, but is a decent way to get a sense of which parts of a large function are expensive. how to profile startup code that...
...And 14 more matches
NSS API Guidelines
cdbhdl.h, certdb.h, cert.h, certt.h certhi provides high-level certificate-related functions, that do not access the certificate database, nor individual certificate data directly. currently, ocsp checking settings are exported through certhi. 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. cmmf no longer exists as a proposed standard; cmmf functions have been incorporated into the proposal for certificate management protocols (cmp). same level as ssl lib/crmf cmmf.h, crmf.h, crmft.h, cmmft.h, crmffut.h cryptohi provides high-level cryptographic support operations: such as signing, veri...
...l provides the api to actual cryptographic operations. the freebl is a wrapper api. you must supply a library that implements the cryptographic operations, such as bsafe from rsa security. this is also known as the "bottom layer" api, or blapi. within pkcs #11, wraps crypto lib/freebl blapi.h, blapit.h jar provides support for reading and writing data in java archive (jar)
format, including zlib compression. port lib/jar jar-ds.h, jar.h, jarfile.h nss provides high-level initialiazation and shutdown of security services. specifically, this library provides nss_init() for establishing default certificate, key, module databases, and initializing a default random number generator. nss_shutdown() closes these databases, to prevent further access by an a...
... pk11func.h, secmod.h, secmodt.h pkcs12 provides functions and types for encoding and decoding pkcs #12 data. pkcs #12 can be used to to encode keys, and certificates, for export or import into other applications. pkcs #12 lib/pkcs12 pkcs12t.h, pkcs12.h, p12plcy.h, p12.h, p12t.h pkcs7 provides functions and types for encoding and decoding encrypted data in pkcs #7
format. for example, pkcs #7 is used to encrypt certificate data to exchange between applications, or to encrypt s/mime message data. pkcs #7 lib/pkcs7 secmime.h, secpkcs7.h, pkcs7t.h softoken provides a software implementation of a pkcs #11 module. pkcs #11: implementation lib/softoken keydbt.h, keylow.h, keytboth.h, keytlow.h, secpkcs5.h, pkcs11.h, pkcs11f.h, pkcs11p.h,...
...And 14 more matches
Handling Mozilla Security Bugs
version 1.1 important: anyone who believes they have found a mozilla-related security vulnerability can and should report it by sending email to address security@mozilla.org. for more in
formation read the rest of this document. introduction in order to improve the mozilla project's approach to resolving mozilla security vulnerabilities, mozilla.org is creating more
formal arrangements for handling mozilla security-related bugs. first, mozilla.org is appointing a security module owner charged with primary responsibility for coordinating the investigation and resolution of reported mozilla security vulnerabilities. the security module owner will have one or more peers to assist in this task. at the same time, mozilla.org is also creating a larger "mozilla security bug group" by which ...
...es arising from problems in mozilla code. this work is separate from the work of developers adding new security features (cryptographically-based or otherwise) to mozilla, although obviously many of the same people will be involved in both sets of activities. background security vulnerabilities are different from other bugs, because their consequences are potentially so severe: users' private in
formation (including financial in
formation) could be exposed, users' data could be destroyed, and users' systems could be used as plat
forms for attacks on other systems. thus people have strong feelings about how security-related bugs are handled, and in particular about the degree to which in
formation about such bugs is publicly disclosed. the mozilla project is a public software development project...
...cks on other systems. thus people have strong feelings about how security-related bugs are handled, and in particular about the degree to which in
formation about such bugs is publicly disclosed. the mozilla project is a public software development project, and thus we have an inherent bias towards openness. in particular, we understand and acknowledge the concerns of those who believe that all in
formation about security vulnerabilities should be publicly disclosed as soon as it is known, so that users may take immediate steps to protect themselves and so that problems can get the maximum amount of developer attention and be fixed as soon as possible. at the same time, the mozilla project receives substantial contributions of code and developer time from organizations that use (or plan to use...
...And 14 more matches
imgIContainer
ents.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.imgicontainer); method overview void addrestoredata([array, size_is(acount), const] in char data, in unsigned long acount); native code only! ...
...sses["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.imgicontainer); method overview void addrestoredata([array, size_is(acount), const] in char data, in unsigned long acount); native code only! ...
...ode only! obsolete since gecko 2.0 void appendframe(in print32 ax, in print32 ay, in print32 awidth, in print32 aheight, in gfximage
format a
format, [array, size_is(imagelength)] out pruint8 imagedata, out unsigned long imagelength); native code only! obsolete since gecko 2.0 void appendpalettedframe(in print32 ax, in print32 ay, in print32 awidth, in print32 aheight, in gfximage
format a
format, in pruint8 apalettedepth, [array, size_is(imagelength)] out pruint8 imagedata, out unsigned long imagelength, [array, size_is(palettelength)] out pruint32 palettedata, out unsigned long palettelength); native code only! obsolete since gecko 2.0 void clear(); obsolete since gecko 1.9.2 gfximagesurface copycurrentframe(); native code only! obsolete since gecko 2.0 ...
...And 14 more matches
Drag Operations - Web APIs
ag data (datatransfer is a datatransfer object). when a drag occurs, data must be associated with the drag which identifies what is being dragged. for example, when dragging the selected text within a textbox, the data associated with the drag data item is the text itself. similarly, when dragging a link on a web page, the drag data item is the link's url. the drag data contains two pieces of in
formation, 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. during the drag, in an event listener for the dragenter and dragover events, you use the data types of the data being dragged to check whether a drop is allowed. for ins...
... the least specific type will be normal text data using the type text/plain. this data will be a simple textual representation. to set a drag data item within the datatransfer, use the setdata() method. it takes two arguments: the type of data and the data value. for example: event.datatransfer.setdata("text/plain", "text to drag"); in this case, the data value is "text to drag" and is of the
format text/plain. you can provide data in multiple
formats. to do this, call the setdata() method multiple times with different
formats. you should call it with
formats in order from most specific to least specific. const dt = event.datatransfer; dt.setdata("application/x.bookmark", bookmarkstring); dt.setdata("text/uri-list", "https://www.mozilla.org"); dt.setdata("text/plain", "https://www.mozill...
...; dt.setdata("text/plain", "https://www.mozilla.org"); here, data is added in three different types. the first type, application/x.bookmark, is a custom type. other applications won't support this type, but you can use a custom type for drags between areas of the same site or application. ...
...And 14 more matches
WebGL2RenderingContext - Web APIs
ent.getelementbyid('mycanvas'); var gl = canvas.getcontext('webgl2'); webgl 2 is an extension to webgl 1. the webgl2renderingcontext interface implements all members of the webglrenderingcontext interface. some methods of the webgl 1 context can accept additional values when used in a webgl 2 context. you will find this info noted on the webgl 1 reference pages. the webgl tutorial has more in
formation, examples, and resources on how to get started with webgl. constants see the webgl constants page. state in
formation webgl2renderingcontext.getindexedparameter() returns the indexed value for the given target. buffers webgl2renderingcontext.bufferdata() initializes and creates the buffer object's data store. webgl2renderingcontext.buffersubdata() updates a subset of a buffer o...
... of a texture to a framebuffer. webgl2renderingcontext.invalidateframebuffer() invalidates the contents of attachments in a framebuffer. webgl2renderingcontext.invalidatesubframebuffer() invalidates portions of the contents of attachments in a framebuffer webgl2renderingcontext.readbuffer() selects a color buffer as the source for pixels. renderbuffers webgl2renderingcontext.getinternal
formatparameter() returns in
formation about implementation-dependent support for internal
formats. webgl2renderingcontext.renderbufferstoragemultisample() creates and initializes a renderbuffer object's data store and allows specifying the number of samples to be used. textures webgl2renderingcontext.texstorage2d() specifies all levels of two-dimensional texture storage. webgl2renderingconte...
...ontext.teximage3d() specifies a three-dimensional texture image. webgl2renderingcontext.texsubimage3d() specifies a sub-rectangle of the current 3d texture. webgl2renderingcontext.copytexsubimage3d() copies pixels from the current webglframebuffer into an existing 3d texture sub-image. ...
...And 14 more matches
Matrix math for the web - Web APIs
matrices can be used to represent trans
formations of objects in space, and are used for per
forming 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 trans
forms and the matrix3d trans
form type. while this article uses css to simplify explanations, matrices are a core concept used by many different technologies including webgl, the webxr (vr and ar) api, and glsl shaders. this article is also available as an mdn content kit. the live examples use a collection of utility functions available under a global object named mdn. trans
formation matrices there are many types of matrices, but the ones we are interested in are the 3d trans
formation matrices. these matrices consist of a set of...
...ion of utility functions available under a global object named mdn. trans
formation matrices there are many types of matrices, but the ones we are interested in are the 3d trans
formation matrices. these matrices consist of a set of 16 values arranged in a 4x4 grid. in javascript, it is easy to represent a matrix as an array. let's begin by considering the identity matrix. this is a special trans
formation matrix which functions much like the number 1 does in scalar multiplication; just like n * 1 = n, multiplying any matrix by the identity matrix gives a resulting matrix whose values match the original matrix. the identity matrix looks like this in javascript: let identitymatrix = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; what does multiplying by the identity matrix look...
...gives a resulting matrix whose values match the original matrix. the identity matrix looks like this in javascript: let identitymatrix = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; what does multiplying by the identity matrix look like? the easiest example is to multiply a single point by the identity matrix. since a 3d point only needs three values (x, y, and z), and the trans
formation matrix is a 4x4 value matrix, we need to add a fourth dimension to the point. by convention, this dimension is called the perspective, and is represented by the letter w. for a typical position, setting w to 1 will make the math work out. after adding the w component to the point, notice how neatly the matrix and the point line up: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] [4, 3...
...And 14 more matches
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
own coordinate system in this manner. the world space; the origin of this space is the origin of the webgl coordinate system underlying the entire 3d canvas. the player, avatar, or camera; the origin of this space is used as the camera position for rendering the scene to be displayed to the user. the hand and/or hand controller; each of these represents one of the user's hands, either in the
form of the hand itself or a controller (or both). the origin is generally the center of the user's fisted hand. the target ray; each controller or other handheld device may have a targeting ray associated with it, which is represented by a space whose origin is at the point on the controller at which the ray is emitted, and is oriented so that -z extends in the direction of the target it's pointing ...
... may have a targeting ray associated with it, which is represented by a space whose origin is at the point on the controller at which the ray is emitted, and is oriented so that -z extends in the direction of the target it's pointing at. ...
... poses once your reference space or spaces are established for the various key objects in the scene, you will have times when you need to describe another position relative to the origin of a particular reference space. this is done using poses. ...
...And 14 more matches
Example and tutorial: Simple synth keyboard - Web APIs
this example makes use of the following web api interfaces: audiocontext, oscillatornode, periodicwave, and gainnode. because oscillatornode is based on audioscheduledsourcenode, this is to some extent an example for that as well. the video keyboard html there are three primary components to the display for our virtual keyboard. ...
... named "container" is the scrollable box that lets the keyboard be scrolled horiontally if it's too wide for the available space. the keys themselves will be inserted into the block of class "keyboard". the settings bar beneath the keyboard, we'll put some controls for configuring the layer. for now, we will have two controls: one to set the master volume and another to select what periodic wave
form to use when generating notes. the volume control first we create the <div> to contain the settings bar, so it can be styled as needed. then we establish a box that will be presented on the left side of the bar and place a label and an <input> element of type "range". the range element will typically be presented as a slider control; we configure it to allow any value between 0.0 and 1.0, steppi...
...t value of 0.5, and we provide a <datalist> element which is connected to the range using the name attribute to find an option list whose id matches; in this case, the data set is named "volume". this lets us provide a set of common values and special strings which the browser may optionally choose to display in some fashion; we provide names for the values 0.0 ("mute") and 1.0 ("100%"). ...
...And 14 more matches
Making content editable - Developer guides
note: in firefox 63 beta/dev edition, some of the rich-text editing features have been disabled by default, for better cross-browser compatibility. these are object resizing on <img>, <table>, and absolutely-positioned elements; inline table editing to add or remove rows and columns; and the grabber that allows moving of absolutely-positioned elements. see bug 1449564 and firefox-specific html editing ui has been deprecated for additional details. ...
...lowclipboard.clipboard.cutcopy", "allaccess"); user_pref("capability.policy.allowclipboard.clipboard.paste", "allaccess"); example: a simple but complete rich text editor <!doctype html> <html> <head> <title>rich text editor</title> <script type="text/javascript"> var odoc, sdeftxt; function initdoc() { odoc = document.getelementbyid("textbox"); sdeftxt = odoc.innerhtml; if (document.comp
form.switchmode.checked) { setdocmode(true); } } function
formatdoc(scmd, svalue) { if (validatemode()) { document.execcommand(scmd, false, svalue); odoc.focus(); } } function validatemode() { if (!document.comp
form.switchmode.checked) { return true ; } alert("uncheck \"show html\"."); odoc.focus(); return false; } function setdocmode(btosource) { var ocontent; if (btosource) { oc...
...e type="text/css"> .intlink { cursor: pointer; } img.intlink { border: 0; } #toolbar1 select { font-size:10px; } #textbox { width: 540px; height: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textbox #sourcetext { padding: 0; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </style> </head> <body onload="initdoc();"> <
form name="comp
form" 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"...
...And 14 more matches
<input type="radio"> - HTML: Hypertext Markup Language
is selected. defining a radio group a radio group is defined by giving each of radio buttons in the group the same name. once a radio group is established, selecting any radio button in that group automatically deselects any currently-selected radio button in the same group. you can have as many radio groups on a page as you like, as long as each has its own unique name. ...
...its own unique name. for example, if your
form needs to ask the user for their preferred contact method, you might create three radio buttons, each with the name property set to contact but one with the value email, one with the value phone, and one with the value mail. the user never sees the value or the name (unless you expressly add code to display it). ...
...they each also have a unique id, which is used by the <label> element's for attribute to associate the labels with the radio buttons. you can try out this example here: data representation of a radio group when the abov...
...And 14 more matches
Firefox user agent string reference - HTTP
this document describes the user agent string used in firefox 4 and later and applications based on gecko 2.0 and later. for a breakdown of changes to the string in gecko 2.0, see final user agent string for firefox 4 (blog post). see also this document on user agent sniffing and this hacks blog post. general
form the ua string of firefox itself is broken down into four components: mozilla/5.0 (plat
form; rv:geckoversion) gecko/geckotrail firefox/firefoxversion mozilla/5.0 is the general token that says the browser is mozilla compatible, and is common to almost every browser today. plat
form describes the native plat
form the browser is running on (e.g. windows, mac, linux or android), and whether or not it's a mobile phone. firefox os phones simply say "mobile"; the web is the platfor...
...see below for further details and examples. ...
... as "17.0"). from firefox 10 on mobile, geckotrail is the same as firefoxversion. the recommended way of sniffing for gecko-based browsers (if you have to sniff for the browser engine instead of using feature detection) is by the presence of the "gecko" and "rv:" strings, since some other browsers include a "like gecko" token. for other products based on gecko, the string can take one of two
forms, where the tokens have the same meaning except those noted below: mozilla/5.0 (plat
form; rv:geckoversion) gecko/geckotrail appname/appversion mozilla/5.0 (plat
form; rv:geckoversion) gecko/geckotrail firefox/firefoxversion appname/appversion appname/appversion indicates the application name and version. for instance, this could be "camino/2.1.1", or "seamonkey/2.7.1". firefox/firefoxvers...
...And 14 more matches
String.prototype.normalize() - JavaScript
if omitted or undefined, "nfc" is used. these values have the following meanings: "nfc" canonical decomposition, followed by canonical composition. "nfd" canonical decomposition. "nfkc" compatibility decomposition, followed by canonical composition. ...
...if omitted or undefined, "nfc" is used. these values have the following meanings: "nfc" canonical decomposition, followed by canonical composition. "nfd" canonical decomposition. "nfkc" compatibility decomposition, followed by canonical composition. ...
...if omitted or undefined, "nfc" is used. these values have the following meanings: "nfc" canonical decomposition, followed by canonical composition. "nfd" canonical decomposition. "nfkc" compatibility decomposition, followed by canonical composition. ...
...And 14 more matches
Localization - Archive of obsolete content
the title and description fields of your add-on's preferences. it doesn't, yet, support localization of css or content scripts, or the add-on's title and description that appear in the add-ons manager. see limitations below. localized strings translated strings are kept in a directory called "locale" under your main add-on directory, one file for each locale. ...
...ized strings translated strings are kept in a directory called "locale" under your main add-on directory, one file for each locale. the files: use the .properties
format are named "xx-yy.properties", where "xx-yy" is the name of the locale in question contain one entry for each string you want to localize, consisting of an identifier for the string and its translation in that locale, in the
format identifier=translation need to use utf-8 without bom encoding lines starting with "#" (after optional whitespace) are comments suppose your add-on contains a single localizable string, represented in english as "hello!", and you want to supply us english and french french localizations. you'd add two files to the "locale" directory: my-addon/ data lib locale/ en-us.pro...
...odule, and assign its get function to "_" (underscore). wrap all references to localizable strings with the _() function. if you run it you'll see the expected output for the current locale: info: hello! info: bonjour ! note that because you can't require() modules in content scripts, you can't yet reference localized strings from content scripts. ...
...And 13 more matches
Connecting to Remote Content - Archive of obsolete content
in this section we'll look into the xml and json communication mechanisms. ...
...the request! the open method takes two required parameters: the http request method and the url to send the request. the http request method can be "get", "post" or "put". sending a post request requires you to set the content type of the request and to pass the post data to the send() method as below. request.open("post", url, true); request.setrequestheader("content-type", "application/x-www-
form-urlencoded"); request.send("data=hello&version=2"); the third parameter for the open method specifies whether the request should be handled asynchronously or not. in asynchronous mode code execution continues immediately after the send call. in synchronous mode the code and user interface are blocked while waiting for a response to come back. note: requests can take a long time to process and ...
... note: requests can take a long time to process and you don't want users to be stuck waiting while a request is obtained and processed. therefore, it is very important that xmlhttprequest calls are always done asynchronously. now let's look at the most common types of content you can use to communicate with remote servers. json content json is a very lightweight and simple data representation
format, similar to the object representation used in javascript. unlike javascript, the json
format doesn't allow any kind of code that can be run, only data. json used to be risky in terms of security because the favored way of parsing it was to use the javascript eval function. since eval executes any code contained in the string, workarounds had to be devised in order to close security holes. luck...
...And 13 more matches
Adding preferences to an extension - Archive of obsolete content
volves turning each function into a member of the stockwatcher class. let's take a look at each function in the class. startup() the stockwatcher.startup() function is called when our extension is first loaded. its job is to start up the observer to watch for changes to our preferences, instantiate an object to use to manage our preferences, and install an interval routine to update the stock in
formation periodically. var stockwatcher = { prefs: null, tickersymbol: "", // initialize the extension startup: function() { // register to receive notifications of preference changes this.prefs = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice) .getbranch("extensions.stockwatcher2."); this.p...
...prefs is configured by startup() to reference our extension's preferences, while tickersymbol indicates the stock symbol to monitor. the first thing the startup() function does is to get a reference to the preferences for our extension. this is done in two steps: first, we get...
...prefs is configured by startup() to reference our extension's preferences, while tickersymbol indicates the stock symbol to monitor. the first thing the startup() function does is to get a reference to the preferences for our extension. this is done in two steps: first, we get the preferences service. this component handles pr...
...And 13 more matches
JXON - Archive of obsolete content
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). this is a good and standardized compromise for a javascript usage, since all of the in
formation of an xml document is contained in these node types. all other in
formation (like processing instructions, schemas, comments, etc.) will be lost. this type of algorithm is still considered lossless, since what is lost is meta-in
formation and not in
formation. in order to avoid conflicts, the representation of nodes and attributes names is case insensitive (always rendered in lower case), so o...
..., the representation of nodes and attributes names is case insensitive (always rendered in lower case), so objects' local property names set using javascript must always have some kind of capitalization (that is, at least one capital letter somewhere in their names), as you can see below. the following algorithms are somewhat based on the parker convention, version 0.4, which prescribes the trans
formation of tags names into object properties names and the recognition of the typeof of all the collected text content of each tag (plain text parsing); but with some differences (so, one can say that we follow a our convention). moreover, all algorithms are equally lossless for the contemplated nodes. we consider the third algorithm as the most representative and practical jxon parsing algorithm. ...
...onverted into text nodes), the process is unnecessarily costly. in fact, if your goal is to edit an xml document, it is strongly recommended to work on it rather than create new ones. the parker convention the functions listed above for the conversion of an xml document to json (often called "jxon algorithms") are more or less freely based on the parker convention (especially regarding the trans
formation of tags names into object properties names, the recognition of the typeof of all the collected text content of each tag and the absorption of solitary text and/or cdatasection nodes into primitive values). it is called “parker convention” in opposition to “badgerfish convention”, after the comic parker & badger by cuadrado. see also: badgerfish convention. the following is a transcr...
...And 13 more matches
Source code directories overview - Archive of obsolete content
the source code so a developer can get a good idea what is in mozilla and where to find things. it is a good document for a new mozilla developer to start learning about the mozilla code base. this document contains material for seamonkey, firefox, and toolkit. it is a living document which is (supposed to be) updated monthly according to changes in the mozilla source tree. see also similar in
formation in mozilla source code directory structure, and also see the more detailed overview of how the parts of gecko fit together. introduction: common subdirectories a common naming scheme is used throughout the mozilla source trees. at the top level is the name of the product (e.g. seamonkey). at the second level is the name of the module (e.g. the editor directory in seamonkey). the third leve...
.... thus, the scheme is recursive; it can apply to submodules, sub-submodules and so on. base contains the basic (core) functionality for the module. base contains all the source code that cannot be categorized into a submodule. build contains any special makefiles for building the particular module. doc contains any documentation associated with this module. idl contains the xpidl (cross plat
form interface definition language) interface files. interfaces are used so functionality can be available to both javascript scripts and c code with as little effort as possible. xpidl files have their own mini-language and processing tools. public contains source code that will be exported to the dist/include directory. they are not all necessarily public in the general sense; some are only meant f...
...r internal use in a certain module. as more code is written with or converted to xpidl interfaces, the value of the public directory diminishes. src contains the bulk of the source code. tests contains c harnesses, html or xul that exercise this module. tools contains scripts for automatically generating certain source code and other special tools for building this module. there are also plat
form dependent subdirectories which contain source code for specific plat
forms. windows contains source code for windows 95, windows 98 and windows nt 4.0. mac contains source code for macos: both the powerpc and 68000 versions. gtk contains source code for gtk (a.k.a. the gimp toolkit) which runs on x-windows on unix. motif contains source code for motif, a toolkit which runs on x-windows on u...
...And 13 more matches
Creating a Help Content Pack - Archive of obsolete content
elp content. the previous document had a lot of places where ideas were simply introduced without explanation, and i've tried to go through things a bit more slowly with better descriptions. this is still very much a work in progress, tho, and i need to complete the rest of it soon (where "complete" means "use what's there that's good, build on the stuff that's not as good, and add other useful in
formation as necessary". this document describes how to integrate html help documentation into your application using the mozilla help viewer. documentation contained in the help viewer can be accessed using any xul application or program that embeds mozilla. what is a content pack? a content pack is a packaged set of files that describe help content. content packs include help documents written in...
...on rdf:about="urn:root" nc:title="" nc:defaulttopic="" nc:base=""> </rdf:description> fill in the attributes as follows: rdf:about must be urn:root or your pack won't work. this attribute marks the start point in the rdf graph described by the file, and the help viewer searches for this element in order to query for further in
formation (stored in child elements) about the content pack being parsed. nc:title is where you specify the title (e.g., "mozilla firefox help") for the help window. this attribute is required. nc:defaulttopic will hold the rdf:id of the topic you want displayed when the viewer first loads if none has been specified. this attribute also specifies what topic is loaded when the user hits the home butt...
...to describe where to find the glossary, index, and table of contents. (we're still not actually to the point where we're describing the actual data in each of these, so we'll just use some filler data for now.) add the following code inside the rdf:description element you just created: <nc:panellist> <rdf:seq> </rdf:seq> </nc:panellist> you'll create the relevant in
formation descriptions within the rdf:seq element. the location of each of the glossary, index, and table of contents data sources is stored in one rdf:description element contained within one rdf:li element, like so: <rdf:seq> <rdf:li> <rdf:description nc:panelid="glossary" nc:datasources="chrome://foo/locale/help/...
...And 13 more matches
Gecko FAQ - Gecko Redirect 1
d to support open internet standards such as html 5, css 3, the w3c dom, xml, javascript, and others. gecko is used in multiple browsers, including mozilla firefox, seamonkey, and others. gecko is continuously under development at mozilla.org. gecko has been known previously by the code names "raptor" and "nglayout"; the new name was chosen following a trademark infringement dispute. for more in
formation see the wikipedia article on gecko. what is a layout engine? basically, a layout engine takes content (such as html, xml, image files, applets, and so on) and
formatting in
formation (such as cascading style sheets, presentational html tags, etc.) and displays the
formatted content on the screen. it paints the browser's content area, which is the blank area inside the browser window's chrom...
...n see the wikipedia article on gecko. what is a layout engine? basically, a layout engine takes content (such as html, xml, image files, applets, and so on) and
formatting in
formation (such as cascading style sheets, presentational html tags, etc.) and displays the
formatted content on the screen. it paints the browser's content area, which is the blank area inside the browser window's chrome.
formally, a layout engine defines the placement policy for a document and places content on a page. gecko's core is a very fast layout engine. gecko also offers the ability to parse various document types (html, xml, svg, etc), advanced rendering capabilities including compositing and trans
formations, and support for embedded javascript and plugins. gecko is so fast and so powerful that it's being us...
... how is a layout engine like gecko different from a web browser? gecko provides the foundation needed to display content on the screen, including a layout engine and a complementary set of browser components. ...
...And 13 more matches
Introduction to events - Learn web development
in this article, we discuss some important concepts surrounding events, and look at how they work in browsers. ...
... this might be a single element, set of elements, the html document loaded in the current tab, or the entire browser window. there are many different types of events that can occur. for example: the user selects a certain element or hovers the cursor over a certain element. the user chooses a key on the keyboard. the user resizes or closes the browser window. a web page finishes loading. a
form is submitted. a video is played, paused, or finishes. an error occurs. you can gather from this (and from glancing at the mdn event reference) that there are a lot of events that can be responded to. each available event has an event handler, which is a block of code (usually a javascript function that you as a programmer create) that runs when the event fires. when such a block of code is d...
...the simple random color example we've played with already. now try changing btn.onclick to the following different values in turn, and observing the results in the example: btn.onfocus and btn.onblur — the color changes when the button is focused and unfocused; try pressing the tab to focus on the button and press the tab again to focus away from the button. these are often used to display in
formation about filling in
form fields when they are focused, or displaying an error message if a
form field is filled with an incorrect value. btn.ondblclick — the color changes only when the button is double-clicked. window.onkeypress, window.onkeydown, window.onkeyup — the color changes when a key is pressed on the keyboard. the keypress event refers to a general press (button down and then u...
...And 13 more matches
Working with JSON - Learn web development
it is commonly used for transmitting data in web applications (e.g., sending some data from the server to the client, so it can be displayed on a web page, or vice versa). you'll come across it quite often, so in this article we give you all you need to work with json using javascript, including parsing json so you can access data within it, and creating json. ...
...and creating json. prerequisites: basic computer literacy, a basic understanding of html and css, familiarity with javascript basics (see first steps and building blocks) and oojs basics (see introduction to objects). objective: to understand how to work with data stored in json, and create your own json objects. no, really, what is json? json is a text-based data
format following javascript object syntax, which was popularized by douglas crockford. even though it closely resembles javascript object literal syntax, it can be used independently from javascript, and many programming environments feature the ability to read (parse) and generate json. json exists as a string — useful when you want to transmit data across a network. it needs to be converted to a ...
.... note: converting a string to a native object is called deserialization, while converting a native object to a string so it can be transmitted across the network is called serialization. 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. ...
...And 13 more matches
Multimedia: video - Learn web development
why optimize your multimedia? for the average website, 25% of bandwidth comes from video. ...
... why optimize your multimedia? for the average website, 25% of bandwidth comes from video. ...
...amely images and video, account for over 70% of the bytes downloaded for the average website. we have already taken a look at optimizing images. this article looks at optimizing video to improve web per
formance. prerequisites: basic computer literacy, basic software installed, and basic knowledge of client-side web technologies. objective: to learn about the various video
formats, their impact on per
formance, 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. why optimize your multimedia? for the average website, 25% of bandwidth comes from video. optimizing video has the potential for very large bandwidth savings that translate into better website per
formance. optimizin...
...And 13 more matches
Server-side web frameworks - Learn web development
in our framework-specific modules. overview server-side web frameworks (a.k.a. "web application frameworks") are software frameworks that make it easier to write, maintain and scale web applications. they provide tools and libraries that simplify common web development tasks, including routing urls to appropriate handlers, interacting with databases, supporting sessions and user authorization,
formatting output (e.g. html, json, xml), and improving security against web attacks. the next section provides a bit more detail about how web frameworks can ease web application development. we then explain some of the criteria you can use for choosing a web framework, and then list some of your options. what can a web framework do for you? web frameworks provide tools and libraries to simplify c...
...make your life a lot easier. this section discusses some of the functionality that is often provided by web frameworks (not every framework will necessarily provide all of these features!). work directly with http requests and responses as we saw in the last article, web servers and browsers communicate via the http protocol — servers wait for http requests from the browser and then return in
formation in http responses. web frameworks allow you to write simplified syntax that will generate server-side code to work with these requests and responses. this means that you will have an easier job, interacting with easier, higher-level code rather than lower level networking primitives. the example below shows how this works in the django (python) web framework. every "view" function (a reques...
...lified syntax that will generate server-side code to work with these requests and responses. this means that you will have an easier job, interacting with easier, higher-level code rather than lower level networking primitives. the example below shows how this works in the django (python) web framework. every "view" function (a request handler) receives an httprequest object containing request in
formation, and is required to return an httpresponse object with the
formatted output (in this case a string). # django view function from django.http import httpresponse def index(request): # get an httprequest (request) # per
form operations using in
formation from the request. # return httpresponse return httpresponse('output string to return') route requests to the appropriate ha...
...And 13 more matches
Handling common JavaScript problems - Learn web development
prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high-level principles of cross browser testing. objective: to be able to diagnose common javascript cross-browser problems, and use appropriate tools and techniques to fix them. ...
...its current state and see what is going on. let's get to work. the error is now being thrown at line 51. click on line number 51 in the center panel to add a breakpoint to it (you'll see a blue arrow appear over the top of it). now refresh the page (cmd/ctrl + r) — the browser will pause execution of the code at line 51. at this point, the right-hand side will update to show some very useful in
formation. under breakpoints, you'll see the details of the break-point you have set. under call stack, you'll see a few entries — this is basically a list of the series of functions that were invoked to cause the current function to be invoked. at the top, we have showheroes() the function we are currently in, and second we have onload, which stores the event handler function containing the c...
...onload, which stores the event handler function containing the call to showheroes(). under scopes, you'll see the currently active scope for the function we are looking at. we only have three — showheroes, block, and window (the global scope). each scope can be expanded to show the values of variables inside the scope when execution of the code was stopped. we can find out some very useful in
formation in here. expand the showheroes scope — you can see from this that the heroes variable is undefined, indicating that accessing the members property of jsonobj (first line of the function) didn't work. you can also see that the jsonobj variable is storing a text string, not a json object. exploring further down the call stack, click onload in the call stack section. the view will update...
...And 13 more matches
Shell global objects
eager standard classes, if (s == 'lazy' && !o) return new o with lazy standard classes evalinworker(str) evaluate str in a separate thread with its own runtime. getsharedarraybuffer() retrieve the sharedarraybuffer object from the cross-worker mailbox. the object retrieved may not be identical to the object that was installed, but it references the same shared memory. getsharedarraybuffer per
forms an ordering memory barrier. setsharedarraybuffer() install the sharedarraybuffer object in the cross-worker mailbox. setsharedarraybuffer per
forms an ordering memory barrier. shapeof(obj) get the shape of obj (an implementation detail). groupof(obj) get the group of obj (an implementation detail). unwrappedobjectshavesameshape(obj1, obj2) returns true iff obj1 and obj2 have the same shap...
...and its cached content. the cache entry is filled and read by the evaluate function by using it in place of the source, and by setting savebytecode and loadbytecode options. printprofilerevents() register a callback with the profiler that prints javascript profiler events to stderr. callback is only registered if profiling is enabled. enablesinglestepprofiling() this function will fail on plat
forms that don't support single-step profiling (currently everything but arm-simulator). when enabled, at every instruction a backtrace will be recorded and stored in an array. adjacent duplicate backtraces are discarded. disablesinglestepprofiling() return the array of backtraces recorded by enablesinglestepprofiling. enablespsprofiling() enables sps instrumentation and corresponding assertions, ...
...fo() return an int32 value which corresponds to the offset of the latest stack pointer, such that one can take the differences of 2 to estimate a frame-size. entrypoints(params) carry out some jsapi operation as directed by params, and return an array of objects describing which javascript entry points were invoked as a result. params is an object whose properties indicate what operation to per
form. here are the recognized groups of properties: { function } call the object params.function with no arguments. { object, property } fetch the property named params.property of params.object. { tostring } apply js::tostring to params.tostring. { tonumber } apply js::tonumber to params.tonumber. { eval } apply js::evaluate to params.eval. the return value is an array of str...
...And 13 more matches
Starting WebLock
to have startup notification. the nsicategoryservice maintains sets of name-value pairs like the one below. the category manager every category is identified by a string that represents the name of the category. each category contains a set of name-value pairs. for example, you might have a category named "important people" in which the name-value pairs would be names and phone numbers. the
format of the name-value pair is left up to you. this data structure is more than enough to support the persisting of components that want to be started up. the category name also maps nicely onto the notion of a notification "topic." the topic name could be something like "xpcom-startup", for instance, and the name-value pair could contain the contract ids required to create the components requestin...
...ce needs to be able to enable and disable the web locking functionality, see what sites are in the whitelist, and add or remove sites from that list. weblock needs to provide an api, and it needs to hook into gecko in order to implement the actual locking functionality. the weblock user interface the weblock component in this tutorial uses xul to define the additional browser ui in a cross-plat
form way, and xul uses javascript to access and control xpcom components, but gecko's pluggable ui allows any user interface to call into gecko and the components you create as easily as you can from xul. see xul for a discussion of how xul interacts with javascript and xpcom. creating the weblock programming interface design is one of the hardest parts of any programming problem. the question the ...
...is: how should weblock look to the outside world? what, in other words, is the interaction of clients with the weblock component? in this section, we enumerate the basic functionality the component should expose and create the single interface that organizes and provides this functionality. instead of starting with the implementation, developers use xpidl (see xpidl and type libraries for more in
formation about xpidl) to define the interface to the component: how the functionality should be organized, expressed, and exposed to its clients. in general, the weblock service interface needs to include the following functionality: lock - enable web locking so that any browser in the gecko application is restricted to the white list of website domains. unlock - disable web locking. this should...
...And 13 more matches
XRView - Web APIs
you can think of it as a description of a specific eye or camera and how it views the world. a 3d frame will involve two views, one for each eye, separated by an appropriate distance which approximates the distance between the viewer's eyes. this allows the two views, when projected in isolation into the appropriate eyes, to simulate a 3d world. properties eye read only which of the two eyes (left) or (right) for which this xrview represents the perspective. ...
...ve. this value is used to ensure that any content which is pre-rendered for presenting to a specific eye is distributed or positioned correctly. the value can also be none if the xrview is presenting monoscopic data (such as a 2d image, a full-screen view of text. or a close-up view of something that doesn't need to appear in 3d). ...
...(such as a 2d image, a full-screen view of text. or a close-up view of something that doesn't need to appear in 3d). projectionmatrix read only the projection matrix that will trans
form the scene to appear correctly given the point-of-view indicated by eye. this matrix should be used directly in order to avoid presentation distortions that may lead to potentially serious user discomfort. trans
form read only an xrrigidtrans
form which describes the current position and orientation of the viewpoint in relation to the xrreferencespace specified when getviewerpose() was called on the xrframe being rendered. usage notes positions and number of xrviews per frame while rendering a scene, the set of views that are used to render the scene for the viewer as of the current frame are obtained by...
...And 13 more matches
Operable - Accessibility
operable states that user interface components and navigation must be operable. note: to read the w3c definitions for operable and its guidelines and success criteria, see principle 2: operable — user interface components and navigation must be operable. guideline 2.1 — keyboard accessible: make all functionality available from a keyboard this guideline covers the necessity of making core website functionality available via a keyboard in addition to other means (e.g. ...
...able — user interface components and navigation must be operable. guideline 2.1 — keyboard accessible: make all functionality available from a keyboard this guideline covers the necessity of making core website functionality available via a keyboard in addition to other means (e.g. mouse), so that users that rely on keyboard controls can access them. success criteria how to con
form to the criteria practical resource 2.1.1 keyboard (a) all functionality should be accessible using keyboard controls, unless it cannot be done using the keyboard (e.g. freehand drawing). built-in controls should be used where possible (e.g. tabbing through
form controls), and you should only build in custom functionality where needed. see ui controls and building keyboard ac...
...you press enter/return on a focused button to open an options window, you should be able to close that window again and return to the main content using the keyboard. this is very important so that keyboard users do not get trapped on specific sections of your apps. 2.1.3 keyboard — all functionality (aaa) this is a further step beyond criterion 2.1.1. to achieve aaa con
formance, all functionality should be accessible using keyboard controls — with no exceptions. see ui controls and building keyboard accessibility back in 2.1.4 character key shortcuts (a) added in 2.1 if a single character key shortcut exists, then at least one of the following is true: single character key shortcuts can be turned off, remapped or are only active when the relevant us...
...And 13 more matches
Understandable - Accessibility
this article provides practical advice on how to write your web content so that it con
forms to the success criteria outlined in the understandable principle of the web content accessibility guidelines (wcag) 2.0 and 2.1. understandable states that in
formation and the operation of user interface must be understandable. note: to read the w3c definitions for understandable and its guidelines and success criteria, see principle 3: understandable — in
formation and the operation of user interface must be understandable. guideline 3.1 — readable: make text content readable and understandable this guideline focuses on making text content as understandable as possible. ...
.... note: to read the w3c definitions for understandable and its guidelines and success criteria, see principle 3: understandable — in
formation and the operation of user interface must be understandable. guideline 3.1 — readable: make text content readable and understandable this guideline focuses on making text content as understandable as possible. success criteria how to con
form to the criteria practical resource 3.1.1 language of page (a) the default human language of each web page should be detectable via code. this is essential for purposes like making sure the reader has arrived at a page written in a language suitable for them. the simplest way to achieve this is to set the lang attribute on the page's <html> element, giving it a value equal to th...
...e video and audio content, and pronunciation guide for english dictionary note: also see the wcag description for guideline 3.1 readable: make text content readable and understandable. guideline 3.2 — predictable: make web pages appear and operate in predictable ways this guideline focuses on making user interfaces intuitive and understandable. success criteria how to con
form to the criteria practical resource 3.2.1 on focus (a) when a control or other page feature receives focus, it should not change the context in a way that may confuse or disorientate the user. this is a matter of sensible design — people don't want interfaces to surprise them; they want things to be intuitive and behave as expected. for example, focusing a navigation...
...And 13 more matches
Color picker tool - CSS: Cascading Style Sheets
in: 0; border: 1px solid #ddd; background-color: #fff; display: table; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-color-picker .picking-area { width: 198px; height: 198px; margin: 5px; border: 1px solid #ddd; position: relative; float: left; display: table; } .ui-color-picker .picking-area:hover { cursor: default; } /* hsv
format - hue-saturation-value(brightness) */ .ui-color-picker .picking-area { background: url('https://mdn.mozillademos.org/files/5707/picker_mask_200.png') center center; background: -moz-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -moz-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -webkit-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -we...
...100%), -webkit-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -ms-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -ms-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -o-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -o-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background-color: #f00; } /* hsl
format - hue-saturation-lightness */ .ui-color-picker[data-mode='hsl'] .picking-area { background: -moz-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -moz-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -webkit-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, ...
...: none; user-select: none; } .ui-input-slider * { float: left; height: 100%; line-height: 100%; } /* input slider */ .ui-input-slider > input { margin: 0; padding: 0; width: 50px; text-align: center; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-input-slider-info { width: 90px; padding: 0px 10px 0px 0px; text-align: right; text-trans
form: lowercase; } .ui-input-slider-left, .ui-input-slider-right { width: 16px; cursor: pointer; background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center left no-repeat; } .ui-input-slider-right { background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center right no-repeat; } .ui-input-slider-name { width: 90px; padding: 0 10px 0 0; text-align: right; tex...
...And 13 more matches
HTML attribute: multiple - HTML: Hypertext Markup Language
for the file input type, the native messaging the browser provides differs. in firefox, the file input reads "no files selected" when the attribute is present and "no file selected" when not, when no files are selected. most browsers displaying a scrolling list box for a <select> control with the multiple attribute set versus a single line dropdown when the attribute is ommitted. ...
...valid pseudo-class if more than one comma-separated email address is included if the attribute is not present. when multiple is set on the email input type, the user can inlclude zero (if not also required), one or more comma-separated email addresses. <input type="email" multiple name="emails" id="emails"> if and only if the multiple attribute is specified, the value can be a list of properly-
formed comma-separated e-mail addresses. any trailing and leading whitespace is removed from each address in the list. when multiple is set on the file input type, the user can select one or more files. the user can choose multiple files from the file picker in any way that their chosen plat
form allows (e.g. by holding down shift or control, and then clicking). <input type="file" multiple name="uplo...
...any trailing and leading whitespace is removed from each address in the list. if the required attribute is present, at least one email address is required. some browsers support the appearance of the list of options from the associated <datalist> for subsequent email addresses when multiple is present. others do not. file input when multiple is set on the ...
...And 13 more matches
HTML attribute reference - HTML: Hypertext Markup Language
elements in html have attributes; these are additional values that configure the elements or adjust their behavior in various ways to meet the criteria the users want. attribute list attribute name elements description accept <
form>, <input> list of types the server accepts, typically a file type. accept-charset <
form> list of supported charsets. accesskey global attribute keyboard shortcut to activate or add focus to the element. action <
form> the uri of a program that processes the in
formation submitted via the
form. align <applet>, <caption>, <col>, <colgroup>, <hr>, <iframe>, <img>, <table>, <tbody>, <td>, <tfoot> , <th>, <thead>, <tr> specifies the horizontal alignment of the element. ...
...the element. allow <iframe> specifies a feature-policy for the iframe. alt <applet>, <area>, <img>, <input> alternative text in case an image can't be displayed. async <script> executes the script asynchronously. autocapitalize global attribute sets whether input is automatically capitalized when entered by user autocomplete <
form>, <input>, <select>, <textarea> indicates whether controls in this
form can by default have their values automatically completed by the browser. autofocus <button>, <input>, <keygen>, <select>, <textarea> the element should be automatically focused after the page loaded. autoplay <audio>, <video> the audio or video should play as soon as possible. backgro...
...ies the url of the applet's class file to be loaded and executed. codebase <applet> this attribute gives the absolute or relative url of the directory where applets' .class files referenced by the code attribute are stored. color <basefont>, <font>, <hr> this attribute sets the text color using either a named color or a color specified in the hexadecimal #rrggbb
format. note: this is a legacy attribute. please use the css color property instead. cols <textarea> defines the number of columns in a textarea. colspan <td>, <th> the colspan attribute defines the number of columns a cell should span. content <meta> a value associated with http-equiv or name depending on the context. contentedi...
...And 13 more matches
<input type="hidden"> - HTML: Hypertext Markup Language
for example, the id of the content that is currently being ordered or edited, or a unique security token. hidden inputs are completely invisible in the rendered page, and there is no way to make it visible in the page's content. note: there is a live example below the following line of code — if it is working correctly, you should see nothing! <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. events none. ...
... none. supported common attributes autocomplete idl attributes value methods none. note: the input and change events do not apply to this input type. hidden inputs cannot be focused even using javascript (e.g. hiddeninput.focus()). ...
...hen the
form is submitted to the server. this specifically can't be edited or seen by the user via the user interface, although you could edit the value via browser developer tools. important: while the value isn't displayed to the user in the page's content, it is visible—and can be edited—using any browser's developer tools or "view source" functionality. do not rely on hidden inputs as a
form of security. ...
...And 13 more matches
<input type="number"> - HTML: Hypertext Markup Language
um value to accept for this input. if the value of the element is less than this, the element fails constraint validation. if a value is specified for min that isn't a valid number, the input has no minimum value. this value must be less than or equal to the value of the max attribute. ...
...hat kind of in
formation is expected in the field. it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message. the text must not include carriage returns or line feeds. if the control's content has one directionality (ltr or rtl) but needs to present the placeholder in the opposite directionality, you can use unicode bidirectional algorithm
formatting characters to override directionality within the placeholder; see overriding bidi using unicode control characters in the unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your
form, and can cause unexpected technical issues with your content. see labels and placehold...
...de directionality within the placeholder; see overriding bidi using unicode control characters in the unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your
form, and can cause unexpected technical issues with your content. see labels and placeholders in <input>: the input (
form input) element for more in
formation. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also specified. step ...
...And 13 more matches
HTML elements reference - HTML: Hypertext Markup Language
this page lists all the html elements, which are created using tags. they are grouped by function to help you find what you have in mind easily. an alphabetical list of all elements is provided in the sidebar on every element's page as well as this one. for more in
formation about the basics of html elements and attributes, see the section on elements in the introduction to html article. ...
...tml elements and attributes, see the section on elements in the introduction to html article. main root element description <html> the html <html> element represents the root (top-level element) of an html document, so it is also referred to as the root element. all other elements must be descendants of this element. document metadata metadata contains in
formation about the page. this includes in
formation about styles, scripts and data to help software (search engines, browsers, etc.) use and render the page. metadata for styles and scripts may be defined in the page or link to another file that has the in
formation. element description <base> the html <base> element specifies the base url to use for all relative urls i...
... <link> the html external resource link element (<link>) specifies relationships between the current document and an external resource. ...
...And 13 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
ted javascript to ecma international, a european standards organization, which resulted in the first edition of the ecmascript standard that year. the standard received a significant update as ecmascript edition 3 in 1999, and it has stayed pretty much stable ever since. the fourth edition was abandoned, due to political differences concerning language complexity. many parts of the fourth edition
formed the basis for ecmascript edition 5, published in december of 2009, and for the 6th major edition of the standard, published in june of 2015. because it is more familiar, we will refer to ecmascript as "javascript" from this point on. unlike most programming languages, the javascript language has no concept of input or output. it is designed to run as a scripting language in a host environme...
...ect. so the type diagram looks more like this: number string boolean symbol (new in es2015) object function array date regexp null undefined and there are some built-in error types as well. things are a lot easier if we stick with the first diagram, however, so we'll discuss the types listed there for now. numbers numbers in javascript are "double-precision 64-bit
format ieee 754 values", according to the spec — there's no such thing as an integer in javascript (except bigint), so you have to be a little careful. see this example: console.log(3 / 2); // 1.5, not 1 console.log(math.floor(3 / 2)); // 1 so an apparent integer is in fact implicitly a float. also, watch out for stuff like: 0.1 + 0.2 == 0.30000000000000004; in practice, integer v...
...int), so you have to be a little careful. see this example: console.log(3 / 2); // 1.5, not 1 console.log(math.floor(3 / 2)); // 1 so an apparent integer is in fact implicitly a float. also, watch out for stuff like: 0.1 + 0.2 == 0.30000000000000004; in practice, integer values are treated as 32-bit ints, and some implementations even store it that way until they are asked to per
form an instruction that's valid on a number but not on a 32-bit integer. this can be important for bit-wise operations. the standard arithmetic operators are supported, including addition, subtraction, modulus (or remainder) arithmetic, and so forth. there's also a built-in object that we did not mention earlier called math that provides advanced mathematical functions and constants: math.sin(3.5);...
...And 13 more matches
Date.parse() - JavaScript
1970, 00:00:00 utc or nan if the string is unrecognized or, in some cases, contains illegal date values (e.g. 2015-02-31). it is not recommended to use date.parse as until es5, parsing of strings was entirely implementation dependent. there are still many differences in how different hosts parse date strings, therefore date strings should be manually parsed (a library can help if many different
formats are to be accommodated). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax direct call: date.parse(datestring) implicit call: new date(datestring) parameters datestring a string representing a simpli...
...his interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax direct call: date.parse(datestring) implicit call: new date(datestring) parameters datestring a string representing a simplification of the iso 8601 calendar date extended
format. (other
formats may be used, but results are implementation-dependent.) return value a number representing the milliseconds elapsed since january 1, 1970, 00:00:00 utc and the date obtained by parsing the given string representation of a date. if the argument doesn't represent a valid date, nan is returned. description the parse() method takes a date string (such as "2011-10-10t14:48:00") ...
... a date. if the argument doesn't represent a valid date, nan is returned. description the parse() method takes a date string (such as "2011-10-10t14:48:00") and returns the number of milliseconds since january 1, 1970, 00:00:00 utc. this function is useful for setting date values based on string values, for example in conjunction with the settime() method and the date object. ...
...And 13 more matches
Notes on HTML Reflow - Archive of obsolete content
a frame is rectangular, with width, height, and an offset from the parent frame that contains it. ...
...a frame is rectangular, with width, height, and an offset from the parent frame that contains it. ...
...a frame is rectangular, with width, height, and an offset from the parent frame that contains it. ...
...And 12 more matches
Introduction to XUL - Archive of obsolete content
is displayed and managed by the same layout engine that manages html content in the browser. ui descriptions, then, look a great deal like html 4. xul is an application of xml. in fact, it is just xml with specific meaning defined for a few element types, and into which html can be scattered. ...
...at deal like html 4. xul is an application of xml. in fact, it is just xml with specific meaning defined for a few element types, and into which html can be scattered. terms "xpfe" is the term mozilla-the-organization is using to describe mozilla-the-browser's cross plat
form front end, because x and c look similar if you beat them long and hard with a hammer. the intention is to build cross-plat
form applications like browsers and mail clients from a set of tools designed for that purpose. ...
...can be scattered. terms "xpfe" is the term mozilla-the-organization is using to describe mozilla-the-browser's cross plat
form front end, because x and c look similar if you beat them long and hard with a hammer. the intention is to build cross-plat
form applications like browsers and mail clients from a set of tools designed for that purpose. the intention is not to implement a generic cross-plat
form application framework. that's been done, and is a great deal of work. we intend to provide a subset of cross-plat
form functionality suitable for building network applications like browsers, leveraging the cross-plat
form functionality already built into gecko, mozilla's html layout engine. the term "cross-plat
form ui" is somewhat misleading. ui designers will be able to create ui descriptions whi...
...And 12 more matches
Visual typescript game engine - Game development
socketio used for session staff. ...
...rocess we need some plugins. npm install npm run build navigate in browser /build/app.html to see client app in action -the client part is a browser web application. no reloading or redirecting. this is a single page application. i use html request only for loading local/staged html (like register, login etc.). networking is based on websocket full-duplex communication only.you must be con
form with classic socket connection methodology. webrtc can be used for any proportion. already implemented: -video chat webrtc (sip) chat and data communication. look back on main staff : -class 'connector' (native websocket) used for user session staff. for main account session staff like login, register etc. client config if you want web app without any networking then setup: appusenetwor...
...o use communication for multiplayer but you don't want to use server database account sessions. the setup this on false in main client config class. appuseaccountssystem: boolean = false; networking is disabled by default. find configuration at ./src/lib/client-config.ts /** * addson * all addson are ansync loaded scripts. * - cache is based on webworkers. * - hackertimer is for better per
formace also based on webworkers. * - dragging is script for dragging dom elements. */ 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/dr...
...And 12 more matches
HTML: A good basis for accessibility - Learn web development
r="#ffffff"> <td width="200"> <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...
...n attractive layout, your content should make logical sense in its source order — you can always place it where you want using css later on, but you should get the source order right to start with, so what screen reader users get read out to them will make sense. ui controls by ui controls, we mean the main parts of web documents that users interact with — most commonly buttons, links, and
form controls. in this section, we'll look at the basic accessibility concerns to be aware of when creating such controls. later articles on wai-aria and multimedia will look at other aspects of ui accessibility. one key aspect of the accessibility of ui controls is that by default, browsers allow them to be manipulated by the keyboard. you can try this out using our native-keyboard-accessibility.htm...
...fferent focusable elements. the focused elements are given a highlighted default style in every browser (it differs slightly between different browsers) so that you can tell what element is focused. you can then press enter/return to follow a focused link or press a button (we've included some javascript to make the buttons alert a message), or start typing to enter text in a text input. other
form elements have different controls, for example, the <select> element can have its options displayed and cycled between using the up and down arrow keys. note: different browsers may have different keyboard control options available. see using native keyboard accessibility for more details. you essentially get this behavior for free, just by using the appropriate elements, e.g. <h1>links</h1> ...
...And 12 more matches
HTML: A good basis for accessibility - Learn web development
r="#ffffff"> <td width="200"> <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...
...n attractive layout, your content should make logical sense in its source order — you can always place it where you want using css later on, but you should get the source order right to start with, so what screen reader users get read out to them will make sense. ui controls by ui controls, we mean the main parts of web documents that users interact with — most commonly buttons, links, and
form controls. in this section, we'll look at the basic accessibility concerns to be aware of when creating such controls. later articles on wai-aria and multimedia will look at other aspects of ui accessibility. one key aspect of the accessibility of ui controls is that by default, browsers allow them to be manipulated by the keyboard. you can try this out using our native-keyboard-accessibility.htm...
...fferent focusable elements. the focused elements are given a highlighted default style in every browser (it differs slightly between different browsers) so that you can tell what element is focused. you can then press enter/return to follow a focused link or press a button (we've included some javascript to make the buttons alert a message), or start typing to enter text in a text input. other
form elements have different controls, for example, the <select> element can have its options displayed and cycled between using the up and down arrow keys. note: different browsers may have different keyboard control options available. see using native keyboard accessibility for more details. you essentially get this behavior for free, just by using the appropriate elements, e.g. <h1>links</h1> ...
...And 12 more matches
Mozilla accessibility architecture
this page is maintained by aaron leventhal and by the mozilla accessibility community. feedback and constructive suggestions are encouraged. 1. intro this document is for people who wish to understand the architecture of mozilla's accessibility api module, which provides support for plat
form accessibility apis. accessibility apis are used by 3rd party software like screen readers, screen magnifiers, and voice dictation software, which need in
formation about document content and ui controls, as well as important events like changes of focus. mozilla supports two accessibility apis: microsoft active accessibility (msaa) on windows and accessibility tool kit (atk) on linux and unix. we do not currently support the carbon accessibility model for apple's os x. please note, the documentation...
...r unix accessibility, check out mozilla's atk project page. readers of this document should be familiar with interfaces, the w3c dom, xul and the concept of a layout object tree. 2. accessible nodes and interfaces every node in the dom tree could be important to 3rd party assistive technology. accessibility apis on each operating system have built-in assumptions about what is the most important in
formation, and how an accessibility server like mozilla should use the api's programmatic interfaces to expose this in
formation to an accessibility client (the assistive technology). each plat
form's accessibility api has made different assumptions, although there are a number of common characteristics. for example, they all expose an accessible name, or text representation, of each object, and they al...
...les of accessible role constants are role_button, role_checkbox and role_list, although they can have slightly different names and values in each api. in general, the accessibility apis use similar concepts, but use different method, constant and interfaces names. given that there is a fair amount of commonality between accessibility api toolkits, it made sense to write of the code in a cross plat
form manner, and then deal with the plat
form differences on a consistent manner. the shared code makes itself available to the toolkit-specific code via generic xpcom interfaces that return in
formation about objects we want to expose. all focusable nodes, tables and text have accessibility interfaces. we call these objects "accessible nodes". each of these accessible nodes supports at minimum the gene...
...And 12 more matches
Mozilla's Section 508 Compliance
the united states federal rehabilitation act's section 508 is a new standard for defining accessibility requirements for software and other electronic and in
formation technology. part of section 508 (§1194.21) specifically relates to mozilla, and the ability of us government agencies to buy software that contains mozilla software components. here is a detailed list of section 508 bugs in mozilla's seamonkey application suite. some of them are fairly minor. the following is provided for in
formational purposes only and is not a legally binding voluntary product accessibility template (vpat). here are the section 508 requirements and how far along mozilla seamonkey rv1.8a4 is with each one: requirement windows linux/unix mac os ...
... mostly complete. caveats: 1) although sidebar cannot be customized without a mouse, all sidebar functions that come with the browser are available through other means 2) java and in-page plugins cannot be used with the keyboard, so they must not be installed for keyboard-only users additional features for ...
...nterface elements as the input focus changes. the focus shall be programmatically exposed so that assistive technology can track focus and focus changes. complete. we expose focus programmatically via msaa (windows) and atk (linux/unix). incomplete, we show focus but need to expose it programmatically by supporting carbon/cocoa accessibility. ...
...And 12 more matches
JIT Optimization Strategies
2. provide a user-browsable documentation of optimization strategies, how they work, how they are defeated, and options for how to re-enable them. spidermonkey's optimizing jit, ionmonkey, uses various strategies to optimize operations. ...
... 2. provide a user-browsable documentation of optimization strategies, how they work, how they are defeated, and options for how to re-enable them. spidermonkey's optimizing jit, ionmonkey, uses various strategies to optimize operations. ...
...se to display in its ui. 2. provide a user-browsable documentation of optimization strategies, how they work, how they are defeated, and options for how to re-enable them. spidermonkey's optimizing jit, ionmonkey, uses various strategies to optimize operations. the most commonplace operations that are relevant for fast program execution are property accesses and function calls. optimization in
formation is currently collected for the following operations: getproperty (obj.prop) setproperty (obj.prop = val) getelement (obj[elemname]) setelement (obj[elemname] = val) call (func(...)) at each operation site, ionmonkey tries a battery of strategies, from the most optimized but most restrictive to the least optimized but least restrictive. for each strategy attempted, its outcome is tra...
...And 12 more matches
nsIDOMWindowUtils
ength and string of result are also computed with native line breaks. query_content_flag_use_xp_line_break 0x0001 one of values of aadditionalflags of sendquerycontentevent(). this flag must not be set with query_content_flag_use_native_line_break. when this is set, the aoffset and alength are offset and length in/of the content generated with xp line breaks (i.e., "\n" on all plat
forms). additionally, the offset, length and string of result are also computed with xp line breaks. this is more useful for javascript in chrome. query_content_flag_selection_spellcheck 0x0002 one of values of aadditionalflags of sendquerycontentevent(). query_content_flag_selection_ime_rawinput 0x0008 one of values of aadditionalflags of sendquerycontentevent(). ...
...onalflags of sendquerycontentevent(). query_content_flag_selection_urlstrikeout 0x0400 one of values of aadditionalflags of sendquerycontentevent(). query_content_flag_offset_relative_to_insertion_point 0x0800 one of values of aadditionalflags of sendquerycontentevent(). query_selected_text 3200 query_selected_text queries the first selection range's in
formation. query_text_content 3201 query_text_content queries the text at the specified range. query_caret_rect 3203 query_caret_rect queries the (collapsed) caret rect of the offset. if the actual caret is there at the specified offset, this returns the actual caret rect. otherwise, this guesses the caret rect from the metrics of the text. query_text_rect ...
...pecified offset, this returns the actual caret rect. otherwise, this guesses the caret rect from the metrics of the text. query_text_rect 3204 query_text_rect queries the specified text's rect. query_editor_rect 3205 query_text_rect queries the focused editor's rect. query_character_at_point 3208 query_character_at_point queries the character in
formation at the specified point. the point is offset in the window. note: if there are some panels at the point, this method send the query event to the panel's widget automatically. query_text_rect_array 3209 selection_set_flag_use_native_line_break 0x0000 one of values of aadditionalflags of sendselectionsetevent(). this flag must not be set with selection_...
...And 12 more matches
nsIFile
xpcom/io/nsifile.idlscriptable an instance of this interface is a cross-plat
form representation of a location in the filesystem. inherits from: nsisupports last changed in gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27) nsifile is the correct plat
form-agnostic way to specify a file; you should always use this instead of a string to ensure compatibility. with an nsifile you can navigate to ancestors or descendants without having to deal with the different path separators used on different plat
forms, query the state of any file or directory at the position represented by the nsifile and create, move or copy items in the filesystem. ...
...f a string to ensure compatibility. with an nsifile you can navigate to ancestors or descendants without having to deal with the different path separators used on different plat
forms, query the state of any file or directory at the position represented by the nsifile and create, move or copy items in the filesystem. an nsifile can be retrieved by either instantiating an nsilocalfile using a plat
form specific path string or by using cross-plat
form locations retrieved from the directory service. all methods with string parameters have two
forms. the preferred
form operates on utf-16 encoded characters strings. an alternate
form operates on characters strings encoded in the "native" charset. a string containing characters encoded in the native charset cannot be safely passed to javascript via ...
... cross-plat
form locations retrieved from the directory service. all methods with string parameters have two
forms. the preferred
form operates on utf-16 encoded characters strings. an alternate
form operates on characters strings encoded in the "native" charset. a string containing characters encoded in the native charset cannot be safely passed to javascript via xpconnect. therefore, the utf-16
forms are scriptable, but the "native methods" are not. in addition, the native
form cannot deal with files whose name contains characters outside the default system code page on windows. using the native
form limits the ability of your code to deal with the full unicode support on windows 2000 or later where the os itself does not have such a limitation. ...
...And 12 more matches
WebIDL bindings
mochitest/general/test_interfaces.html will most likely fail. this is a signal that you need to get a review from a dom peer. resist the urge to just add your interfaces to the moz.build list without the review; it will just annoy the dom peers and they'll make you get the review anyway. the configuration file, dom/bindings/bindings.conf, is basically a python dict that maps interface names to in
formation about the interface, called a descriptor. there are all sorts of possible options here that handle various edge cases, but most descriptors can be very simple. all the generated code is placed in the mozilla::dom namespace. for each interface, a namespace whose name is the name of the interface with binding appended is created, and all the things pertaining to that interface's binding go in...
...r have a corresponding tosupports method that can produce an nsisupports from it. (this allows the return value to be implicitly converted to a parentobject instance by the compiler via one of that class's non-explicit constructors.) if many instances of myinterface are expected to be created quicky, the return value of getparentobject should itself inherit from nswrappercache for optimal per
formance. returning null from getparentobject is allowed in situations in which it's ok to associate the resulting object with a random global object for security purposes; this is not usually ok for things that are exposed to web content. again, if you do not need wrapper caching you don't need to do this. the actual type returned from getparentobject must be defined in a header included from your i...
...in, if you do not need wrapper caching you don't need to do this. 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. add the webidl for myinterface in dom/webidl and to the list in dom/webidl/moz.build. add an entry to dom/bindings/bindings.conf that sets some basic in
formation about the implementation of the interface. if the c++ type is not mozilla::dom::myinterface, you need to set the 'nativetype' to the right type. if the type is not in the header file one gets by replacing '::' with '/' and appending '.h', then add a corresponding 'headerfile' annotation (or headerfile annotation to the .webidl file). if you don't have to set any annotations, then you don't n...
...And 12 more matches
Network request details - Firefox Developer Tools
the screenshots and descriptions in this section reflect firefox 78. earlier versions appeared similarly, but might not include some functionality. ...
... the screenshots and descriptions in this section reflect firefox 78. earlier versions appeared similarly, but might not include some functionality. ...
...ocket items) cookies params response cache timings security (only for secure pages) stack trace (only when the request has a stack trace, e.g. a script called by another script). clicking the icon at the right-hand end of the toolbar closes the details pane and returns you to the list view. headers tab the headers tab has a toolbar, followed by three main sections. this includes: in
formation about the request status: the response status code for the request; click the "?" icon to go to the reference page for the status code. version: the version of http used. transferred: the amount of data transferred for the request. referrer policy: the value of the referrer-policy header. http response headers http request headers each section has a disclosure triangl...
...And 12 more matches
The HTML DOM API - Web APIs
interacting with the contents of 2d images and the context of an html <canvas>, for example to draw on top of them. ...
...ndamental record representing a single object within the document (such as an element or text node). nodes may be strictly organizational, providing a means for grouping other nodes together or for providing a point at which a hierarchy can be constructed; other nodes may represent visible components of a document. each node is based on the node interface, which provides properties for getting in
formation about the node as well as methods for creating, deleting, and organizing nodes within the dom. nodes don't have any concept of including the content that is actually displayed in the document. they're empty vessels. the fundamental notion of a node that can represent visual content is introduced by the element interface. an element object instance represents a single element in a document c...
...ced by the element interface. an element object instance represents a single element in a document created using either html or an xml vocabulary such as svg. ...
...And 12 more matches
Using IndexedDB - Web APIs
ersion of the database, so you do not have to create these object stores again. you only need to create any new object stores, or delete object stores from the previous version that are no longer needed. if you need to change an existing object store (e.g., to change the keypath), then you must delete the old object store and create it again with the new options. (note that this will delete the in
formation in the object store! if you need to save that in
formation, you should read it out and save it somewhere else before upgrading the database.) trying to create an object store with a name that already exists (or trying to delete an object store with a name that does not already exist) will throw an error. if the onupgradeneeded event exits successfully, the onsuccess handler of the open dat...
...eded event exits successfully, the onsuccess handler of the open database request will then be triggered. blink/webkit supports the current version of the spec, as shipped in chrome 23+ and opera 17+; ie10+ does too. other and older implementations don't implement the current version of the spec, and thus do not support the indexeddb.open(name, version).onupgradeneeded signature yet. for more in
formation on how to upgrade the version of the database in older webkit/blink, see the idbdatabase reference article. structuring the database now to structure the database. indexeddb uses object stores rather than tables, and a single database can contain any number of object stores. whenever a value is stored in an object store, it is associated with a key. there are several different ways that a ...
...eir age, but let's ignore those unfortunate choices for the sake of convenience and move along. now let's look at creating an indexeddb to store our data: const dbname = "the_name"; var request = indexeddb.open(dbname, 2); request.onerror = function(event) { // handle errors. }; request.onupgradeneeded = function(event) { var db = event.target.result; // create an objectstore to hold in
formation about our customers. we're // going to use "ssn" as our key path because it's guaranteed to be // unique - or at least that's what i was told during the kickoff meeting. var objectstore = db.createobjectstore("customers", { keypath: "ssn" }); // create an index to search customers by name. we may have duplicates // so we can't use a unique index. objectstore.createindex("name", ...
...And 12 more matches
User Timing API - Web APIs
the user timing interface allows the developer to create application specific timestamps that are part of the browser's per
formance timeline. there are two types of user defined timing event types: the "mark" event type and the "measure" event type. mark events are named by the application and can be set at any location in an application. measure events are also named by the application but they are placed between two marks thus they are effectively a midpoint between two marks. this document provides an overview of the mark and measure per
formance event types including the four user timing methods that extend the per
formance interface. ...
...et at any location in an application. measure events are also named by the application but they are placed between two marks thus they are effectively a midpoint between two marks. this document provides an overview of the mark and measure per
formance event types including the four user timing methods that extend the per
formance interface. for more details and example code regarding these two per
formance event types and the methods, see using the user timing api. per
formance marks a per
formance mark is a named per
formance entry that is created by the application. the mark is a timestamp in the browser's per
formance timeline. creating a per
formance mark the per
formance.mark() method is used to create a per
formance mark. the method takes one argument, the name of the mark (for example perfo...
...sing the user timing api. per
formance marks a per
formance mark is a named per
formance entry that is created by the application. the mark is a timestamp in the browser's per
formance timeline. creating a per
formance mark the per
formance.mark() method is used to create a per
formance mark. the method takes one argument, the name of the mark (for example per
formance.mark("mark-1")). the mark's per
formance entry will have the following property values: entrytype - set to "mark". name - set to the "name" given when the mark was created. starttime - set to the timestamp when mark() was called. duration - set to "0" (a mark has no duration). ...
...And 12 more matches
WebGLRenderingContext - Web APIs
he drawing surface of an html <canvas> element. to get an access to a webgl context for 2d and/or 3d graphics rendering, call getcontext() on a <canvas> element, supplying "webgl" as the argument: var canvas = document.getelementbyid('mycanvas'); var gl = canvas.getcontext('webgl'); once you have the webgl rendering context for a canvas, you can render within it. ...
...might be null if it is not associated with a <canvas> element. ...
...res the context is compatible with the user's xr hardware, re-creating the context if necessary with a new configuration to do so. this can be used to start an application using standard 2d presentation, then transition to using a vr or ar mode later. viewing and clipping webglrenderingcontext.scissor() defines the scissor box. webglrenderingcontext.viewport() sets the viewport. state in
formation webglrenderingcontext.activetexture() selects the active texture unit. webglrenderingcontext.blendcolor() sets the source and destination blending factors. webglrenderingcontext.blendequation() sets both the rgb blend equation and alpha blend equation to a single equation. webglrenderingcontext.blendequationseparate() sets the rgb blend equation and alpha blend equation separately.
...And 12 more matches
Lighting in WebGL - Web APIs
't have much built-in knowledge. it just runs two functions you supply — a vertex shader and a fragment shader — and expects you to write creative functions to get the results you want. in other words, if you want lighting you have to calculate it yourself. fortunately, it's not all that hard to do, and this article will cover some of the basics. this example uses the glmatrix library to per
form its matrix and vertex math. you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. simulating lighting and shading in 3d although going into detail about the theory behind simulated lighting in 3d graphics is far beyond the scope of this article, it's helpful to know a bit about how it works. instead of discussing i...
...ng to simplify the lighting model by only considering simple directional and ambient lighting; we won't have any specular highlights or point light sources in this scene. instead, we'll have our ambient lighting plus a single directional light source, aimed at the rotating cube from the previous demo. once you drop out the concept of point sources and specular lighting, there are two pieces of in
formation we'll need in order to implement our directional lighting: we need to associate a surface normal with each vertex. this is a vector that's perpendicular to the face at that vertex. we need to know the direction in which the light is traveling; this is defined by the direction vector. then we update the vertex shader to adjust the color of each vertex, taking into account the ambient li...
...st 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); } finally, we need to update the code that builds the uni
form matrices to generate and deliver to the shader a normal matrix, which is used to trans
form the normals when dealing with the current orientation of the cube in relation to the light source: const normalmatrix = mat4.create(); mat4.invert(normalmatrix, modelviewmatrix); mat4.transpose(normalmatrix, normalmatrix); ... gl.uni
formmatrix4fv( programinfo.uni
formlocations.normalmatrix, ...
...And 12 more matches
Using textures in WebGL - Web APIs
you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. loading textures the first thing to do is add code to load the textures. in our case, we'll be using a single texture, mapped onto all six sides of our rotating cube, but the same technique can be used for any number of textures. ...
...re = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); // because images have to be download over the internet // they might take a moment until they are ready. // until then put a single pixel in the texture so we can // use it immediately. when the image has finished downloading // we'll update the texture with the contents of the image. ...
...have to be download over the internet // they might take a moment until they are ready. // until then put a single pixel in the texture so we can // use it immediately. when the image has finished downloading // we'll update the texture with the contents of the image. ...
...And 12 more matches
ARIA Test Cases - Accessibility
introduction the in
formation on this page is out of date: it was last updated november 2010. however, the in
formation might still be useful for some readers. for more up-to-date examples, see the openajaxalliance aria examples page. or copy-paste: http://oaa-accessibility.org/examples/ for each example we test the "expected" results with assistive technologies, for each browser that at supports wai-aria in. where a failure occurs we will test the browser for api incorrectness, using tools such as msaa inspect. this must be done in order to determine where to file a bug (browser or at). ...
...ste: http://oaa-accessibility.org/examples/ for each example we test the "expected" results with assistive technologies, for each browser that at supports wai-aria in. where a failure occurs we will test the browser for api incorrectness, using tools such as msaa inspect. this must be done in order to determine where to file a bug (browser or at). there are several purposes for providing this in
formation: help browser vendors provide correct implementations help at vendors provide correct implementations in
form authors as to what actually works reliably in general we're testing with the latest public releases. however, where things don't work we may test with nightly builds if they are available, in order to show what is already fixed in upcoming releases. we can add more screen read...
...ld be used as an "aria test file". new tests for internet explorer 8 rc1 on this msdn page the aria state/role mapping in ie8 to msaa roles can be directly checked. also, as a clever feature for at testing, the firing of events (like event_object_statechange) can be invoked from the examples. finally, a list of currently non-mapped aria roles is given. documenting and filing bugs review the in
formation on how to file a bug on an aria implementation. when documenting an issue, please also list it in the relevant compatibility table below. when possible provide a link to the bug in the database so that its status can be reviewed. 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 te...
...And 12 more matches
Using CSS transitions - CSS: Cascading Style Sheets
r a different period of time. ...
...od of time. ...
...ght: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size left top trans
form -webkit-trans
form color; -webkit-transition-duration: 0.5s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top trans
form -webkit-trans
form color; transition-duration: 0.5s; transition-timing-function: ease-in-out; } .box1{ trans
form: rotate(270deg); -webkit-trans
form: rotate(270deg); width: 50px; height: 50px; background-color: blue; color: yellow; font-size: 18px; left: 150px; top: 25px; position: absolute; -webkit-transition-property: width height background-col...
...And 12 more matches
Audio and Video Delivery - Developer guides
arting point for exploring the various delivery mechanisms of web based media and compatibility with popular browsers. the audio and video elements whether we are dealing with pre-recorded audio files or live streams, the mechanism for making them available through the browser's <audio> and <video> elements remains pretty much the same. currently, to support all browsers we need to specify two
formats, although with the adoption of mp3 and mp4
formats in firefox and opera, this is changing fast. you can find compatibility in
formation in the guide to media types and
formats on the web. to deliver video and audio, the general workflow is usually something like this: check what
format the browser supports via feature detection (usually a choice of two, as stated above). if the browser doe...
... identify how you want to play/instantiate the media (e.g. a <video> element, or document.createelement('video') perhaps?) deliver the media file to the player. ...
...tion). license/key exchange is controlled by the application, facilitating the development of robust playback applications supporting a range of content decryption and protection technologies. one of the principle uses of eme is to allow browsers to implement drm (digital rights management), which helps to prevent web-based content (especially video) from being copied. ...
...And 12 more matches
CSS3 - Archive of obsolete content
the css working group of the w3c, in a decision referred as the beijing doctrine, divided css in smaller components called modules . each of these modules is now an independent part of the language and moves towards standardization at its own pace. while some modules are already w3c recommendations, other still are early working drafts. new modules are also added when new needs are identified.
formally, there is no css3 standard per se . each module being standardized independently, the standard css consists of css2.1 amended and extended by the completed modules, not necessary all with the same level number. at each point of time, a snapshot of the css standard can be defined, listing css2.1 and the mature modules. the w3 consortium periodically publishes such snapshots, like in 2007, 201...
...fore becomes ::before, :first-letter becomes ::first-letter, and :first-line becomes ::first-line. the new general sibling combinator ( h1~pre ). the next iteration of the selectors specification is already in progress, though it still hasn't reached the first public working draft stage. 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) . media queries are not only used in css document but also in some attributes of html elements, like the media attribute of the <link> element. the next iteration of this specification is in the work, allowing to tailor a web site regarding the inpu...
...ttribute of the <link> element. the next iteration of this specification is in the work, allowing to tailor a web site regarding the input methods available on the user agent, with new media features like hover or pointer. detection of ecmascript support, using the script media features is also proposed. css style attributes recommendation since november 7th, 2013
formally defines the syntax of the content of the html style global attribute. css fonts module level 3 candidate recommendation since september 20th, 2018 amends the css2.1 font matching algorithm to be closer to what is really implemented. adds: support for downloadable fonts via the css @font-face at-rule. the control of the contextual inter-g...
...And 11 more matches
MMgc - Archive of obsolete content
::rcobject { ... }; class myothermanagedgcobject : public mmgc::gcobject { drcwb(myobject*) myobject; }; class myothermanagedrcobject : public mmgc::rcobject { drcwb(myobject*) myobject; }; the rcobject must zero itself out on deletion. for this reason, rcobject's always have finalizers. declare a destructor that zeros out all of the fields of your rcobject. see zeroing rcobjects for more in
formation. class myobject : public mmgc::rcobject { public: myobject() { x = 1; y = 2; z = 3; } ~myobject() { x = y = z = 0; } private: int x; int y; int z; }; gcroot if you have a pointer to a gcobject from an object in unmanaged memory, the unmanaged object must be a subclass of gcroot. gcroot must be subclassed by any unmanaged memory class that holds gc pointers. class mygcobject : public ...
..., or by creating a gcroot and passing it the memory locations to treat as a root: /** subclassing constructor */ gcroot(gc *gc); /** general constructor */ gcroot(gc *gc, const void *object, size_t size); allocating objects allocating unmanaged objects is as simple as using global operator new/delete, the same way you always have. to allocate a managed (gc) object, you must use the parameterized
form of operator new, and pass it a reference to the mmgc::gc object. class myobject : public mmgc::gcobject { ... }; ... myobject* myobject = new (gc) myobject(); dwb/drc/drcwb there are several smart pointer templates which must be used in your c++ code to work properly with mmgc. dwb dwb stands for declared write barrier. it must be used on a pointer to a gcobject/gcfinalizedobject, when that poin...
...cts that exist purely on the stack, and never in the heap. the flash player class "nativeinfo" is a good example. such objects are essentially the same as stack-based local variables. zeroing rcobjects all rcobjects (including all subclasses) must zero themselves out completely upon destruction. asserts enforce this. the reason is that our collector zeroes memory upon free and this was hurting per
formance. since mmgc must traverse objects to decrement refcounts properly upon destruction, i just made destructors do zeroing too. this mostly applies to non-pointer fields as drcwb smart pointers do this for you. poisoned memory in debug builds, mmgc writes "poison" into deallocated memory as a debugging aid. here's what the different poison values mean: 0xfafafafa uninitialized unmanaged memory...
...And 11 more matches
URIs and URLs - Archive of obsolete content
warning: the content of this article may be out of date. it was last updated in 2002. overview handling network and locally retrievable resources is a central part of necko. ...
... warning: the content of this article may be out of date. it was last updated in 2002. overview handling network and locally retrievable resources is a central part of necko. ...
... warning: the content of this article may be out of date. it was last updated in 2002. overview handling network and locally retrievable resources is a central part of necko. ...
...And 11 more matches
XUL controls - Archive of obsolete content
the following table lists the xul user interface controls. for a step-by-step guide on how to use these controls, see the xul tutorial. for more reference in
formation, see the xul reference. <button> a button that can be pressed by the user. <button label="save" accesskey="s"/> more in
formation about the button element. button reference <button type="menu"> a button that has a drop down menu attached to it. pressing the button opens the menu. <button type="menu" label="view"> <menupopup> <menuitem label="list"/> <menuitem label="details"/> </menupopup> </button> more in
formation about this type of menu button element. button reference related elements: menupopup menuitem ...
...menuitem label="list"/> <menuitem label="details"/> </menupopup> </button> more in
formation about this type of menu button element. button reference related elements: menupopup menuitem <button type="menu-button"> a button that that has a separate arrow button with a menu attached to it. unlike with the 'menu' type, a separate action may be per
formed when the main part of the button is pressed. <button type="menu-button" label="new"> <menupopup> <menuitem label="new document"/> <menuitem label="new image"/> </menupopup> </button> more in
formation about this type of menu button element. button reference related elements: menupopup menuitem <checkbox> a control that may be turn...
... checkbox reference <colorpicker> a control that may be used to select a color. <colorpicker color="#ff0000"/> colorpicker reference <colorpicker type="button"> a specialized type of color picker which shows only a button. ...
...And 11 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
improper browser detection can lead to web maintenance nightmares. rethinking the basics of when and how to detect user agents is crucial to creating maintainable, cross browser web content. ...
... compliant with the w3c html, w3c css, w3c xml, w3c dom, and ecmascript (javascript) standards. it also includes compatibility features which allow it to reasonably handle legacy content which was developed for earlier generations of browsers such as netscape navigator 4 as well as features which provide compatibility with internet explorer 5 and 6. unlike other browsers, gecko is truly cross plat
form and provides consistent behavior across all supported operating systems. the easiest way to support gecko is to create content which follows web standards. unfortunately, no other browser supports web standards as completely as gecko. this means web developers and authors are forced to continue to support other browsers which do not comply with the standards as fully. fortunately, other browsers...
...ersion using the reported user agent string. although this approach was considered reasonable at the time, this approach caused problems for browser vendors right from the beginning. the original netscape browsers used a user agent string which began with the code name for the netscape browser followed by its version number, e.g. mozilla/version followed by a comment token which gave additional in
formation regarding the operating system being used, etc. since the earliest browser detection techniques were based upon looking for a netscape based browser and only provided customized content to browsers which used the mozilla/version user agent string, other browser vendors standardized on using mozilla/version to signal that they were compatible with a particular netscape version. since other br...
...And 11 more matches
Game distribution - Game development
ame — that's great! this article covers all you need to know about the ways in which you can distribute your newly created game into the wild. this includes hosting it yourself online, submitting it to open marketplaces, and submitting it to closed ones like google play or the ios app store. ...
...you need to know about the ways in which you can distribute your newly created game into the wild. this includes hosting it yourself online, submitting it to open marketplaces, and submitting it to closed ones like google play or the ios app store. benefits of html5 over native building games with html5 gives you extra advantages, such as: multiplat
form bliss the technology itself is multiplat
form, so you can write the code once and target multiple devices. this can range from low-end smartphones or tablets, through laptops and desktop computers, to smart tvs, watches or even a fridge if it can handle a modern enough browser. you don't need to have separate teams to work on the same title targeting different plat
forms with only one code base to worry about. you can spend more time and mon...
...nt it and don't have to jump through lots of hoops to play. desktop vs mobile the vast majority of the traffic we are interested in — people playing html5 games — comes from mobile devices so that's something you will have to focus on if you truly want to succeed. mobile devices are where html5 technology can truly shine and show its advantages. there's no flash, and html5 is fully multiplat
form. trying to compete with desktop games directly is very difficult. you can put your html5 games into the same arena (see native desktop, later on) and you should because it's good to diversify the plat
forms you support, but you have to remember that developers creating desktop games have years of experience, great tools and stable distribution channels. many html5 games will target different mark...
...And 11 more matches
A first splash into JavaScript - Learn web development
0px; min-width: 480px; margin: 0 auto; } .lastresult { color: white; padding: 3px; } </style> </head> <body> <h1>number guessing game</h1> <p>we have selected a random number between 1 and 100. see if you can guess it in 10 turns or fewer. ...
...move forward, looking at how we can turn these steps into code, building up the example, and exploring javascript features as we go. initial setup to begin this tutorial, we'd like you to make a local copy of the number-guessing-game-start.html file (see it live here). open it in both your text editor and your web browser. at the moment you'll see a simple heading, paragraph of instructions and
form for entering a guess, but the
form won't currently do anything. the place where we'll be adding all our code is inside the <script> element at the bottom of the html: <script> // your javascript goes here </script> adding variables to store our data let's get started. first of all, add the following lines inside your <script> element: let randomnumber = math.floor(math.random() * 100) +...
... <label for="guessfield">enter a guess: </label><input type="text" id="guessfield" class="guessfield"> <input type="submit" value="submit guess" class="guesssubmit"> our final two variables store a guess count of 1 (used to keep track of how many guesses the player has had), and a reference to a reset button t...
...And 11 more matches
Client-side tooling overview - Learn web development
ke notes. though your choice of code editor is certainly a tooling choice, this series of articles will go beyond that, focusing on developer tools that help you produce web code more efficiently. from a high-level perspective, you can put client-side tools into the following three broad categories of problems to solve: safety net — tools that are useful during your code development. trans
formation — tools that trans
form code in some way, e.g. turning an intermediate language into javascript that a browser can understand. post-development — tools that are useful after you have written your code, such as testing and deployment tools. let's look at each one of these in more detail. safety net these are tools that make the code you write a little better. this part of the tooling...
...urable tool for catching potential syntax errors and encouraging "best practices" throughout your code. some companies and projects have also shared their eslint configs. you can also find linting tools for other languages, such as csslint. also well-worth looking at is webhint, a configurable, open-source linter for the web that surfaces best practices including approaches to accessibility, per
formance, cross-browser compatibility via mdn's browser compatibility data, security, testing for pwas, and more. it is available as a node.js command-line tool and a vs code extension. source code control also known as version control systems (vcs), source code control is essential for backing work up and working in teams. a typical vcs involves having a local version of the code that you make chan...
... all the time. git is the source code control system that most people use these days. it is primarily accessed via the command line but can be accessed via friendly user interfaces. with your code in a git repository, you can push it to your own server instance, or use a hosted source control website such as github, gitlab, or bitbucket. we'll be using github in this module. ...
...And 11 more matches
64-bit Compatibility
this article focuses on hacking tracemonkey code generation (jstracer.cpp, jsregex.cpp) in ways that will work on both 32-bit and 64-bit jit backends. ...
... this article focuses on hacking tracemonkey code generation (jstracer.cpp, jsregex.cpp) in ways that will work on both 32-bit and 64-bit jit backends. ...
...the compiler can implicitly sign or zero extend operands with unintended side effects. ...
...And 11 more matches
imgIEncoder
libpr0n/public/imgiencoder.idlscriptable please add a summary to this article. ...
...ruint32 height, in pruint32 stride, in pruint32 frame
format, in astring frameoptions); void encodeclipboardimage(in nsiclipboardimage aclipboardimage, out nsifile aimagefile); obsolete since gecko 1.9 void endimageencode(); void initfromdata([array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 input
format, in astring outputoptions); void startimageencode(in pruint32 width, in pruint32 height, in pruint32 input
format, in astring outputoptions); constants possible values for input
format (note that not all image
formats support saving alpha channels): constant value description input_
format_rgb 0 input is rgb each pixel is represented by three bytes: r, g, and b (in that order, regardl...
... void startimageencode(in pruint32 width, in pruint32 height, in pruint32 input
format, in astring outputoptions); constants possible values for input
format (note that not all image
formats support saving alpha channels): constant value description input_
format_rgb 0 input is rgb each pixel is represented by three bytes: r, g, and b (in that order, regardless of host endianness) input_
format_rgba 1 input is rgb each pixel is represented by four bytes: r, g, and b (in that order, regardless of host endianness). ...
...And 11 more matches
nsIAnnotationService
tant. type_binary 4 binary type constant. type_int64 5 int64 type constant. note: use of value "1" is omitted due to it's temporary use as expire_never in bug 319455. methods setpageannotation() this method sets an annotation for given uri, overwriting any previous annotation with the same url/name. it is your job to namespace your annotation names. use the
form "namespace/value", so your name would be like "bills_extension/page_state" or "history/thumbnail". do not use characters that are not valid in urls such as spaces, ":", commas, or most other symbols. you should stick to ascii letters and numbers plus "_", "-", and "/". the annotation "favicon" is special. favicons are stored in the favicon service, but are special cased in the protocol handler ...
...tant annotation that the user or extension wants to keep, you should add a bookmark for the page and use an expire_never annotation. this will ensure the annotation exists until the item is removed by the user. setitemannotation() this method sets an annotation for given item, overwriting any previous annotation with the same url/name. it is your job to namespace your annotation names. use the
form "namespace/value", so your name would be like "bills_extension/page_state" or "history/thumbnail". do not use characters that are not valid in urls such as spaces, ":", commas, or most other symbols. you should stick to ascii letters and numbers plus "_", "-", and "/". the annotation "favicon" is special. favicons are stored in the favicon service, but are special cased in the protocol handler ...
...will be defined in the future. aexpiration one of the expire_* constant value defined above. note: all item annotations will get deleted when the bookmark is removed. setpageannotationstring() this method sets an annotation for given uri by taking a string as input value, overwriting any previous annotation with the same url/name. it is your job to namespace your annotation names. use the
form "namespace/value", so your name would be like "bills_extension/page_state" or "history/thumbnail". do not use characters that are not valid in urls such as spaces, ":", commas, or most other symbols. you should stick to ascii letters and numbers plus "_", "-", and "/". the annotation "favicon" is special. favicons are stored in the favicon service, but are special cased in the protocol handler ...
...And 11 more matches
Reference Manual
red to do the right thing. safety features type safeguards it is an invariant of nscomptr that it holds the xpcom-correct interface pointer for it's underlying type. for example, an nscomptr<nsifoo> will always hold the pointer that would be returned by queryinterface, when querying an xpcom object for its nsifoo interface. in debug builds, if you subvert this invariant with one of the assignment
forms that doesn't call queryinterface, nscomptr will assert at runtime in the bad assignment. // given two un-related interfaces |nsifoo| and |nsibar|... nsibar* bar = ...; // ... 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 ) ...
...scomptrs machinery, causing leaks, type mismatches, and other calamities. // old-style c/c++ casts by-pass |nscomptr|s machinery and cause leaks... nsresult rv; nscomptr<nsifoo> foo = ...; // ... rv = getfoo( (nsifoo**)&foo ); rv = getfoo( &(nsifoo*)foo ); // sure, they compile; but now you leak. to help prevent this, we are trying to make the first
form, above, illegal by making operator& private. see bug 59414. implementation details and debugging machinery although it is a class, nscomptr has no virtual methods, and therefore, no vtable or vptr. because a few key routines are factored out into a common non-template base class, the actual underlying pointer is stored as an nsisupports* (except in debug builds where nscap_feature_debug_ptr_types...
...template-specific inlines. there is no factored base class. this implies that the entire application must be compiled with the same setting of nscap_feature_debug_ptr_types, else some parts will be expecting a base class and others will not. the app will not link. unit tests the unit tests for nscomptr can be found in the file /xpcom/tests/testcomptr.cpp initialization and assignment built-in
forms assignment into, or initialization of an nscomptr is easy to understand. the nscomptr releases its old value, if any, and then assigns in the new value, addrefing it and/or calling queryinterface as you direct by "annotating" the assignment with directives like dont_addref. this section describes each of the possibilities, though the directives can be more succinctly described in the table below...
...And 11 more matches
Xptcall Porting Guide
overview xptcall is a library that supports both invoking methods on arbitrary xpcom objects and implementing classes whose objects can impersonate any xpcom interface. it does this using plat
form specific assembly language code. this code needs to be ported to all plat
forms that want to support xptcall (and thus mozilla). ...
...s both invoking methods on arbitrary xpcom objects and implementing classes whose objects can impersonate any xpcom interface. it does this using plat
form specific assembly language code. this code needs to be ported to all plat
forms that want to support xptcall (and thus mozilla). the tree mozilla/xpcom/reflect/xptcall +--public // exported headers +--src // core source | \--md // plat
form specific parts | +--mac // mac ppc | +--unix // all unix | \--win32 // win32 | +--test // simple tests to get started \--tests // full tests via api porters are free to create subdirectories under the base md directory for their given plat
forms and to integrate into the build system as appropriate for their plat
form. theory of operation there are really two piece...
...ple tests to get started \--tests // full tests via api porters are free to create subdirectories under the base md directory for their given plat
forms and to integrate into the build system as appropriate for their plat
form. theory of operation there are really two pieces of functionality: invoke and stubs... ...
...And 11 more matches
Migrating from Firebug - Firefox Developer Tools
ement it is possible to press ctrl+shift+c / cmd+opt+c. the devtools share the same shortcuts, but also provide shortcuts for the different panels. e.g. the network monitor can be opened via ctrl+shift+q / cmd+opt+q, the web console via ctrl+shift+k / cmd+opt+k and the debugger via ctrl+shift+s / cmd+opt+s. web console the web console is the equivalent of firebug's console panel. it shows log in
formation associated with a web page and allows you to execute javascript expressions via its command line. the display between both is somewhat different. this may be changed in bug 1269730. filter log messages firebug offers two ways to filter log messages, via the options menu and via the filter buttons within the toolbar. the developer tools console offers similar functionality via the filter bu...
...to edit the tag names inline. you can also edit the html directly. in firebug you do this by right-clicking a node and clicking edit html... in the context menu. in the devtools this option is also available via the context menu. there the option is called edit as html. only the live preview of changes is currently missing, which is tracked in bug 1067318 and bug 815464. copy html and related in
formation firebug's html panel allows to copy the inner and outer html of an element as well as the css and xpath to it via the context menu of an element. the page inspector provides the same functionality except copying xpaths. this is covered by bug 987877. edit css both tools allow to view and edit the css rules related to the element selected within the node view in a similar way. firebug has ...
...n't have this feature yet, but it's requested in bug 1323746. searching within the style sheets firebug allows to search within the style sheets via the search field. the style editor in the devtools also provides a way to search within a style sheet, though there is currently no option to search within multiple sheets (see bug 889571) and also not via a regular expression (see bug 1362030. ...
...And 11 more matches
A basic 2D WebGL animation example - Web APIs
first, let's take a look at the vertex shader. its job, as always, is to convert the coordinates we're using for our scene into clipspace coordinates (that is, the system by which (0, 0) is at the center of the context and each axis extends from -1.0 to 1.0 regardless of the actual size of the context). ...
...e vertex shader. its job, as always, is to convert the coordinates we're using for our scene into clipspace coordinates (that is, the system by which (0, 0) is at the center of the context and each axis extends from -1.0 to 1.0 regardless of the actual size of the context). ...
...ich is the position of the vertex in whatever coordinate system it's using. we need to convert these values so that both components of the position are in the range -1.0 to 1.0. this can be done easily enough by multiplying by a scaling factor that's based on the context's aspect ratio. we'll see that computation shortly. we're also rotating the shape, and we can do that here, by applying a trans
form. we'll do that first. the rotated position of the vertex is computed by applying the rotation vector, found in the uni
form urotationvector, that's been computed by the javascript code. then the final position is computed by multiplying the rotated position by the scaling vector provided by the javascript code in uscalingfactor. the values of z and w are fixed at 0.0 and 1.0, respectively, since ...
...And 11 more matches
Web Authentication API - Web APIs
authentication methods while at the same time significantly increasing ease of use (since users don't have to manage dozens of increasingly complicated passwords). many websites already have pages that allow users to register new accounts or sign in to an existing account, and the web authentication api acts as a replacement or supplement to those on those existing webpages. similar to the other
forms of the credential management api, the web authentication api has two basic methods that correspond to register and login: navigator.credentials.create() - when used with the publickey option, creates new credentials, either for registering a new account or for associating a new asymmetric key pair credentials with an existing account. navigator.credentials.get() - when used with the publicke...
...ter and login: navigator.credentials.create() - when used with the publickey option, creates new credentials, either for registering a new account or for associating a new asymmetric key pair credentials with an existing account. ...
... with the publickey option, uses an existing set of credentials to authenticate to a service, either logging a user in or as a
form of second-factor authentication. please note: both create() and get() require a secure context (e.g. - the server is connected by https or is the localhost), and will not be available for use if the browser is not operating in a secure context. in their most basic
forms, both create() and get() receive a very large random number called a challenge from the server and they return the challenge signed by the private key back to the server. this proves to the server that a user is in possession of the private key required for authentication without revealing any secrets over the network. in order to understand how the create() and get() methods fit into the bigge...
...And 11 more matches
<button>: The Button element - HTML: Hypertext Markup Language
the html <button> element represents a clickable button, used to submit
forms or anywhere in a document for accessible, standard button functionality. by default, html buttons are presented in a style resembling the plat
form the user agent runs on, but you can change buttons’ appearance with css. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, interactive content, listed, labelable, and submittable
form-associated element, palpable content. permitted content phrasing content but there must be no interactive content tag omission ...
...ate of a <button> across page loads. setting autocomplete="off" on the button disables this feature; see bug 654072. disabled this boolean attribute prevents the user from interacting with the button: it cannot be pressed or focused. firefox, unlike other browsers, persists the dynamic disabled state of a <button> across page loads. use the autocomplete attribute to control this feature.
form html5 the <
form> element to associate the button with (its
form owner). the value of this attribute must be the id of a <
form> in the same document. (if this attribute is not set, the <button> is associated with its ancestor <
form> element, if any.) this attribute lets you associate <button> elements to <
form>s anywhere in the document, not just inside a <
form>. it can also override an ancestor...
...tml5 the <
form> element to associate the button with (its
form owner). the value of this attribute must be the id of a <
form> in the same document. (if this attribute is not set, the <button> is associated with its ancestor <
form> element, if any.) this attribute lets you associate <button> elements to <
form>s anywhere in the document, not just inside a <
form>. it can also override an ancestor <
form> element.
formaction html5 the url that processes the in
formation submitted by the button. overrides the action attribute of the button's
form owner. does nothing if there is no
form owner.
formenctype html5 if the button is a submit button (it's inside/associated with a <
form> and doesn't have type="button"), specifies how to encode the
form data that is submitted. possible values: appli...
...And 11 more matches
<textarea> - HTML: Hypertext Markup Language
the html <textarea> element represents a multi-line plain-text editing control, useful when you want to allow users to enter a sizeable amount of free-
form text, for example a comment on a review or feedback
form. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the above example demonstrates a number of features of <textarea>: an id attribute to allow the <textarea> to be associated with a <label> element for accessibility purposes a name attribute to set the name of the associated data point submitted to the server when the
form is submitted. rows and cols attributes to allow you to specify an exact size for ...
... attributes this element includes the global attributes. ...
...very use, or the document provides its own auto-completion method; the browser does not automatically complete the entry. on: the browser can automatically complete the value based on values that the user has entered during previous uses. ...
...And 11 more matches
Functions - JavaScript
to use a function, you must define it somewhere in the scope from which you wish to call it. see also the exhaustive reference chapter about javascript functions to get to know the details. ...
...o use the function constructor to create functions from a string at runtime, much like eval(). a method is a function that is a property of an object. read more about objects and methods in working with objects. calling functions defining a function does not execute it. defining it simply names the function and specifies what to do when the function is called. calling the function actually per
forms the specified actions with the indicated parameters. for example, if you define the function square, you could call it as follows: square(5); the preceding statement calls the function with an argument of 5. the function executes its statements and returns the value 25. functions must be in scope when they are called, but the function declaration can be hoisted (appear below the call in the ...
...xample: function foo(i) { if (i < 0) return; console.log('begin: ' + i); foo(i - 1); console.log('end: ' + i); } foo(3); // output: // begin: 3 // begin: 2 // begin: 1 // begin: 0 // end: 0 // end: 1 // end: 2 // end: 3 nested functions and closures you may nest a function within another function. the nested (inner) function is private to its containing (outer) function. it also
forms a closure. a closure is an expression (most commonly, a function) that can have free variables together with an environment that binds those variables (that "closes" the expression). since a nested function is a closure, this means that a nested function can "inherit" the arguments and variables of its containing function. in other words, the inner function contains the scope of the outer funct...
...And 11 more matches
d - SVG: Scalable Vector Graphics
down somewhere else—in other words, moving the current point (po; {xo, yo}). there is no line drawn between po and the new current point (pn; {xn, yn}). command parameters notes m (x, y)+ move the current point to the coordinate x,y. any subsequent coordinate pair(s) are interpreted as parameter(s) for implicit absolute lineto (l) command(s) (see below). ...
...re interpreted as parameter(s) for implicit absolute lineto (l) command(s) (see below).
formula: pn = {x, y} m (dx, dy)+ move the current point by shifting the last known position of the path by dx along the x-axis and by dy along the y-axis. any subsequent coordinate pair(s) are interpreted as parameter(s) for implicit relative lineto (l) command(s) (see below). ...
...e end point (pn; {xn, yn}), based on the parameters specified. the end point (pn) then becomes the current point for the next command (po′). command parameters notes l (x, y)+ draw a line from the current point to the end point specified by x,y. any subsequent coordinate pair(s) are interpreted as parameter(s) for implicit absolute lineto (l) command(s). ...
...And 11 more matches
WebAssembly Concepts - WebAssembly
this article explains the concepts behind how webassembly works including its goals, the problems it solves, and how it runs inside the web browser's rendering engine. what is webassembly? webassembly is a new type of code that can be run in modern web browsers and provides new features and major gains in per
formance. it is not primarily intended to be written by hand, rather it is designed to be an effective compilation target for low-level source languages like c, c++, rust, etc. this has huge implications for the web plat
form — it provides a way to run code written in multiple languages on the web at near-native speed, with client apps running on the web that previously couldn’t have done so. what’s more, you don’t even have to know how to create webassembly code to take advant...
...e web at near-native speed, with client apps running on the web that previously couldn’t have done so. what’s more, you don’t even have to know how to create webassembly code to take advantage of it. webassembly modules can be imported into a web (or node.js) app, exposing webassembly functions for use via javascript. ...
... use of webassembly to confer massive per
formance advantages and new features while still making functionality easily available to web developers. webassembly goals webassembly is being created as an open standard inside the w3c webassembly community group with the following goals: be fast, efficient, and portable — webassembly code can be executed at near-native speed across different plat
forms by taking advantage of common hardware capabilities. be readable and debuggable — webassembly is a low-level assembly language, but it does have a human-readable text
format (the specification for which is still being finalized) that allows code to be written, viewed, and debugged by hand. keep secure — webassembly is specified to be run in a safe, sandboxed execution environment. like oth...
...And 11 more matches
Tamarin Tracing Build Documentation - Archive of obsolete content
tamarin source versions the following instructions are for obtaining and building the tamarin tracing source code. ...
... tamarin source versions the following instructions are for obtaining and building the tamarin tracing source code. ...
... tamarin source versions the following instructions are for obtaining and building the tamarin tracing source code. ...
...And 10 more matches
Introduction to CSS layout - Learn web development
then work with the way things are laid out by default rather than fighting against it. 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 in
formation). we also have entire layout methods that are switched on via specific display values, for example css grid and flexbox, which alter how elements inside the element they are set on are laid out. floats — applying a float value such as left can cause block level elements to wrap alongside one side of an element, like the way images sometimes have text floating around them in magazine layou...
...letely out of the page's normal layout flow, like it is sitting on its own separate layer. from there, you can fix it in a position relative to the edges of the page's <html> element (or its nearest positioned ancestor element). this is useful for creating complex layout effects such as tabbed boxes where different content panels sit on top of one another and are shown and hidden as desired, or in
formation panels that sit off screen by default, but can be made to slide on screen using a control button. fixed positioning is very similar to absolute positioning, except that it fixes an element relative to the browser viewport, not another element. this is useful for creating effects such as a persistent navigation menu that always stays in the same place on the screen as the rest of the content...
...ties can be used to lay out elements that are not tables, a use which is sometimes described as "using css tables". the example below shows one such use; using css tables for layout should be considered a legacy method at this point, for those situations where you have very old browsers without support for flexbox or grid. let's look at an example. first, some simple markup that creates an html
form. ...
...And 10 more matches
Creating hyperlinks - Learn web development
objective: to learn how to implement a hyperlink effectively, and link multiple files together. ...
...s created by wrapping the text or other content, see block level links, inside an <a> element and using the href attribute, also known as a hypertext reference, or target, that contains the web address. <p>i'm creating a link to <a href="https://www.mozilla.org/">the mozilla homepage</a>. </p> this gives us the following result: i'm creating a link to the mozilla homepage. ...
...nown as a hypertext reference, or target, that contains the web address. <p>i'm creating a link to <a href="https://www.mozilla.org/">the mozilla homepage</a>. </p> this gives us the following result: i'm creating a link to the mozilla homepage. adding supporting in
formation with the title attribute another attribute you may want to add to your links is title. the title contains additional in
formation about the link, such as which kind of in
formation the page contains, or things to be aware of on the web site. <p>i'm creating a link to <a href="https://www.mozilla.org/" title="the best place to find more in
formation about mozilla's mission and how to contribute">the mozilla homepage</a>. </p> this gives us the following result and hovering over the link displays the title a...
...And 10 more matches
Website security - Learn web development
basic computer literacy. objective: to understand the most common threats to web application security and what you can do to reduce the risk of your site being hacked. ...
...denial of service attacks, or displaying modified (and often damaging) in
formation on their homepages. in other high-profile cases, millions of passwords, email addresses, and credit card details have been leaked into the public domain, exposing website users to both personal embarrassment and financial risk. the purpose of website security is to prevent these (or any) sorts of attacks. the more
formal definition of website security is the act/practice of protecting websites from unauthorized access, use, modification, destruction, or disruption. effective website security requires design effort across the whole of the website: in your web application, the configuration of the web server, your policies for creating and renewing passwords, and the client-side code. while all that sounds very ...
...g with the results. an attacker can construct a search link that contains a malicious script as a parameter (e.g., http://mysite.com?q=beer<script%20src="http://evilsite.com/tricky.js"></script>) and email it to another user. if the target user clicks this "interesting link", the script will be executed when the search results are displayed. as discussed earlier, this gives the attacker all the in
formation they need to enter the site as the target user, potentially making purchases as the user or sharing their contact in
formation. a persistent xss vulnerability occurs when the malicious script is stored on the website and then later redisplayed unmodified for other users to execute unwittingly. for example, a discussion board that accepts comments that contain unmodified html could stor...
...And 10 more matches
Introduction to automated testing - Learn web development
ng all the things we've looked at in previous articles manually can be a real pain. fortunately, there are tools to help us automate some of this pain away. there are two main ways in which we can automate the tests we've been talking about in this module: use a task runner such as grunt or gulp, or npm scripts to run tests and clean up code during your build process. this is a great way to per
form tasks like linting and minifying code, adding in css prefixes or transpiling nascent javascript features for maximum cross-browser reach, and so on. use a browser automation system like selenium to run specific tests on installed browsers and return results, alerting you to failures in browsers as they crop up. commercial cross-browser testing apps like lambdatest, sauce labs, browserstack, and ...
...type yes and press enter/return and npm will generate a package.json file in your directory. this file is basically a config file for the project. you can customize it later, but for now it'll look something like this: { "na...
...type yes and press enter/return and npm will generate a package.json file in your directory. ...
...And 10 more matches
Command line crash course - Learn web development
what to do. on the surface they’re far from welcoming but there’s a lot you can do with them, and we promise that, with a bit of guidance and practise, using them will get easier! this is why we are providing this chapter — to help you get started in this seemingly unfriendly environment. where did the terminal come from? the terminal originates from around the 1950s-60s and its original
form really doesn’t resemble what we use today (for that we should be thankful). you can read a bit of the history on wikipedia’s entry for computer terminal. since then, the terminal has remained a constant feature of all operating systems — from desktop machines, to servers tucked away in the cloud (it’s not really a cloud), to microcomputers like the raspberry pi zero, and even to mobile p...
...mputer terminal. since then, the terminal has remained a constant feature of all operating systems — from desktop machines, to servers tucked away in the cloud (it’s not really a cloud), to microcomputers like the raspberry pi zero, and even to mobile phones. it provides direct access to the computer’s underlying file system and low-level features, and is therefore incredibly useful for per
forming complex tasks rapidly, if you know what you are doing. it is also useful for automation — for example to write a command to update the titles of hundreds of files instantly, say from “ch01-xxxx.png” to “ch02-xxxx.png”. if you updated the file names using your finder or explorer gui app, it would take you a long time. anyway, the terminal is not going away anytime soon. what does ...
...before you go any further, open your terminal program! nav...
...And 10 more matches
Localization content best practices
this document provides best practices for developers to create localizable code, and describes how to avoid some localizability (l12y) common mistakes. note: if you're a localizer and you want to contribute to the localization of mozilla products, you might want to read our localization quick start guide for in
formation on localizing mozilla code. note on localizers mozilla localizers are volunteers with very diverse technical skills: some of them rely exclusively on translation tools, others prefer to work directly with text editors and don't have problems working with vcs systems. it's important to consider this when adding strings, and especially localization comments for strings that contain references, or obscure technical details. localization files choose good key ids...
... rely exclusively on translation tools, others prefer to work directly with text editors and don't have problems working with vcs systems. it's important to consider this when adding strings, and especially localization comments for strings that contain references, or obscure technical details. localization files choose good key ids the ids (names) chosen for your keys, regardless of the file
format, should always be descriptive of the string, and its role in the interface (button label, title, etc.). think of them as long variable names. when you have to change a key id, adding a progressive number to the existing key should always be used as a last resort. for example, suppose this string needs to be changed from "event" to "add new event": new-event-header = event add-new-event-header...
...ariables at run-time. english could be ambiguous. for example: bookmark. is this a noun or a verb? using meaningful ids could also help in these cases. strings are used in a specific context. for example accessibility (a11y) strings: in this case space is less important than clarity, since these strings are not displayed in the ui but used by tools like screen readers. there is an established
format for localization comments: it's important to follow the
format as closely as possible, since there are a number of automated tools that parse these comments for easier access and use by localizers. dtd files <!-- localization note (entity name): {{privacy}} will be replaced at run-time by an active link. the string 'privacy-link' will be used as text for this link. --> properties files...
...And 10 more matches
gettext
warning: this document pertains to the development of mozilla web sites and not to the development of gecko-based extensions or applications. plurals gettext lets you define and use singular and plural
forms of a string. to take advantage of this functionality, you need to use a different keyword (i.e. different gettext function name) for string which are supposed to support plurals. for instance, in php the default keyword for regular messages is gettext() and _(). for messages with plural support, the default keyword is ngettext(). ...
...ing. to take advantage of this functionality, you need to use a different keyword (i.e. different gettext function name) for string which are supposed to support plurals. for instance, in php the default keyword for regular messages is gettext() and _(). for messages with plural support, the default keyword is ngettext(). a definition of a string with plurals takes three arguments: the singular
form of the english string, the plural
form of the english string, and the number basing on which the function will return the correct (singular or plural)
form of the string. consider the following code snippet: <?php $num = 1; printf(ngettext("%d user likes this.", "%d users like this.", $num), $num); ?> depending on the value of the $num variable, this code will either use the singular ("us...
...in the above example, $num equals 1, so the string returned (for english) will be %d user likes this. ...
...And 10 more matches
Introduction to NSPR
the netscape portable runtime (nspr) api allows compliant applications to use system facilities such as threads, thread synchronization, i/o, interval timing, atomic operations, and several other low-level services in a plat
form-independent manner. this chapter introduces key nspr programming concepts and illustrates them with sample code. the current implementation of nspr allows developers to compile a single source code base on macintosh (ppc), win32 (nt 3.51, nt 4.0, win'95), and over twenty versions of unix. nspr does not provide a plat
form for porting existing code. it must be used from the beginning of a software project. 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...
...turning, whereas it ignores system threads when determining when a process should exit. this arrangement implies that a system thread should not have volatile data that needs to be safely stored away. priorities for nspr threads are based loosely on hints provided by the client and sometimes constrained by the underlying operating system. therefore, priorities are not rigidly defined. ...
... threads can also have "per-thread-data" attached to them. ...
...And 10 more matches
Places utilities for JavaScript
s for common calls. these just take in the node, as the interface is already defined: asvisit(anode) asfullvisit(anode) ascontainer(anode) asquery(anode) annotations a few annotation names are defined here. load_in_sidebar_anno - this annotation is associated with bookmarks or items that should load in the sidebar automatically. description_anno - this annotation stores description in
formation about a bookmark. post_data_anno - i need to clarify here, but i think this is the name of the annotation that stores in
formation for keyword searches from a bookmark. lmanno_feeduri - need to clarify here too, but i think for each livemark, there is an bookmark which contains an annotation storing the associated feed uri. lmanno_siteuri - need to clarify here, but i think for each livema...
...ils class since firefox 3 beta 5 has been split into: placesutils: can be used in any toolkit application placesuiutils: only in firefox placesutils this is a gigantic object full of usefulness if you need to do any bookmark work from within browser.xul. as such, it gets its own special section. ...
...ce and searching for a particular folder on your own. placesrootid bookmarksmenufolderid the bookmarks menu. toolbarfolderid the bookmarks toolbar. tagsfolderid the folder that tags are stored in. unfiledbookmarksfolderid other other attributes stored in placesutils. localstore warning: local store provided access to the local-store rdf data source, which stores persisted in
formation about the browser. its functionality has been replaced by xulstore. uritypes containertypes leftpanequeries queries that appear in the library's left pane. leftpanefolderid a single folder shown in the library's left pane. allbookmarksfolderid the id of the "all bookmarks" folder shown in the library's left pane. placesflavors generic_view_drop_types methods createfi...
...And 10 more matches
ctypes
turntype[, argtype1, ...]); cdata int64(n); string libraryname(name); library open(libspec); ctype pointertype(typespec); ctype structtype(name[, fields]); cdata uint64(n); properties property type description errno number the value of the latest system error. similar to errno in libc, available on all plat
forms. cannot be set. winlasterror number|undefined the value of the latest windows error. similar to getlasterror under windows, available only for windows. cannot be set. constants abi constants these constants are used to specify the abi used to call a native function in the library. constant description default_abi corresponds to cdecl; standard lib...
...bi used for calling functions declared with stdcall on windows. these functions' names are automatically mangled for you by js-ctypes. winapi_abi used for calling windows system functions. these are declared as stdcall on windows, but do not have mangled names like those used by stdcall_abi above. predefined data types primitive types these types behave the same on all plat
forms. type description int8_t signed 8-bit integer. uint8_t unsigned 8-bit integer. int16_t signed 16-bit integer. uint16_t unsigned 16-bit integer. int32_t signed 32-bit integer. uint32_t unsigned 32-bit integer. int64_t signed 64-bit integer. uint64_t unsigned 64-bit integer. float3...
...ecause of this, ctypes.int64 and ctypes.uint64 do not automatically convert to javascript numbers. instead, they convert to objects of the wrapper types ctypes.int64 and ctypes.uint64, which are javascript objects rather than cdata objects. see 64-bit integers for details. types that act like specific c types these types are designed to work exactly like the corresponding type on the native plat
form. type description bool a boolean type that behaves like the corresponding c type on the plat
form. short a short integer type that behaves like the corresponding c type on the plat
form. unsigned_short an unsigned short integer type that behaves like the corresponding c type on the plat
form. int an integer type that behaves like the int c...
...And 10 more matches
Constraint validation API - Web APIs
however, you may want to impose more complex constraints, or to provide clearer reporting of validation failures than the defaults. this can be done using the constraint validation api. note: client-side constraint validation doesn't remove the need for validation on the server side. ...
...our web application. therefore, you need to also validate input values on the server side, in a way that is consistent with what is done on the client side. client side validation is a tool for giving quick feedback to the user. you should not rely on it to completely sanitize data received by the server. ...
...erefore, you need to also validate input values on the server side, in a way that is consistent with what is done on the client side. client side validation is a tool for giving quick feedback to the user. you should not rely on it to completely sanitize data received by the server. ...
...And 10 more matches
Using Fetch - Web APIs
marked with * const response = await fetch(url, { method: 'post', // *get, post, put, delete, etc. ...
... fetch('https://example.com', { credentials: 'include' }); if you only want to send credentials if the request url is on the same ...
... fetch('https://example.com', { credentials: 'include' }); if you only want to send credentials if the request url is on the same origin as the calling scrip...
...And 10 more matches
Key Values - Web APIs
the tables below list the standard key values in various categories of key, with an explanation of what the key is typically used for. corresponding virtual keycodes for common plat
forms are included where available. learn how to use these key values in javascript using keyboardevent.key special values | modifier keys | whitespace keys | navigation keys | editing keys | ui keys | device keys | ime and composition keys | function keys | phone keys | multimedia keys | audio control keys | tv control keys | media controller keys | speech recognition keys | document keys | application selector keys | browser control keys | numeric keypad keys special values values of key which have special meanings other than identifying a specific key or character. keyboardevent.key value ...
... meanings other than identifying a specific key or character. keyboardevent.key value description virtual keycode windows mac linux android "unidentified" the user agent wasn't able to map the event's virtual keycode to a specific key value. this can happen due to hardware or software constraints, or because of constraints around the plat
form on which the user agent is running. varies varies varies varies modifier keys modifiers are special keys which are used to generate special characters or cause special actions when used in combination with other keys. examples include the shift and control keys, and lock keys such as caps lock and numlock. keyboardevent.key value description virtual keycode...
...e (0x1008ff6d) qt::key_paste (0x010000e2) "redo" redo the last action. appcommand_redo gdk_key_redo (0xff66) "undo" undo the last action. appcommand_undo gdk_key_undo (0xff65) [1] on keyboards without a dedicated del key, the mac generates the "delete" value when fn is pressed in tandem with delete (which is backspace on other plat
forms). [2] internet explorer (tested on release 9 and 11) and firefox 36 and earlier use "del" instead of "delete" for the del key. [3] internet explorer (tested on release 9 and 11) and firefox 36 and earlier generate the value "crsel" instead of "crsel" when the crsel key is pressed. [4] internet explorer (tested on release 9 and 11) and firefox 36 and earlier generate the value "exsel" instead ...
...And 10 more matches
Using Navigation Timing - Web APIs
the navigation timing api lets you easily obtain detailed and highly accurate timing in
formation to help isolate per
formance problems with your site's code or resources. unlike other tools or libraries, the navigation timing api lets you gather in
formation that only the browser can provide at a level of accuracy much improved over other techniques. it also offers the advantage of being able to provide timing in
formation as perceived by the user rather than data that has no correlation to what the user experiences. collecting timing in
formation using the api is as simple as obtaining the per
formance object using window.per
formance and looking up what you need within the object returned. for example, to measure the perceived loading time for a page: window.addeventlistener("load", function()...
...t has no correlation to what the user experiences. collecting timing in
formation using the api is as simple as obtaining the per
formance object using window.per
formance and looking up what you need within the object returned. for example, to measure the perceived loading time for a page: window.addeventlistener("load", function() { let now = new date().gettime(); let loadingtime = now - per
formance.timing.navigationstart; document.queryselector(".output").innertext = loadingtime + " ms"; }, false); this code, executed when the load event occurs, subtracts from the current time the time at which the navigation whose timing was recorded began (per
formance.timing.navigationstart), and outputs that in
formation to the screen by inserting it into an element. html <div class="o...
...mation to the screen by inserting it into an element. html <div class="output"> </div> css .output { border: 1px solid #bbb; font: 16px "open sans", "helvetica", "arial", sans-serif; } in tandem with appropriate html and css, the result is: the values listed are for the <iframe> in which the sample is presented above. for a list of the available timing values you can look for in per
formancetiming, see the per
formancetiming interface's properties section. determining navigation type to put the timing in
formation obtained from per
formancetiming into the correct perspective, you need to know more about what sort of load operation occurred. in particular, you need to know: was this a load or a reload? was this a navigation or a move forward or backward through history? how ma...
...And 10 more matches
WebGL2RenderingContext.texImage3D() - Web APIs
the webglrenderingcontext.teximage3d() method of the webgl api specifies a three-dimensional texture image. ...
... the webglrenderingcontext.teximage3d() method of the webgl api specifies a three-dimensional texture image. ...
... the webglrenderingcontext.teximage3d() method of the webgl api specifies a three-dimensional texture image. ...
...And 10 more matches
WebGLRenderingContext.getParameter() - Web APIs
when using the webgl_compressed_texture_s3tc extension: ext.compressed_rgb_s3tc_dxt1_ext ext.compressed_rgba_s3tc_dxt1_ext ext.compressed_rgba_s3tc_dxt3_ext ext.compressed_rgba_s3tc_dxt5_ext when using the webgl_compressed_texture_s3tc_srgb extension: ext.compressed_srgb_s3tc_dxt1_e...
... glenum gl.blend_equation_rgb glenum gl.blend_src_alpha glenum gl.blend_src_rgb glenum gl.blue_bits glint gl.color_clear_value float32array (with 4 values) gl.color_writemask sequence<glboolean> (with 4 values) gl.compressed_texture_
formats uint32array returns the compressed texture
formats. when using the webgl_compressed_texture_s3tc extension: ext.compressed_rgb_s3tc_dxt1_ext ext.compressed_rgba_s3tc_dxt1_ext ext.compressed_rgba_s3tc_dxt3_ext ext.compressed_rgba_s3tc_dxt5_ext when using the webgl_compressed_texture_s3tc_srgb extension: ext.compressed_srgb_s3tc_dxt1_ext ext.compressed_srgb_alpha_s3tc_dxt1_ext ext.
...r gl.framebuffer_binding webglframebuffer or null null corresponds to a binding to the default framebuffer. see also bindframebuffer. gl.front_face glenum gl.cw or gl.ccw. see also frontface. gl.generate_mipmap_hint glenum gl.fastest, gl.nicest or gl.dont_care. see also hint. ...
...And 10 more matches
Adding 2D content to a WebGL context - Web APIs
« previousnext » once you've successfully created a webgl context, you can start rendering into it. a simple thing we can do is draw a simple square untextured plane, so let's start there, by building code to draw a square plane. the complete source code for this project is available on github. this project uses the glmatrix library to per
form its matrix operations, so you will need to include that in your project. we're loading a copy from a cdn in our html's <head>. drawing the scene the most important thing to understand before we get started is that even though we're only rendering a square plane object in this example, we're still drawing in 3d space. it's just we're drawing a square and we're putting it directly in front of the camera perpendicular to the view di...
...e. it's just we're drawing a square and we're putting it directly in front of the camera perpendicular to the view direction. we need to define the shaders that will create the color for our simple scene as well as draw our object. these will establish how the square plane appears on the screen. the shaders a shader is a program, written using the opengl es shading language (glsl), that takes in
formation about the vertices that make up a shape and generates the data needed to render the pixels onto the screen: namely, the positions of the pixels and their colors. there are two shader functions run when drawing webgl content: the vertex shader and the fragment shader. you write these in glsl and pass the text of the code into webgl to be compiled for execution on the gpu. together, a set of ...
...d pass the text of the code into webgl to be compiled for execution on the gpu. together, a set of vertex and fragment shaders is called a shader program. 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. vertex shader each time a shape is rendered, the vertex shader is run for each vertex in the shape. ...
...And 10 more matches
Variable fonts guide - CSS: Cascading Style Sheets
ferent size headings in different weights for better readability at each size, or using a slightly narrower width for data-dense displays. for comparison, it is typical in a typographic system for a magazine to use 10–15 or more different weight and width combinations throughout the publication — giving a much wider range of styles than currently typical on the web (or indeed practical for per
formance reasons alone). a note about font families, weights, and variants you might notice that we have been talking about having a specific font file for every weight and style (i.e. bold and italic and bold italic), rather than relying upon the browser to synthesize them. the reason for this is that most typefaces have very specific designs for bolder weights and italics that often include comple...
... and all their variations, and one containing the italic variations. this is sometimes done to reduce the overall file size in cases where the italics aren't needed or used. in all cases, it is still possible to link them with a common font-family name so you can call them using the same font-family and appropriate font-style. introducing the 'variation axis' the heart of the new variable fonts
format is the concept of an axis of variation describing the allowable range of that particular aspect of the typeface design. so the 'weight axis' describes how light or how bold the letter
forms can be; the 'width axis' describes how narrow or how wide they can be; the 'italic axis' describes if italic letter
forms are present and can be turned on or off accordingly, etc. note that an axis can be a ra...
...five currently registered axes are weight, width, slant, italic, and optical size. the w3c has undertaken mapping them to existing css attributes, and in one case introduced a new one, which you'll see below. custom axes are in fact limitless: the typeface designer can define and scope any axis they like, and are just required to give it a four-letter tag to identify it within the font file
format itself. you can use these four-letter tags in css to specify a point along that axis of variation, as will be show in the code examples below. registered axes and existing css attributes in this section we'll demonstrate the five registered axes defined with examples and the corresponding css. where possible, both the standard and lower-level syntax are included. the lower-level syntax (fo...
...And 10 more matches
list-style-type - CSS: Cascading Style Sheets
applied to any element whose display value is set to list-item. moreover, because this property is inherited, it can be set on a parent element (commonly <ol> or <ul>) to make it apply to all list items. ...
...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. note that: some types require a suitable font installed to display as expected. the cjk-ideographic is identical to trad-chinese-in
formal; it exists for legacy reasons. values <custom-ident> a identifier matching the value of a @counter-style or one of the predefined styles: symbols() defines an anonymous style of the list. <string> the specified string will be used as the item's marker. none no item marker is shown. disc a filled circle (default value) circle a hollow circle square ...
...一萬一千一百一十一 devanagari -moz-devanagari example ethiopic-numeric example georgian traditional georgian numbering e.g. an, ban, gan, … he, tan, in… gujarati -moz-gujarati example gurmukhi -moz-gurmukhi example hebrew traditional hebrew numbering hiragana e.g. あ, い, う, え, お,...
...And 10 more matches
Setting up adaptive streaming media sources - Developer guides
mpeg-dash hls (http live streaming) in order to adaptively stream media we need to split the media up into chunks. ...
... mpeg-dash hls (http live streaming) in order to adaptively stream media we need to split the media up into chunks. ...
... mpeg-dash hls (http live streaming) in order to adaptively stream media we need to split the media up into chunks. ...
...And 10 more matches
Index - Developer guides
found 43 pages: # page tags and summary 1 developer guides api, guide, landing, web these articles provide how-to in
formation to help make use of specific web technologies and apis. 2 ajax ajax, dom, json, javascript, references, xmlhttprequest asynchronous javascript and xml, while not a technology in itself, is a term coined in 2005 by jesse james garrett, that describes a "new" approach to using a number of existing technologies together 3 community ajax if you know of useful mailing lists, newsgroups, forums, or other communities related to ajax, please link to them here. 4 getting started ajax, api, advanced, javascript, webmechanics, xmlhttprequest this article guides you through the ajax...
...the way the mozilla engine exposes live changes in a document. 6 audio and video delivery audio, guide, html, html5, media, video whether we are dealing with pre-recorded audio files or live streams, the mechanism for making them available through the browser's <audio> and <video> elements remains pretty much the same. currently, to support all browsers we need to specify two
formats, although with the adoption of mp3 and mp4
formats in firefox and opera, this is changing fast. you can find compatibility in
formation in the guide to media types and
formats on the web. 7 adding captions and subtitles to html5 video html5, media, webvtt, captions, subtitles, track in other articles we looked at how to build a cross browser video player using the htmlmedia...
...on the web. 7 adding captions and subtitles to html5 video html5, media, webvtt, captions, subtitles, track in other articles we looked at how to build a cross browser video player using the htmlmediaelement and window.fullscreen apis, and also at how to style the player. this article will take the same player and show how to add captions and subtitles to it, using the webvtt
format and the <track> element. 8 creating a cross-browser video player apps, html5, video, full screen this article describes a simple html5 video player that uses the media and fullscreen apis and works across most major desktop and mobile browsers. as well as working fullscreen, the player features custom controls rather than just using the browser defaults. the player controls...
...And 10 more matches
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
the html <fieldset> element is used to group several controls as well as labels (<label>) within a web
form. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. as the example above shows, the <fieldset> element provides a grouping for a part of an html
form, with a nested <legend> element providing a caption for the <fieldset>. ...
...n a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. as the example above shows, the <fieldset> element provides a grouping for a part of an html
form, with a nested <legend> element providing a caption for the <fieldset>. ...
...to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. as the example above shows, the <fieldset> element provides a grouping for a part of an html
form, with a nested <legend> element providing a caption for the <fieldset>. ...
...And 10 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the above example shows simple usage of the <video> element. in a similar manner to the <img> element, we include a path to the media we want to display inside the src attribute; we can include other attributes to specify in
formation such as video width and height, whether we want it to autoplay and loop, whether we want to show the browser's default video controls, etc. the content inside the opening and closing <video></video> tags is shown as a fallback in browsers that don't support the element. attributes like all other html elements, this element supports the global attributes. autoplay a boolean attribute; ...
...ally play audio (or videos with an audio track) can be an unpleasant experience for users, so should be avoided when possible. if you must offer autoplay functionality, you should make it opt-in (requiring a user to specifically enable it). however, this can be useful when creating media elements whose source will be set at a later time, under user control. see our autoplay guide for additional in
formation about how to properly use autoplay. to disable video autoplay, autoplay="false" will not work; the video will autoplay if the attribute is there in the <video> tag at all. to remove autoplay, the attribute needs to be removed altogether. in some browsers (e.g. chrome 70.0) autoplay doesn't work if no muted attribute is present. autopictureinpicture a boolean attribute which if true...
...-picture mode (and the control). crossorigin this enumerated attribute indicates whether to use cors to fetch the related image. cors-enabled resources can be reused in the <canvas> element without being tainted. the allowed values are: anonymous sends a cross-origin request without a credential. in other words, it sends the origin: http header without a cookie, x.509 certificate, or per
forming http basic authentication. if the server does not give credentials to the origin site (by not setting the access-control-allow-origin: http header), the image will be tainted, and its usage restricted. use-credentials sends a cross-origin request with a credential. in other words, it sends the origin: http header with a cookie, a certificate, or per
forming http basic authentication. if the...
...And 10 more matches
HTTP headers - HTTP
an http header consists of its case-insensitive name followed by a colon (:), then by its value. whitespace before the value is ignored. custom proprietary headers have historically been used with an x- prefix, but this convention was deprecated in june 2012 because of the inconveniences it caused when nonstandard fields became standard in rfc 6648; others are listed in an iana registry, whose original content was defined in rfc 4229. iana also maintains a registry of proposed new http headers. ...
...hen nonstandard fields became standard in rfc 6648; others are listed in an iana registry, whose original content was defined in rfc 4229. iana also maintains a registry of proposed new http headers. headers can be grouped according to their contexts: general headers apply to both requests and responses, but with no relation to the data transmitted in the body. request headers contain more in
formation about the resource to be fetched, or about the client requesting the resource. response headers hold additional in
formation about the response, like its location or about the server providing it. entity headers contain in
formation about the body of the resource, like its content length or mime type. headers can also be grouped according to how proxies handle them: connection keep-ali...
...rowsing data (e.g. cookies, storage, cache) associated with the requesting website. expires the date/time after which the response is considered stale. pragma implementation-specific header that may have various effects anywhere along the request-response chain. used for backwards compatibility with http/1.0 caches where the cache-control header is not yet present. warning general warning in
formation about possible problems. client hints http client hints are a work in progress. actual documentation can be found on the website of the http working group. accept-ch servers can advertise support for client hints using the accept-ch header field or an equivalent html <meta> element with http-equiv attribute ([html5]). accept-ch-lifetime servers can ask the client to remember the...
...And 10 more matches
An overview of HTTP - HTTP
ned in the early 1990s, http is an extensible protocol which has evolved over time. it is an application layer protocol that is sent over tcp, or over a tls-encrypted tcp connection, though any reliable transport protocol could theoretically be used. due to its extensibility, it is used to not only fetch hypertext documents, but also images and videos or to post content to servers, like with html
form results. http can also be used to fetch parts of documents to update web pages on demand. components of http-based systems http is a client-server protocol: requests are sent by one entity, the user-agent (or a proxy on behalf of it). most of the time the user-agent is a web browser, but it can be anything, for example a robot that crawls the web to populate and maintain a search engine index. ...
...or a proxy on behalf of it). most of the time the user-agent is a web browser, but it can be anything, for example a robot that crawls the web to populate and maintain a search engine index. each individual request is sent to a server, which handles it and provides an answer, called the response. between the client and the server there are numerous entities, collectively called proxies, which per
form different operations and act as gateways or caches, for example. in reality, there are more computers between a browser and the server handling the request: there are routers, modems, and more. thanks to the layered design of the web, these are hidden in the network and transport layers. http is on top, at the application layer. although important to diagnose network problems, the underlying l...
...routers, modems, and more. thanks to the layered design of the web, these are hidden in the network and transport layers. http is on top, at the application layer. although important to diagnose network problems, the underlying layers are mostly irrelevant to the description of http. client: the user-agent the user-agent is any tool that acts on the behalf of the user. this role is primarily per
formed by the web browser; other possibilities are programs used by engineers and web developers to debug their applications. the browser is always the entity initiating the request. it is never the server (though some mechanisms have been added over the years to simulate server-initiated messages). to present a web page, the browser sends an original request to fetch the html document that represen...
...And 10 more matches
Intl - JavaScript
the intl object is the namespace for the ecmascript internationalization api, which provides language sensitive string comparison, number
formatting, and date and time
formatting. the intl object provides access to several constructors as well as functionality common to the internationalization constructors and other language sensitive functions. constructor properties intl.collator() constructor for collators, which are objects that enable language-sensitive string comparison. intl.datetime
format() constructor for objects that enable language-sensitive date and time
formatting. ...
...ive functions. constructor properties intl.collator() constructor for collators, which are objects that enable language-sensitive string comparison. intl.datetime
format() constructor for objects that enable language-sensitive date and time
formatting. intl.displaynames() constructor for objects that enable the consistent translation of language, region and script display names. intl.list
format() constructor for objects that enable language-sensitive list
formatting. intl.locale() constructor for objects that represents a unicode locale identifier. intl.number
format() constructor for objects that enable language-sensitive number
formatting. intl.pluralrules() constructor for objects that enable plural-sensitive
formatting and language-specific rules for plurals. intl.relativet...
... static methods intl.getcanonicallocales() returns canonical locale names. ...
...And 10 more matches
Authoring MathML - MathML
l.css stylesheet might be enough. to use it, just insert one line in your document header: <script src="https://fred-wang.github.io/mathml.css/mspace.js"></script> if you need more complex constructions, you might instead consider using the heavier mathjax library as a mathml polyfill: <script src="https://fred-wang.github.io/mathjax.js/mpadded-min.js"></script> note that these two scripts per
form feature detection of the mspace or mpadded elements (see the browser compatibility table on these pages). there is also a similar script to display a warning at the top of the page for browsers without good mathml support and let the users choose between one of the fallback above: <script src="https://fred-wang.github.io/mathml-warning.js/mpadded-min.js"></script> if you don't want to use this ...
...odern math; } you can then use the @font-face rule as usual to provide woff fallback for latin modern and latin modern math. see this github repository to get woff fonts and sample css stylesheets to use on your web site and check its test page. mathml in xml documents (xhtml, epub, etc) if for some reason you need to use mathml in xml documents, be sure to satisfy the usual requirements: well-
formed document, use of correct mime type, mathml namespace "http://www.w3.org/1998/math/mathml" on <math> roots. for example, the xhtml version of the previous example looks like this: <?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.1 plus mathml 2.0//en" "http://www.w3.org/math/dtd/mathml2/xhtml-math11-f.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>...
...be sure to have the "send as html" and "view as html" options enabled. in thunderbird, you can use the "insert html" command to paste your html+mathml code. mathbird is a convenient add-on for thunderbird to insert such mathml expressions using the asciimath input syntax. moreover, a latex-to-mathml input box has also been integrated into seamonkey since ver...
...And 10 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
kup language for the mozilla browser. there are earlier experiments going back a long way in developing user interfaces using a combination of html and scripting languages, and xul could be considered an evolutionary step from that. similar approaches are found in xaml, which is used in windows vista, and flex, which is used in adobe flash. like web pages, which display the same regardless of plat
form, applications marked up in xul will work the same in any environment where firefox runs. because html was originally conceived as a language for marking up documents, specifically web pages, it is inevitably lacking in functionality for marking up applications. xul, on the other hand, was conceived from the ground up as a markup language for user interfaces, and makes it possible to insert ui co...
...ly conceived as a language for marking up documents, specifically web pages, it is inevitably lacking in functionality for marking up applications. xul, on the other hand, was conceived from the ground up as a markup language for user interfaces, and makes it possible to insert ui components with sophisticated features just by writing tags, without any particular scripting. unlike languages with
formal specifications that have been standardized by bodies like the w3c, xul currently does not have an explicit specification. note: although there is a specification document, its markup is based on implementations and markup as of 2001, and current xul differs from it in many aspects. for the latest xul specifications, please see the xul reference on mdc and the xul page in the mozilla wiki. for...
...as the root element. apart from having a different intended purpose than the window element, it is functionally no different. root elements for dialog windows dialog use the dialog element when creating options dialogs, confirmation dialogs, etc. this element takes a number of attributes, and can easily be made to display controls (buttons, etc) using widgets and layouts native to whatever plat
form it is running on. for example, windows places the ok button on the left and the cancel button on the right, while mac os x has the opposite layout. this is what firefox itself uses for bookmark properties and other dialogs. buttons used in dialog windows a dialog element will display some number of buttons at its bottom. as shown in table 1, there are four types of buttons that can be displaye...
...And 9 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
n implementation can also use other transport technologies such as soap-based remote procedure calls, xmlhttprequest interfaces, or dom 3 load. the second example shows a tabbed menu that dynamically loads news headlines into the current web page. this implementation uses xmlhttprequest. extending traditional hypertext navigation the hypertext approach to developing web pages, in which developers
format text layouts into pages and link those pages to related content, is analogous to a book or a magazine: readers view pages, go to other pages for more in
formation, and view resources listed as references on that page. html and web standards have evolved and now offer flexible and fine-grained control to layout as well supporting dhtml, powerful programming languages like javascript, and addition...
...licitly created with application-like behavior and more sophisticated navigational models in mind. in the next section we will introduce inner-browsing as an extension to the traditional model. let's start defining what we mean by inner-browsing. in this model, when a request goes to the web server, the current page is updated rather than replaced. without leaving the page, the user browses new in
formation and preserves the page's context. this new navigational method allows us to make html user interfaces behave similarly to non-web based applications such as contact management software. the basic implementation uses a resource such as the web page or the web application to control the navigation system. in other words, the page is the browsing device during the experience, and the user is "i...
...see the table below for a description of how applications like this exemplify inner-browsing and how they might be implemented using the inner-browsing approach. some examples: web page with ticker it is common to see web pages with a ticker element, often used to rotate news or stock quotes updates. a simple ticker element implemented in dhtml statically includes the da...
...And 9 more matches
Microsummary XML grammar reference - Archive of obsolete content
for an introduction to how to create a microsummary, read the article creating a microsummary. ...
...for an introduction to how to create a microsummary, read the article creating a microsummary. ...
...for an introduction to how to create a microsummary, read the article creating a microsummary. ...
...And 9 more matches
NPAPI plugin reference - Archive of obsolete content
the articles below describe each of the apis related to npapi plugins. browser-side plug-in api this chapter describes methods in the plug-in api that are provided by the browser; these allow call back to the browser to request in
formation, tell the browser to repaint part of the window, and so forth. the names of all of these methods begin with npn_ to indicate that they are implemented by the browser and called by the plug-in. np_getmimedescription np_getmimedescription returns a supported mime type list for your plugin. it works on unix (linux) and macos. on windows you have to define supported mimetypes in the dll resource file. np_getvalue allows the browser to query the plug-in for in
formation. np_initialize provides global initialization for a plug-in. np_port contains ...
... browser and called by the plug-in. np_getmimedescription np_getmimedescription returns a supported mime type list for your plugin. it works on unix (linux) and macos. on windows you have to define supported mimetypes in the dll resource file. np_getvalue allows the browser to query the plug-in for in
formation. np_initialize provides global initialization for a plug-in. np_port contains in
formation required by the window field of an npwindow structure. np_shutdown provides global deinitialization for a plug-in. npanycallbackstruct contains in
formation required during embedded mode printing. npapi plug-in side api this chapter describes methods in the plug-in api that are available from the plug-in object; these allow plug-ins to interact with the browser. the names of all of thes...
...ames of all of these methods begin with npp_ to indicate that they are implemented by the plug-in and called by the browser. npbyterange represents a particular range of bytes from a stream. npclass npclass is a structure that holds a set of pointers to functions that make up the behavior of an instance of an npclass (i.e. an npobject). npembedprint substructure of npprint that contains plat
form-specific in
formation used during embedded mode printing. npevent represents an event passed by npp_handleevent() to a windowless plug-in. npfullprint substructure of npprint that contains plat
form-specific in
formation used during full-page mode printing. npidentifier npidentifier is an opaque type used for method and property identifiers, such as strings or integers. npidentifiers are uniqu...
...And 9 more matches
TCP/IP Security - Archive of obsolete content
tcp/ip is widely used throughout the world to provide network communications. tcp/ip communications are composed of four layers that work together. when a user wants to transfer data across networks, the data is passed from the highest layer through intermediate layers to the lowest layer, with each layer adding in
formation. at each layer, the logical units are typically composed of a header and a payload. the payload consists of the in
formation passed down from the previous layer, while the header contains layer-specific in
formation such as addresses. at the application layer, the payload is the actual application data. the lowest layer sends the accumulated data through the physical network; the data is then passed up through the layers to its destination. essentially, the data pro...
...tocol (icmp) and internet group management protocol (igmp). data link layer. this layer handles communications on the physical network components. the best-known data link layer protocol is ethernet. security controls exist for network communications at each layer of the tcp/ip model. as previously explained, data is passed from the highest to the lowest layer, with each layer adding more in
formation. because of this, a security control at a higher layer cannot provide protection for lower layers, because the lower layers per
form functions of which the higher layers are not aware. security controls that are available at each layer include: application layer. separate controls must be established for each application. for example, if an application needs to protect sensitive data s...
...ally sound application protocol is very difficult, and implementing it properly is even more challenging, so creating new application layer security controls is likely to create vulnerabilities. also, some applications, particularly off-the-shelf software, may not be capable of providing such protection. while application layer controls can protect application data, they cannot protect tcp/ip in
formation such as ip addresses because this in
formation exists at a lower layer. whenever possible, application layer controls for protecting network communications should be standards-based solutions that have been in use for some time. one example is secure multipurpose internet mail extensions (s/mime), which is commonly used to encrypt email messages. transport layer. controls at this layer ca...
...And 9 more matches
Using workers in extensions - Archive of obsolete content
« previous this article shows you how to use worker threads in extensions to per
form tasks in the background without blocking the user interface. if you haven't already created an extension, or would like to refresh your memory, take a look at the previous articles in this series: creating a status bar extension creating a dynamic status bar extension adding preferences to an extension localizing an extension updating an extension to support multiple mozilla applications download the sample you may download the complete example: download the example. ...
...n creating a dynamic status bar extension adding preferences to an extension localizing an extension updating an extension to support multiple mozilla applications download the sample you may download the complete example: download the example. how this differs from previous versions this version of the stock ticker extension moves the xmlhttprequest call that fetches updated stock in
formation into a worker thread, which then passes that in
formation back to the main body of the extension's code to update the display in the status bar. this demonstrates not only how to use workers in an extension, but also how to per
form xmlhttprequest in a worker, and how workers and main thread code can pass data back and forth. the worker the worker thread's job in this example is to issue the...
...
formation back to the main body of the extension's code to update the display in the status bar. this demonstrates not only how to use workers in an extension, but also how to per
form xmlhttprequest in a worker, and how workers and main thread code can pass data back and forth. the worker the worker thread's job in this example is to issue the xmlhttprequest calls that fetch the updated stock in
formation. that's all it does. every 10 minutes, it calls xmlhttprequest, and, when the results are received, sends an event back to the main thread with the received data. so we need to move the refreshin
formation() method from the stockwatcher2.js file into a separate file that will host the worker thread. ...
...And 9 more matches
Archive of obsolete content
perhaps your target audience is people that are using older hardware, for example, and can't upgrade to the latest and greatest browsers. or for "reasons," your company is required to use very old software and you need to build web content that runs on that software. or perhaps you're just curious about the history of an obsolete feature or api, and how it worked. there are many reasons older documentation can be useful. ...
...historical reference only. see the complete index of archived content note to writers: we need to try to keep the subpages here organized instead of all dumped into one large folder. try to create subtrees for categories of material. also, only move pages here that are extremely obsolete. if anyone might realistically need the in
formation in a living product, it may not be appropriate to move it here. in general, it may be best to discuss it in the mdn web docs room on matrix before moving content here. .htaccess ( hypertext access ) file accessing : htaccess files can be opened using any text editor, like windows notepad, vin, sublime text editor or any other. syntax highlit...
...d layouts. element events archived event pages firefox developer tools these are articles related to the firefox developer tools, which are no longer current. gecko compatibility handbook ** notes ** - the solution quick reference needs more attention. - i'm also looking for a way to organize all that in
formation. - some inline examples were removed because of technical limitations. they are actually replaced by ''-(example removed)-'' the goal of this handbook is to help you update websites to work with standards-based browsers and properly detect gecko. getting the page url in npapi plugin sometimes, you want to restrict an npapi plugi...
...And 9 more matches
Mobile accessibility - Learn web development
this article looks at mobile-specific accessibility considerations. prerequisites: basic computer literacy, a basic understanding of html, css, and javascript, and an understanding of the previous articles in the course. objective: to understand what problems exist with accessibility on mobile devices, and how to overcome them. ...
... devices. long gone are the days when mobile devices ran completely different web technologies to desktop browsers, forcing developers to use browser sniffing and serve them completely separate sites (although quite a few companies still detect usage of mobile devices and serve them a separate mobile domain). these days, mobile devices can usually handle fully-featured websites, and the main plat
forms even have screenreaders built in to enable visually impaired users to use them successfully. modern mobile browsers tend to have good support for wai-aria, too. to make a website accessible and usable on mobile, you just need to follow general good web design and accessibility best practices. there are some exceptions that need special consideration for mobile; the main ones are: control me...
...b design and accessibility best practices. there are some exceptions that need special consideration for mobile; the main ones are: control mechanisms — make sure interface controls such as buttons are accessible on mobiles (i.e., mainly touchscreen), as well as desktops/laptops (mainly mouse/keyboard). user input — make user input requirements as painless as possible on mobile (e.g., in
forms, keep typing to a minimum). responsive design — make sure layouts work on mobile, conserve image download sizes, and think about the provision of images for high-resolution screens. summary of screenreader testing on android and ios the most common mobile plat
forms have fully functional screen readers. these function in much the same way as desktop screenreaders, except they are largely op...
...And 9 more matches
Fundamental text and font styling - Learn web development
int blank down the cavernous barrel of this awesome prowling machine. truly a wonder of nature this urban predator — tommy the cat had many a story to tell. but it was a rare occasion such as this that he did.</p> html { font-size: 10px; } h1 { font-size: 5rem; } p { font-size: 1.5rem; color: red; font-family: helvetica, arial, sans-serif; } font style, font weight, text trans
form, and text decoration css provides four common properties to alter the visual weight/emphasis of text: font-style: used to turn italic text on and off. possible values are as follows (you'll rarely use this, unless you want to turn some italic styling off for some reason): normal: sets the text to the normal font (turns existing italics off.) italic: sets the text to use the italic ve...
...trabold, -black, etc.), but realistically you'll rarely use any of them except for normal and bold: normal, bold: normal and bold font weight lighter, bolder: sets the current element's boldness to be one step lighter or heavier than its parent element's boldness. 100–900: numeric boldness values that provide finer grained control than the above keywords, if needed. ...
...'ll rarely use any of them except for normal and bold: normal, bold: normal and bold font weight lighter, bolder: sets the current element's boldness to be one step lighter or heavier than its parent element's boldness. 100–900: numeric boldness values that provide finer grained control than the above keywords, if needed. text-trans
form: allows you to set your font to be trans
formed. values include: none: prevents any trans
formation. uppercase: trans
forms all text to capitals. lowercase: trans
forms all text to lower case. capitalize: trans
forms all words to have the first letter capitalized. full-width: trans
forms all glyphs to be written inside a fixed-width square, similar to a monospace font, allowing aligning of e.g. latin characters along with asian ...
...And 9 more matches
Web fonts - Learn web development
nt.woff"); } below this you can then use the font family name specified inside @font-face to apply your custom font to anything you like, as normal: html { font-family: "myfont", "bitstream vera serif", serif; } the syntax does get a bit more complex than this; we'll go into more detail below. there are two important things to bear in mind about web fonts: browsers support different font
formats, so you'll need multiple font
formats for decent cross-browser support. 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. we'll show ...
...rectory on your computer now. in the web-font-start.css file, you'll find some minimal css to deal with the basic layout and typesetting of the example. finding fonts for this example, we'll use two web fonts, one for the headings, and one for the body text. to start with, we need to find the font files that contain the fonts. fonts are created by font foundries and are stored in different file
formats. 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). examples include font squirrel, dafont, and everything fonts. a paid font distributor: this is a site that makes fonts available for a charge, such as font...
...and more readable font for the paragraphs. when you find each font, press on the download button, and save the file inside the same directory as the html and css files you saved earlier. it doesn't matter whether they are ttf (true type fonts) or otf (open type fonts). in each case, unzip the font package (web fonts are usually distributed in zip files containing the font file(s) and licensing in
formation). you may find multiple font files in the package — some fonts are distributed as a family with different variants available, for example thin, medium, bold, italic, thin italic, etc. for this example, we just want you to concern yourself with a single font file for each choice. note: under the "find fonts" section in the right-hand column, you can click on the different tags and classif...
...And 9 more matches
What is JavaScript? - Learn web development
basic computer literacy, a basic understanding of html and css. objective: to gain familiarity with what javascript is, what it can do, and how it fits into a web site. a high-level definition javascript is a scripting or programming language that allows you to implement complex features on web pages — every time a web page does more than just sit there and display static in
formation for you to look at — displaying timely content updates, interactive maps, animated 2d/3d graphics, scrolling video jukeboxes, etc. — you can bet that javascript is probably involved. it is the third layer of the layer cake of standard web technologies, two of which (html and css) we have covered in much more detail in other parts of the learning area. html is the markup language tha...
... can achieve with a few lines of javascript code.) the three layers build on top of one another nicely. let's take a simple text label as an example. ...
...complex things. for example: the dom (document object model) api allows you to manipulate html and css, creating, removing and changing html, dynamically applying new styles to your page, etc. every time you see a popup window appear on a page, or some new content displayed (as we saw above in our simple demo) for example, that's the dom in action. the geolocation api retrieves geographical in
formation. this is how google maps is able to find your location and plot it on a map. the canvas and webgl apis allow you to create animated 2d and 3d graphics. people are doing some amazing things using these web technologies —see chrome experiments and webglsamples. audio and video apis like htmlmediaelement and webrtc allow you to do really interesting things with multimedia, such as play audi...
...And 9 more matches
Accessibility API cross-reference
ss-reference helps us see the difference between today's accessibility api's. all accessibility apis to date define a list of possible object roles, or general types, such as button, menu item, text, etc. they also define a list of possible object states, such as focused, read-only, checked, etc. an interesting problem is that mozilla, safari/khtml, opera, staroffice and other apps are cross-plat
form, but there is currently no cross-plat
form accessibility api. the ipc mechanisms used by current generation api's are also not cross-plat
form, although communication for some cross-plat
form accessibility api of the future could be done through sockets. these tables describe how various accessibility apis define possible roles of an object, and states. all accessibility apis to date define a list ...
..., etc. they also define a list of possible object states, such as focused, read-only, checked, etc. this table is the start of a cross-reference, so we can spot the differences and similarities in the apis. aria is a standard developed as part of the web accessibility initiative, which uses markup syntax quite familiar to users of html, xml, sgml and others. the roles it specifies have already in
formed the 'semantic elements' of html5 (such as main and footer), but there is not a one-to-one mapping between the aria roles and the semantics of html5. aria can be used to 'fill out' the missing semantics of html, but may also be used in other markup languages (such as svg) and expresses semantics using attributes, compared with html, which tends to have distinct named elements for its roles. for ...
...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. aria live region. alert alert alert alert, alertdialog content changes over time, such as animated gif animation n/a no spec n/a a section that
forms an independent part of a document, page, or site. article <article> <part> or <art> object representing entire app. aria role denotes interactive (not browsable) content operable in ways that differ from any of the other interactive aria roles, and may be only a part of the main document. application frame n/a application see <div> and...
...And 9 more matches
Software accessibility: Where are we today?
were not designed with the needs of people with disabilities in mind. many, including those who were blind or physically disabled, were unable to use applications which were written for microsoft operating systems. these applications assumed that computer users could: read and react to text and images displayed on the screen. type on a standard keyboard. select text, pictures, and other in
formation using a mouse react to sounds played. this tends to be somewhat less of a limitation in that most software doesn't rely exclusively on audio to relay feedback. if a person was unable to do one of the above-listed tasks, they found themselves unable to use many popular computer applications. here are some of the groups of people that have problems doing some of those tasks: print disabl...
... hearing impaired we must also consider the increasing numbers of aging baby boomers that are beginning to experience problems with their sight, vision or dexterity. when you add all these groups of people together, that's a lot of potential users! in answer to this problem, many small accessibility hardware and software vendors created products and software which helped people who could not per
form one of the four basic tasks to use common computer applications. some examples of these assistive devices and software include: screen reading software, which speaks text displayed on the screen using hardware or software text-to-speech, and which allows a blind person to use the keyboard to simulate mouse actions alternate input devices, which allow people with physical disabilities to use ...
... makes the computer talk to the user: those who can't read print at all usually use talking programs (text-to-speech). talking programs are also useful for print disabilities other than visual impairments, such as dyslexia. additionally, text-to-speech is used by those who cannot speak, in place of their own voice. finally, this technology could be useful to mainstream users, on portable in
formation appliances, or to access in
formation when the eyes are busy elsewhere. magnification enlarges the screen's contents: for those with low vision, it may suffice to use a larger font, a built-in high contrast theme, or even just an an extra large screen. otherwise, screen magnification programs may be used, which allow zooming in to portions of the screen, while following the mous...
...And 9 more matches
How Mozilla's build system works
ld the tree. to do this, config.status must first scan the build system definition. the build system definition consists of various moz.build files in the tree. there is roughly one moz.build file per directory or per set of related directories. each moz.build file defines how its part of the build configuration works. for example, it says i want these c++ files compiled or look for additional in
formation in these directories. config.status starts with the main moz.build file and then recurses into all referenced files and directories. as the moz.build files are read, data structures describing the overall build system definition are emitted. these data structures are then read by a build backend generator, which then converts them into files, function calls, and so on. in the case of a make ...
...root directory and then recursively descends into child directories until it's done. but there's more to the process than that. the recursive make backend divides the source tree into tiers. a tier is a grouping of related directories containing makefiles of their own. for example, there is a tier for the netscape portable runtime (nspr), one for the javascript engine, one for the core gecko plat
form, one for the xul app being built, and so on. the main moz.build file defines the tiers and directories in the tiers. in reality, the main moz.build files include other moz.build files, such as /toolkit/toolkit.mozbuild, which define the tiers. they do this via the add_tier_dir() function. at build time, the tiers are traversed in the order they are defined. typically, the traversal order looks ...
...o on. the main moz.build file defines the tiers and directories in the tiers. in reality, the main moz.build files include other moz.build files, such as /toolkit/toolkit.mozbuild, which define the tiers. they do this via the add_tier_dir() function. at build time, the tiers are traversed in the order they are defined. typically, the traversal order looks something like base, nspr, nss, js, plat
form, app. each tier consists of three sub-tiers: export, libs, and tools. these sub-tiers roughly correspond to the actions of pre-build, main-build, and post-build. this naming, however, can be misleading because all three sub-tiers are part of the build: export is used to do things like copy headers into place. libs is reserved for most of the work, like compiling c++ source files. tools is u...
...And 9 more matches
NSS Certificate Download Specification
they are: der encoded certificate: this is a single binary der encoded certificate. pkcs#7 certificate chain: this is a single pkcs#7 signeddata object. the only significant field in the signeddata object is the certificates field, which may contain multiple certificates to be imported together. ...
...they are: der encoded certificate: this is a single binary der encoded certificate. pkcs#7 certificate chain: this is a single pkcs#7 signeddata object. the only significant field in the signeddata object is the certificates field, which may contain multiple certificates to be imported together. ...
...they are: der encoded certificate: this is a single binary der encoded certificate. pkcs#7 certificate chain: this is a single pkcs#7 signeddata object. the only significant field in the signeddata object is the certificates field, which may contain multiple certificates to be imported together. ...
...And 9 more matches
NSS_3.12_release_notes.html
nss 3.12 release notes 17 june 2008 newsgroup: mozilla.dev.tech.crypto contents introduction distribution in
formation new in nss 3.12 bugs fixed documentation compatibility feedback introduction network security services (nss) 3.12 is a minor release with the following new features: sqlite-based shareable certificate and key databases libpkix: an rfc 3280 compliant certificate path validation library camellia cipher support tls session ticket extension (rfc 5077) nss 3.12 is tri-licensed under the mpl 1.1/gpl 2.0/lgpl 2.1. ...
...cate and key databases libpkix: an rfc 3280 compliant certificate path validation library camellia cipher support tls session ticket extension (rfc 5077) nss 3.12 is tri-licensed under the mpl 1.1/gpl 2.0/lgpl 2.1. note: firefox 3 uses nss 3.12, but not the new sqlite-based shareable certificate and key databases. we missed the deadline to enable that feature in firefox 3. distribution in
formation the cvs tag for the nss 3.12 release is nss_3_12_rtm. nss 3.12 requires nspr 4.7.1. see the documentation section for the build instructions. nss 3.12 source and binary distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_rtm/src/. binary distributions: https://ftp.mozi...
...tions. nss 3.12 source and binary distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_rtm/src/. binary distributions: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_rtm/. both debug and optimized builds are provided. go to the subdirectory for your plat
form, dbg (debug) or opt (optimized), to get the tar.gz or zip file. the tar.gz or zip file expands to an nss-3.12 directory containing three subdirectories: include - nss header files lib - nss shared libraries bin - nss tools and test programs you also need to download the nspr 4.7.1 binary distributions to get the nspr 4.7.1 header files and shared libraries, which nss 3.12 re...
...And 9 more matches
Network Security Services
network security services (nss) is a set of libraries designed to support cross-plat
form development of security-enabled client and server applications. applications built with nss can support ssl v3, tls, pkcs #5, pkcs #7, pkcs #11, pkcs #12, s/mime, x.509 v3 certificates, and other security standards. for detailed in
formation on standards supported, see overview of nss. for a list of frequently asked questions, see the faq. nss is available under the mozilla public license. for in
formation on downloading nss releases as tar files, see download pki source. ...
... of frequently asked questions, see the faq. nss is available under the mozilla public license. for in
formation on downloading nss releases as tar files, see download pki source. if you're a developer and would like to contribute to nss, you might want to read the documents highlevel overview of internal details of nss and getting started with nss. documentation background in
formation overview of nss provides a brief summary of nss and its capabilities. nss faq answers basic questions about nss. introduction to public-key cryptography explains the basic concepts of public-key cryptography that underlie nss. ...
...ith nss. documentation background in
formation overview of nss provides a brief summary of nss and its capabilities. nss faq answers basic questions about nss. introduction to public-key cryptography explains the basic concepts of public-key cryptography that underlie nss. introduction to ssl introduces the ssl protocol, including in
formation about cryptographic ciphers supported by ssl and the steps involved in the ssl handshake. getting started nss releases this page contains in
formation about the current and past releases of nss. get the source code and build it instructions on how to build nss on the different supported plat
forms. nss apis introduction to network securi...
...And 9 more matches
JSAPI User Guide
point to a valid object, but no longer does because the object no longer exists. using a dangling pointer can crash a c++ program (or worse). in the case of js::value, the javascript garbage collector recycles objects, strings, and numbers that don't appear to be in use, and a js::value by itself does not protect its referent from the garbage collector. see garbage collection below for crucial in
formation on how to use js::values safely. js::value includes member functions to test the javascript data type. these are isobject(), isnumber(), isint32(), isdouble(), isstring(), isboolean(), isnull(), and isundefined(). if a js::value contains a jsobject, double, or jsstring, you can cast it to its underlying data type using the toobject(), todouble(), and tostring() member functions, respectiv...
... the memory. garbage collection has two important consequences for jsapi applications. first, the application must be very careful to ensure that any values it needs are gc-reachable. the garbage collector is rather eager about its job. any object you leave lying around will be destroyed if you don't tell the jsapi you're still using it. second, the application should take steps to reduce the per
formance impact of garbage collection. keeping objects alive if your jsapi application crashes, it is likely due to a gc-related error. the application must ensure that the garbage collector can reach all the objects, numbers, and strings that are still being used. otherwise, the gc will free the memory occupied by those values, leading to a probable crash the next time your program tries to use the...
...l to enable extra garbage collection. gc zeal usually causes a gc-related crash to occur much sooner (closer to its cause) and more reliably. it's for development and debugging only, because the extra garbage collection makes js very slow. use js_dumpheap to dump the spidermonkey heap or specific interesting parts of it. see spidermonkey garbage collection internals for more details. ...
...And 9 more matches
Secure Development Guidelines
the following content will likely see significant revision, though can be used as a reference for security best practices to follow when developing code for mozilla. ...
...t a product how to avoid making them how to mitigate them everything is oriented toward c/c++ introduction: gaining control specifics about the underlying architecture, using x86 as an example 6 basic registers (eax, ebx, ecx, edx, edi, esi) 2 stack-related registers (esp, ebp) mark top and bottom of current stack frame status register (eflags) contains various state in
formation instruction pointer (eip) points to register being executed; can’t be modified directly introduction: gaining control (2) eip is modified using call or jump instructions attacks usually rely on obtaining control over the eip otherwise the attacker can try to control memory pointed to by an existing function pointer a vulnerability is required to modify the eip or s...
... using call or jump instructions attacks usually rely on obtaining control over the eip otherwise the attacker can try to control memory pointed to by an existing function pointer a vulnerability is required to modify the eip or sensitive memory saved return addr or function pointer get altered introduction: gaining control (3) common issues used to gain control buffer overflows
format string bugs integer overflows/underflows writing secure code: input validation input validation most vulnerabilities are a result of un-validated input always per
form 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 shou...
...And 9 more matches
nsILoginManager
.getservice(components.interfaces.nsiloginmanager); method overview void addlogin(in nsilogininfo alogin); nsiautocompleteresult autocompletesearch(in astring asearchstring, in nsiautocompleteresult apreviousresult, in nsidomhtmlinputelement aelement); unsigned long countlogins(in astring ahostname, in astring aactionurl, in astring ahttprealm); boolean fill
form(in nsidomhtml
formelement a
form); void findlogins(out unsigned long count, in astring ahostname, in astring aactionurl, in astring ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins); void getalldisabledhosts([optional] out unsigned long count, [retval, array, size_is(count)] out wstring hostnames); void getalllogins([optional] out unsigned long count, ...
...vingenabled(in astring ahost, in boolean isenabled); methods addlogin() stores a new login in the login manager. note: default values for the nsiloginmetainfo properties are created if the specified login doesn't explicitly specify them. void addlogin( in nsilogininfo alogin ); parameters alogin the login to store. exceptions thrown an exception is thrown if the login in
formation is already stored in the login manager. to change a login, you have to use modifylogin(). autocompletesearch() generates results for a user field autocomplete menu. note: this method is provided for use only by the
formfillcontroller, which calls it directly. it should not be used for any other purpose. nsiautocompleteresult autocompletesearch( in astring asearchstring, in nsiautoco...
... number of logins matching the specified criteria. called when only the number of logins is needed, and not the actual logins (which avoids prompting the user for a master password, as the logins don't need to be decrypted). ...
...And 9 more matches
Index
ger.idl and nsiactivity.idl files for source documentation. 7 address book interfaces mailnews, mozilla, seamonkey, thunderbird this page contains a list of the interfaces that you'll will most likely hit when writing patches for the address book or writing extensions. the complete list of interfaces for the address book can be found here. address book examples show how to per
form various tasks and provide code snippets. 8 address book examples mailnews, seamonkey, thunderbird this article provides examples on accessing and manipulating thunderbird address books. address book interfaces provides an overview of the related interfaces. see an overview of thunderbird components for a general description of the thunderbird user interface and related progra...
...ents for a general description of the thunderbird user interface and related programmatic interfaces. 9 address book sync client design by richard h. pizzarro <rhp@netscape.com> 10 autoconfiguration in thunderbird administration, enterprise author: ben bucksch please do not change this document without consulting the author 11 autoconfig file
format no summary! 12 autoconfig file
format definition please see https://wiki.mozilla.org/thunderbird:autoconfiguration:configfile
format. 13 autoconfig: how to create a configuration file autoconfiguration, thunderbird authoritative definition 14 autoconfiguration in thunderbird moved to autoconfiguration 15 buddy...
...mozilla.org) what is the "cached" compose window? instead of destroying the mail compose window on send (or close) just to create a new one the next time, mozilla mail will "cache" the compose window on send (or close), and use that instead. the downsides are that we have had some bugs, it complicates and bloats the code, and it requires more testing. the upside is that is has been a major per
formance win why did you do this? back 0.9.7, we hit a wall with the compose window. any new window per
formance problems that mozilla has are especially painful in mail compose, as we need to create a new compose window on every new mail message or reply. but we noticed that the common usage pattern is to compose, send, compose, send, compose send. we decided it would be worth the trouble to ...
...And 9 more matches
SubtleCrypto.importKey() - Web APIs
the importkey() method of the subtlecrypto interface imports a key: that is, it takes as input a key in an external, portable
format and gives you a cryptokey object that you can use in the web crypto api. the function accepts several import
formats: see supported
formats for details. syntax const result = crypto.subtle.importkey(
format, keydata, algorithm, extractable, usages ); parameters
format is a string describing the data
format of the key to import. it can be one of the following: raw: raw
format. pkcs8: pkcs #8
format. spki: subjectpublickeyinfo
format. jwk: json web key
format. keydata is an arraybuffer, a typedarray, a dataview, or a jsonwebkey object containing the key in the given
format. algorithm is a dictionary object de...
...ctionary object defining the type of key to import and providing extra algorithm-specific parameters. for rsassa-pkcs1-v1_5, rsa-pss, or rsa-oaep: pass an rsahashedimportparams object. for ecdsa or ecdh: pass an eckeyimportparams object. for hmac: pass an hmacimportparams object. for aes-ctr, aes-cbc, aes-gcm, or aes-kw: pass the string identifying the algorithm or an object of the
form { "name": algorithm }, where algorithm is the name of the algorithm. for pbkdf2 : pass the string pbkdf2. extractable is a boolean indicating whether it will be possible to export the key using subtlecrypto.exportkey() or subtlecrypto.wrapkey(). keyusages is an array indicating what can be done with the key. possible array values are: encrypt: the key may be used to encrypt messag...
... a key. unwrapkey: the key may be used to unwrap a key. return value result is a promise that fulfills with the imported key as a cryptokey object. 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. supported
formats this api supports four different key import/export
formats: raw, pkcs #8, subjectpublickeyinfo, and json web key. raw you can use this
format to import or export aes or hmac secret keys, or elliptic curve public keys. in this
format the key is supplied as an arraybuffer containing the raw bytes for the key. pkcs #8 you c...
...And 9 more matches
UIEvent.layerX - Web APIs
ccurs inside a positioned element, where the returned value is relative to the top left of the positioned element. syntax var xpos = event.layerx xpos is an integer value in pixels for the x-coordinate of the mouse pointer, when the mouse event fired. ...
...ositioned element, where the returned value is relative to the top left of the positioned element. syntax var xpos = event.layerx xpos is an integer value in pixels for the x-coordinate of the mouse pointer, when the mouse event fired. ...
...ned element, where the returned value is relative to the top left of the positioned element. syntax var xpos = event.layerx xpos is an integer value in pixels for the x-coordinate of the mouse pointer, when the mouse event fired. ...
...And 9 more matches
UIEvent.layerY - Web APIs
curs inside a positioned element, where the returned value is relative to the top left of the positioned element. syntax var ypos = event.layery; ypos is an integer value in pixels for the y-coordinate of the mouse pointer, when the mouse event fired. ...
...sitioned element, where the returned value is relative to the top left of the positioned element. syntax var ypos = event.layery; ypos is an integer value in pixels for the y-coordinate of the mouse pointer, when the mouse event fired. ...
...ed element, where the returned value is relative to the top left of the positioned element. syntax var ypos = event.layery; ypos is an integer value in pixels for the y-coordinate of the mouse pointer, when the mouse event fired. ...
...And 9 more matches
Web Audio API - Web APIs
werful and versatile system for controlling audio on the web, allowing developers to choose audio sources, add effects to audio, create audio visualizations, apply spatial effects (such as panning) and much more. web audio concepts and usage the web audio api involves handling audio operations inside an audio context, and has been designed to allow modular routing. basic audio operations are per
formed with audio nodes, which are linked together to
form an audio routing graph. several sources — with different types of channel layout — are supported even within a single context. this modular design provides the flexibility to create complex audio functions with dynamic effects. audio nodes are linked into chains and simple webs by their inputs and outputs. they typically start with one or...
... api. web audio api target audience the web audio api can seem intimidating to those that aren't familiar with audio or music terms, and as it incorporates a great deal of functionality it can prove difficult to get started if you are a developer. it can be used to simply incorporate audio into your website or application, by providing atmosphere like futurelibrary.no, or auditory feedback on
forms. however, it can also be used to create advanced interactive instruments. with that in mind, it is suitable for both developers and musicians alike. we have a simple introductory tutorial for those that are familiar with programming but need a good introduction to some of the terms and structure of the api. there's also a basic concepts behind web audio api article, to help you understand the ...
...ent is fired when playback has stopped because the end of the media was reached. defining audio sources interfaces that define audio sources for use in the web audio api. audioscheduledsourcenode the audioscheduledsourcenode is a parent interface for several types of audio source node interfaces. it is an audionode. ...
...And 9 more matches
ARIA: dialog role - Accessibility
ke a dialog accessible. additionally, the following needs to be done: the dialog must be properly labeled keyboard focus must be managed correctly the sections below describe how these two requirements can be met. labeling even though it is not required for the dialog itself to be able to receive focus, it still needs to be labeled. the label given to the dialog will provide contextual in
formation for the interactive controls inside the dialog. in other words, the dialog's label acts like a grouping label for the controls inside it (similar to how a <legend> element provides a grouping label for the controls inside a <fieldset> element). if a dialog already has a visible title bar, the text inside that bar can be used to label the dialog itself. the best way to achieve this is by usi...
...d="dialog1desc">you can change your details at any time in the user account section.</p> <button>close</button> </div> keep in mind that a dialog's title and description text do not have to be focusable in order to be perceived by screen readers operating in a non-virtual mode. the combination of the aria dialog role and labeling techniques should make the screen reader announce the dialog's in
formation when focus is moved into it. required javascript features focus management a dialog has particular requirements for how keyboard focus should be managed: dialogs should always have at least one focusable control. for many dialogs, there will be a button like "close", "ok" or "cancel". in addition to the needed control, dialogs can contain any number of focusable elements, even entire ...
...ation when focus is moved into it. required javascript features focus management a dialog has particular requirements for how keyboard focus should be managed: dialogs should always have at least one focusable control. for many dialogs, there will be a button like "close", "ok" or "cancel". in addition to the needed control, dialogs can contain any number of focusable elements, even entire
forms or other container widgets like tabs. when the dialog appears on the screen, keyboard focus (whose control depends upon the dialogs purpose) should be moved to the default focusable control inside the dialog. for dialogs that only provide a basic message, it could be an "ok" button. for dialogs containing a
form it could be the first field in the
form. after the dialog is dismissed, keyboard f...
...And 9 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
in: 0; border: 1px solid #ddd; background-color: #fff; display: table; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-color-picker .picking-area { width: 198px; height: 198px; margin: 5px; border: 1px solid #ddd; position: relative; float: left; display: table; } .ui-color-picker .picking-area:hover { cursor: default; } /* hsv
format - hue-saturation-value(brightness) */ .ui-color-picker .picking-area { background: url("images/picker_mask.png"); background: -moz-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -moz-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -webkit-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -webkit-linear-gradient(left, #fff 0%, rgba(255, 255, ...
...100%), -webkit-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -ms-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -ms-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background: -o-linear-gradient(bottom, #000 0%, rgba(0, 0, 0, 0) 100%), -o-linear-gradient(left, #fff 0%, rgba(255, 255, 255, 0) 100%); background-color: #f00; } /* hsl
format - hue-saturation-lightness */ .ui-color-picker[data-mode='hsl'] .picking-area { background: -moz-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, hsla(0, 0%, 0%, 0) 50%, hsl(0, 0%, 0%) 100%), -moz-linear-gradient(left, hsl(0, 0%, 50%) 0%, hsla(0, 0%, 50%, 0) 100%); background: -webkit-linear-gradient(top, hsl(0, 0%, 100%) 0%, hsla(0, 0%, 100%, 0) 50%, ...
...f; -moz-user-select: none; user-select: none; } .ui-input-slider * { float: left; height: 100%; } /* input slider */ .ui-input-slider > input { margin: 0; padding: 0; width: 50px; text-align: center; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-input-slider-info { width: 90px; padding: 0px 10px 0px 0px; text-align: right; text-trans
form: lowercase; line-height: inherit; } .ui-input-slider-left, .ui-input-slider-right { width: 16px; cursor: pointer; background: url("arrows.png") center left no-repeat; } .ui-input-slider-right { background: url("arrows.png") center right no-repeat; } .ui-input-slider-name { width: 90px; padding: 0 10px 0 0; text-align: right; text-trans
form: lowercase; } .ui-input-slider-btn-set { wi...
...And 9 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. it was supported on the <
form> element, but was removed in favor of file in html5. 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. ...
...ful 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. ...
...of any
format is acceptable. for instance, there are a number of ways microsoft word files can be identified, so a site that accepts word files might use an <input> like this: <input type="file" id="docpicker" accept=".doc,.docx,application/msword,application/vnd.openxml
formats-officedocument.wordprocessingml.document"> whereas if you're accepting a media file, you may want to be include any
format of that media type: <input type="file" id="soundfile" accept="audio/*"> <input type="file" id="videofile" accept="video/*"> <input type="file" id="imagefile" accept="image/*"> the accept attribute doesn't validate the types of the selected files; it simply provides hints for browsers to guide users towards selecting the correct file types. it is still possible (in most cases) for users to tog...
...And 9 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
es to achieve various purposes: referrer/cors control for security and privacy: see crossorigin and referrerpolicy. use both width and height to set the intrinsic size of the image, allowing it to take up space before it loads, to mitigate content layout shifts. responsive image hints with sizes and srcset (see also the <picture> element and our responsive images tutorial). supported image
formats the html standard doesn't list what image
formats to support, so each user agent supports different
formats. a complete guide to image
formats supported by web browsers is available. below is a list of the image
formats that are most commonly used on the web, as well as some older
formats that should no longer be used, despite existing content possibly still using them. abbreviation...
...html standard doesn't list what image
formats to support, so each user agent supports different
formats. a complete guide to image
formats supported by web browsers is available. below is a list of the image
formats that are most commonly used on the web, as well as some older
formats that should no longer be used, despite existing content possibly still using them. ...
...ing content possibly still using them. ...
...And 9 more matches
Content-Disposition - HTTP
in a regular http response, the content-disposition response header is a header indicating if the content is expected to be displayed inline in the browser, that is, as a web page or as part of a web page, or as an attachment, that is downloaded and saved locally. in a multipart/
form-data body, the http content-disposition general header is a header that can be used on the subpart of a multipart body to give in
formation about the field it applies to. ...
...header that can be used on the subpart of a multipart body to give in
formation about the field it applies to. the subpart is delimited by the boundary defined in the content-type header. used on the body itself, content-disposition has no effect. the content-disposition header is defined in the larger context of mime messages for e-mail, but only a subset of the possible parameters apply to http
forms and post requests. only the value
form-data, as well as the optional directive name and filename, can be used in the http context. 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 (d...
...e the web page, or as the web page) or attachment (indicating it should be downloaded; most browsers presenting a 'save as' dialog, prefilled with the value of the filename parameters if present). ...
...And 9 more matches
Lexical grammar - JavaScript
right and is converted into a sequence of input elements which are tokens, control characters, line terminators, comments or white space. ecmascript also defines certain keywords and literals and has rules for automatic insertion of semicolons to end statements. control characters control characters have no visual representation but are used to control the interpretation of the text. unicode
format-control characters code point name abbreviation description u+200c zero width non-joiner <zwnj> placed between characters to prevent being connected into ligatures in certain languages (wikipedia). u+200d zero width joiner <zwj> placed between characters that would not normally be connected in order to cause the characters to be rendered ...
... code point name abbreviation description u+200c zero width non-joiner <zwnj> placed between characters to prevent being connected into ligatures in certain languages (wikipedia). u+200d zero width joiner <zwj> placed between characters that would not normally be connected in order to cause the characters to be rendered using their connected
form in certain languages (wikipedia). u+feff byte order mark <bom> used at the start of the script to mark it as unicode and the text's byte order (wikipedia). white space white space characters improve the readability of source text and separate tokens from each other. these characters are usually unnecessary for the functionality of the code. minification tools are often u...
...minification tools are often used to remove whitespace in order to reduce the amount of data that needs to be transferred. white space characters code point name abbreviation description escape sequence u+0009 character tabulation <ht> horizontal tabulation \t u+000b line tabulation <vt> vertical tabulation \v u+000c
form feed <ff> page breaking control character (wikipedia). \f u+0020 space <sp> normal space u+00a0 no-break space <nbsp> normal space, but no point at which a line may break others other unicode space characters <usp> spaces in unicode on wikipedia line terminators in addition to white space characters, line terminato...
...And 9 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
a button or menu item to the firefox browser window. the chrome manifest plays two important roles: it registers the contents of the chrome packages, and invokes the cross-package overlay. developing a simple extension: hello world in this section, we will write an extremely simple “hello world” extension that only displays the time.3 phase 1: test install our first step will be to per
form a test installation consisting of the minimum code needed to add a new menu item to the tools menu (figure 3). fixme: figure 3: menu after phase 1 complete source file structure first set up the work folders you’ll use to organize your extension’s source files. the folder can be wherever you want, but for the purposes of this guide, we’ll assume it’s at c:\extensions\helloworld . creat...
... chrome.manifest this is the chrome manifest described in the earlier section. registers packages and invokes cross-package overlays. content/overlay.xul xul file that will be overlaid on the firefox browser window, adding buttons, menu items, etc. ...
... (these files will be used in phase 2). create install manifest fill in the install.rdf file as shown in listing 1. listing 1: content for install.rdf <?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"> <!-- unique id for extension. can be in e-mail address
format or guid
format --> <em:id>helloworld@xuldev.org</em:id> <!-- indicates that this add-on is an extension --> <em:type>2</em:type> <!-- extension name displayed in add-on manager --> <em:name>hello, world!</em:name> <!-- extension version number. there is a version numbering scheme you must follow --> <em:version>0.1</em:version> <!-- brief description displayed in...
...And 8 more matches
JavaScript crypto - Archive of obsolete content
llows the page to automatically login and logout based on the presence of the smartcard. generating keys and issuing user certificates there are several crypto object methods used in generating keys for certificates: generatecrmfrequest(), importusercertificates(). the generatecrmfrequest() function generates a key and creates a crmf request object. this object can be passed to a ca using a web
form. ...
... the generatecrmfrequest() function generates a key and creates a crmf request object. this object can be passed to a ca using a web
form. the importusercertificates() function loads certificates into the nss database or smartcard if the corresponding key is found there. the popchallengeresponse() function is not implemented. ...
... corresponding key is found there. the popchallengeresponse() function is not implemented. ...
...And 8 more matches
Using nsIXULAppInfo - Archive of obsolete content
d thunderbird 1.0, do not support it. you'll need to have additional code for those older versions. getting nsixulappinfo to get a component implementing nsixulappinfo use this code: var appinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); (for explanation see this creating xpcom article.) getting application in
formation after you obtained the app info component, you can read its properties to get the application's id, human-readable name, version, plat
form version, etc. for complete list of nsixulappinfo's properties, please see nsixulappinfo interface description. id you can tell which application you're running under using the nsixulappinfo.id property. const firefox_id = "{ec8030f7-c20a-464f-9b0e-13a...
...r app } note: you could also use nsixulappinfo.name, which is a human-readable name for the application, such as "firefox", "thunderbird" or "seamonkey", but who knows, maybe they'll rename it again! version sometimes you need to know the version of the application your code is running under. for example, one of unfrozen functions you're relying on was changed. ...
...info.name, which is a human-readable name for the application, such as "firefox", "thunderbird" or "seamonkey", but who knows, maybe they'll rename it again! version sometimes you need to know the version of the application your code is running under. for example, one of unfrozen functions you're relying on was changed. ...
...And 8 more matches
What is accessibility? - Learn web development
he web, and start learning about how others use it — you are not your users. the main types of disability to consider are explained below, along with any special tools they use to access web content (known as assistive technologies, or ats). note: the world health organization's disability and health fact sheet states that "over a billion people, about 15% of the world's population, have some
form of disability", and "between 110 million and 190 million adults have significant difficulties in functioning." people with visual impairments people with visual impairments include people with blindness, low-level vision, and color blindness. many people with visual impairments use screen magnifiers that are either physical magnifiers or software zoom capabilities. most browsers and operating ...
...ations — some users might not have a mouse. the way this usually affects web development work is the requirement that controls be accessible by the keyboard — we'll discuss keyboard accessibility in later articles in the module, but it is a good idea to try out some websites using just the keyboard to see how you get on. can you use the tab key to move between the different controls of a web
form, for example? you can find more details about keyboard controls in our cross browser testing using native keyboard accessibility section. in terms of statistics, a significant number of people have mobility impairments. the u.s. centers for disease control and prevention disability and functioning (noninstitutionalized adults 18 years and over) reports the usa "percent of adults with any physica...
......
...And 8 more matches
What’s in the head? Metadata in HTML - Learn web development
prerequisites: basic html familiarity, as covered in getting started with html. ...
...plate you obtained in the previous section on <title> (the title-example.html page), try changing the meta charset value to iso-8859-1, and add the japanese to your page. 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 in
formation it contains. content specifies the actual meta content. two such meta elements that are useful to include on your page define the author of the page, and provide a concise description of the page. let's look at an example: <meta name="author" content="chris mills"> <meta name="description" content="the mdn web docs learning area aims to provide complete beginners to the web with all they...
...rovide complete beginners to the web with all they need to know to get started with developing web sites and applications."> specifying an author is beneficial in many ways: it is useful to be able to understand who wrote the page, if you have any questions about the content and you would like to contact them. ...
...And 8 more matches
Third-party APIs - Learn web development
apquest-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. for example: let map = l.mapquest.map('map', { center: [53.480759, -2.242631], layers: l.mapquest.tilelayer('map'), zoom: 12 }); here we are creating a variable to store the map in
formation in, then creating a new map using the mapquest.map() method, which takes as its parameters the id of a <div> element you want to display the map in ('map'), and an options object containing the details of the particular map we want to display. 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...
...mapquest.map() method, which takes as its parameters the id of a <div> element you want to display the map in ('map'), and an options object containing the details of the particular map we want to display. 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. this is all the in
formation the mapquest api needs to plot a simple map. the server you are connecting to handles all the complicated stuff, like displaying the correct map tiles for the area being shown, etc. note: some apis handle access to their functionality slightly differently, requiring the developer to make an http request to a specific url pattern to retrieve data. these are called restful apis — we'll sho...
...the api key placeholder with your key. changing the type of map there are a number of different types of map that can be shown with the mapquest api. to do this, find the following line: layers: l.mapquest.tilelayer('map') try changing 'map' to 'hybrid' to show a hybrid-style map. try some other values too. the tilelayer reference page shows the different available options, plus a lot more in
formation. adding different controls the map has a number of different controls available; by default it just shows a zoom control. you can expand the controls available using the map.addcontrol() method; add this to your code, inside the window.onload handler: map.addcontrol(l.mapquest.control()); the mapquest.control() method just creates a simple full-featured control set, and it is placed in t...
...And 8 more matches
Beginning our React todo list - Learn web development
ode as a starting point for this project, we're going to provide two things: an app() function to replace the one you have now, and some css to style your app. ...
... <label htmlfor="new-todo-input" classname="label__lg"> what needs to be done? ...
...ublic/index.html and change the <title> element’s text to todomatic. this way, it will match the <h1> at the top of our app. <title>todomatic</title> when your browser refreshes, you should see something like this: it's ugly, and doesn’t function yet, but that's okay — we'll style it in a moment. ...
...And 8 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
a new array with new objects, completely avoiding mutating the original todos array. note: svelte allows us to specify different options that affect how the compiler works. the <svelte:options immutable={true}/> option tells the compiler that you promise not to mutate any objects. this allows it to be less conservative about checking whether values have changed and generate simpler and more per
formant code. for more in
formation on <svelte:options...>, check the svelte options documentation. all of these solutions involve an assignment in which the updated variable is on the left side of the equation. any of this techniques will allow svelte to notice that our todos array has been modified. choose one, and update your checkalltodos() function as required. now you should be able to check a...
...when the control receives focus. the problem is that all these dom nodes are dynamically created by svelte at runtime. so we'll have to wait for them to be created and added to the dom in order to use them. to do so, we'll have to learn about the component lifecycle to understand when we can access them — more on this later. creating a newtodo component let's begin by extracting our new todo
form out to its own component. with what we know so far we can create a new component file and adjust the code to emit an addtodo event, passing the name of the new todo in with the additional details. create a new file — components/newtodo.svelte. put the following contents inside it: <script> import { createeventdispatcher } from 'svelte' const dispatch = createeventdispatcher()...
...he name of the new todo in with the additional details. create a new file — components/newtodo.svelte. ...
...And 8 more matches
Strategies for carrying out testing - Learn web development
e most important target browsers and devices, and then code defensively to give your site the widest support reach it can be expected to have. by coding defensively, we mean trying to build in intelligent fallbacks so that if a feature or style doesn't work in a browser, the site will be able to downgrade to something less exciting that still provides an acceptable user experience — the core in
formation is still accessible, for example, even if it doesn't look quite as nice. the aim is to build up a chart of browsers/devices you can refer to as you test. you can make this as simple or as complex as you like — for example a common approach is to have multiple grades of support level, something like: a grade: common/modern browsers — known to be capable. test thoroughly and provide fu...
... test. you can make this as simple or as complex as you like — for example a common approach is to have multiple grades of support level, something like: a grade: common/modern browsers — known to be capable. test thoroughly and provide full support. b grade: older/less capable browsers — known not to be capable. test, and provide a more basic experience that gives full access to core in
formation and services. c grade: rare/unknown browsers — don't test, but assume they are capable. serve the full site, which should work, at least with the fallbacks provided by our defensive coding. throughout the following sections, we'll build up a support chart in this
format. note: yahoo first made this approach popular, with their graded browser support approach. educated guesses you c...
... for example, if you live in western europe or north america, you will know that a lot of people use windows and mac desktops/laptops, where the main browsers are chrome, firefox, safari, ie, and edge. you probably want to just test the latest versions of the first three, as these browsers receive regular updates. ...
...And 8 more matches
SVG Guidelines
for example, consider an image of a path with a gradient fill. ...
...for example, consider an image of a path with a gradient fill. ...
...for example, consider an image of a path with a gradient fill. ...
...And 8 more matches
Experimental features in Firefox
in order to test new features, mozilla publishes a test version of the firefox browser, firefox nightly, every day. these nightly builds of firefox typically include experimental or partially-implemented features, including those for proposed or cutting-edge web plat
form standards. this page lists features that are in nightly versions of firefox along with in
formation on how to activate them, if necessary. you can test your web sites and applications before these features get released and ensure everything will still work with the latest web technology capabilities. to test these experimental features, you need to download firefox nightly or firefox developer edition. which you need is described alongside each feature's description below. editor's note: when adding features to these table...
...ted as per the whatwg spec (bug 1509527), but we still need to make other changes too, like making it available on contenteditable content. see also bug 1205133 for details. release channel version added enabled by default? nightly 75 yes developer edition 75 no beta 75 no release 75 no preference name dom.
forms.inputmode <link rel="preload"> the <link> element's rel attribute is intended to help provide per
formance gains by letting you download resources earlier in the page lifecycle, ensuring that they're available earlier and are less likely to block page rendering. read preloading content with rel="preload" for more details. for more details on the status of this feature, see bug 1639607. ...
... see bug 1099557 for more details. release channel version added enabled by default? nightly 43 yes developer edition 43 no beta 43 no release 43 no preference name layout.css.control-characters.enabled or layout.css.cont...
...And 8 more matches
Firefox and the "about" protocol
there is a lot of useful in
formation about firefox hidden away behind the about: url protocol. the most useful is the url about:config, which displays preferences and settings that can be inspected and changed. available about: urls depend on your specific firefox version. ...
...cted and changed. available about: urls depend on your specific firefox version. ...
...ic firefox version. here is a complete list of urls in the about: pseudo protocol: about: page description about:about provides an overview of all about: pages available for your current firefox version about:addons add-ons manager about:buildconfig displays the configuration and plat
form used to build firefox about:cache displays in
formation about the memory, disk, and appcache about:checkerboard switches to the checkerboarding measurement page, which allows to detect checkerboarding issues about:config provides a way to inspect and change firefox preferences and settings about:compat lists overriding site compatability fixes, linked to specific bug issues. about:crashes lists all ...
...And 8 more matches
Leak-hunting strategies and tips
use with caution. strategy for finding leaks when trying to make a particular testcase not leak, i recommend focusing first on the largest object graphs (since these entrain many smaller objects), then on smaller reference-counted object graphs, and then on any remaining individual objects or small object graphs that don't entrain other objects. ...
...r trace-malloc or lsan or valgrind to find the leaks of smaller graphs of objects. (when i refer to the size of a graph of objects, i'm referring to the number of objects, not the size in bytes. ...
... referring to the number of objects, not the size in bytes. ...
...And 8 more matches
A guide to searching crash reports
stats site provides facilities for investigating large numbers of firefox crash reports. this guide to searching through crash reports may help you locate the crash reports that will help you find and fix the firefox bug you're working on. ...
... the crash reports database by over 100 criteria: crash signature, date, plat
form, product, version, etc. grouping you can cluster the results of each search into groups using the same criteria. to achieve full power and flexibility requires a good understanding of both of these functions. search is easy to understand, but the grouping capabilities are easy to overlook. searching the search
form you can get to the search page by clicking on the "super search" link near the toolbar at the top right of any page in crash-stats. this brings up a search
form like the one in the following screenshot. fields are provided for four common search criteria: product, version, plat
form, and process type. the product field is pre-populated with "firefox" because that is a common case. as the fine ...
...1.3 million crash reports matching this search. you can reorder the groups in various ways by clicking on the column headers. the links within the results do the following things. the first link in each "signature" column cell links to a signature report, which contains additional details about crash reports with that signature. the "add term" link in each "signature" column cell lets you per
form a narrower subsequent search among crash reports with that signature. the links in each "bugs" column cell link to bug reports in bugzilla. the default search: crash reports if you switch to the "crash reports" tab you will see results like the ones in the following screenshot. this is a list of all the individual crash reports that match the search criteria. if the number of matches is la...
...And 8 more matches
Parser API
this makes it easier to write tools in javascript that manipulate javascript source programs, such as syntax highlighters, static analyses, translators, compilers, obfuscators, etc. note: this page describes spidermonkey-specific behavior and might be incomplete. visit estree spec for a community ast standard that includes latest ecmascript features and is backward-compatible with spidermonkey
format. 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.
...erces src to a string and parses the result as a javascript program. by default, the parsing returns a program object (see below) representing the parsed abstract syntax tree (ast). ...
... of the following properties: loc boolean default: true when loc is true, the parser includes source location in
formation in the returned ast nodes. source string default: null a description of the input source; typically a filename, path, or url. this string is not meaningful to the parsing process, but is produced as part of the source location in
formation in the returned ast nodes. line number default: 1 the initial line number to use for source location in
formation. builder builder default: null a builder object, which can be used to produce ast nodes in custom data
formats. the expected callback methods are described under builder objects. target string default: script ...
...And 8 more matches
Mozilla Projects
ing clang, or from another language) and compiles that into javascript, which can be run on the web. firefox sync firefox sync synchronizes state and configuration data used by the browser, such as bookmarks, history, preferences, bookmarks, and so forth among all your devices. jshydra jshydra is a static analysis tool that is capable of per
forming analysis of general javascript code. l20n l20n lets localizers reach higher levels of free linguistic expression by sharpening the divide between localization and application logic. leak monitor leak monitor is a firefox extension by l. david baron that helps extension and chrome developers to find memory leaks. it will pop-u...
... bound to break, for details see this post. mozilla calls mccoy a "simple system" which is a clear sign that something probably is not working, and indeed, is not. mccoy is an application that allows add-on authors to provide secure updates to their users. applications periodically look for and install updates to their add-ons. it's important that the update in
formation retrieved has not been tampered with since being written by the add-on author. specifically, it focuses on the process of digitally signing update manifests so the applications can verify the integrity of a manifest retrieved over normally insecure channels. midas midas is the code name for gecko's built-in rich text edit...
... internet explorer also supports the ability to edit specific elements using the contenteditable attribute; starting with firefox 3, gecko also supports contenteditable. once midas is invoked, a few more methods of the document object become available. mozinfo throughout mozmill and other mozilla python code, checking the underlying plat
form is done in many different ways. the various checks needed lead to a lot of copy+pasting, leaving the reader to wonder....is this specific check necessary for (e.g.) an operating system? because in
formation is not consolidated, checks are not done consistently, nor is it defined what we are checking for. necko necko is a network library th...
...And 8 more matches
AT APIs Support
ress still. but in the meantime it more up-to-date and contains more details than existed analogues for at-spi and msaa this documentation explains how makers of screen readers, voice dictation packages, onscreen keyboards, magnification software and other assitive technologies can support gecko-based software. we provide for them the support of these products on windows, linux/unix and os x plat
forms. accessible gecko gecko is a rendering engine that firefox, seamonkey, netscape and yelp use. gecko can render a variety of content, not just html and supports key web standards such as cascading style sheets, javascript and the w3c dom. gecko also handles the users keystrokes and mouse clicks. gecko is the core architecture that we are adding accessibility to, in order to support basic access...
... all applications that are based on it. gecko based applications gecko can be used in two ways to create application: embedded clients embedded clients use gecko only in the content window, at the moment for html and generic xml only. they typically use standard windows controls for their user interface -- the area outside of the client content window, plus the context menu. ...
...rea outside of the client content window, plus the context menu. on windows plat
form mfcembed testing client - this is a very simple package, great for testing basic html accessibility with your products and the gecko rendering engine (please contact us for a copy). k-meleon - light, ultra-fast and more advanced (fully configurable) gecko-based web browser available on the windows plat
form on linux/unix plat
form yelp help viewer - the help viewer in gnome evolution email - provides integrated mail, addressbook and calendaring functionality to users of the gnome desktop. ...
...And 8 more matches
Work with animations - Firefox Developer Tools
operty transitioned, and it is labeled with the name of the property being transitioned. if the animation used css @keyframes, there is one bar for each animation, labeled with its name. if the animation or transition had a delay, this is shown as a cross-hatched portion of the bar. delay and enddelay are both represented. ...
...if you hover over this selector, the element is highlighted in the page. click the selector to select the element in the inspector. to the left of the selector is a "target" icon (). ...
...e element in the inspector. to the left of the selector is a "target" icon (). clicking this icon locks the highlighter on the element. animation details if you click one of the bars, you'll see details of all the properties that were changed in the animation. for example, try clicking on the bar for img#icon's animation: this is telling us that two properties were modified: filter and trans
form. each dot represents an entry for that property in the set of keyframes used for the animation. both properties were initialized at 0ms and finalized at 750ms. filter was given a value at 250ms and trans
form at 500ms. if you hover over a dot, you'll see the value assigned to that property at that point in the timeline: this is essentially a visual representation of the animation's keyframes: ...
...And 8 more matches
Background Tasks API - Web APIs
tremely busy chunk of code, and your main javascript code may run right inside this thread along with all of this. certainly most if not all code that is capable of making changes to the dom is running in the main thread, since it's common for user interface changes to only be available to the main thread. because event handling and screen updates are two of the most obvious ways users notice per
formance issues, it's important for your code to be a good citizen of the web and help to prevent stalls in the execution of the event loop. in the past, there's been no way to do this reliably other than by writing code that's as efficient as possible and by offloading as much work as possible to workers. window.requestidlecallback() makes it possible to become actively engaged in helping to ensure t...
... how much time it can safely use without causing the system to lag. if you stay within the limit given, you can make the user's experience much better. getting the most out of idle callbacks because idle callbacks are intended to give your code a way to cooperate with the event loop to ensure that the system is utilized to its full potential without over-tasking it, resulting in lag or other per
formance problems, you should be thoughtful about how you go about using them. use idle callbacks for tasks which don't have high priority. because you don't know how many callbacks have been established, and you don't know how busy the user's system is, you don't know how often your callback will be run (unless you specify a timeout. there's no guarantee that every pass through the event loop (or ...
...t would invoke the handler for that promise's resolution or rejection as soon as your callback returns. use timeouts when you need to, but only when you need to. using timeouts can ensure that your code runs in a timely manner, but it can also allow you to cause lag or animation stutters by mandating that the browser call you when there's not enough time left for you to run without disrupting per
formance. falling back to settimeout because the background tasks api is fairly new, your code may need to be able to work on browsers that don't yet support it. you can do so with a simple shim that uses settimeout() as a fallback option. this isn't a polyfill, since it's not functionally identical; settimeout() doesn't let you make use of idle periods, but instead runs your code when possible, le...
...And 8 more matches
Using files from web applications - Web APIs
o possible (but not mandatory) to access the filelist through the change event. you need to use eventtarget.addeventlistener() to add the change event listener, like this: const inputelement = document.getelementbyid("input"); inputelement.addeventlistener("change", handlefiles, false); function handlefiles() { const filelist = this.files; /* now you can work with the file list */ } getting in
formation about selected file(s) the filelist object provided by the dom lists all of the files selected by the user, each specified as a file object. you can determine how many files the user selected by checking the value of the file list's length attribute: const numfiles = filelist.length; individual file objects can be retrieved by simply accessing the list as an array: for (let i = 0, numfil...
...ue of the file list's length attribute: const numfiles = filelist.length; individual file objects can be retrieved by simply accessing the list as an array: for (let i = 0, numfiles = filelist.length; i < numfiles; i++) { const file = filelist[i]; // ... } this loop iterates over all the files in the file list. there are three attributes provided by the file object that contain useful in
formation about the file. name the file's name as a read-only string. this is just the file name, and does not include any path in
formation. size the size of the file in bytes as a read-only 64-bit integer. type the mime type of the file as a read-only string or "" if the type couldn't be determined. example: showing file(s) size the following example shows a possible use of the size proper...
...t include any path in
formation. size the size of the file in bytes as a read-only 64-bit integer. type the mime type of the file as a read-only string or "" if the type couldn't be determined. ...
...And 8 more matches
HTMLButtonElement - Web APIs
properties inherits properties from its parent, htmlelement. htmlbuttonelement.accesskey is a domstring indicating the single-character keyboard key to give access to the button. htmlbuttonelement.autofocus is a boolean indicating whether or not the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. ...
...an indicating whether or not the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. only one
form-associated element in a document can have this attribute specified. htmlbuttonelement.disabled is a boolean indicating whether or not the control is disabled, meaning that it does not accept any clicks. htmlbuttonelement.
form read only is a html
formelement reflecting the
form that this button is associated with. if the button is a descendant of a
form element, then this attribute is the id of that
form element. ...
...cified. htmlbuttonelement.disabled is a boolean indicating whether or not the control is disabled, meaning that it does not accept any clicks. htmlbuttonelement.
form read only is a html
formelement reflecting the
form that this button is associated with. if the button is a descendant of a
form element, then this attribute is the id of that
form element. if the button is not a descendant of a
form element, then the attribute can be the id of any
form element in the same document it is related to, or the null value if none matches. ...
...And 8 more matches
HTMLInputElement - Web APIs
ect x="331" y="65" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlinputelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties properties related to the parent
form form read only html
formelement object: returns a reference to the parent <
form> element.
formaction string: returns / sets the element's
formaction attribute, containing the uri of a program that processes in
formation submitted by the element. this overrides the action attribute of the parent
form.
formenctype string: returns / sets the element's
formenctyp...
...ence to the parent <
form> element.
formaction string: returns / sets the element's
formaction attribute, containing the uri of a program that processes in
formation submitted by the element. this overrides the action attribute of the parent
form.
formenctype string: returns / sets the element's
formenctype attribute, containing the type of content that is used to submit the
form to the server. this overrides the enctype attribute of the parent
form.
formmethod string: returns / sets the element's
formmethod attribute, containing the http method that the browser uses to submit the
form. this overrides the method attribute of the parent
form. ...
...urns / sets the element's
formenctype attribute, containing the type of content that is used to submit the
form to the server. this overrides the enctype attribute of the parent
form.
formmethod string: returns / sets the element's
formmethod attribute, containing the http method that the browser uses to submit the
form. this overrides the method attribute of the parent
form.
formnovalidate boolean: returns / sets the element's
formnovalidate attribute, indicating that the
form is not to be validated when it is submitted. this overrides the novalidate attribute of the parent
form. ...
...And 8 more matches
UIEvent.pageY - Web APIs
hole document. syntax var pagey = event.pagey; pagey is an integer value in pixels for the y-coordinate of the mouse pointer, relative to the whole document, when the mouse event fired. this property takes into account any vertical scrolling of the page. ...
...syntax var pagey = event.pagey; pagey is an integer value in pixels for the y-coordinate of the mouse pointer, relative to the whole document, when the mouse event fired. this property takes into account any vertical scrolling of the page. ...
... var pagey = event.pagey; pagey is an integer value in pixels for the y-coordinate of the mouse pointer, relative to the whole document, when the mouse event fired. this property takes into account any vertical scrolling of the page. ...
...And 8 more matches
Using the Web Speech API - Web APIs
nitionevent || webkitspeechrecognitionevent the grammar the next part of our code defines the grammar we want our app to recognise. the following variable is defined to hold our grammar: var colors = [ 'aqua' , 'azure' , 'beige', 'bisque', 'black', 'blue', 'brown', 'chocolate', 'coral' ... ]; var grammar = '#jsgf v1.0; grammar colors; public <color> = ' + colors.join(' | ') + ' ;' the grammar
format used is jspeech grammar
format (jsgf) — you can find a lot more about it at the previous link to its spec. however, for now let's just run through it quickly: the lines are separated by semi-colons, just like in javascript. the first line — #jsgf v1.0; — states the
format and version used. this always needs to be included first. the second line indicates a type of term that we want t...
...s.innerhtml = 'tap/click then say a color to change the background color of the app. ...
...s — plus a number of closely-related interfaces for representing text to be synthesised (known as utterances), voices to be used for the utterance, etc. again, most oses have some kind of speech synthesis system, which will be used by the api for this task as available. demo to show simple usage of web speech synthesis, we've provided a demo called speak easy synthesis. this includes a set of
form controls for entering text to be synthesised, and setting the pitch, rate, and voice to use when the text is uttered. after you have entered your text, you can press enter/return to hear it spoken. to run the demo, you can clone (or directly download) the github repo it is part of, open the html index file in a supporting desktop browser, or navigate to the live demo url in a supporting mobile...
...And 8 more matches
Web APIs
ent apiddomeencoding apiencrypted media extensionsffetch apifile system api frame timing apifullscreen apiggamepad api geolocation apihhtml drag and drop apihigh resolution timehistory apiiimage capture apiindexeddbintersection observer apillong tasks api mmedia capabilities api media capture and streamsmedia session apimedia source extensions mediastream recordingnnavigation timingnetwork in
formation api ppage visibility apipayment request apiper
formance apiper
formance timeline apipermissions apipointer eventspointer lock apiproximity events 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 notific...
...vent extendablemessageevent f featurepolicy federatedcredential fetchevent file fileentrysync fileerror fileexception filelist filereader filereadersync filerequest filesystem filesystemdirectoryentry filesystemdirectoryreader filesystementry filesystementrysync filesystemfileentry filesystemflags filesystemsync focusevent fontface fontfaceset fontfacesetloadevent
formdata
formdataentryvalue
formdataevent fullscreenoptions g gainnode gamepad gamepadbutton gamepadevent gamepadhapticactuator geolocation geolocationcoordinates geolocationposition geolocationpositionerror geometryutils gestureevent globaleventhandlers gyroscope h htmlanchorelement htmlareaelement htmlaudioelement htmlbrelement htmlbaseelement htmlbasefontelement htmlbodyelement htmlbutt...
...lers gyroscope h htmlanchorelement htmlareaelement htmlaudioelement htmlbrelement htmlbaseelement htmlbasefontelement htmlbodyelement htmlbuttonelement htmlcanvaselement htmlcollection htmlcontentelement htmldlistelement htmldataelement htmldatalistelement htmldetailselement htmldialogelement htmldivelement htmldocument htmlelement htmlembedelement htmlfieldsetelement htmlfontelement html
formcontrolscollection html
formelement htmlframesetelement htmlhrelement htmlheadelement htmlheadingelement htmlhtmlelement htmlhyperlinkelementutils htmliframeelement htmlimageelement htmlinputelement htmlisindexelement htmlkeygenelement htmllielement htmllabelelement htmllegendelement htmllinkelement htmlmapelement htmlmarqueeelement htmlmediaelement htmlmenuelement htmlmenuitemelement h...
...And 8 more matches
Text labels and names - Accessibility
failure to do so makes an image map hard to use for users of assistive technology — they need alternative text to be able to understand the purpose of an image. examples the following example show a simple image map (taken from h24: providing text alternatives for the area elements of image maps): <img src="welcome.gif" usemap="#map1" alt="areas in the library. select an area for more in
formation on that area." /> <map id="map1" name="map1"> <area shape="rect" coords="0,0,30,30" href="reference.html" alt="reference" /> <area shape="rect" coords="34,34,100,100" href="media.html" alt="audio visual lab" /> </map> see the <area> element reference page for a live interactive example. see also <area> h24: providing text alternatives for the area elements of image maps d...
...process. examples the title for the reference article about the <title> element is as follows: <title><title>: the document title element - html: hypertext markup language</title> another example might look like so: <title>fill in your details to register — mygov services</title> to help the user, you can update the page title value to reflect significant page state changes (such as
form validation problems): <title>2 errors — fill in your details to register — mygov services</title> see also <title> embedded content must be labeled make sure that elements that embed content have a title attribute that describes the embedded content. this includes the <embed> and <object> elements. these elements are often used for graphical content, much like the <img> element. a de...
...rance of the image; the <figcaption> describes it from a functional perspective (in this case, the latin name of the flower in the image). <figure> <img src="milkweed.jgp" alt="black and white close-up photo of milkweed flowers"> <figcaption>asclepias verticillata</figcaption> </figure> fieldset elements must be labeled fieldset elements must have a text description, similar to other
form elements. use the <legend> element to describe the purpose of a fieldset. use a legend to label a fieldset when grouping a set of
form elements together with a <fieldset> element, you should include a nested <legend> element inside it, containing a clear description of the group. users of assistive technology find this description helpful when trying to work out the overall purpose of the grou...
...And 8 more matches
matrix3d() - CSS: Cascading Style Sheets
the matrix3d() css function defines a 3d trans
formation as a 4x4 homogeneous matrix. its result is a <trans
form-function> data type. syntax the matrix3d() function is specified with 16 values. they are described in the column-major order. matrix3d(a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4) values a1 b1 c1 d1 a2 b2 c2 d2 a3 b3 c3 d3 are <number>s describing the linear trans
formation. a4 b4 c4 d4 are <number>s describing the translation to apply. note: until firefox 16, gecko accepted a <length> value for a4, b4 and c4. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 this trans
formation applies to the 3d space and can't be represented on the plane. ...
...re <number>s describing the translation to apply. note: until firefox 16, gecko accepted a <length> value for a4, b4 and c4. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 this trans
formation applies to the 3d space and can't be represented on the plane. a generic 3d affine trans
formation can't be represented using a cartesian-coordinate matrix, as translations are not linear trans
formations. a1a2a3a4b1b2b3b4c1c2c3c4d1d2d3d4 examples cube squashing example the following example shows a 3d cube created from dom elements and trans
forms, which can be hovered/focused to apply a matrix3d() trans
form to it. html <section id="example-element" tabindex="0"> <div cla...
...s, which can be hovered/focused to apply a matrix3d() trans
form to it. ...
...And 8 more matches
Live streaming web audio and video - Developer guides
her it be an mp3 or webm file. this file sits on a server and can be delivered — like most other files — to the browser. this is often known as a progressive download. live streamed media lacks a finite start and end time as rather than a static file, it is a stream of data that the server passes on down the line to the browser and is often adaptive (see below). usually, we require different
formats and special server-side software to achieve this. adaptive streaming one of the main priorities for live streaming is to keep the player synchronized with the stream: adaptive streaming is a technique for doing this in the case of low bandwidth. the idea is that the data transfer rate is monitored and if it looks like it's not keeping up, we drop down to a lower bandwidth (and consequently l...
...ng one of the main priorities for live streaming is to keep the player synchronized with the stream: adaptive streaming is a technique for doing this in the case of low bandwidth. the idea is that the data transfer rate is monitored and if it looks like it's not keeping up, we drop down to a lower bandwidth (and consequently lower quality) stream. in order to have this capability, we need to use
formats that facilitate this. live streaming
formats generally allow adaptive streaming by breaking streams into a series of small segments and making those segments available at different qualities and bit rates. streaming audio and video on demand streaming technology is not used exclusively for live streams. it can also be used instead of the traditional progressive download method for audio and ...
...ser currently supports anything other than http without requiring plugins, although this looks set to change. protocols other than http may also be subject to blocking from firewalls or proxy servers. using streaming protocols the process of using the various protocols is reassuringly familiar if you are used to working with media over http. for example: <video src="rtsp://myhost.com/mymedia.
format"> <!-- fallback here --> </video> media source extensions (mse) media source extensions is a w3c working draft that plans to extend htmlmediaelement to allow javascript to generate media streams for playback. allowing javascript to generate streams facilitates a variety of use cases like adaptive streaming and time shifting live streams. for example, you could implement mpeg-dash using jav...
...And 8 more matches
The HTML autocomplete attribute - HTML: Hypertext Markup Language
the html autocomplete attribute is available on <input> elements that take a text or numeric value as input, <textarea> elements, <select> elements, and <
form> elements. 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 in
formation expected in the field. the source of the suggested values is generally up to the browser; typically values come from past values entered by the user, but they may also come from pre-configured values. ...
...ected in the field. the source of the suggested values is generally up to the browser; typically values come from past values entered by the user, but they may also come from pre-configured values. for instance, a browser might let the user save their name, address, phone number, and email addresses for autocomplete purposes. ...
...ce, a browser might let the user save their name, address, phone number, and email addresses for autocomplete purposes. perhaps the browser offers the ability to save encrypted credit card in
formation, for autocompletion following an authentication procedure. if an <input>, <select> or <textarea> element has no autocomplete attribute, then browsers use the autocomplete attribute of the element's
form owner, which is either the <
form> element that the element is a descendant of, or the <
form> whose id is specified by the
form attribute of the element. ...
...And 8 more matches
<input type="checkbox"> - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
.... events change and input supported common attributes checked idl attributes checked, indeterminate and value methods select() value a domstring representing the value of the checkbox. this is never seen on the client-side, but on the server this is the value given to the data submitted with the checkbox's name. take the following example: <
form> <div> <input type="checkbox" id="subscribenews" name="subscribe" value="newsletter"> <label for="subscribenews">subscribe to newsletter?</label> </div> <div> <button type="submit">subscribe</button> </div> </
form> in this example, we've got a name of subscribe, and a value of newsletter. when the
form is submitted, the data name/value pair will be subscribe=newsletter. if...
...And 8 more matches
<input type="password"> - HTML: Hypertext Markup Language
ll request. 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. note: any
forms involving sensitive in
formation like passwords (e.g. login
forms) should be served over https; many browsers now implement mechanisms to warn against insecure login
forms; see insecure passwords. value a domstring representing a password, or empty events change and input supported common attributes autocomplete, inputmode, maxlength, minlength, pattern, plac...
...trol being used to enter the password. if the user hasn't entered anything yet, this value is an empty string (""). if the required property is specified, then the password edit box must contain a value other than an empty string to be valid. if the pattern attribute is specified, the content of a password control is only considered valid if the value passes validation; see validation for more in
formation. note: the line feed (u+000a) and carriage return (u+000d) characters are not permitted in a password value. when setting the value of a password control, line feed and carriage return characters are stripped out of the value. additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, password field inputs support the following att...
...that valid passwords using a wide assortment of character classes are selected and used by your users. with a pattern, you can mandate case rules, require the use of some number of digits and/or punctuation characters, and so forth. see the section validation for details and an example. ...
...And 8 more matches
Browser detection using the user agent - HTTP
syntax error in // browsers that do not support look-behind expressions // because all browsers parse the entire script, including // sections of the code that are never executed. ...
...ically change the width and height of their screen by flipping their tablet on its side! so, user agent sniffing is definitely not the way to go. thankfully, there are much better alternatives. use navigator.maxtouchpoints to detect if the user's device has a touchscreen. then, default back to checking the user agent screen only if (!("maxtouchpoints" in navigator)) { /*code here*/}. using this in
formation of whether the device has a touchscreen, do not change the entire layout of the website just for touch devices: you will only create more work and maintenance for yourself. rather, add in touch conveniences such as bigger, more easily clickable buttons (you can do this using css by simply increasing the font size). here is an example of code that increases the padding of #examplebutton to 1e...
...|iemobile)\b/i.test(ua) || /\b(android|windows phone|ipad|ipod)\b/i.test(ua) ); } } if (hastouchscreen) document.getelementbyid("examplebutton").style.padding="1em"; as for the screen size, simply use window.innerwidth and window.addeventlistener("resize", function(){ /*refresh screen size dependent things*/ }). what you want to do for screen size is not slash off in
formation on smaller screens. that will only annoy people because it will force them to use the desktop version. rather, try to have fewer columns of in
formation in a longer page on smaller screens while having more columns with a shorter page on larger screen sizes. this effect can be easily achieved using css flexboxes, sometimes with floats as a partial fallback. also try to move less relevant/imp...
...And 8 more matches
HTTP Public Key Pinning (HPKP) - HTTP
browsers and is no longer supported. to ensure the authenticity of a server's public key used in tls sessions, this public key is wrapped into a x.509 certificate which is usually signed by a certificate authority (ca). web clients such as browsers trust a lot of these cas, which can all create certificates for arbitrary domain names. if an attacker is able to compromise a single ca, they can per
form mitm attacks on various tls connections. hpkp can circumvent this threat for the https protocol by telling the client which public key belongs to a certain web server. hpkp is a trust on first use (tofu) technique. the first time a web server tells a client via a special http header which public keys belong to it, the client stores this in
formation for a given period of time. when the client vis...
...o imported custom root certificates all pinning violations are ignored. enabling hpkp to enable this feature for your site, you need to return the public-key-pins http header when your site is accessed over https: public-key-pins: pin-sha256="base64=="; max-age=expiretime [; includesubdomains][; report-uri="reporturi"] pin-sha256 the quoted string is the base64 encoded subject public key in
formation (spki) fingerprint. it is possible to specify multiple pins for different public keys. some browsers might allow other hashing algorithms than sha-256 in the future. see below on how to extract this in
formation out of a certificate or key file. max-age the time, in seconds, that the browser should remember that this site is only to be accessed using one of the defined keys. includesubdoma...
...port-uri optional if this optional parameter is specified, pin validation failures are reported to the given url. note: the current specification requires including a second pin for a backup key which isn't yet used in production. this allows for changing the server's public key without breaking accessibility for clients that have already noted the pins. ...
...And 8 more matches
Regular expressions - JavaScript
ressions. creating a regular expression you construct a regular expression in one of two ways: using a regular expression literal, which consists of a pattern enclosed between slashes, as follows: let re = /ab+c/; regular expression literals provide compilation of the regular expression when the script is loaded. if the regular expression remains constant, using this can improve per
formance. or calling the constructor function of the regexp object, as follows: let re = new regexp('ab+c'); using the constructor function provides runtime compilation of the regular expression. use the constructor function when you know the regular expression pattern will be changing, or you don't know the pattern and are getting it from another source, such as user input. writing a...
...attern a regular expression pattern is composed of simple characters, such as /abc/, or a combination of simple and special characters, such as /ab*c/ or /chapter (\d+)\.\d*/. the last example includes parentheses, which are used as a memory device. the match made with this part of the pattern is remembered for later use, as described in using groups. note: if you are already familiar with the
forms of a regular expression, you may also read the cheatsheet for a quick lookup for a specific pattern/construct. using simple patterns simple patterns are constructed of characters for which you want to find a direct match. for example, the pattern /abc/ matches character combinations in strings only when the exact sequence "abc" occurs (all characters together and in that order). such a match ...
...exp("a\\*b") create the same expression, which searches for "a" followed by a literal "*" followed by "b". if escape strings are not already part of your pattern you can add them using string.replace: function escaperegexp(string) { return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string } the "g" after the regular expression is an option or flag that per
forms a global search, looking in the whole string and returning all matches. it is explained in detail below in advanced searching with flags. why isn't this built into javascript? there is a proposal to add such a function to regexp, but it was rejected by tc39. using parentheses parentheses around any part of the regular expression pattern causes that part of the matched substring to be remember...
...And 8 more matches
2015 MDN Fellowship Program - Archive of obsolete content
announcing the mdn fellows! blog post, may 14 2015. mdn fellows successfully oriented blog post, july 6 2015. mdn fellows: what they did & what’s next blog post, september 23, 2015. 2015 mdn fellowship program launching in q1 2015, the mozilla developer fellowship intends to accelerate the involvement of highly-skilled and experienced web developers with the open web. ...
...n established track record of contributions and expertise in a specific web technology, function or domain who wish to increase the effectiveness of their teaching and communications. what seven weeks of partnering closely with mozilla to (1) build curriculum, code, or likely both; and (2) receive coaching, training and best practices for effectively communicating and educating with technical in
formation. we expect this to be between 5-10 hours of your time per week. specific projects (we encourage you to target one of these in your application): testthewebforward brief project description mozilla participates in an important w3c open testing initiative, testthewebforward.com. to support our efforts, the fellow will review various technical specifications to identify gaps between the d...
...en the documentation and current situation and refine existing tests to adapt to this cross-browser test harness. activities and deliverables identify gaps between existing documentation and current development environments. the work would entail refining existing tests to adapt to this framework. required skills and experience experience and comfort writing javascript test scripts. mentor in
formation josh matthews, mozilla plat
form group. github: jdm twitter: @lastontheboat service workers brief project description service workers essentially act as proxy servers that sit between web applications, the browser and (when available) the network. they enable the creation of effective offline experiences and wiill also allow access to push notifications and background sync apis. act...
...And 7 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
wealth of material on creating extensions for firefox. all of these documents currently assume, however, that you are developing your extension using xul and javascript only. for complex extensions, it may be necessary to create components in c++ that provide additional functionality. reasons why you might want to include c++ components in your extension include: need for high-per
formance beyond what can be delivered by javascript code. use of third-party libraries written in c or c++. use of mozilla interfaces that are not exposed via xpcom (e.g. nspr). note: with the modern jit javascript engine in gecko and js-ctypes more extension code can be written only in javascript than ever before. please consider all of your options carefully before de...
...u might want to take a look at this guide instead. on the other hand, if you are an experienced developer or team, and you know that you are going to build a large, complex extension, you would do well to consider the approach described in this article. one final note: i've only tried these techniques inside firefox, but they'll probably work more or less unchanged on other gecko-based plat
forms like thunderbird or seamonkey. if someone can confirm this and/or provide guidelines for what's different, i'll update the article to incorporate this in
formation. bambi meets mozilla none of this is for the faint of heart. in particular, the initial step involves building mozilla, which is a huge - nay, gargantuan! - project. many intelligent developers have been driven to the bri...
... bambi meets mozilla none of this is for the faint of heart. in particular, the initial step involves building mozilla, which is a huge - nay, gargantuan! - project. many intelligent developers have been driven to the brink of insanity trying to build it for the first time. if you're not an experienced c++ developer, i wouldn't even bother. stick to javascript. on windows plat
forms the first time i built mozilla i used this guide. i can't even remember why anymore, but i got stuck in a number of places, and the whole affair ended up taking far longer than i originally expected. much furniture was smashed, much hair torn out by the roots. here's a comprehensive looking guide that's gotten good reviews. follow every step methodically and you'll probably be alright. fo...
...And 7 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
s originally published in japanese for the firefox developers conference summer 2007. mr. shimoda is a co-author of firefox 3 hacks (o'reilly japan, 2008). this chapter explains how to use xpcom to implement advanced processes using only javascript. introduction javascript lacks functions for opening files and character-code conversion, among other things. a different mechanism is needed to per
form these functions. internet explorer handles this using activex; in firefox, we use the cross-plat
form component object model, or xpcom. due to deprecation of enableprivilege this functionality can not be used in web pages. enableprivilege is disabled in firefox 15 and will be removed in firefox 17. about xpcom xpcom is a framework for developing plat
form-independent components. components devel...
... components, and sometimes the components are simply referred to as xpcoms. firefox itself includes a great number of xpcom components, and they can be used in extensions as well. sometimes an extension will be packaged with a special xpcom component developed specifically for it. note: if you're developing components in c++ or other compiled languages, be sure to include binaries for every plat
form. ...
...d languages, be sure to include binaries for every plat
form. reference materials to get an idea of what kinds of functions embedded xpcom can handle, take a look at the api reference and the interface definitions from xpidl in the actual source code. note: interface definition language (idl) is a language for giving standard definitions of objects, methods, and so forth. the xpidl (cross-plat
form idl) used by mozilla is a partial extension to the corba idl. you can per
form a full-text search of the firefox source code in mozilla cross-reference using character strings, filenames, etc as search keys. if you’re having trouble with any of the details of the interface, it is helpful to search on the source code for usage examples within firefox. note: to look at the firefox 3 source code,...
...And 7 more matches
Appendix D: Loading Scripts - Archive of obsolete content
ntages, as well as its own quirks which may trap the unwary. below is an overview of the more common means of loading scripts, along with some of their primary advantages, disadvantages, quirks, and use cases. the examples below which make use of the services global assume that you're previously imported the services.jsm module. as this module only exists on firefox 4 and other gecko 2-based plat
forms, the services in question will have to be manually loaded on other plat
forms. <script> tags xul script tags are traditionally the primary means of loading scripts for extension developers. these tags are generally inserted into xul overlay files or other xul documents, after which they are automatically loaded into the context of the xul window in question and executed immediately and sync...
...de. advantages namespacing: since scripts executed via evalinsandbox run in a defined namespace, global namespace contamination and the resultant extension compatibility issues are not usually a problem. flexibility: the evalinsandbox method accepts several parameters, including the url, line number, and javascript version of the file from which the code being evaluated was extracted. this in
formation is invaluable for debugging, and the flexibility with which it can be specified makes this method useful for extracting javascript from a number of file
formats other than raw javascript scripts. additionally, as sandbox objects can be created with an arbitrary prototype object, the evaluated code can be given access to the global properties of any existing scope. security: sandbox objects ...
...n be augmented or rarified to add or remove privileges as necessary. under ordinary circumstances, native objects passed out of sandboxes are wrapped in xraywrapper objects, which means that only native properties of these objects are directly exposed to privileged code. this behavior can be reversed by setting the wantsxrays parameter to false when constructing the sandbox. disadvantages per
formance: there are several significant per
formance disadvantages inherent in this method: there is currently no way to load code into sandboxes from a cache. this means that code must be compiled and executed anew each time it is loaded, which has a significant overhead for large code bases. in addition to compile time, reading files synchronously from disk has its own overhead, and xmlhttp...
...And 7 more matches
Modularization techniques - Archive of obsolete content
the mechanism we're using is based on the principles laid down by com, so pretty much anything you know about com can be applied here, and any reference on com can provide you with more interesting and complex examples than the ones provided here. the basics interfaces the basic building blocks of modules are c++ pure virtual interfaces. ...
...es between modules that may reside in separate, possibly dynamically loaded, libraries. each interface is assigned a unique interface identifier, or iid. nsisupports the key interface in our model is the nsisupports interface, our equivalent to com's iunknown interface. nsisupports provides two key features, interface interrogation and reference counting. interface interrogation is a simple, uni
form mechanism for determining which interfaces a object supports, and for hiding the the mechanics of how the object was implemented. interface interrogation is per
formed using the queryinterface() method. the caller passes in an id and a pointer to a address to place the resulting interface. if the query is successful, queryinterface() will return ns_ok. if the object does not support the given int...
...an objects reference count generally starts at zero. addref() increments that reference count, and release() decrements it. if a call to release() causes the reference count to hit zero, the object will generally free itself. ...
...And 7 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
. the majority of this api is now deprecated and as of gecko 1.9 no longer available. extension, theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. in particular plugin developers should see how to package a plugin as an extension. xpinstall is a javascript-based installer technology that works across all the plat
forms that mozilla and netscape browsers based on mozilla (such as netscape 7) are deployed. it can be a way to ensure a smooth user-experience when obtaining plugins, without obliging the user to exit the browsing environment to launch a binary installer (the classic setup.exe experience on windows) or obliging the user to restart their browser. for plugin vendors who have already written a native co...
...(e.g. exe) installer, xpinstall can wrap this native installer and run it so that the user never has to leave the browsing environment and click on the exe to run it. this article presents a guideline for improving the plugin installation experience for netscape gecko browsers using xpinstall. a definition of terms xpinstall is an installer technology, and the name itself stands for "cross plat
form install" (hence "xp" -- an abbreviation for "cross plat
form"). an xpinstall package is usually called an xpi package for short (and often pronounced "zippy"). this article is about how you can use xpinstall to install plugins to the browsers that support xpinstall. an xpi package is in fact a zip file with the xpi file extension (e.g. myplugininstaller.xpi), and can be created on windows by utili...
...re, and what messages to feed to the user. you can create an xpinstall file by first zipping all the items you want installed with winzip (create a zip archive) and then renaming it with the xpi file extension instead of the zip file extension. unlike native code installers (for example, files called setup.exe), the programming language for install operations in xpi is javascript. since the file
format that contains the software and the install.js javascript file is a cross-plat
form file (zip) and since javascript is understood by mozilla browsers on all plat
forms, often one single xpi package can be deployed on all plat
forms. this is, in fact, how skins and themes are installed to mozilla browsers, changing their look and feel. this article focuses on how to install plugins. which browsers...
...And 7 more matches
Custom toolbar button - Archive of obsolete content
introduction the technique described here does not involve any hacking. instead, you make your custom button as a self-contained extension in your profile. ...
...x's menu bar, choose view – character encoding – unicode (utf-8). check that the text you typed looks ok with this setting. if your text editor does not support utf-8, search the internet for a better one that you can download. optional tools you can optionally use any image editor to customize the images. you can optionally use a jar tool or zip tool to package your button as a cross-plat
form installable (xpi) for other people to install and use. making a button there are ten easy steps. when you have completed all the steps, you will have a structure like this in your profile directory: the profile directory and the extensions directory already exist. you will add the other directories and files that are shown in the diagram. (other directories and files also exist, but the ...
... a structure like this in your profile directory: the profile directory and the extensions directory already exist. you will add the other directories and files that are shown in the diagram. (other directories and files also exist, but the diagram does not show them.) 1. go to the profile directory that you use for the application, then go to the extensions directory there. note: for in
formation about how to find the profile directory, see: profile folder explanation: the profile directory contains in
formation specific to a user, keeping it separate from the application. if the application is reinstalled or upgraded, in
formation in the profile is not affected. 2. in the extensions directory, create a new directory with the following name. copy the name from here and paste it, to...
...And 7 more matches
Manifest Files - Archive of obsolete content
he following line to it: content tests file:///c:/testfiles/ the file path in that line should point to the directory created above. if you aren't sure what the file path is, open that directory in a browser and copy the url from the address field. that's it! now, all you need to do is add some xul files into that new directory, and you will be able to load them by typing in a chrome url of the
form chrome://tests/content/<filename>. of course, you will need to restart the browser for the changes to take effect. if the file doesn't load, make sure that the file path is correct. the basic syntax of the lines in the manifest file for content packages is: 'content <packagename> <filepath>' the first field 'content' indicates a content package. for themes, 'skin' is used while 'locale' is used f...
... call these overridden versions, but the original built-in versions instead. otherwise, if an extension attempted to call the modified versions, it would likely not work properly, or worse, create a security hole. this flag was added to prevent this problem and should always be used for newer extensions, but is left out for older extensions that might not be compatible with the change. for more in
formation about this feature, see xpcnativewrapper. themes and locales the themes and locales, the syntax is similar as for content packages, but you also need to specify the content package you are providing a theme or locale for. for example: skin browser classic/1.0 jar:classic.jar!/skin/classic/browser/ locale browser en-us jar:en-us.jar!/locale/browser/ for these, the extra field has been added ...
...version number in a special way; the version number is just part of the theme name. the locale is 'en-us'. the chrome urls that these would map to would be chrome://browser/skin and chrome://browser/locale. if you were creating your own theme or locale for the browser, all you need to do is create a manifest file with one of these two lines in it, modified to suit your theme or locale. for more in
formation about themes, see themes. for more in
formation about locales, see localization. our example find files dialog let's create a manifest file for the find files dialog we'll be creating. you can combine all of the three types into a single file if you wish. this may be done when creating an extension such that all of the parts are in one file. we will do this for the find files dialog. creat...
...And 7 more matches
XML - Archive of obsolete content
in order to provide flexibility to you as adesigner of interfaces, xul offers no flexibility to you as acoder. you must be very careful about your syntax, and in particular about these four cardinal rules of xul: all events and attributes must be written in lowercase. unlike html, xul is very sensitive to case. all of the events and attributes -- even the javascript event listeners normally
formatted in the javascript world with uppercase verbs (e.g., onclick, onload) -- must be lowercase or they are invalid. all strings must be double quoted. all of the values for all of the attributes declared in xul are strings. when an attribute is assigned a value (e.g., flex="1" or "onload='dointerestingstartupthing()'") that value must be double-quoted. every xul widget must use close tags...
... javascript world with uppercase verbs (e.g., onclick, onload) -- must be lowercase or they are invalid. all strings must be double quoted. all of the values for all of the attributes declared in xul are strings. when an attribute is assigned a value (e.g., flex="1" or "onload='dointerestingstartupthing()'") that value must be double-quoted. every xul widget must use close tags to be well-
formed. html allows some elements, such as <br> and <hr>, to be neither closed nor matched with a closing element. in xul, elements must either be of the
form <tag></tag> or <tag/> to be valid. for example, <html:img src="box.gif" /> is valid, but <html:img src="box.gif"> is not. all attributes must have a value. xul is made out of xml you don't need to know all about xml in order to use xul, ...
...doesn't have much to say about the data itself. when someone says they are using xml, what they probably mean is that they have used xml to define their own syntax for marking up some data they are interested in. lots of people have created new languages out of xml. mathml and the chemical markup language (cml) are two of the better-known and more widely-used languages, but there are hundreds. in
formation developers create languages particular to their applications, any time they need a very specific way to represent the structure of some data. when we say language, we mean that developers create a set of terms, orlexicon, and a relationship between these terms, or what some people call agrammar. then they insist that their authors use the language to describe the thing it has been created f...
...And 7 more matches
Gecko Compatibility Handbook - Archive of obsolete content
- some inline examples were removed because of technical limitations. they are actually replaced by ''-(example removed)-'' the goal of this handbook is to help you update websites to work with standards-based browsers and properly detect gecko. if you're new to standards, you may find using web standards in your web pages a helpful introduction. gecko is an embeddable browser, developed as part of the mozilla open source project and based on w3 standards rather than the proprietary approaches of the past. ...
...tandard features added. neither internet explorer 4 or netscape navigator 4 support the w3 dom. instead, each browser supports its own proprietary api for manipulating the content, style and position of html elements in a web page. in addition, internet explorer 4 and netscape navigator 4 use completely different methods of embedding third-party software into the browser. gecko is a cross-plat
form browser engine, compatible with a number of windows versions including windows xp, as well as mac and linux. because of gecko's cross-plat
form nature, functionality is generally very much the same on different plat
forms unlike internet explorer for mac and ie for windows, which are very different programs and so may behave quite differently from each other. quick compatibility test if your site...
...3 so you can communicate with the aol client software. this way you can test your site on the aol client from behind your firewall, provided that your network administrators will open these ports. you need to be connected to the internet to test your site on aol; it isn't possible to access your site on a local machine via your lan, without an internet connection. see webmaster@aol for further in
formation. solution quick reference as discussed in mozilla's using web standards in your web pages, coding for cross-browser compatibility requires you write standard markup that gecko-based browsers, netscape 4, and ie browsers can render properly. symptom possible problem solution site works correctly in netscape 6.x but not netscape 7.x or other browsers based upon gecko...
...And 7 more matches
Using the W3C DOM - Archive of obsolete content
some browsers have non-standard properties, such as internet explorer's document.all[], that are not part of the w3c document object model (dom) standards and may cause javascript errors in standards-compliant browsers. the w3c document object model provides interfaces dom elements to scriptable objects. w3c dom standards are well supported by modern browsers, however the standards are moving target so support for newer features should be tested before use. ...
...t, whereas code based on proprietary standards requires much more effort to be compatible with multiple user agents. unsupported dom-related properties the following ie proprietary document object properties are not supported in the w3c document object model: document.layers[] id_attribute_value document.all document.all.id_attribute_value document.all[id_attribute_value] the following
form related properties (originally from internet explorer) are not supported in the w3c document object model:
formname.inputname.value inputname.value
formctrlname document.
forms(0) (note: document.
forms[0] (using square brackets) uses the dom standard
forms collection) scripts that use these properties will throw errors in most standards-compliant browsers. instead, use the w3c dom properti...
...irst element with a matching name or id (id versus name when using getelementbyid, msdn: getelementbyid method). ...
...And 7 more matches
-ms-filter - Archive of obsolete content
re fundamentally incompatible with each other. important: as of windows internet explorer 9 this feature was deprecated. as of internet explorer 10 this feature was removed and should no longer be used. ...
...ction-token> <any-value> ')' the <string> contains the list of filters, transitions, and procedural surfaces. refer to the filters and transitions reference for details. examples the following example shows how to use the -ms-filter attribute in internet explorer 8. ...
...t of filters, transitions, and procedural surfaces. refer to the filters and transitions reference for details. examples the following example shows how to use the -ms-filter attribute in internet explorer 8. ...
...And 7 more matches
Anatomy of a video game - Game development
in to it when it is called. that callback function will be executed at a suitable time before the next repaint. here is an example of a simple main loop: window.main = function () { window.requestanimationframe( main ); // whatever your main loop needs to do }; main(); // start the cycle note: in each of the main() methods discussed here, we schedule a new requestanimationframe before per
forming our loop contents. that is not by accident and it is considered best practice. calling the next requestanimationframe early ensures the browser receives it on time to plan accordingly even if your current frame misses its vsync window. the above chunk of code has two statements. the first statement creates a function as a global variable called main(). this function does some work and also t...
...owser wants to paint. you are given control over each frame of animation. it is also very simple because main() is the only function getting looped. a first person shooter (or a similar game) presents a new scene once every frame. you cannot really get more smooth and responsive than that. but do not immediately assume animations require frame-by-frame control. simple animations can be easily per
formed, even gpu-accelerated, with css animations and other tools included in the browser. there are a lot of them and they will make your life easier. building a better main loop in javascript there are two obvious issues with our previous main loop: main() pollutes the window object (where all global variables are stored) and the example code did not leave us with a way to stop the loop unless the...
...es. the above sections describe main loops which try not to wrestle away control from the browser. these main methods attach themselves to window.requestanimationframe(), which asks the browser for control over the upcoming frame. it is up to the browser how to relate these requests to their main loop. the w3c spec for requestanimationframe does not really define exactly when the browsers must per
form the requestanimationframe callbacks. this can be a benefit because it leaves browser vendors free to experiment with the solutions that they feel are best and tweak it over time. modern versions of firefox and google chrome (and probably others) attempt to connect requestanimationframe callbacks to their main thread at the very beginning of a frame's timeslice. the browser's main thread thus tri...
...And 7 more matches
Fetching data from the server - Learn web development
previous overview: client-side web apis next another very common task in modern websites and applications is retrieving individual data items from the server to update sections of a webpage without having to load an entire new page. this seemingly small detail has had a huge impact on the per
formance and behavior of sites, so in this article, we'll explain the concept and look at technologies that make it possible, such as xmlhttprequest and the fetch api. prerequisites: javascript basics (see first steps, building blocks, javascript objects), the basics of client-side apis objective: to learn how to fetch data from the server and use it to update the contents of a web page. what is the problem here? originally page loading on the web was simple — y...
...nologies that allow web pages to request small chunks of data (such as html, xml, json, or plain text) and display them only when needed, helping to solve the problem described above. this is achieved by using apis like xmlhttprequest or — more recently — the fetch api. these technologies allow web pages to directly handle making http requests for specific resources available on a server and
formatting the resulting data as needed before it is displayed. note: in the early days, this general technique was known as asynchronous javascript and xml (ajax), because it tended to use xmlhttprequest to request xml data. this is normally not the case these days (you'd be more likely to use xmlhttprequest or fetch to request json), but the result is still the same, and the term "ajax" is still o...
...s (you'd be more likely to use xmlhttprequest or fetch to request json), but the result is still the same, and the term "ajax" is still often used to describe the technique. the ajax model involves using a web api as a proxy to more intelligently request data rather than just having the browser reload the entire page. let's think about the significance of this: go to one of your favorite in
formation-rich sites, like amazon, youtube, cnn, etc., and load it. now search for something, like a new product. the main content will change, but most of the surrounding in
formation, like the header, footer, navigation menu, etc., will stay the same. this is a really good thing because: page updates are a lot quicker and you don't have to wait for the page to refresh, meaning that the site fee...
...And 7 more matches
Starting our Svelte Todo list app - Learn web development
k your testing server url you'll see our todos.svelte component being rendered: adding static markup for the moment we will start with a static markup representation of our app, so you can see what it will look like. ...
... todos.svelte --> <div class="todoapp stack-large"> <!-- newtodo --> <
form> <h2 class="label-wrapper"> <label for="todo-0" class="label__lg"> what needs to be done? ...
...y-hidden">show</span> <span>completed</span> <span class="visually-hidden">tasks</span> </button> </div> <!-- todosstatus --> <h2 id="list-heading">2 out of 3 items completed</h2> <!-- 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...
...And 7 more matches
TypeScript support in Svelte - Learn web development
we also had a look at using the transition directive to implement animations on dom elements in svelte. 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. ...
...loper survey it is the third most loved language, right behind rust and python. so typescript is going through a great phase of adoption. typescript's main advantages are: early spotted bugs: the compiler checks types at compile time and provides error reporting. readability: static typing gives the code more structure, making it self-documenting and more readable. rich ide support: type in
formation allows code editors and ides to offer features like code navigation, autocompletion, and smarter hints. safer refactoring: types allows ides to know more about your code, and assist you while refactoring large portions of your code base. type inference: enables you to take advantage of many typescript features even without declaring variable types. availability of new and future javascrip...
...responding import statements (don't include the .ts in your import statements; typescript chose to omit the extensions). note: using typescript in component markup sections is not supported yet. you'll have to use javascript from the markup, and typescript in the <script lang='ts'> section. improved developer experience with typescript typescript provides code editors and ides with lots of in
formation to allow them to deliver a friendlier development experience. we'll use visual studio code to do a quick test and see how we can get autocompletion hints and type-checking as we're writing components. note: if you don't wish to use vs code, we also provide instructions for using typescript error checking from the terminal instead, slightly later on. there is work in progress to support ...
...And 7 more matches
Getting started with Svelte - Learn web development
ding web apps than some of the other frameworks covered in this module. while frameworks like react and vue do the bulk of their work in the user's browser while the app is running, svelte shifts that work into a compile step that happens only when you build your app, producing highly-optimized vanilla javascript. the outcome of this approach is not only smaller application bundles and better per
formance, but also a developer experience that is more approachable for people that have limited experience of the modern tooling ecosystem. svelte sticks closely to the classic web development model of html, css, and js, just adding a few extensions to html and javascript. it arguably has fewer concepts and tools to learn than some of the other framework options. it's main current disadvantages are...
...ower devices: applications built with svelte have smaller bundle sizes, which is ideal for devices with slow network connections and limited processing power. less code means less kb to download, parse, execute, and keep hanging around in memory. highly interactive pages or complex visualizations: if you are building data-visualizations that need to display a large number of dom elements, the per
formance gains that come from a framework with no runtime overhead will ensure that user interactions are snappy and responsive. onboarding people with basic web development knowledge: svelte has a shallow learning curve. web developers with basic html, css, and javascript knowledge can easily grasp svelte specifics in a short time and start building web applications. moreover, with the help of sap...
... requirements in order to work with svelte you need to have node.js installed. it's recommended that you use the long-term support (lts) version. node includes npm (the node package manager), and npx (the node package runner). note that you can also use the yarn package manager in place of npm, but we'll assume you are using npm in this set of tutorials. see package management basics for more in
formation on npm and yarn. if you're using windows, you will need to install some software to give you parity with unix/macos terminal in order to use the terminal commands mentioned in this tutorial. gitbash (which comes as part of the git for windows toolset) or windows subsystem for linux (wsl) are both suitable. cmder is another very good and complete alternative. see command line crash course fo...
...And 7 more matches
Styling Vue components with CSS - Learn web development
cally added to our site. the reset styles should be applied to the app now. the images below show the look of the app before and after the reset is applied. before: after: noticeable changes include the removal of the list bullets, background color changes, and changes to the base button and input styles. adding global styles to single file components now that we've reset our css to be uni
form across browsers, we need to customize the styles a bit more. there are some styles that we want to apply across components in our app. while adding these files directly to the reset.css stylesheet would work, we'll instead add them to the <style> tags in app.vue to demonstrate how this can be used. there are already some styles present in the file. let's remove those and replace them with the st...
...ent in the file. let's remove those and replace them with the styles below. these styles do a few things — adding some styling to buttons and inputs, and customizing the #app element and its children. ...
...now we can go through and begin editing our components to use some of these styles. adding css classes in vue we sh...
...And 7 more matches
Mozilla’s UAAG evaluation report
elf, running on windows 2000, as of february 20, 2002. we are claiming to support html 4, css 2, png, jpg and gif. this evaluation does not cover mailnews or composer. there may be accessibility and customizability features not listed here. a very good resource is the customizing document. when filing mozilla bugs based on uaag requirements, please use bug 24413 as the uaag meta bug. ...
... 1.3 provide text messages. (p1) c status line and alert boxes used to convey messages and alerts guideline 2. ensure user access to all content. checkpoint title status notes/plans checkpoint title status notes/plans 2.1 render content according to specification. (p1) vg renders html, css, and a number of graphic image
formats. does not contradict current specifications for html and css rendering. 2.2 provide text view. (p1) c also known as view source. 2.3 render conditional content. (p1) vg alt for img: rendered when images turned off. see meta bug 41924 for open issues with the alt attribute. title for *any* element: rendered as tooltip longdesc for img element: in context me...
...ride popping up new windows on target=anything: user_pref("browser.target_new_blocked", true); override popup windows at beginning of new page load (blocks most popup advertisements): user_pref("dom.disable_open_during_load", true); 5.4 selection and focus in viewport. (p2) c when focus and/or selection changes they are in the viewport 5.5 confirm
form submission. (p2) p only allows confirmation if the in
formation is not secure? this is also under preferences, security, ssl, "sending
form data from unencrypted page to unencrypted page" 5.6 confirm fee links. (p2) ni no support of fee links 5.7 manual viewport close only. (p3) c just fixed! see bug 32571 for more in
formation. guideline 6. implem...
...And 7 more matches
What to do and what not to do in Bugzilla
nts and the email to contact. if you need faster access to get canconfirm or editbugs, especially in order to triage bugs or to participate in a bug day, then you can ask in #bmo on irc, or you may create a bug requesting permissions. include a link to your bugzilla activity page in the bug description. ...
...to triage bugs or to participate in a bug day, then you can ask in #bmo on irc, or you may create a bug requesting permissions. include a link to your bugzilla activity page in the bug description. before you have canconfirm, you can still do good triaging by leaving comments with useful in
formation on the bug that will help to confirm it. the same is true for editbugs: leave comments with the in
formation you'd like to be able to edit into the bug, and that will help you get the editbugs permissions quickly. canconfirm privilege the canconfirm privilege allows you to confirm bugs and also to start your bug reports in the confirmed state (new). it also governs which bug entry
form you are presented with first (either the guided or advanced
forms). confirming unconfirmed bugs a useful ge...
...he "my bugs" link at the bottom of every bugzilla page) at least every two months and test whether they still exist. editbugs privilege the more powerful editbugs privilege gives you the privileges of canconfirm and also the ability to edit most aspects of a bug. therefore, don't abuse your privileges. ...
...And 7 more matches
Eclipse CDT Manual Setup
mach setup most people should be reading the eclipse cdt page instead of this one, now that mach ide eclipse is a thing. this page contains the content that used to live on the eclipse cdt page that most people will likely just consider noise. there is valuable in
formation here that should be integrated back into that page, but a large amount of it is now taken care of by the mach project generation code. for now it's stored here until that integration happens in order that the eclipse cdt page isn't hugely cluttered with mostly redundant in
formation, make setting up eclipse look much more complicated than it is nowadays. setup time some points in the rest of this document below are old and taken care of by the mach commands described above (although some of the project configur...
... up eclipse look much more complicated than it is nowadays. setup time some points in the rest of this document below are old and taken care of by the mach commands described above (although some of the project configuration is not done automatically yet). some of it like the section on building the index and usage tips are still relevant, and other parts still may provide useful background in
formation to understand it in more detail on how eclipse works. you can expect it to take an hour or so to work through these instructions if you're doing so for the first time. (this assumes that you already have a copy of the mozilla source, and that you have also built the source so that you have a pre-existing object directory. if that is not the case, then get your build going now so that it c...
...h static analysis of the project's source files, to build up a picture of the code (what eclipse is trying to do when it "indexes" the source.) static analysis involves parsing the source files, so naturally it can only produce good results if it has a sensible set of preprocessor defines, include paths and pre-include files for each source file. since eclipse doesn't initially have any of this in
formation, the code assistance that it's able to provide out of the box is pretty broken. for projects the size and complexity of mozilla, it's impractical to manually configure eclipse when there is a valid set of defines and includes paths for each of the different parts of the source code. happily, eclipse makes manual configuration unnecessary. like some other ides, that are used with projects ...
...And 7 more matches
Error codes returned by Mozilla APIs
ired feature. ns_error_no_interface (0x80004002) an attempt was made to call queryinterface to retrieve an interface which an object does not support. ns_error_null_pointer (0x80004003) an error occurred because a value was set to null when this was not expected. ns_error_abort (0x80004004) this error indicates that an operation failed and the caller should abort whatever action is being per
formed. this typically will occur if an operation could not complete properly. ns_error_failure (0x80004005) this is the most general of all the errors and occurs for all errors for which a more specific error code does not apply. ns_error_unexpected (0x8000ffff) an operation did not complete due to a condition which was not expected. this error occurred rather than continuing. ns_error_out_of_me...
...this error will occur in this situation. file errors the following table lists the errors that could occur when using files. while these errors can occur when using the file apis, they can also occur with other components that use files. ns_error_file_unrecognized_path (0x80520001) this error occurs when an attempt is made to set a path that isn't ...
...ation is being shutdown. this error will occur in this situation. file errors the following table lists the errors that could occur when using files. while these errors can occur when using the file apis, they can also occur with other components that use files. ns_error_file_unrecognized_path (0x80520001) this error occurs when an attempt is made to set a path that isn't valid for the plat
form. for example, if a character in the path is not valid for a filename. in addition, this error may occur when a relative path is supplied to a method that expects an absolute path and vice versa. ns_error_file_unresolvable_symlink (0x80520002) an attempt was made to access a symbolic link to a file or directory which does not exist. ns_error_file_execution_failed (0x80520003) an attempt to lau...
...And 7 more matches
Index
localization once you have your l10n testing environment set up in xcode, testing your firefox on ios localization is a breeze. 8 localization and plurals internationalization, localization you're likely here because you're localizing a .properties file and it had a link to this page. this page is to help explain how to localize these strings so that the correct plural
form is shown to the user. for example, "1 page" vs "2 pages". 9 localization content best practices apps, extensions, internationalization, localization, mozilla, l10n, l12y this document provides best practices for developers to create localizable code, and describes how to avoid some localizability (l12y) common mistakes. 10 localization notes guide, internation...
...2y) common mistakes. 10 localization notes guide, internationalization, localization, mozilla localizers usually work on the localizable files without the context of the source files including the localized strings; it is important to add comments to the localizable files themselves, too. these comments are generally referred to as localization notes. there is an established
format for those, which is described in this document. 11 localization prerequisites internationalization, localization, delete to work on localization, you need a subset of the mozilla build prerequisites. on mac and linux, you should be just fine, and on windows, mozillabuild should get you everything you need. 12 localization quick start guide guide, translation ...
... localization prerequisites internationalization, localization, delete to work on localization, you need a subset of the mozilla build prerequisites. on mac and linux, you should be just fine, and on windows, mozillabuild should get you everything you need. 12 localization quick start guide guide, translation this guide is filled with all of the basic, technical in
formation you need to get involved in the mozilla l10n program. 13 initial setup localization as a pre-requisite to contributing to the l10n program, you need to have access to code, tools, and a properly configured local environment (i.e., your personal computer). you also need to determine if a localization effort already exists for your locale. here we'll go over the accounts y...
...And 7 more matches
About NSPR
netscape portable runtime (nspr) provides plat
form independence for non-gui operating system facilities. these facilities include threads, thread synchronization, normal file and network i/o, interval timing and calendar time, basic memory management (malloc and free) and shared library linking. history a good portion of the library's purpose, and perhaps the primary purpose in the gromit environment, was to provide the underpinnings of the java vm, more or less mapping the sys layer that sun defined for the porting of the java vm to various plat
forms. nspr went beyond that requirement in some areas and since it was also the plat
form independent layer for most of the servers produced by netscape. it was expected and preferred that existing code be restructured and perhaps even rewritten in ...
... at the time of writing the current generation of nspr was known as nspr20. the first generation of nspr was originally conceived just to satisfy the requirements of porting java to various host environments. ...
...neration of nspr was known as nspr20. the first generation of nspr was originally conceived just to satisfy the requirements of porting java to various host environments. nspr20, an effort started in 1996, built on that original idea, though very little is left of the original code. (the "20" in "nspr20" does not mean "version 2.0" but rather "second generation".) many of the concepts have been re
formed, expanded, and matured. today nspr may still be appropriate as the plat
form dependent layer under java, but its primary application is supporting clients written entirely in c or c++. how it works nspr's goal is to provide uni
form service over a wide range of operating system environments. it strives to not export the lowest common denominator, but to exploit the best features of each operati...
...And 7 more matches
NSS FAQ
general questions what is network security services (nss) nss is set of libraries, apis, utilities, and documentation designed to support cross-plat
form development of security-enabled client and server applications. it provides a complete open-source implementation of the crypto libraries used by mozilla and other companies in the firefox browser, aol instant messenger (aim), server products from red hat, and other products. for an overview of nss, see overview of nss. for detailed in
formation on the open-source nss project, see nss project page. what can i do with nss? is nss appropriate for my application? if you want add support for ssl, s/mime, or other internet security standards to your application, you can use network security services (nss) to do so. because nss provides ...
...maintains sslref or makes it available. it was built as an example of an ssl implementation, not for creating production applications. nss was designed from the ground up for use by commercial developers. it provides a complete software development kit that uses the same architecture used to support security features in many client and server products from netscape and other companies. what plat
forms and development environments are supported? this section is out of date iplanet e-commerce solutions has certified nss 3.1 on 18 plat
forms, including aix 4.3, hp-ux 11.0, red hat linux 6.0, solaris (2.6 or later), windows nt (4.0 or later), and windows 2000. other contributors are in the process of certifying additional plat
forms. the nss 3.1 api requires c or c++ development environments. fo...
... what cryptography standards are supported? nss supports ssl v2 and v3, tls, pkcs #5, pkcs #7, pkcs #11, pkcs #12, s/mime, and x.509 v3 certificates. ...
...And 7 more matches
Introduction to Network Security Services
for a general overview of nss and the standards it supports, see overview of nss. shared libraries network security services provides both static libraries and shared libraries. applications that use the shared libraries must use only the apis that they export. three shared libraries export public functions: the ssl library supports core ssl operations. the s/mime library supports core s/mime operations. the nss library supports core crypto operations. ...
...ic functions: the ssl library supports core ssl operations. the s/mime library supports core s/mime operations. the nss library supports core crypto operations. we guarantee that applications using the exported apis will remain compatible with future versions of those libraries. for a complete list of public functions exported by these shared libraries in nss 3.2, see nss functions. for in
formation on which static libraries in nss 3.1.1 are replaced by each of the above shared libraries in nss 3.2 , see migration from nss 3.1.1. figure 1, below, shows a simplified view of the relationships among the three shared libraries listed above and nspr, which provides low-level cross plat
form support for operations such as threading and i/o. (note that nspr is a separate mozilla project; see n...
...1 relationships among core nss libraries and nspr naming conventions and special libraries windows and unix use different naming conventions for static and dynamic libraries: windows unix static .lib .a dynamic .dll .so or .sl in addition, windows has "import" libraries that bind to dynamic libraries. so the nss library has the following
forms: libnss3.so - unix shared library libnss3.sl - hp-ux shared library libnss.a - unix static library nss3.dll - windows shared library nss3.lib - windows import library binding to nss3.dll nss.lib - windows static library nss, ssl, and s/mime have all of the above
forms. the following static libaries aren't included in any shared libraries libcrmf.a/crmf.lib provides an api for crmf ...
...And 7 more matches
NSS 3.35 release notes
nss 3.35 requires nspr 4.18, or newer. nss 3.35 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_35_rtm/src/ new in nss 3.35 new functionality tls 1.3 support has been updated to draft -23. this includes a large number of changes since 3.34, which supported only draft -18. see below for details. ...
...shake message. for the sslsignaturescheme enum, the enumerated values ssl_sig_rsa_pss_sha* are deprecated in response to a change in tls 1.3. please use the equivalent ssl_sig_rsa_pss_rsae_sha* for rsaencryption keys, or ssl_sig_rsa_pss_pss_sha* for pss keys. note that this release does not include support for the latter. ...
...ues ssl_sig_rsa_pss_sha* are deprecated in response to a change in tls 1.3. please use the equivalent ssl_sig_rsa_pss_rsae_sha* for rsaencryption keys, or ssl_sig_rsa_pss_pss_sha* for pss keys. note that this release does not include support for the latter. notable changes in nss 3.35 previously, nss used the dbm file
format by default. starting with version 3.35, nss uses the sql file
format by default. ...
...And 7 more matches
NSS tools : crlutil
nd list, create, modify or delete certificates entries in a particular crl. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation. this document discusses certificate revocation list management. for in
formation on security module database management, see using the security module database tool. for in
formation on certificate and key database management, see using the certificate database tool. 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 sect...
...g create new certificate revocation list(crl).- -d delete certificate revocation list from cert database. -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. -m modify existing crl which can be located in cert db or in arbitrary file. ...
...if options -m|-g is used and -c crl-script-file is not specified, crlutil will read script data from standard input. ...
...And 7 more matches
NSS tools : pk12util
rectory into which to import to or export from certificates and keys. 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). if the prefix sql: is not used, then the tool assumes that the given databases are in the old
format. -p prefix specify the prefix used on the certificate and key databases. this option is provided as a special case. changing the names of the certificate and key databases is not recommended. -h tokenname specify the name of the token to import into or export from. -v enable debug logging when importing. -k slotpasswordfi...
...all package) encryption algorithm. -m | --key-len keylength specify the desired length of the symmetric key to be used to encrypt the private key. -n | --cert-key-len certkeylength specify the desired length of the symmetric key to be used to encrypt the certificates and other meta-data. -r dumps all of the data in raw (binary)
form. this must be saved as a der file. the default is to return in
formation in a pretty-print ascii
format, which displays the in
formation about the certificates and public keys in the p12 file. return codes o 0 - no error o 1 - user cancelled o 2 - usage error o 6 - nls init error o 8 - certificate db open error o 9 - key db open ...
...d be at least 8 characters long, and should contain at least one non-alphabetic character. enter new password: re-enter password: enter password for pkcs12 file: pk12util: pkcs12 import successful exporting keys and certificates using the pk12util command to export certificates and keys requires both the name of the certificate to extract from the database (-n) and the pkcs#12-
formatted output file to write to. there are optional parameters that can be used to encrypt the file to protect the certificate material. pk12util -o p12file -n certname [-c keycipher] [-c certcipher] [-m|--key_len keylen] [-n|--cert_key_len certkeylen] [-d [sql:]directory] [-p dbprefix] [-k slotpasswordfile|-k slotpassword] [-w p12filepasswordfile|-w p12filepassword] for example: # pk12ut...
...And 7 more matches
Hacking Tips
e tracelogger (js shell / browser) create graphs showing time spent in which engine and which function like this. whenever running a testcase the file "tl-data.json" and several "tl-*" files get created in the "/tmp" directory. (per proces a "tl-data-*pid*.json" file and per thread a "tl-tree.*pid*.*id*.tl", "tl-event.*pid*.*id*.tl" and "tl-dict.*pid*.*id*.json" file). these files contain all in
formation to create a tracelogger graph. on https://github.com/h4writer/tracelogger you can find the instructions to create the graph (tools v2 > 1. creating a tracelogging graph). note 1: when you are doing this from "file:///" you will probably get a security warning in the console. this is because firefox doesn't allow loading files from the harddisk using httprequest, even when the file loading t...
...tjes/tracelogger/tree/master/tools_v2. you need to download "engine.js", "reduce.py", "reduce.js", "reduce-tree.js" and "reduce-corrections.js". running this tool is a matter of running "python reduce.py js_shell /tmp/tl-data.json tl-reduced". where js_shell is a real shell. using callgrind (js shell) as spidermonkey just-in-time compiler are rewriting the executed program, valgrind should be in
formed from the command line by adding --smc-check=all-non-file. $ valgrind --tool=callgrind --callgrind-out-file=bench.clg \ --smc-check=all-non-file --vex-iropt-register-updates=allregs-at-mem-access ./js ./run.js the output file can then be use with kcachegrind which provides a graphical view of the call graph. using ionmonkey spew (js shell) ionmonkey spew is extremely verbose (not as mu...
... to remove uninteresting functions. using the arm simulator the arm simulator can be used to test the arm jit backend on x86/x64 hardware. an arm simulator build is an x86 shell (or browser) with the arm jit backend. instead of entering jit code, it runs it in a simulator (interpreter) for arm code. to use the simulator, compile an x86 shell (32-bit, x64 doesn't work as we use a different value
format there), and pass --enable-arm-simulator to configure. for instance, on a 64-bit linux host you can use the following configure command to get an arm simulator build: ar=ar cc="gcc -m32" cxx="g++ -m32" ../configure --target=i686-pc-linux --enable-debug --disable-optimize --enable-threadsafe --enable-simulator=arm or on os x: $ ar=ar cc="clang -m32" cxx="clang++ -m32" ../configure --target=i...
...And 7 more matches
JS_ConvertArguments
obsolete since jsapi 38this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. 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 per
form any necessary conversions. cx also affects the interpretation of
format, if js_addargument
formatter has been called. ...
...ated by the js engine and passed to a jsnative or jsfastnative callback, not an array created by application code. in certain error cases, js_convertarguments calls js_argv_callee(argv), which accesses memory outside the range [argv .. argv+argc). js_convertarguments may modify argv in place by replacing an argument with the converted value. (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. ... void * out parameters. pointers to variables into which to store the converted values. there must be one pointer for each parameter described in
format. variables for optional parameters must already be initialized, because if an optional param...
...corresponding js types with a single function call. it saves you from having to write separate tests and elaborate if...else statements in your function code to retrieve and translate multiple js values for use with your own functions. cx is the context for the call. argc indicates the number of js values you are passing in for conversion. argv is a pointer to the array of js values to convert. ...
...And 7 more matches
Gecko object attributes
to text attributes, which apply only to substrings in a text object. object attributes list aria attributes all aria attributes used on dom element (i.e., any attribute prefixed by 'aria-') are exposed as object attributes; name is preserved except the 'aria-' prefix is cut. common attributes class the class name for an element from html, xul, svg, etc. this is useful for retrieving micro
format semantics for an element. display similar with display css style. applied to: any visible accessible id any value, defined by ui/content developers. used to indicate a persistent identifier for any object; useful for scripting. applied to: any role which related dom node has id attribute tag the actual markup tag used to create this element (also used in xul). applied to: any role xml...
...id any value, defined by ui/content developers. used to indicate a persistent identifier for any object; useful for scripting. applied to: any role which related dom node has id attribute tag the actual markup tag used to create this element (also used in xul). applied to: any role xml-roles if a dynamic content accessibility role string is used, it is exposed here. this may provide more in
formation than the mapped role, which is best-fit. the role string may be a space-delimited list of roles. applied to: any role group attributes level for headings, the heading level. for outline items, the indentation level. for diagrams with levels, each item can have its level specified. the level value is 1-based. applied to: grid, heading, listitem, row, tablist exposed in aria: aria-lev...
...whether changes within the current region or subtree should be automatically presented. possible values are "off" which is the same as not being set -- this means the region is not live. other possible values are "polite", "assertive", and "rude", which is a suggestion for the policy when interrupting the user for changes to this region. please see the aria states and properties module for more in
formation. additional in
formation may be provide by the object attributes atomic and relevant. applied to: any role exposed in aria: aria-live relevant space delimited string with keywords describing what kinds of changes in the subtree are in
formational, as opposed to presentational. if not specified, the default should be considered "additions text", which indicates that newly created objects an...
...And 7 more matches
History Service Design
view the service interface definition: nsinavhistoryservice.idl. ...
...in places are: improve access to browsing history allow association of useful metadata with urls flexible query system for both end-users and add-ons developers clean architecture for ease of code reuse and maintainability the most known and visible feature of history are views. the user can query his visits based on a date range, meta contents or revisit behavior. this involves storing in
formations on all of the user's visits, including visit time, type of visit and meta data. old history system was instead only storing first and last visit date, and a generic visits counter, creating some problem due to the impossibility to represent real history flow in a timeframe. history views must be organized and as concise as possible. each visit is associated with a favicon, to allow for bet...
...wing to fast find good candidates for bookmarking. a locationbar intelligent algorithm (aka: the awesomebar) allows searchs through bookmarks, history, keywords (and much more) detaching the user from the old long searches through tree views. this is possible through a relevance algorithm that assigns a param called frecency to every page in history, see the places frecency algorithm for major in
formations. history service provides the basics to create such adaptive search paths, allowing for a better browsing experience through a common interface. long term objectives include the ability to index more in
formations from the visited pages, through fulltext indexes, and the possibility to generalize the frecency algorithm to allow for its use in user's queries. might be also nice to provide a ...
...And 7 more matches
Mozilla internal string guide
ir buffer (ns[c]string) and strings that are not required to have a null-terminator (nsa[c]string). nsa[c]string is the base of the string classes (since it imposes fewer requirements) and ns[c]string is a class derived from it. functions taking strings as parameters should generally take one of these four types. in order to avoid unnecessary copying of string data (which can have significant per
formance cost), the string classes support different ownership models. all string classes support the following three ownership models dynamically: reference counted, copy-on-write, buffers (the default) adopted buffers (a buffer that the string class owns, but is not reference counted, because it came from somewhere else) dependent buffers, that is, an underlying buffer that the string class doe...
...onst char16_t* or const char*) into a class of type nsastring. note that you must null-terminate buffers used by to nsdependentstring. if you don't want to or can't null-terminate the buffer, use nsdependentsubstring. nsprintfcstring- derived from nscstring, this string behaves like an nsautocstring. the constructor takes parameters which allows it to construct a 8-bit string from a printf-style
format string and parameter list. there are also a number of concrete classes that are created as a side-effect of helper routines, etc. you should avoid direct use of these classes. let the string library create the class for you. nssubstringtuple - created via string concatenation nsdependentsubstring - created through substring nspromiseflatstring - created through promiseflatstring() nslit...
...remaining data over if (pos < len - 1) memmove(cur + 4, cur + 1, (len - 1 - pos) * sizeof(char16_t)); // fill the tab with spaces *cur = char16_t(' '); *(cur + 1) = char16_t(' '); *(cur + 2) = char16_t(' '); *(cur + 3) = char16_t(' '); pos += 4; cur += 4; } } } if a string buffer becomes smaller while writing it, use setlength to in
form the string class of the new size: /** * remove every tab character from `data` */ void removetabs(nsastring& data) { int len = data.length(); char16_t* cur = data.beginwriting(); char16_t* end = data.endwriting(); while (cur < end) { if (char16_t('\t') == *cur) { len -= 1; end -= 1; if (cur < end) memmove(cur, cur + 1, (end - cur) * sizeof(char16_t)); ...
...And 7 more matches
Observer Notifications
profile, or any services which require access to the profile (preferences, bookmarks, and so on) then a common pattern is to register with the nsicategorymanager for the app-startup topic which can be done in the component's registration code, and then in that notification register with the observer service for the profile-after-change notification. see receiving startup notifications for more in
formation about how this works. starting in firefox 3.5 components can simply register for the profile-after-change notification in nsicategorymanager. topic description * everything. [nsobserverservice.cpp] topic description xpcom-startup note: an extension can no longer be registered to receive this notification in firefox 4 and...
... xpcom-shutdown-threads shuts down the thread manager, causing all nsthreads to finish processing any events already queued and stop accepting new events. browser these topics indicate interesting things that happen that the browser alerts you to. topic description browser:purge-session-history sent when the sanitizer runs to purge all history and other in
formation. browser:purge-domain-data sent after domain-specific history and other in
formation have been purged. the data value is a string
form of the domain. browser-lastwindow-close-requested sent when the browser wishes to close the last open browser window. when this is sent, it is possible that other windows may still be open, such as the download manager or preferences. t...
...ess memory). data is intentionally left blank. content-document-global-created nsidomwindow origin sent immediately after a web content document window has been set up, but before any script code has been executed. this lets extensions inject api into content windows as needed (see nsidomglobalpropertyinitializer for an alternative method of doing this). data is a string
form of the origin (for use in security checks), eg "http://developer.mozilla.org". document-element-inserted document null sent immediately after the root element of a document has been created, but before executing any script on it. user-interaction-active nsidomwindow null sent once every 5000ms while this chrome document sees some kind of user activity (for...
...And 7 more matches
nsIAccessibleRole
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) constants constant value description role_nothing 0 used when accessible has no strong defined role. role_titlebar 1 represents a title or caption bar for a window. it is used by msaa only, supported automatically by ms windows. role_menubar 2 represents the menu bar (positioned beneath the title bar of a window) from which menus are selected by the user. the role is used by xul:menubar or role="menubar". ...
...ointer. role_caret 7 represents the system caret. the role is supported for caret. role_alert 8 represents an alert or a condition that a user should be notified about. assistive technologies typically respond to the role by reading the entire on screen contents of containers advertising this role. should be used for warning dialogs, etc. the role is used by xul:browsermessage, role="alert", x
forms:message. role_window 9 represents the window frame, which contains child objects such as a title bar, client, and other objects contained in a window. the role is supported automatically by ms windows. role_internal_frame 10 a sub-document or iframe. role_menupopup 11 represents a menu, which presents a list of options from which the user can make a selection to per
form an action. it is us...
...vides split panes within a window. it is used for xul:separator, html:hr, role="separator". role_toolbar 22 represents a toolbar, which is a grouping of controls (push buttons or toggle buttons) that provides easy access to frequently used features. it is used for xul:toolbar, role="toolbar". role_statusbar 23 represents a status bar, which is an area at the bottom of a window that displays in
formation about the current operation, state of the application, or selected object. the status bar has multiple fields, which display different kinds of in
formation. it is used for xul:statusbar. role_table 24 represents a table that contains rows and columns of cells, and optionally, row headers and column headers. it is used for html:table, role="grid". also refer to the following roles: role_col...
...And 7 more matches
nsIZipWriter
modules/libjar/zipwriter/public/nsizipwriter.idlscriptable this interface provides an easy way for scripts to archive data in the zip file
format. operations on the archive can be per
formed one by one, or queued for later execution. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) once all the operations you wish to per
form are added to the queue, a call to processqueue() will per
form the operations in the order they were added to the queue. operations per
formed on the queue throw any errors that occur out to the observer. attempting to per
form a synchronous operation on the interface while the background queue is in progress will throw an ns_error_in_progress exception. file and directory names should use slashes...
... attributes attribute type description comment acstring gets or sets the comment associated with the currently open zip file. exceptions thrown ns_error_not_initialized if no zip file has been opened. file nsifile the zip file being written to. read only. inqueue boolean true if operations are being per
formed in the background queue, or false if background operations are not in progress. read only. constants constant value description compression_none 0 do not compress the file. compression_fastest 1 use the fastest compression method when adding the file to the archive. compression_default 6 use the default compression method when ...
...fastest 1 use the fastest compression method when adding the file to the archive. compression_default 6 use the default compression method when adding the file to the archive. compression_best 9 use the best compression method when adding the file to the archive. methods addentrychannel() adds data from a channel to the zip file. if the operation is per
formed on the queue then the channel will be opened asynchronously, otherwise the channel must support being opened synchronously. void addentrychannel( in autf8string azipentry, in prtime amodtime, in print32 acompression, in nsichannel achannel, in boolean aqueue ); parameters azipentry the path of the file entry to add to the zip file. this is the path it will be located at within ...
...And 7 more matches
XPCOM ABI
only applications which use this abi could use this xpcom component. ...
...only applications which use this abi could use this xpcom component. ...
...only applications which use this abi could use this xpcom component. ...
...And 7 more matches
XPCOM
xpcom is a cross plat
form component object model, similar to microsoft com. it has multiple language bindings, allowing xpcom components to be used and implemented in javascript, java, and python in addition to c++. interfaces in xpcom are defined in a dialect of idl called xpidl. xpcom itself provides a set of core components and classes, e.g. file and memory management, threads, basic data structures (strings, arrays, variants), etc. the majority of xpcom components are not part of this core set and are provided by other parts of the plat
form (e.g. gecko or necko) or by an application or even by an extension. ...
...to this end, there exist xpcom interfaces to read and write registry data. ...
...dy_addrefedalready_addrefed in association with nscomptr allows you to assign in a pointer without addrefing it.binary compatibilityif mozilla decides to upgrade to a compiler that does not have the same abi as the current version, any built component may fail. it is a possiblity that is introduced when upgrading to a new compiler without recompiling everything. effectively, it is a different plat
form.bundling multiple binary componentsbinary xpcom components are sometimes required to implement low-level features for extensions. since binary components are linked against a single gecko sdk, a dependency to a particular version of gecko is created. if the component uses only "frozen" xpcom interfaces, there is a good chance the same binary component will work with different versions of gecko (v...
...And 7 more matches
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 plat
form 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...
...ules for html elements using the appropriate attributes using the embed element for plug-in display using custom embed attributes plug-in references plug-in development overview writing plug-ins registering plug-ins ms windows unix mac os x drawing a plug-in instance handling memory sending and receiving streams working with urls getting version and ui in
formation displaying messages on the status line making plug-ins scriptable building plug-ins building, plat
forms, 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 ...
... 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 in
formation windowed plug-ins mac os windows unix event handling for windowed plug-ins windowless plug-ins specifying that a plug-in is windowless invalidating the drawing area forcing a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless plug-ins streams recei...
...And 7 more matches
Animating CSS properties - Firefox Developer Tools
the per
formance cost of animating a css property can vary from one property to another, and animating expensive css properties can result in jank as the browser struggles to hit a smooth frame rate. the frame rate and waterfall can give you insight into the work the browser's doing in a css animation, to help diagnose per
formance problems. with css animations you specify a number of keyframes, each of which uses css to define the appearance of the element at a particular stage of the animation. the browser creates the animation as a transition from each keyframe to the next. compared with animating elements using javascript, css animations can be easier to create. ...
...animating expensive css properties can result in jank as the browser struggles to hit a smooth frame rate. ...
... the appearance of the element at a particular stage of the animation. the browser creates the animation as a transition from each keyframe to the next. compared with animating elements using javascript, css animations can be easier to create. they can also give better per
formance, as they give the browser more control over when to render frames, and to drop frames if necessary. however, the per
formance cost of modifying a css property can vary from one property to another. animating expensive css properties can result in jank as the browser struggles to hit a smooth frame rate. the css rendering waterfall the process the browser uses to update the page when a css property has changed can be described as a waterfall consisting of the following steps: recalculate style: every time a cs...
...And 7 more matches
EffectTiming.fill - Web APIs
which the animation is running, while "forwards" ensures that once the animation's end time has been passed, the element will continue to be drawn in the state it was in at its last rendered frame. note that authors are discouraged from using fill modes to persist the effect of an animation indefinitely. see the alternatives to fill modes section below for approaches that are simpler and more per
formant. element.animate(), and keyframeeffect() accept an object of timing properties including fill. the value of fill corresponds directly to fill in effecttiming objects returned by gettiming() in animationeffect and keyframeeffect. syntax var timingproperties = { fill: "none" | "forwards" | "backwards" | "both" | "auto" } value a domstring indicating the fill type to use in order to pro...
...he part that really matters for our purposes is the css that styles the "box" element that we'll be animating. that css looks like this: #box { width: 200px; height: 200px; left: 50px; top: 50px; border: 1px solid #7788ff; margin: 0; position: relative; background-color: #2233ff; display: flex; justify-content: center; } all this does is specify the size, border, and color in
formation, as well as indicate that the box should be centered both vertically and horizontally inside its container. note that there's no rotation applied. javascript content now let's check out the javascript. first we'll define the two objects that describe the keyframes and the timing configuration to use, then we'll actually see the code that triggers and runs the animation when the "animatebut...
... vertically and horizontally inside its container. note that there's no rotation applied. javascript content now let's check out the javascript. first we'll define the two objects that describe the keyframes and the timing configuration to use, then we'll actually see the code that triggers and runs the animation when the "animatebutton" button is clicked. var boxrotationkeyframes = [ { trans
form: "rotate(-90deg)" }, { trans
form: "rotate(90deg)" } ]; the boxrotationkeyframes object is an array of keyframes, each describing the state of the affected element at a point in the animation process. in this case, we have just two keyframes; the first defines what affect is applied to the element immediately after the animation first begins to play, and the second defines the effect applied t...
...And 7 more matches
HTMLTextAreaElement - Web APIs
cols unsigned long: returns / sets the element's cols attribute, indicating the visible width of the text area. defaultvalue string: returns / sets the control's default value, which behaves like the node.textcontent property. disabled boolean: returns / sets the element's disabled attribute, indicating that the control is not available for interaction.
form read only object: returns a reference to the parent
form element. if this element is not contained in a
form element, it can be the id attribute of any <
form> element in the same document or the value null. inputmode maxlength long: returns / sets the element's maxlength attribute, indicating the maximum number of characters the user can enter. this constraint is ev...
... sets the element's placeholder attribute, containing a hint to the user about what to enter in the control. readonly boolean: returns / sets the element's readonly attribute, indicating that the user cannot modify the value of the control. required boolean: returns / sets the element's required attribute, indicating that the user must specify a value before submitting the
form. rows unsigned long: returns / sets the element's rows attribute, indicating the number of visible text lines for the control. selectiondirection string: returns / sets the direction in which selection occurred. this is "forward" if selection was per
formed in the start-to-end direction of the current locale, or "backward" for the opposite direction. this can also be "none"...
...e value of an <input>, <select>, or <textarea> element has been changed. examples autogrowing textarea example make a textarea autogrow while typing: 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. javascript function insertmetachars(sstarttag, sendtag) { var bdouble = arguments.length > 1, omsgin...
...And 7 more matches
WebGLRenderingContext.texSubImage2D() - Web APIs
the webglrenderingcontext.texsubimage2d() method of the webgl api specifies a sub-rectangle of the current texture. ...
... the webglrenderingcontext.texsubimage2d() method of the webgl api specifies a sub-rectangle of the current texture. ...
... the webglrenderingcontext.texsubimage2d() method of the webgl api specifies a sub-rectangle of the current texture. ...
...And 7 more matches
WebGL: 2D and 3D graphics for the web - Web APIs
support for webgl is present in firefox 4+, google chrome 9+, opera 12+, safari 5.1+, internet explorer 11+, and microsoft edge build 10240+; however, the user's device must also have hardware that supports these features. ...
... support for webgl is present in firefox 4+, google chrome 9+, opera 12+, safari 5.1+, internet explorer 11+, and microsoft edge build 10240+; however, the user's device must also have hardware that supports these features. ...
... support for webgl is present in firefox 4+, google chrome 9+, opera 12+, safari 5.1+, internet explorer 11+, and microsoft edge build 10240+; however, the user's device must also have hardware that supports these features. ...
...And 7 more matches
Lifetime of a WebRTC session - Web APIs
—or any combination thereof—into a browser application. in this article, we'll look at the lifetime of a webrtc session, from establishing the connection all the way through closing the connection when it's no longer needed. this article doesn't get into details of the actual apis involved in establishing and handling a webrtc connection; it simply reviews the process in general with some in
formation about why each step is required. see signaling and video calling for an actual example with a step-by-step explanation of what the code does. this page is currently under construction, and some of the content will move to other pages as the webrtc guide material is built out. pardon our dust! establishing the connection the internet is big. really big. it’s so big that years ago, smar...
...en what their address is. this is like trying to mail a package to your friend michelle by labeling it “michelle” and dropping it in a mailbox when you don't know her address. you need to look up her address and include it on the package, or she'll wind up wondering why you forgot her birthday again. this is where signaling comes in. signaling signaling is the process of sending control in
formation between two devices to determine the communication protocols, channels, media codecs and
formats, and method of data transfer, as well as any required routing in
formation. the most important thing to know about the signaling process for webrtc: it is not defined in the specification. why, you may wonder, is something fundamental to the process of establishing a webrtc connection left out of...
...eady has a method in place for connecting two devices, it doesn’t make sense for them to have to use another one, defined by the specification, just for webrtc. since webrtc doesn’t live in a vacuum, there is likely other connectivity in play, so it makes sense to avoid having to add additional connection channels for signaling if an existing one can be used. ...
...And 7 more matches
Starting up and shutting down a WebXR session - Web APIs
can open up a developer tools panel that lets you control the position and orientation of the headset and any hand controllers, as well as button presses on the controllers. emulator usage while somewhat awkward compared to using an actual headset, this makes it possible to experiment with and developer webxr code on a desktop computer, where webxr isn't normally available. it also lets you per
form some basic testing before taking your code to a real device. be aware, however, that the emulator does not yet completely emulate all of the webxr api, so you may run into problems you're not expecting. again, carefully read the readme file and make sure you're aware of the limitations before you begin. important: you should always test your code on actual ar and/or vr hardware before releasing ...
...de must, likewise, have been loaded securely. if the document wasn't loaded securely, you won't get very far. the navigator.xr property doesn't even exist if the document wasn't loaded securely. this may also be the case if there simply is no compatible xr hardware available. either way, you need to be prepared for the lack of an xr property and either gracefully handle the error or provide some
form of fallback. falling back to the webxr polyfill one fallback option is the webxr polyfill, provided by the immersive web working group that's in charge of the webxr standardization process. the polyfill brings support for webxr to browsers that don't have native webxr support, and smooths out the inconsistencies among implementations in the browsers that do have it, so it can sometimes also be ...
...s changes. obtain a webgl context for the canvas into which you intend to render your frames by calling the htmlcanvaselement method getcontext() on the target context. set up your webgl data and models and prepare to render the scene. set the webgl context as the source for the xr system by creating an xrwebgllayer and passing set the value of the session's renderstate property baselayer. ...
...And 7 more matches
WebXR Device API - Web APIs
o represent actual ar and/or vr sessions. xrframe while presenting an xr session, the state of all tracked objects which make up the session are represented by an xrframe. to get an xrframe, call the session's requestanimationframe() method, providing a callback which will be called with the xrframe once available. ...
... xrspace xrspace is an opaque base class on which all virtual coordinate system interfaces are based. positions in webxr are always expressed in relation to a particular xrspace at the time at which a particular xframe takes place. the space's coordinate system has its origin at the a given physical position. ...
...he view relative to the camera, in order to allow for creating stereographic effects. xrviewport describes a viewport. a viewport is a rectangular portion of a graphic surface. in webxr, a viewport represents the area of a drawing surface corresponding to a particular xrview, such as the portion of the webgl framebuffer used to render one of the two eyes' perspectives on the scene. xrrigidtrans
form a trans
form defined using a position and orientation in the virtual space's coordinate system as described by the xrspace. xrpose describes a position and orientation in space relative to an xrspace. xrviewerpose based on xrpose, xrviewerpose specifies the state of a viewer of the webxr scene as indicated by the xr device. included is an array of xrview objects, each representing one perspec...
...And 7 more matches
Basic concepts behind Web Audio API - Web APIs
this article explains some of the audio theory behind how the features of the web audio api work, to help you make in
formed decisions while designing how audio is routed through your app. it won't turn you into a master sound engineer, but it will give you enough background to understand why the web audio api works like it does. audio graphs the web audio api involves handling audio operations inside an audio context, and has been designed to allow modular routing. basic audio operations are per
formed with audio nodes, which are linked together to
form an audio routing graph. several sources — with different types of channel layout — are supported even within a single context. this modular design provides the flexibility to create complex audio functions with dynamic effects. ...
...although, you don't have to provide a destination if you, say, just want to visualize some audio data. a simple, typical workflow for web audio would look something like this: create the audio context. ...
...or stream. create effects nodes, such as reverb, biquad filter, panner, or compressor. choose the final destination for the audio, such as the user's computer speakers. establish connections from the audio sources through zero or more effects, eventually ending at the chosen destination. channel notation the number of audio channels available on a signal is frequently presented in a numeric
format, such as 2.0 or 5.1. this is called channel notation. the first number is the number of full frequency range audio channels that the signal includes. the number after the period indicates the number of those channels which are reserved for low-frequency effect (lfe) outputs; these are often referred to as subwoofers. each input or output is composed of one or more audio channels, which toge...
...And 7 more matches
Migrating from webkitAudioContext - Web APIs
the latter version of createbuffer() was potentially expensive, because it had to decode the audio buffer synchronously, and with the buffer being arbitrarily large, it could take a lot of time for this method to complete its work, and no other part of your web page's code could execute in the mean time. because of these problems, this version of the createbuffer() method has...
..., which should be familiar because they are similar to things like the the htmlinputelement property type. oscillatornode.type oscillatornode's type property has been changed to use web idl enums. ...
...similar to things like the the htmlinputelement property type. oscillatornode.type oscillatornode's type property has been changed to use web idl enums. ...
...And 7 more matches
Perceivable - Accessibility
this article provides practical advice on how to write your web content so that it con
forms to the success criteria outlined in the perceivable principle of the web content accessibility guidelines (wcag) 2.0 and 2.1. perceivable states that users must be able to perceive it in some way, using one or more of their senses. note: to read the w3c definitions for perceivable and its guidelines and success criteria, see principle 1: perceivable - in
formation and user interface components must be presentable to users in ways they can perceive. guideline 1.1 — providing text alternatives for non-text content the key here is that text can be converted to other
forms that people with disabilities can use. for example, it can be spoken by a screenreader, converted to large print, or repr...
... text alternatives. ...
...ther text alternative mechanisms for the argument against longdesc. multimedia content (i.e., audio or video) should at least have a descriptive identification available, such as a caption or similar. see text alternatives for static caption options, and audio transcripts, video text tracks, and other multimedia content for other alternatives. ui controls such as
form elements and buttons should have text labels that describe their purpose. buttons are simple—you should make sure the button text describes the function of the button (e.g., <button>upload image</button>). for more in
formation on other ui controls, see ui controls. implement decorative (non-content) images, video, etc., in a way that is invisible to assistive technology, so it doesn...
...And 7 more matches
src - CSS: Cascading Style Sheets
the src css descriptor of the @font-face rule specifies the resource containing font data. it is required for the @font-face rule to be valid. ...
... the src css descriptor of the @font-face rule specifies the resource containing font data. it is required for the @font-face rule to be valid. ...
...plicit
format */ src: url('path/to/font.woff'); /* quoted url */ src: url(path/to/svgfont.svg#example); /* fragment identifying font */ /* <font-face-name> values */ src: local(font); /* unquoted name */ src: local(some font); /* name containing space */ src: local("font"); /* quoted name */ /* multiple items */ src: local(font), url(path/to/font.svg)
format("svg"), url(path/to/font.woff)
format("woff"), url(path/to/font.otf)
format("opentype"); values <url> [
format( <string># ) ]? ...
...And 7 more matches
Block and inline layout in normal flow - CSS: Cascading Style Sheets
in this guide, we will explore the basics of how block and inline elements behave when they are part of the normal flow. normal flow is defined in the css 2.1 specification, which explains that any boxes in normal flow will be part of a
formatting context. they can be either block or inline, but not both at once. we describe block-level boxes as participating in a block
formatting context, and inline-level boxes as participating in an inline
formatting context. the behaviour of elements which have a block or inline
formatting context is also defined in this specification. for elements with a block
formatting context, the spec says: “in a block
formatting context, boxes are laid out one after the other, vertically, beginning at the top of a containing block. the vertical distance between...
...atting context is also defined in this specification. for elements with a block
formatting context, the spec says: “in a block
formatting context, boxes are laid out one after the other, vertically, beginning at the top of a containing block. the vertical distance between two sibling boxes is determined by the 'margin' properties. vertical margins between adjacent block-level boxes in a block
formatting context collapse. in a block
formatting context, each box's left outer edge touches the left edge of the containing block (for right-to-left
formatting, right edges touch).” - 9.4.1 for elements with an inline
formatting context: “in an inline
formatting context, boxes are laid out horizontally, one after the other, beginning at the top of a containing block. horizontal margins, ...
...for example, by describing vertical distance between block boxes. the behavior on block and inline elements is the same when working in a vertical writing mode, and we will explore this in a future guide on flow layout and writing modes. ...
...And 7 more matches
rotate() - CSS: Cascading Style Sheets
syntax the amount of rotation created by rotate() is specified by an <angle>. if positive, the movement will be clockwise; if negative, it will be counter-clockwise. a rotation by 180° is called point reflection. rotate(a) values a is an <angle> representing the angle of the rotation. ...
... syntax the amount of rotation created by rotate() is specified by an <angle>. if positive, the movement will be clockwise; if negative, it will be counter-clockwise. a rotation by 180° is called point reflection. rotate(a) values a is an <angle> representing the angle of the rotation. ...
... syntax the amount of rotation created by rotate() is specified by an <angle>. if positive, the movement will be clockwise; if negative, it will be counter-clockwise. a rotation by 180° is called point reflection. rotate(a) values a is an <angle> representing the angle of the rotation. ...
...And 7 more matches
transition-duration - CSS: Cascading Style Sheets
duration: inherit; transition-duration: initial; transition-duration: unset; values <time> is a <time> denoting the amount of time the transition from the old value of a property to the new value should take. a time of 0s indicates that no transition will happen, that is the switch between the two states will be instantaneous. a negative value for the time renders the declaration invalid. ...
...m the old value of a property to the new value should take. a time of 0s indicates that no transition will happen, that is the switch between the two states will be instantaneous. a negative value for the time renders the declaration invalid. ...
...
formal syntax <time># examples transition-duration: 0.5s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size left top trans
form -webkit-trans
form color; -webkit-transition-duration:0.5s; -webkit-transition-timing-function: ease-in-out; transition-property: width height background-color font-size left top trans
form -webkit-trans
form color; transition-duration:0.5s; transition-timing-function: ease-in-out; } .box1{ trans
form: rotate(270deg); -webkit-trans
form: rotate(270deg); width: 50px; ...
...And 7 more matches
HTML5 - Developer guides
sely what your content is. connectivity: allowing you to communicate with the server in new and innovative ways. offline and storage: allowing webpages to store data on the client-side locally and operate offline more efficiently. multimedia: making video and audio first-class citizens in the open web. 2d/3d graphics and effects: allowing a much more diverse range of presentation options. per
formance and integration: providing greater speed optimization and better usage of computer hardware. device access: allowing for the usage of various input and output devices. styling: letting authors write more sophisticated themes. semantics sections and outlines in html5 a look at the new outlining and sectioning elements in html5: <section>, <article>, <nav>, <header>, <footer> and <asi...
...e usage of various input and output devices. styling: letting authors write more sophisticated themes. semantics sections and outlines in html5 a look at the new outlining and sectioning elements in html5: <section>, <article>, <nav>, <header>, <footer> and <aside>. using html5 audio and video the <audio> and <video> elements embed and allow the manipulation of new multimedia content.
forms improvements a look at the constraint validation api, several new attributes, new values for the <input> attribute type and the new <output> element. new semantic elements beside sections, media and
forms elements, there are numerous new elements, like <mark>, <figure>, <figcaption>, <data>, <time>, <output>, <progress>, or <meter> and <main>, increasing the number of valid html5 elements. i...
...s, there are numerous new elements, like <mark>, <figure>, <figcaption>, <data>, <time>, <output>, <progress>, or <meter> and <main>, increasing the number of valid html5 elements. improvement in <iframe> using the sandbox and srcdoc attributes, authors can now be precise about the level of security and the wished rendering of an <iframe> element. mathml allows directly embedding mathematical
formulas. introduction to html5 this article introduces how to indicate to the browser that you are using html5 in your web design or web application. html5 reference guide quick-reference html5 sheet containing markup generators, code examples and web developer tools. the guide is downloadable for ease of use and access. this page was created with help from the w3c as a quick guide for those who ...
...And 7 more matches
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
ed in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the above example shows simple usage of the <audio> element. in a similar manner to the <img> element, we include a path to the media we want to embed inside the src attribute; we can include other attributes to specify in
formation such as whether we want it to autoplay and loop, whether we want to show the browser's default audio controls, etc. the content inside the opening and closing <audio></audio> tags is shown as a fallback in browsers that don't support the element. attributes this element's attributes include the global attributes. autoplay a boolean attribute: if specified, the audio will automatically...
...ally play audio (or videos with an audio track) can be an unpleasant experience for users, so should be avoided when possible. if you must offer autoplay functionality, you should make it opt-in (requiring a user to specifically enable it). however, this can be useful when creating media elements whose source will be set at a later time, under user control. see our autoplay guide for additional in
formation about how to properly use autoplay. controls if this attribute is present, the browser will offer controls to allow the user to control audio playback, including volume, seeking, and pause/resume playback. crossorigin this enumerated attribute indicates whether to use cors to fetch the related audio file. cors-enabled resources can be reused in the <canvas> element without being tainte...
...g, and pause/resume playback. crossorigin this enumerated attribute indicates whether to use cors to fetch the related audio file. cors-enabled resources can be reused in the <canvas> element without being tainted. the allowed values are: anonymous sends a cross-origin request without a credential. in other words, it sends the origin: http header without a cookie, x.509 certificate, or per
forming http basic authentication. if the server does not give credentials to the origin site (by not setting the access-control-allow-origin: http header), the image will be tainted, and its usage restricted. use-credentials sends a cross-origin request with a credential. in other words, it sends the origin: http header with a cookie, a certificate, or per
forming http basic authentication. if the...
...And 7 more matches
HTTP Messages - HTTP
http messages are how data is exchanged between a server and a client. 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. http messages are composed of textual in
formation encoded in ascii, and span over multiple lines. in http/1.1, and earlier versions of the protocol, these messages were openly sent across the connection. in http/2, the once human-readable message is now divided up into http frames, providing optimization and per
formance improvements. web developers, or webmasters, rarely craft these textual http messages themselves: software, a web browser, proxy, or web server, per
form this action. they provide http messages through config files (for proxies or servers), apis (for browsers), or othe...
...broadly transparent to the user. http requests, and responses, share similar structure and are composed of: a start-line describing the requests to be implemented, or its status of whether successful or a failure. this start-line is always a single line. an optional set of http headers specifying the request, or describing the body included in the message. a blank line indicating all meta-in
formation for the request has been sent. an optional body containing data associated with the request (like content of an html
form), or the document associated with a response. the presence of the body and its size is specified by the start-line and http headers. the start-line and http headers of the http message are collectively known as the head of the requests, whereas its payload is known as ...
...http headers of the http message are collectively known as the head of the requests, whereas its payload is known as the body. http requests start line http requests are messages sent by the client to initiate an action on the server. ...
...And 7 more matches
Introduction - JavaScript
amental concepts. what you should already know this guide assumes you have the following basic background: a general understanding of the internet and the world wide web (www). good working knowledge of hypertext markup language (html). some programming experience. if you are new to programming, try one of the tutorials linked on the main page about javascript. where to find javascript in
formation the javascript documentation on mdn includes the following: learn web development provides in
formation for beginners and introduces basic concepts of programming and the internet. javascript guide (this guide) provides an overview about the javascript language and its objects. javascript reference provides detailed reference material for javascript. if you are new to javascript, star...
...ript language and its objects. javascript reference provides detailed reference material for javascript. if you are new to javascript, start with the articles in the learning area and the javascript guide. once you have a firm grasp of the fundamentals, you can use the javascript reference to get more details on individual objects and statements. what is javascript? javascript is a cross-plat
form, object-oriented scripting language used to make webpages interactive (e.g., having complex animations, clickable buttons, popup menus, etc.). there are also more advanced server side versions of javascript such as node.js, which allow you to add more functionality to a website than simply downloading files (such as realtime collaboration between multiple computers). inside a host environment (f...
...ge elements such as operators, control structures, and statements. core javascript can be extended for a variety of purposes by supplementing it with additional objects; for example: client-side javascript extends the core language by supplying objects to control a browser and its document object model (dom). ...
...And 7 more matches
Number.prototype.toLocaleString() - JavaScript
or this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...se clone https://github.com/mdn/interactive-examples and send us a pull request. syntax numobj.tolocalestring([locales [, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose
formatting conventions should be used. in implementations, which ignore the locales and options arguments, the locale used and the
form of the string returned are entirely implementation dependent. ...
...x numobj.tolocalestring([locales [, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose
formatting conventions should be used. in implementations, which ignore the locales and options arguments, the locale used and the
form of the string returned are entirely implementation dependent. see the intl.number
format() constructor for details on these parameters and how to use them. return value a string with a language-sensitive representation of the given number. per
formance when
formatting large numbers of numbers, it is better to create a number
format object and use the function provided by its number
format.
format property. examples using tolocalestring in basic use without specifying a loca...
...And 7 more matches
How to make PWAs installable - Progressive web apps (PWAs)
work offline (this is required only by chrome for android currently) currently, only the chromium-based browsers such as chrome, edge, and samsung internet require the service worker. if developing your app using firefox, be aware that you will need a service worker to be compatible with chromium-based browsers. ...
... chrome for android currently) currently, only the chromium-based browsers such as chrome, edge, and samsung internet require the service worker. if developing your app using firefox, be aware that you will need a service worker to be compatible with chromium-based browsers. the manifest file the key element is a web manifest file, which lists all the in
formation about the website in a json
format. ...
... as chrome, edge, and samsung internet require the service worker. if developing your app using firefox, be aware that you will need a service worker to be compatible with chromium-based browsers. the manifest file the key element is a web manifest file, which lists all the in
formation about the website in a json
format. it usually resides in the root folder of a web app. ...
...And 7 more matches
Introduction to progressive web apps - Progressive web apps (PWAs)
it's just a shorthand used initially by google for the concept of creating a flexible, adaptable app using only web technologies. ...
...efore offer a more seamless experience for the users. you can install a native app so that it works offline, and users love tapping their icons to easily access their favorite apps, rather than navigating to it using a browser. pwas give us the ability to create web apps that can enjoy these same advantages. it's not a brand new concept—such ideas have been revisited many times on the web plat
form with various approaches in the past. progressive enhancement and responsive design already allow us to build mobile friendly websites. pwas, however, provide all this and more without losing any of the existing features that make the web great. what makes an app a pwa? as we hinted at above, pwas are not created with a single technology. they represent a new philosophy for building web apps, i...
...rvice workers, along with saving precious bandwidth and time. pwas have near-instantaneous loading (from the second visit). the ability to update only the content that has changed when an app update is available. in contrast, with a native app, even the slightest modification can force the user to download the entire application again. a look and feel that is more integrated with the native plat
form—app icons on the home screen or app launcher, applications that automatically run in full screen mode, etc. re-engaging with users through the use of system notifications and push messages, leading to more engaged users and better conversion rates. success stories there are many success stories of companies trying the pwa route, opting for an enhanced website experience rather than a native...
...And 7 more matches
<feComposite> - SVG: Scalable Vector Graphics
the <fecomposite> svg filter primitive per
forms the combination of two input images pixel-wise in image space using one of the porter-duff compositing operations: over, in, atop, out, xor, and lighter. additionally, a component-wise arithmetic operation (with the result clamped between [0..1]) can be applied. the arithmetic operation is useful for combining the output from the <fediffuselighting> and <fespecularlighting> filters with texture data. ...
...positing operations: over, in, atop, out, xor, and lighter. additionally, a component-wise arithmetic operation (with the result clamped between [0..1]) can be applied. the arithmetic operation is useful for combining the output from the <fediffuselighting> and <fespecularlighting> filters with texture data. ...
... <path id="red100" d="m 0 0 l 0 100 l 100 0 z" fill="#ff00ff" /> <path id="blue50" d="m 0 125 l 100 125 l 100 225 z" fill="#00ffff" fill-opacity=".5" /> <path id="red50" d="m 0 125 l 0 225 l 100 125 z" fill="#ff00ff" fill-opacity=".5" /> <g id="twobluetriangles"> <use xlink:href="#blue100"/> <use xlink:href="#blue50"/> </g> <g id="bluetriangles"> <use trans
form="translate(275,25)" xlink:href="#twobluetriangles"/> <use trans
form="translate(400,25)" xlink:href="#twobluetriangles"/> <use trans
form="translate(525,25)" xlink:href="#twobluetriangles"/> <use trans
form="translate(650,25)" xlink:href="#twobluetriangles"/> <use trans
form="translate(775,25)" xlink:href="#twobluetriangles"/> <use trans
form="translate(900,25)" xlink:hre...
...And 7 more matches
<metadata> - SVG: Scalable Vector Graphics
the contents of <metadata> should be elements from other xml namespaces such as rdf, foaf, etc. usage context categoriesdescriptive elementpermitted contentany elements or character data attributes global attributes core attributes global event attributes specific attributes none dom interface this element implements the svgmetadataelement interface. ...
...yle> <!-- define symbols used in the svg --> <defs> <!-- hubplug symbol. ...
...ymbol --> <symbol id="hub"> <desc>a typical 10baset/100basetx network hub</desc> <text x="0" y="15">hub</text> <g trans
form="translate(0 20)"> <rect width="253" height="84"/> <rect width="229" height="44" x="12" y="10"/> <circle fill="red" cx="227" cy="71" r="7" /> <!-- five groups each using the defined socket --> <g id="sock1et" trans
form="translate(25 20)"> <title>socket 1</title> <use xlink:href="#hubplug"/> </g> <g id="socket2" trans
form="translate(70 20)"> <title>socket 2</title> <use xlink:href="#hubplug"/> </g> <g id="socket3" trans
form="translate(115 20)"> <title>socket 3</title> <use xlink:href="#hubplug"/> </g> <g i...
...And 7 more matches
places/bookmarks - Archive of obsolete content
ox" }, { group: unsorted, tags: ["mozilla"] }], { sort: "title" } ).on("end", function (results) { // our first query is the same as the simple query above; // all of those results are also returned here. since multiple // queries are or'd together, we also get bookmarks that // match the second query. the second query's properties // are and'd together, so results that are in the plat
form's unsorted // bookmarks folder, and are also tagged with 'mozilla', get returned // as well in this query }); globals constructors bookmark(options) creates an unsaved bookmark instance. parameters options : object required options: name type title string the title for the bookmark. required. url string the url for the b...
...okmarkitems, options) creating, saving, and deleting bookmarks are all done with the save() function. this function takes in any of: a bookmark item (bookmark, group, separator) a duck-typed object (the relative properties for a bookmark item, in addition to a type property of 'bookmark', 'group', or 'separator') an array of bookmark items. all of the items passed in are pushed to the plat
form and are either created, updated or deleted. adding items: if passing in freshly instantiated bookmark items or a duck-typed object, the item is created on the plat
form. updating items: for an item referenced from a previous save() or from the result of a search() query, changing the properties and calling save() will update the item on the server. deleting items: to delete a bookmark item, p...
... in. }); parameters bookmarkitems : bookmark|group|separator|array a bookmark item (bookmark, group, separator), or an array of bookmark items to be saved. options : object optional options: name type resolve function a resolution function that is invoked during an attempt to save a bookmark item that is not derived from the latest state from the plat
form. invoked with two arguments, mine and plat
form, where mine is the item that is being saved, and plat
form is the current state of the item on the item. the object returned from this function is what is saved on the plat
form. by default, all changes on an outdated bookmark item overwrite the plat
form's bookmark item. returns placesemitter : returns a placesemitter. remove(items) a hel...
...And 6 more matches
test/assert - Archive of obsolete content
defined by the commonjs unit testing specification, version 1.1. methods ok(guard, message) tests whether an expression evaluates to true. assert.ok(a == 1, "test that a is equal to one"); this is equivalent to: assert.equal(a == 1, true, "test that a is equal to one"); parameters guard : expression the expression to evaluate. message : string optional message to log, providing extra in
formation about the test. equal(actual, expected, message) tests shallow, coercive equality with ==: assert.equal(1, 1, "test that one is one"); parameters actual : object the actual result. expected : object the expected result. message : string optional message to log, providing extra in
formation about the test. notequal(actual, expected, message) tests that two objects are not equal, us...
... deepequal(actual, expected, message) tests that two objects have a deep equality relation. deep equality is defined in the commonjs specification for assert, item 7, which is quoted here: all identical values are equivalent, as determined by ===. ...
...rily the same order), equivalent values for every corresponding key, and an identical "prototype" property. note: this accounts for both named and indexed properties on arrays. assert.deepequal({ a: "foo" }, { a: "foo" }, "equivalent objects"); parameters actual : object the actual result. expected : object the expected result. message : string optional message to log, providing extra in
formation about the test. notdeepequal(actual, expected, message) tests that two objects do not have a deep equality relation, using the negation of the test for deep equality: assert.notdeepequal({ a: "foo" }, object.create({ a: "foo" }), "object's inherit from different prototypes"); parameters actual : object the actual result. expected : object the expected result. mes...
...And 6 more matches
cfx - Archive of obsolete content
enables you to test, run, and package add-ons. cfx is is no longer supported as of firefox 44 and no longer accepted for add-on submission, jpm should now be used instead. cfx usage is: cfx [options] command [command-specific options] "options" are global options applicable to the tool itself or to all commands (for example --help). ...
...nd-specific options" are documented alongside the commands. there are four supported cfx commands: cfx init create a skeleton add-on as a starting point for your own add-on. cfx run launch an instance of firefox with your add-on installed. cfx test runs your add-on's unit tests. cfx xpi package your add-on as an xpi file, which is the install file
format for firefox add-ons. there are also a number of internal commands, which are more likely to be useful to sdk developers than to add-on developers. cfx init create a new directory called "my-addon", change into it, and run cfx init. this command will create an skeleton add-on, as a starting point for your own add-on development, with the following file structure: my-addon data...
...my-addon data docs main.md lib main.js package.json readme.md tests test-main.js cfx run this command is used to run the add-on. called with no options it looks for a file called package.json in the current directory, loads the corresponding add-on, and runs it under the version of firefox it finds in the plat
form's default install path. supported options you can point cfx run at a different package.json file using the --pkgdir option, and pass arguments to your add-on using the --static-args option. you can specify a different version of the host application using the --binary option, passing in the path to the application binary to run. the path may be specified as a full path or may be relative to th...
...And 6 more matches
Local Storage - Archive of obsolete content
caldirectory(); myfile.append("somefile.txt"); // do stuff with the file. files are handled with the nsifile interface. an nsifile doesn't necessarily represent an existing file, as in the previous examples. you first specify the file using nsifile and then use nsifile.create() to actually write it out to disk. you can also check if an nsifile exists using nsifile.exists(). to read and write in
formation in files, you need to use stream objects. you can read more about reading and writing files here. in general you won't need to do this directly, but it's always useful to know. finally, there's the issue of deleting local files when the extension is going to be uninstalled. whether this is necessary or not is a matter of preference. some extension developers prefer to leave the data there, ...
... to know. finally, there's the issue of deleting local files when the extension is going to be uninstalled. whether this is necessary or not is a matter of preference. some extension developers prefer to leave the data there, so that if the user chooses to install the extension again, all the previous data will be recovered. this is the default behavior when firefox is uninstalled: the profile in
formation remains intact and it will be there waiting for you if firefox is installed again. others feel concerned about privacy and storing private in
formation locally without deleting it. a good argument can be done for both, so it is up to you to choose what to do in this case. the fuel library has an uninstall event you can use to per
form these operations. logging good logging is essential in al...
...vascript implementation of a logger similar to the log4j logger used in java projects. the logger is called log4moz and it is implemented as a javascript code module, so it only works on firefox 3 and above. to use this logger, you need to copy the log4moz.js file to your modules directory. ...
...And 6 more matches
The Essentials of an Extension - Archive of obsolete content
rdf used to be the central storage mechanism for firefox, but it is now being replaced for a simpler database system. we'll discuss both of these storage systems further ahead in the tutorial. now let's look at the important parts of the file. ...
...f these storage systems further ahead in the tutorial. now let's look at the important parts of the file. <em:id>helloworld@xulschool.com</em:id> this is the unique identifier for the extension. firefox needs this to distinguish your extension from other extensions, so it is required that you have an id that is unique. there are two accepted standards for add-on ids. one is the email-like
format in the hello world example, which should be something like <project-name>@<yourdomain>. the other standard practice is to use a generated uuid string, which is extremely unlikely to be duplicated. unix-based systems have a command line tool called uuidgen that generates uuids. there are also downloadable tools for all plat
forms that generate them. the enclosing brackets are just notation, and t...
...her standard practice is to use a generated uuid string, which is extremely unlikely to be duplicated. unix-based systems have a command line tool called uuidgen that generates uuids. there are also downloadable tools for all plat
forms that generate them. the enclosing brackets are just notation, and they're just common practice. as long as your id has some uniqueness to it, it's ok to use either
form. <em:name>xul school hello world</em:name> <em:description>welcome to xul school!</em:description> <em:version>0.1</em:version> <em:creator>appcoast</em:creator> <em:homepageurl>https://developer.mozilla.org/docs/xul_school</em:homepageurl> this is the data that is displayed before and after the extension is installed, that you can see in the add-ons manager. there are many other tags that ...
...And 6 more matches
Creating a dynamic status bar extension - Archive of obsolete content
« previousnext » this article builds upon the article creating a status bar extension, which creates a static status bar panel in the firefox status bar, by dynamically updating its content with in
formation fetched from the web every few minutes. specifically, this sample displays a stock quote in the status bar, and, when you mouse over it, displays a tooltip containing more detailed in
formation about the stock. concepts covered in the previous sample won't be reiterated here; instead, refer to the downloadable sample code or to the previous sample for further details. download the sample you can download a copy of this sample to look over, or to use as the basis for your own extension. or, if you've already got the code from the creating a status bar extension sample, you ca...
...write the javascript code the work of fetching the stock quote an...
...write the javascript code the work of fetching the stock quote and updating the status bar panel's display is handled by the javascript code in the file stockwatcher.js. unlike our previous sample, this one is implemented as an object. ...
...And 6 more matches
XUL Structure - Archive of obsolete content
« previousnext » we'll begin by looking at how the xul is handled in mozilla. 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. the mozilla rendering engine takes the content in the
form of html source and trans
forms it into a document tree. the tree is then converted into a set of objects that can be displayed on the screen. style sheets (css), images, and other technologies are used to control the presentation. xul functions in much the same way. in fact, in mozilla, all document types, whether they are html or xul, or even svg, are all handled by the same underlying code. this ...
...sed to control the presentation. xul functions in much the same way. in fact, in mozilla, all document types, whether they are html or xul, or even svg, are all handled by the same underlying code. this means that the same css properties may be used to style both html and xul, and many of the features can be shared between both. however, there are some features that are specific to html, such as
forms, and others which are specific to xul, such as overlays. since xul and html are handled in the same way, you can load both from either your local file system, from a web page, or from an extension or standalone xulrunner application. content from remote sources (e.g. http://localhost/~username/ ), regardless of whether they are html or xul or another document type, are limited in the type of op...
...re specific to xul, such as overlays. since xul and html are handled in the same way, you can load both from either your local file system, from a web page, or from an extension or standalone xulrunner application. content from remote sources (e.g. ...
...And 6 more matches
XUL Questions and Answers - Archive of obsolete content
more documentation on search plugins is available in the search plugins category. is localizing remote xul possible? loading remote dtds for xml documents is currenty not supported in xul. the following bugs were reported on this issue: bug 22942, bug 133698. ...
...more documentation on search plugins is available in the search plugins category. is localizing remote xul possible? loading remote dtds for xml documents is currenty not supported in xul. the following bugs were reported on this issue: bug 22942, bug 133698. ...
...actually handled as strings. to convert them to integers use the parseint() javascript function. while the attributes are always strings per the dom specification, the properties will eventually be fixed to return the value with the correct type. using the "icon" attribute on a button from xulplanet.com reference: this attribute should be used to set the usage for common buttons. some plat
forms display these buttons with a small icon indicating their usage. this should be used in place of the image attribute. possible values include: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. if you are using a button that matches one of these common usages, use the icon attribut...
...And 6 more matches
Adobe Flash - Archive of obsolete content
s exposed the scriptability feature in netscape gecko browsers since flash 6r49 and later. versions of flash prior to flash 6r49 (such as flash 5) are not scriptable in netscape gecko browsers. thus client-side detection for the right version of flash is an important aspect of creating a scripted flash experience. on mac os x, there is an additional caveat: netscape gecko browsers such as camino (
formerly chimera), the latest mozilla browsers, and future versions of netscape which are built using the mach-o binary
format won't be able to use flash's scriptability features. until macromedia changes this from within the flash plugin, scriptability can not be used on mac os x browsers based on gecko. the example below shows a detection heuristic in action. example 1: verifying the flash plugin v...
...dentifyflash();</script> typically, javascript code that determines what version of the plugin is installed looks at the mimetypes array that is part of the navigator object. every plugin exposes a description string that typically includes the plugin's name and version number. the flash plugin's description string uses a standard versioning nomenclature that can then be parsed for meaningful in
formation. for example, the current flash plugin version is flash 6 r79. the description string exposes this version. furthermore, it is also necessary weed out versions of flash that are not scriptable in mach-o browsers on os x. fortunately, mach-o browsers based on netscape gecko expose this in
formation in their user-agent string. an algorithmic approach to detecting flash plugin version might be: ...
...shversionosxscriptable) // flash version is less than version 12, thus not scriptable on os x } // 6. handle errors (no flash installed, etc.) example 1 uses the regexp (regular expression) object exposed to javascript strings. the description string is broken into an array of constituent strings based on an invocation of the match method with a regular expression that assumes that the string
format will be in the
format flash major rminor where major can be a major revision such as "5" or "6" and minor is the subsidiary version number. example 1 also creates a constant flashversionosxscriptable that declares (arbitrarily) that macromedia will fix flash to be scriptable in mach-o browsers (on os x) by version 12. this is currently not the case, but 12 is a sufficiently high version number ...
...And 6 more matches
Confidentiality, Integrity, and Availability - Archive of obsolete content
in other words, only the people who are authorized to do so can gain access to sensitive data. imagine your bank records. ...
...in other words, only the people who are authorized to do so can gain access to sensitive data. imagine your bank records. ...
...in other words, only the people who are authorized to do so can gain access to sensitive data. imagine your bank records. ...
...And 6 more matches
Threats - Archive of obsolete content
this article discusses threats, explaining what they are and how they can affect network traffic. a threat is any circumstance or event with the potential to adversely impact data or systems via unauthorized access, destruction, disclosure, or modification of in
formation, and/or denial of service. threats may involve intentional actors (e.g., attacker who wants to access in
formation on a server) or unintentional actors (e.g., administrator who forgets to disable user accounts of a
former employee.) threats can be local, such as a disgruntled employee, or remote, such as an attacker in another geographical area. a threat source is the cause of a threat, such as a hostile cyber or physical attack, a human error of omission or commission, a failure of organization-controlled hardware...
...ing system and applications that create exploitable vulnerabilities, or errors made by end users and administrators. network traffic typically passes through intermediate computers, such as routers, or is carried over unsecured networks, such as wireless hotspots. because of this, it can be intercepted by a third party. threats against network traffic include the following: eavesdropping. ...
...omputers, such as routers, or is carried over unsecured networks, such as wireless hotspots. because of this, it can be intercepted by a third party. threats against network traffic include the following: eavesdropping. in
formation remains intact, but its privacy is compromised. for example, someone could learn your credit card number, record a sensitive conversation, or intercept classified in
formation. tampering. in
formation in transit is changed or replaced and then sent on to the recipient. for example, someone could alter an order for goods or change a person's resume. impersonation. in
formation passes to a person who poses as the intended recipient. impersonation can take two
forms: spoofing. a person can pretend to be someone else. for example, a person can pretend to have th...
...And 6 more matches
Requests For Enhancement - Archive of obsolete content
introduction the purpose of this page is to gather requests for enhancement to the mozilla x
forms implementation. if you have an idea that might improve mozilla's x
forms implementation then you should choose one of the following rfe categories and put your request there. you can also contact the x
forms team about your request. you can do so by posting a message on the x
forms newsgroup or file a new bug in the 'x
forms' component of the 'core' product. an additional way to attract the x
forms team's attention to an enhancement request you are promoting is to vote for the bug that is related with the feature request (if there is no bug yet then please feel free to file it). ...
...essage on the x
forms newsgroup or file a new bug in the 'x
forms' component of the 'core' product. an additional way to attract the x
forms team's attention to an enhancement request you are promoting is to vote for the bug that is related with the feature request (if there is no bug yet then please feel free to file it). then you can give a vote by clicking on the 'vote' link on the bug page. the x
forms team looks at votes to help determine which bug is more important for our x
forms users. rfe categories x
forms api this section contains rfe to the x
forms api. custom controls i think that x
forms is a great way to show that 14 year old html hacks can build really powerful web apps and reduce the need for javascript by 90%. ...
...te' link on the bug page. the x
forms team looks at votes to help determine which bug is more important for our x
forms users. rfe categories x
forms api this section contains rfe to the x
forms api. custom controls i think that x
forms is a great way to show that 14 year old html hacks can build really powerful web apps and reduce the need for javascript by 90%. now we need to start teaching x
forms to web newcomers before they are brainwashed into believing that the only way to build cool web apps is to do dom surgery with javascript! ...
...And 6 more matches
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
ral standards so they are able to operate efficiently. they may also incorporate external procedural and/or technical standards. technical standards have traditionally been pioneered through consortiums or standards bodies. the technical standards can be either public, standards-based or a proprietary de facto standard. the purpose of this document is to discuss and emphasize the importance of con
forming to open technology standards that are external to the organization. let’s begin the discussion, however, by looking inward to internal procedures, processes and standards. why should organizations have standard procedures at every level? following standards is certainly not a new organizational phenomenon; organizations require their employees to follow common rules, or a common set of stan...
...p a fundamental understanding of the importance of requiring adherence to these processes. when projects are proposed, they are evaluated to ensure compatibility with the overall business strategy. product marketing must then analyze the marketability of the application/product, and then conduct in-depth technical evaluations and market research studies. if the project is accepted, the compiled in
formation, analysis and research is merged into a request for proposal (rfp). this process is not unique: most organizations have basic project management processes for product or service. even within organizations, their processes are fine-tuned to work within the existing culture. when this happens, a development standard is created and is expected to be followed. it is easy to get caught up in th...
...by following the guidelin...
...And 6 more matches
Introduction to game development for the Web - Game development
the modern web has quickly become a viable plat
form not only for creating stunning, high quality games, but also for distributing those games. the range of games that can be created is on par with desktop and native os counterparts. with modern web technologies and a recent browser, it's entirely possible to make stunning, top-notch games for the web. and we're not talking about simple card games or multi-player social games that have in the olden days been done using flash®. we're talking about kick-ass 3d action shooters, rpgs, and more. ...
...an be created is on par with desktop and native os counterparts. with modern web technologies and a recent browser, it's entirely possible to make stunning, top-notch games for the web. and we're not talking about simple card games or multi-player social games that have in the olden days been done using flash®. we're talking about kick-ass 3d action shooters, rpgs, and more. ...
...ng about simple card games or multi-player social games that have in the olden days been done using flash®. we're talking about kick-ass 3d action shooters, rpgs, and more. thanks to massive per
formance improvements in javascript just-in-time compiler technology and new apis, you can build games that run in the browser (or on html5-powered devices) without making compromises. the html5 game plat
form you can truly think of the web as a better target plat
form for your game. ...
...And 6 more matches
Desktop gamepad controls - Game development
erview: control mechanisms next now we'll look at adding something extra — support for gamepad controls, via the gamepad api. it brings a console-like experience to your web games. the gamepad api gives you the ability to connect a gamepad to your computer and detect pressed buttons directly from the javascript code thanks to the browsers implementing such feature. an api exposes all the in
formation you need to hook up your game's logic and successfully control the user interface and gameplay. api status, browser and hardware support the gamepad api is still in working draft status, although browser support is already quite good — around 63% global coverage, according to caniuse.com. the list of supported devices is also quite extensive — most popular gamepads (e.g. xbox 360 or ps...
...the connect() and disconnect() functions are bound to the following events: window.addeventlistener("gamepadconnected", gamepadapi.connect); window.addeventlistener("gamepaddisconnected", gamepadapi.disconnect); they are fired when the gamepad is connected and disco...
... we can use to know if the controller is connected or not. the connect() and disconnect() functions are bound to the following events: window.addeventlistener("gamepadconnected", gamepadapi.connect); window.addeventlistener("gamepaddisconnected", gamepadapi.disconnect); they are fired when the gamepad is connected and disconnected respectively. the next function is update(), which updates the in
formation about the pressed buttons and axes. the buttons variable contains the layout of a given controller (for example which buttons are where, because an xbox 360 layout may be different to a generic one), the cache containing the in
formation about the buttons from the previous frame and the status containing the in
formation from the current frame. the pressed() function gets the input data and ...
...And 6 more matches
How CSS is structured - Learn web development
ead> <body> <h1>hello world!</h1> <p>this is my first css example</p> </body> </html> in some circumstances, internal stylesheets can be useful. for example, perhaps you're working with a content management system where you are blocked from modifying external css files. but for sites with more than one page, an internal stylesheet becomes a less efficient way of working. to apply uni
form css styling to multiple pages using internal stylesheets, you must have an internal stylesheet in every web page that will use the styling. the efficiency penalty carries over to site maintenance too. with css in internal stylesheets, there is the risk that even one simple styling change may require edits to multiple web pages. inline styles inline styles are css declarations that affect a sing...
...invalid. it is completely ignored by the browser's css engine. important: in css (and other web standards), it has been agreed that us spelling is the standard where there is language variation or uncertainty. for example, color should be spelled color, as colour will not work. functions while most values are relatively simple keywords or numeric values, there are some values which take the
form of a function. an example would be the calc() function, which can do simple math within css: <div class="outer"><div class="box">the inner box is 90% - 30px.</div></div> .outer { border: 5px solid black; } .box { padding: 10px; width: calc(90% - 30px); background-color: rebeccapurple; color: white; } this renders as: a function consists of the function name, and parentheses to ...
...a function consists of the function name, and parentheses to enclose the values for the function. in the case of the calc() example above, the values define the width of this box to be 90% of the containing block width, minus 30 pixels. the result of the calculation isn't something that can be computed in advance and entered as a static value. ...
...And 6 more matches
Getting started with HTML - Learn web development
lement is the opening tag, followed by content, followed by the closing tag. active learning: creating your first html element edit the line below in the input area by wrapping it with the tags <em> and </em>. to open the element, put the opening tag <em> at the start of the line. to close the element, put the closing tag </em> at the end of the line. doing this should give the line italic text
formatting! see your changes update live in the output area. if you make a mistake, you can clear your work using the reset button. if you get really stuck, press the show solution button to see the answer. playable code <h2>live output</h2> <div class="output" style="min-height: 50px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inser...
...r code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; nesting elements elements can be placed within other elements. this is called nesting. if we wanted to state that our cat is very grumpy, we could wrap the word very in a <strong> element, which means that the word is to have strong(er) text
formatting: <p>my cat is <strong>very</strong> grumpy.</p> there is a right and wrong way to do nesting. in the example above, we opened the p element first, then opened the strong element. for proper nesting, we should close the strong element first, before closing the p. the following is an example of the wrong way to do nesting: <p>my cat is <strong>very grumpy.</p></strong> the tags have to o...
...strong> the tags have to open and close in a way that they are inside or outside one another. with the kind of overlap in the example above, the browser has to guess at your intent. this kind of guessing can result in unexpected results. block versus inline elements there are two important categories of elements to know in html: block-level elements and inline elements. block-level elements
form a visible block on a page. a block-level element appears on a new line following the content that precedes it. any content that follows a block-level element also appears on a new line. block-level elements are usually structural elements on the page. for example, a block-level element might represent headings, paragraphs, lists, navigation menus, or footers. a block-level element wouldn't be nes...
...And 6 more matches
Choosing the right approach - Learn web development
placed in the event queue; async callbacks aren't. async callbacks lose full control of how the function will be executed when passed to a third-party library. browser compatibility really good general support, although the exact support for callbacks in apis depends on the particular api. refer to the reference documentation for the api you're using for more specific support info. further in
formation introducing asynchronous javascript, in particular async callbacks settimeout() settimeout() is a method that allows you to run a function after an arbitrary amount of time has passed. useful for... single delayed operation repeating operation multiple sequential operations multiple simultaneous operations yes yes (recursive timeouts) yes (nested time...
... ? safari ios ? samsung internet android ? legend full support full support compatibility unknown compatibility unknownsee implementation notes.see implementation notes. further in
formation cooperative asynchronous javascript: timeouts and intervals, in particular settimeout() settimeout() reference setinterval() setinterval() is a method that allows you to run a function repeatedly with a set interval of time between each execution. not as efficient as requestanimationframe(), but allows you to choose a running rate/frame rate. useful for... single delayed op...
...i ios ? samsung internet android full support yeslegend full support full support compatibility unknown compatibility unknownsee implementation notes.see implementation notes. further in
formation cooperative asynchronous javascript: timeouts and intervals, in particular setinterval() setinterval() reference requestanimationframe() requestanimationframe() is a method that allows you to run a function repeatedly, and efficiently, at the best framerate available given the current browser/system. you should, if at all possible, use this instead of setinterval()/recursive settimeou...
...And 6 more matches
Getting started with Vue - Learn web development
at provides useful facilities for progressive enhancement — unlike many other frameworks, you can use vue to enhance existing html. this lets you use vue as a drop-in replacement for a library like jquery. that being said, you can also use vue to write entire single page applications (spas). this allows you to create markup managed entirely by vue, which can improve developer experience and per
formance when dealing with complex applications. it also allows you to take advantage of libraries for client-side routing and state management when you need to. additionally, vue takes a "middle ground" approach to tooling like client-side routing and state management. while the vue core team maintains suggested libraries for these functions, they are not directly bundled into vue. this allows you to...
...of markup via components. most of the time, vue components are written using a special html template syntax. when you need more control than the html syntax allows, you can write jsx or plain javascript functions to define your components. as you work through this tutorial, you might want to keep the vue guide and api documentation open in other tabs, so you can refer to them if you want more in
formation on any sub topic. for a good (but potentially biased) comparison between vue and many of the other frameworks, see vue docs: comparison with other frameworks. installation to use vue in an existing site, you can drop one of the following <script> elements onto a page. this allows you to start using vue on existing sites, which is why vue prides itself on being a progressive framework. thi...
... a new app framework to build our app into. follow the steps below: in terminal, cd to where you'd like to create your sample app, then run vue create moz-todo-vue. use the arrow keys and enter to select the "manually select features" option. the first menu you’ll be presented with allows you to choose which features you want to include in your project. make sure that "babel" and "linter /
formatter" are selected. if they are not, use the arrow keys and the space bar to toggle them on. once they are selected, press enter to proceed. next you’ll select a config for the linter /
formatter. navigate to "eslint with error prevention only" and hit enter again. this will help us catch common errors, but not be overly opinionated. next you are asked to configure what kind of automated lint...
...And 6 more matches
Focus management with Vue refs - Learn web development
but the focus outline will be gone. this behavior can be jarring. in addition, what happens when you press tab again varies depending on the browser you're using. similarly, if you save or cancel your edit, focus will disappear again as you move back to the non-edit view. to give users a better experience, we'll add code to control the focus so that it gets set to the edit field when the edit
form is shown. we'll also want to put focus back on the "edit" button when a user cancels or saves their edit. in order to set focus, we need to understand a little bit more about how vue works internally. virtual dom and refs vue, like some other frameworks, uses a virtual dom (vdom) to manage elements. this means that vue keeps a representation of all of the nodes in our app in memory. any updates...
...ll also want to put focus back on the "edit" button when a user cancels or saves their edit. in order to set focus, we need to understand a little bit more about how vue works internally. virtual dom and refs vue, like some other frameworks, uses a virtual dom (vdom) to manage elements. this means that vue keeps a representation of all of the nodes in our app in memory. any updates are first per
formed on the in-memory nodes, and then all the changes that need to be made to the actual nodes on the page are synced in a batch. since reading and writing actual dom nodes is often more expensive than virtual nodes, this can result in better per
formance. however, it also means you often should not edit your html elements directly through native browser apis (like document.getelementbyid) when usin...
...u want to access, with a string identifier for the value of the attribute. it's important to note that a ref needs to be unique within a component. no two elements rendered at the same time should have the same ref. adding a ref to our app so, let's attach a ref to our "edit" button in todoitem.vue. ...
...And 6 more matches
Package management basics - Learn web development
e: npm is not the only package manager available. a successful and popular alternative package manager is yarn. yarn resolves the dependencies using a different algorithm that can mean a faster user experience. there are also a number of other emerging clients, such as pnpm. package registries for a package manager to work, it needs to know where to install packages from, and this comes in the
form of a package registry. the registry is a central place that a package is published to and thus can be installed from. npm, as well as being a package manager, is also the name of the most commonly-used package registry for javascript packages. the npm registry exists at npmjs.com. npm is not the only option. you could manage your own package registry — products like microsoft azure allow you t...
...ocalhost:1234. go there now and you’ll not see anything for now, but what is cool is that when you do make changes to your app, parcel will rebuild it and refresh the server automatically so you can instantly see the effect your update had. now for some page content. let's say we want to show human-readable relative dates, such as "2 hours ago", "4 days ago" and so on. ...
...erver automatically so you can instantly see the effect your update had. now for some page content. let's say we want to show human-readable relative dates, such as "2 hours ago", "4 days ago" and so on. the date-fns package’s
formatdistancetonow() method is useful for this (there's other packages that do the same thing too). ...
...And 6 more matches
Mozilla DOM Hacking Guide
er dom class. there you can see, for each object, what interfaces are part of the "flattened" set. as an example, on the window object, we can call all the methods defined on the following interfaces: nsidomwindow, nsidomjswindow, nsidomeventreciever, nsidomeventtarget, nsidomviewcss, and nsidomabstractview. again, without caring on what interface the method is defined. see section 1.5 for more in
formation about the init() method. for the w3c dom (level 1, 2, 3) objects, for each object there is one "standards-compliant" interface, which is exactly the same as the w3c one, named nsidom<objectname>.idl, and a mozilla-specific extension interface, named nsidomns<objectname>.idl, for compatibility with dom level 0. for example, the html "area" element has the following interfaces in its flattene...
...more nsixpcscriptable methods. those methods are used by xpconnect when we require something from javascript that was not defined in idl. for example, getproperty() is used when retrieving an attribute that was not defined in idl, and newresolve() is used when resolving for the first time an attribute or method that was not previously resolved. please see the nsixpcscriptable interface for more in
formation. the nsdomclassinfo class the heart of class info is the nsdomclassinfo class, defined in nsdomclassinfo.h. it implements two interfaces besides nsisupports: nsixpcscriptable and nsiclassinfo. we already know what nsixpcscriptable is used for (see the previous section). nsiclassinfo is an xpcom interface, very well described by mike shaver in this overview of nsiclassinfo. basically it c...
...lass(jscontext *cx, jsobject *obj);: help me! static jsclass sdomjsclass;: help me! protected section: const nsdomclassinfodata* mdata;: help me! static nsresult init(): called only once, it is used to initialize the remaining members of the nsdomclassinfodata structure, as mentioned above. once called, init() sets sisinitialized to true, to remember that the initialization has been per
formed. the implementation is described in section 1.5. static nsresult registerclassname(print32 adomclassinfoid): help me! static nsresult registerclassprotos(print32 adomclassinfoid): help me! static nsresult registerexternalclasses();: help me! nsresult resolveconstructor(jscontext *cx, jsobject *obj, jsobject **objp);: help me! static print32 getarrayindexfromid(jscontext *cx, jsval id, prbo...
...And 6 more matches
Mozilla Style System Documentation
see also the style techtalk for more complete although less detailed documentation. style context management a style context (class nsstylecontext, currently also interface nsistylecontext although the interface should go away when all of the style systems can be moved back into the layout dll) represents the style data for a css
formatting object. in the layout system, these
formatting objects are described as frames (interface nsiframe), although a pair of frames represents table
formatting objects. the css specification describes
formatting objects that correspond to elements in the content model and
formatting objects that correspond to pseudo-elements. (mozilla has a bunch of its pseudo-elements that are not in the css specification.) we also create style contexts for some thin...
... frames (interface nsiframe), although a pair of frames represents table
formatting objects. the css specification describes
formatting objects that correspond to elements in the content model and
formatting objects that correspond to pseudo-elements. (mozilla has a bunch of its pseudo-elements that are not in the css specification.) we also create style contexts for some things that are not css
formatting objects: text nodes and placeholder frames. 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 the...
...: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. this is useful for the pseudo-elements defined in the css specification (:before, :after, :first-line, :first-letter), but few of mozilla's custom pseudo-elements, many of which are hacks for further
formatting objects that we create. the pres context forwards these calls to its style set object (stylesetimpl, interface nsistyleset), which does the real work (and also maintains the lists of stylesheets and owns the rule tree). these methods may all return an existing style context rather than a new one (see stylesetimpl::getcontext), if there is a current style context with the same parent, that m...
...And 6 more matches
Profiling with Xperf
(note that it's not the first version number in the about window; that's the windows version.) if you have an older version, you will experience bugs, especially around symbol loading for local builds. ...
...(note that it's not the first version number in the about window; that's the windows version.) if you have an older version, you will experience bugs, especially around symbol loading for local builds. installation for all versions, the tools are part of the latest windows 7 sdk (sdk version 7.1). use the web installer to install at least the "win32 development tools". ...
... that's the windows version.) if you have an older version, you will experience bugs, especially around symbol loading for local builds. installation for all versions, the tools are part of the latest windows 7 sdk (sdk version 7.1). use the web installer to install at least the "win32 development tools". once the sdk installs, execute either wpt_x86.msi or wpt_x64.msi in the redist/windows per
formance toolkit folder of the sdk's install location (typically program files/microsoft sdks/windows/v7.1/redist/windows per
formance toolkit) to actually install the windows per
formance toolkit tools. it might already be installed by the windows sdk. check if c:\program files\microsoft windows per
formance toolkit already exists. for 64-bit windows 7 or vista, you'll need to do a registry tweak an...
...And 6 more matches
Optimizing Applications For NSPR
netscape portable runtime (nspr) tries to provide a consistent level of service across the plat
forms it supports. this has proven to be quite challenging, a challenge that was met to a large degree, but there is always room for improvement. the casual client may not encounter a need to know the details of the shortcomings to the level described here, but if and when clients become more sophisticated, these issues will certainly surface. this memo is by no way complete. multiplat
form do not call any blocking system call from a local thread. the only exception to this rule is the <tt>select()</tt> and <tt>poll()</tt> system calls on unix, both of which nspr has overridden to make sure they are aware of the nspr local threads. in the combined (mxn) model, which includes nt, irix (spr...
... this problem is especially obvious because the idle thread, which is in charge of driving the asynch io completion port, is also blocked. do not call blocking system calls from the primordial thread. create a global thread and call the system call in that thread, and have the primordial thread join that thread. nspr uses timer signals to implement thread preemption for local threads on some plat
forms. if all the software linked into the application is not ported to the nspr api, the application may fail because of threads being preempted during critical sections. to disable thread preemption call <tt>pr_disableclockinterrupts()</tt>during initialization. interrupting threads (via <tt>pr_interrupt()</tt>) on threads blocked in i/o functions is implemented to various degrees on different plat...
...s. if all the software linked into the application is not ported to the nspr api, the application may fail because of threads being preempted during critical sections. to disable thread preemption call <tt>pr_disableclockinterrupts()</tt>during initialization. interrupting threads (via <tt>pr_interrupt()</tt>) on threads blocked in i/o functions is implemented to various degrees on different plat
forms. the unix based plat
forms all implement the function though there may be up to a 5 second delay in processing the request. the mechanism used to implement <tt>pr_interrupt()</tt> on the pthreads versions of nspr is flawed. no failure attributable to the flaw has shown up in any tests or products - yet. the specific area surrounding pthread's continuation thread has been both observed and empiri...
...And 6 more matches
NSS environment variables
specify. nss_shared_db 3.12 nss_disable_arena_free_list string (any non-empty value) define this variable to get accurate leak allocation stacks when using leak reporting software. nss_memory_allocation 3.4 nss_disable_unload string (any non-empty value) disable unloading of dynamically loaded nss shared libraries during shutdown. necessary on some plat
forms to get correct function names when using leak reporting software. 3.11.8 nss_enable_audit boolean (1 to enable) enable auditing of activities of the nss cryptographic module in fips mode. audit data 3.11.2 nss_enable_pkix_verify boolean (any non-empty value to enable) use libpkix, rather than the old cert library, to verify certificates. 3.12 ...
..., such as in signatures on certificates and crls. see documentation at this link. 3.12.3 nss_output_file string (filename) output file path name for the pkcs #11 module logger. default is stdout. 3.7 nss_sdb_use_cache string ("no","yes","auto") controls whether nss uses a local cache of sql database contents. default is "auto". see the source for more in
formation. 3.12 nss_ssl_cbc_random_iv string ("0", "1") controls the workaround for the beast attack on ssl 3.0 and tls 1.0. "0" disables it, "1" enables it. it is also known as 1/n-1 record splitting. default is "1". nss_ssl_enable_renegotiation string ([0|n|n], [1|u|u], [2|r|r], [3|t|t]) (definition for nss 3.12.6 and above) sets how tls rene...
...in both debug and non-debug builds. 3.12.3 nss_strict_shutdown string (any non-empty value) will trigger an assertion failure in debug builds when a program tries to shutdown nss before freeing all the resources it acquired from nss while nss was initialized. 3.5 nss_trace_ocsp boolean (any value to enable) enables ocsp tracing. the trace in
formation is written to the file pointed by nspr_log_file (default stderr). see nss tracing 3.12 nss_use_decoded_cka_ec_point boolean (any value to enable) tells nss to send ec key points across the pkcs#11 interface in the non-standard unencoded
format that was used by default before nss 3.12.3. 3.12.3 nss_use_shexp_in_cert_name boolean (any value to enable) ...
...And 6 more matches
NSS functions
unction has new arguments such as new flag or addition to structure. ssl functions the public functions listed here are used to configure sockets for communication via the ssl and tls protocols. in addition to the functions listed here, applications that support ssl use some of the certificate functions, crypto functions, and utility functions described below on this page. other sources of in
formation: the nss_reference documents the functions most commonly used by applications to support ssl. the nss home page links to additional ssl documentation. if documentation is available for a function listed below, the function name is linked to either its mdc wiki page or its entry in the old ssl reference. the mozilla cross reference (mxr) link for each function provides access to the fun...
...mxr 3.4 and later cert_findsmimeprofile mxr 3.2 and later cert_findsubjectkeyidextension mxr 3.7 and later cert_findusercertbyusage mxr 3.4 and later cert_findusercertsbyusage mxr 3.4 and later cert_finishcertificaterequestattributes mxr 3.10 and later cert_finishextensions mxr 3.5 and later cert_
formatname mxr 3.2 and later cert_freedistnames mxr 3.2 and later cert_freenicknames mxr 3.2 and later cert_getavatag mxr 3.2 and later cert_getcertchainfromcert mxr 3.4 and later cert_getcertemailaddress mxr 3.2 and later cert_getcertificatenames mxr 3.10 and later cert_getcertificaterequestextens...
...eralname mxr 3.10 and later cert_getprevnameconstraint mxr 3.10 and later cert_getsloptime mxr 3.2 and later cert_getsslcacerts mxr 3.2 and later cert_getstatename mxr 3.2 and later cert_getusepkixforvalidation mxr 3.12 and later cert_getvaliddnspatternsfromcert mxr 3.12 and later cert_gentime2
formattedascii mxr 3.2 and later cert_hexify mxr 3.2 and later cert_importcachain mxr 3.2 and later cert_importcerts mxr 3.2 and later cert_isrootdercert mxr 3.8 and later cert_isusercert mxr 3.6 and later cert_keyfromdercrl mxr 3.4 and later cert_makecanickname mxr 3.4 and later cer...
...And 6 more matches
NSS Tools crlutil
) and list, create, modify or delete certificates entries in a particular crl. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation. this document discusses certificate revocation list management. for in
formation on security module database management, see using the security module database tool. for in
formation on certificate and key database management, see using the certificate database tool. availability see the release notes for the plat
forms this tool is available on. syntax to run the certificate revocation list management tool, type the command crlutil option [arguments] where o...
... -e erase all crls of specified type from the cert database -l list existing crl located in cert database file. -m modify existing crl which can be located in cert db or in arbitrary file. if located in file it should be encoded in asn.1 encode
format. arguments -b bypass ca signature checks. -p dbprefix specify the prefix used on the nss security database files (for example, my_cert8.db and my_key3.db). this option is provided as a special case. changing the names of the ce...
... bypass ca signature checks. -p dbprefix specify the prefix used on the nss security database files (for example, my_cert8.db and my_key3.db). this option is provided as a special case. changing the names of the certificate and key databases is not recommended. -a use ascii
format or allow the use of ascii
format for input and output. this
formatting follows rfc #1113. -c crl-gen-file specify script file that will be used to control crl generation/modification. see crl-cript-file
format below. if options -m|-g is used and -c crl-script-file is not specified, crlutil will read script data from standard input. ...
...And 6 more matches
NSS tools : signver
ut_file] [-s signature_file] [-v] description the signature verification tool, signver, is a simple command-line utility that unpacks a base-64-encoded pkcs#7 signed object and verifies the digital signature using standard cryptographic techniques. the signature verification tool can also display the contents of the signed object. options -a displays all of the in
formation in the pkcs#7 signature. -v verifies the digital signature. -d [sql:]directory specify the database directory which contains the certificates and keys. 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...
...ecify the database directory which contains the certificates and keys. 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). if the prefix sql: is not used, then the tool assumes that the given databases are in the old
format. -a sets that the given signature file is in ascii
format. -i input_file gives the input file for the object with signed data. -o output_file gives the output file to which to write the results. -s signature_file gives the input file for the digital signature. -v enables verbose output. extended examples verifyi...
...signature. -v enables verbose output. extended examples verifying a signature the -v option verifies that the signature in a given signature file is valid when used to sign the given object (from the input file). signver -v -s signature_file -i signed_file -d sql:/home/my/sharednssdb signaturevalid=yes printing signature data the -a option prints all of the in
formation contained in a signature file. using the -o option prints the signature file in
formation to the given output file rather than stdout. signver -a -s signature_file -o output_file nss database types nss originally used berkeleydb databases to store security in
formation. the last versions of these legacy databases are: o cert8.db for certificates o key3.db for keys ...
...And 6 more matches
TPS Tests
to end test for sync. it's name stands for testing and profiling tool for sync (which is a misnomer, since it doesn't do any profiling), and it should not be confused with the similarly named tests in talos. tps consists of a firefox extension of the same name, along with a python test runner, both of which live inside mozilla-central. the python test runner will read a test file (in javascript
format), setup one or more firefox profiles with the necessary extensions and preferences, then launch firefox and pass the test file to the extension. the extension will read the test file and per
form a series of actions specified therein, such as populating a set of bookmarks, syncing to the sync server, making bookmark modifications, etc. a test file may contain an arbitrary number of sections, ea...
...tionally, note that the config file must parse as valid json, and so you can't have comments in it (sorry, i know this is annoying). one alternative is to put underscores before the "disabled" preferences, e.g. "_identity.fxaccounts.autoconfig.uri": "...". writing tps tests each tps test is run as a series of "phases". a phase runs in some firefox profile, and contains some set of actions to per
form or check on that profile. phases have an n to m relationship with profiles, where n >= m (there can never be more phases than profiles). typically there are two profiles used, but any number of profiles could be used in theory (other than 0). after the phases run, two additional "cleanup" phases are run, to unregister the devices with fxa. this is an implementation detail, but if you work with t...
... or phases as you need, but every phase you define later must be declared here, or it will not be run by the python test runner. any phases declared here but not implemented later will cause the test to fail when it hits that phase. 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. bookmarks passwords history tabs
form data prefs test phases the phase blocks are where the action happens! they tell tps what to do. each phase block contains the name of a phase, and a list of actions. tps iterates through the phase blocks in alphanumeric order, and for each phase, it does the following: launches firefox...
...And 6 more matches
Finishing the Component
they can ns_release() the service as usual. * * a user of a service may keep references to particular services * indefinitely and only must call release when it shuts down. * * @status frozen */ these frozen interfaces and functions are part of the gecko sdk. the rule of thumb is that interfaces outside of the sdk are considered "experimental" or unfrozen. see the following sidebar for in
formation about how frozen and unfrozen interfaces can affect your component development, and for technical details about how interface changes beneath your code can cause havoc. the danger of using unfrozen interfaces suppose that you need to use the interface nsifoo that isn't frozen. you build your component using this interface, and it works great with the version of gecko that you have tested ...
...irst entry in the v-table is in fact isprime(). when this method call is made, the code execution treats the isprime method as testa. needless to say, this is a bad thing. furthermore, there is no way easy way to realize this error at runtime. gecko developers could change the interface's iid, and some do. this can prevent many errors like this. but unfrozen interfaces are not supported in any
formal way, and relying upon a different iid for any change in the interface is not a good idea either. when using frozen interfaces, you are guaranteed compatibility with future versions of gecko. the only trouble occurs when the compiler itself changes its v-table layout, which can happen when the compiler changes its abi. for example, in 2002 the gnu compiler collection (gcc), version 3.2 changed ...
... on the white list, the entire page should be blocked. in the weblock component, the shouldload method looks like this: ns_imethodimp weblock::shouldload(print32 contenttype, nsiuri *contentlocation, nsisupports *ctxt, nsidomwindow *window, prbool *_retval) uni
form resource locators the method passes in an interface pointer of type nsiuri, which is based on the uni
form 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. the name of the machine hosting the resource. the name of the resource itself, given as a path. in this context, uris are the strings ...
...And 6 more matches
nsIStringBundle
intl/strres/nsistringbundle.idlscriptable this interface provides functions for retrieving both
formatted and un
formatted strings from a properties file. inherits from: nsisupports last changed in gecko 1.7 this interface is used by xul:stringbundle to retrieve strings. it is recommended that you use the methods of xul:stringbundle to access these functions unless necessary. alternatively, a string bundle can be created within a javascript context with nsistringbundleservice. ...
...strings from a properties file. inherits from: nsisupports last changed in gecko 1.7 this interface is used by xul:stringbundle to retrieve strings. it is recommended that you use the methods of xul:stringbundle to access these functions unless necessary. alternatively, a string bundle can be created within a javascript context with nsistringbundleservice. ...
...l:stringbundle to retrieve strings. it is recommended that you use the methods of xul:stringbundle to access these functions unless necessary. alternatively, a string bundle can be created within a javascript context with nsistringbundleservice. ...
...And 6 more matches
xptcall FAQ
why does xptcall exist? xptcall exists for two reasons: to support invoking arbitrary methods on xpcom interfaces. to support dynamically impersonating any xpcom interface. both of these facilities are required by xpconnect. these facilities are also used by xpcom/proxy. it may also be used by other subsystems in the future. ...
...pport dynamically impersonating any xpcom interface. both of these facilities are required by xpconnect. these facilities are also used by xpcom/proxy. it may also be used by other subsystems in the future. the xptcall approach was chosen over an approach that would have required generating stub code for calling and implementing all interfaces. though the chosen approach requires some core plat
form specific code, it has minimal footprint and is extendable to work with any valid xpcom interface without requiring additional per plat
form compiled code to be distributed. what does xptcall really do? the core invoke function has the declaration: xptc_public_api(nsresult) xptc_invokebyindex(nsisupports* that, pruint32 methodindex, pruint32 paramcount, ...
... 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). given the correct set of parameters, this function can call any method on any xpcom interface. xpconnect uses in
formation from typelib files to reflect arbitrary xpcom interfaces into javascript and to make calls from javascript to xpcom using xptc_invokebyindex. the in
formation in the typelibs allows xpconnect to convert function parameters and build the nsxptcvariant array required to make this call. the stubs (or impersonation) facility of xptcall allows for implementing a class which can, at runtime, prete...
...And 6 more matches
Debugger.Script - Firefox Developer Tools
each of the following is represented by a single jsscript object: the body of a function—that is, all the code in the function that is not contained within some nested function. ...
... each of the following is represented by a single jsscript object: the body of a function—that is, all the code in the function that is not contained within some nested function. ...
... each of the following is represented by a single jsscript object: the body of a function—that is, all the code in the function that is not contained within some nested function. ...
...And 6 more matches
about:debugging - Firefox Developer Tools
f debugging targets. at the moment it supports three main sorts of targets: restartless add-ons, tabs, and workers. opening the about:debugging page there are two ways to open about:debugging: type about:debugging in the firefox url bar. in the tools > web developer menu, click remote debugging. when about:debugging opens, on the left-hand side, you'll see a sidebar with two options and in
formation about your remote debugging setup: setup use the setup tab to configure the connection to your remote device. this firefox provides in
formation about temporary extensions you have loaded for debugging, extensions that are installed in firefox, the tabs that you currently have open, and service workers running on firefox. if your about:debugging page is different from the one displa...
...lick the refresh devices button again. the device should appear. note: you do not need to install the full android studio sdk. only adb is needed. to start a debugging session, first open the page that you wish to debug and then click connect next to the device name to open a connection to it. if the connection was successful, you can now click the name of the device to switch to a tab with in
formation about the device. the in
formation on this page is the same as the in
formation on the this firefox tab, but instead of displaying in
formation for your computer, it displays the in
formation for the remote device with the addition of a tabs section with an entry for each of the tabs open on the remote device. note: if the version of firefox on your remote device is more than one major versi...
...with the addition of a tabs section with an entry for each of the tabs open on the remote device. ...
...And 6 more matches
Frame Timing API - Web APIs
the per
formanceframetiming interface provides frame timing data about the browser's event loop. a frame represents the amount of work a browser does in one event loop iteration such as processing dom events, resizing, scrolling, rendering, css animations, etc. a frame rate of 60 fps (frames per second) for a 60 hz refresh rate is a common target for a good responsive user experience. this means the browser should process a frame in about 16.7 ms. an application can register a per
formanceobserver for "frame" per
formance entry types. the observer (callback) will be notified when new "frame" events are added to the browser's per
formance timeline and the frame's duration (length of time) will be available. this data can be used to help identify areas that take too long to provide a goo...
...ormance entry types. the observer (callback) will be notified when new "frame" events are added to the browser's per
formance timeline and the frame's duration (length of time) will be available. this data can be used to help identify areas that take too long to provide a good user experience. example code of the interfaces described in this document is included in using the frame timing api. per
formance frames the per
formanceframetiming interface extends the following per
formanceentry properties (for "frame" per
formance entry types) by qualifying and constrainting the properties as follows: per
formanceentry.entrytype set to "frame". ...
...o long to provide a good user experience. example code of the interfaces described in this document is included in using the frame timing api. per
formance frames the per
formanceframetiming interface extends the following per
formanceentry properties (for "frame" per
formance entry types) by qualifying and constrainting the properties as follows: per
formanceentry.entrytype set to "frame". per
formanceentry.name set to the document's address. per
formanceentry.starttime set to the domhighrestimestamp when the frame was started. ...
...And 6 more matches
Using the Gamepad API - Web APIs
ts id) had caused the event, since multiple gamepads might be connected at once. we can do much more with the gamepad object, including holding a reference to it and querying it to find out which buttons and axes are being pressed at any one time. doing so is often desirable for games or other interactive web pages that need to know the state of a gamepad now vs. the next time an event fires. per
forming such checks tends to involve using the gamepad object in conjunction with an animation loop (e.g., requestanimationframe), where developers want to make decisions for the current frame based on the state of the gamepad or gamepads. the navigator.getgamepads() method returns an array of all devices currently visible to the webpage, as gamepad objects (the first value is always null, so null wi...
...oop (e.g., requestanimationframe), where developers want to make decisions for the current frame based on the state of the gamepad or gamepads. the navigator.getgamepads() method returns an array of all devices currently visible to the webpage, as gamepad objects (the first value is always null, so null will be returned if there are no gamepads connected.) this can then be used to get the same in
formation. for example, the first code example above you be rewritten as shown below: window.addeventlistener("gamepadconnected", function(e) { var gp = navigator.getgamepads()[e.gamepad.index]; console.log("gamepad connected at index %d: %s. %d buttons, %d axes.", gp.index, gp.id, gp.buttons.length, gp.axes.length); }); the gamepad object's properties are as follows: id: a string con...
...ple, the first code example above you be rewritten as shown below: window.addeventlistener("gamepadconnected", function(e) { var gp = navigator.getgamepads()[e.gamepad.index]; console.log("gamepad connected at index %d: %s. ...
...And 6 more matches
Checking when a deadline is due - Web APIs
ion that stores task titles and deadline times and dates via indexeddb, and then provides users with notifications when deadline dates are reached, via the notification, and vibration apis. you can download the to-do list notifications app from github and play around with the source code, or view the app running live. the basic problem in the to-do app, we wanted to first record time and date in
formation in a
format that is both machine readable and human understandable when displayed, and then check whether each time and date is occurring at the current moment. basically, we want to check what the time and date is right now, and then check each stored event to see if any of their deadlines match the current time and date. if they do, we want to let the user know with some kind of notificati...
...e and date is occurring at the current moment. basically, we want to check what the time and date is right now, and then check each stored event to see if any of their deadlines match the current time and date. if they do, we want to let the user know with some kind of notification. this would be easy if we were just comparing two date objects, but of course humans don't want to enter deadline in
formation in the same
format javascript understands. human-readable dates are quite different, with a number of different representations. recording the date in
formation to provide a reasonable user experience on mobile devices, and to cut down on ambiguities, i decided to create an html
form with: a text input for entering a title for your to-do list. this is the least avoidable bit of user ty...
...on others you just get a standard text input, which is okay. <select> elements for inputting the day, month and year of the deadline. ...
...And 6 more matches
SubtleCrypto.unwrapKey() - Web APIs
the unwrapkey() method of the subtlecrypto interface "unwraps" a key. this means that it takes as its input a key that has been exported and then encrypted (also called "wrapped"). it decrypts the key and then imports it, returning a cryptokey object that can be used in the web crypto api. as with subtlecrypto.importkey(), you specify the key's import
format and other attributes of the key to import details such as whether it is extractable, and which operations it can be used for. but because unwrapkey() also decrypts the key to be imported, you also need to pass in the key that must be used to decrypt it. this is sometimes called the "unwrapping key". the inverse of unwrapkey() is subtlecrypto.wrapkey(): while unwrapkey is composed of decrypt + import, wrapkey is composed of encrypt + ...
...tions it can be used for. but because unwrapkey() also decrypts the key to be imported, you also need to pass in the key that must be used to decrypt it. this is sometimes called the "unwrapping key". the inverse of unwrapkey() is subtlecrypto.wrapkey(): while unwrapkey is composed of decrypt + import, wrapkey is composed of encrypt + export. syntax const result = crypto.subtle.unwrapkey(
format, wrappedkey, unwrappingkey, unwrapalgo, unwrappedkeyalgo, extractable, keyusages ); parameters
format is a string describing the data
format of the key to unwrap. it can be one of the following: raw: raw
format. pkcs8: pkcs #8
format. spki: subjectpublickeyinfo
format. jwk: json web key
format. wrappedkey is an arraybuffer containing the wrappe...
... unwrappingkey is the cryptokey to use to decrypt the wrapped key. the key must have the unwrapkey usage set. ...
...And 6 more matches
SubtleCrypto.wrapKey() - Web APIs
to export a key, it must have cryptokey.extractable set to true. but because wrapkey() also encrypts the key to be imported, you also need to pass in the key that must be used to encrypt it. this is sometimes called the "wrapping key". ...
...to export a key, it must have cryptokey.extractable set to true. but because wrapkey() also encrypts the key to be imported, you also need to pass in the key that must be used to encrypt it. this is sometimes called the "wrapping key". ...
...ptokey.extractable set to true. but because wrapkey() also encrypts the key to be imported, you also need to pass in the key that must be used to encrypt it. this is sometimes called the "wrapping key". the inverse of wrapkey() is subtlecrypto.unwrapkey(): while wrapkey is composed of export + encrypt, unwrapkey is composed of import + decrypt. syntax const result = crypto.subtle.wrapkey(
format, key, wrappingkey, wrapalgo ); parameters
format is a string describing the data
format in which the key will be exported before it is encrypted. it can be one of the following: raw: raw
format. pkcs8: pkcs #8
format. spki: subjectpublickeyinfo
format. jwk: json web key
format. key is the cryptokey to wrap. wrappingkey is the cryptokey used to encrypt the...
...And 6 more matches
WebRTC connectivity - Web APIs
ge needs heavy rewriting for structural integrity and content completeness. lots of info here is good but the organization is a mess since this is sort of a dumping ground right now. signaling unfortunately, webrtc can’t create connections without some sort of server in the middle. we call this the signal channel or signaling service. it’s any sort of channel of communication to exchange in
formation before setting up a connection, whether by email, post card or a carrier pigeon... it’s up to you. the in
formation we need to exchange is the offer and answer which just contains the sdp mentioned below. peer a who will be the initiator of the connection, will create an offer. they will then send this offer to peer b using the chosen signal channel. peer b will receive the offer from the...
...tor of the connection, will create an offer. they will then send this offer to peer b using the chosen signal channel. peer b will receive the offer from the signal channel and create an answer. they will then send this back to peer a along the signal channel. session descriptions the configuration of an endpoint on a webrtc connection is called a session description. the description includes in
formation about the kind of media being sent, its
format, the transfer protocol being used, the endpoint's ip address and port, and other in
formation needed to describe a media transfer endpoint. this in
formation is exchanged and stored using session description protocol (sdp); if you want details on the
format of sdp data, you can find it in rfc 2327. when a user starts a webrtc call to another user...
...the endpoint's ip address and port, and other in
formation needed to describe a media transfer endpoint. this in
formation is exchanged and stored using session description protocol (sdp); if you want details on the
format of sdp data, you can find it in rfc 2327. when a user starts a webrtc call to another user, a special description is created called an offer. this description includes all the in
formation about the caller's proposed configuration for the call. the recipient then responds with an answer, which is a description of their end of the call. in this way, both devices share with one another the in
formation needed in order to exchange media data. this exchange is handled using interactive connectivity establishment (ice, a protocol which lets two devices use an intermediary to exchang...
...And 6 more matches
WebRTC API - Web APIs
webrtc (web real-time communication) is a technology which enables web applications and sites to capture and optionally stream audio and/or video media, as well as to exchange arbitrary data between browsers without requiring an intermediary. the set of standards that comprise webrtc makes it possible to share data and per
form teleconferencing peer-to-peer, without requiring that the user installs plug-ins or any other third-party software. webrtc consists of several interrelated apis and protocols which work together to achieve this. the documentation you'll find here will help you understand the fundamentals of webrtc, how to set up and use both data and media connections, and more. interoperability because implementations of webrtc are still evolving, and because each browser has differ...
...al drivers or plug-ins, and can often be made without any intermediary servers. connections between two peers are represented by the rtcpeerconnection interface. once a connection has been established and opened using rtcpeerconnection, media streams (mediastreams) and/or data channels (rtcdatachannels) can be added to the connection. ...
... number of tracks of media in
formation; 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). most streams consist of at least one audio track and likely also a video track, and can be used to send and receive both live media or stored media in
formation (such as a streamed movie). you can also use the connection between two peers to exchange arbitrary binary data using the rtcdatachannel interface. this can be used for back-channel in
formation, metadata exchange, game status packets, file transfers, or even as a primary channel for data transfer. more details and links to relevant guides and tutorials needed webrtc reference because web...
...And 6 more matches
Writing WebSocket servers - Web APIs
a websocket server can be written in any server-side programming language that is capable of berkeley sockets, such as c(++), python, php, or server-side javascript. ...
...a reverse proxy (such as a regular http server) to detect websocket handshakes, pre-process them, and send those clients to a real websocket server. this means that you don't have to bloat your server code with cookie and authentication handlers (for example). the websocket handshake first, the server must listen for incoming socket connections using a standard tcp socket. depending on your plat
form, this may be handled for you automatically. for example, let's assume that your server is listening on example.com, port 8000, and your socket server responds to get requests at example.com/chat. warning: the server may listen on any port it chooses, but if it chooses any port other than 80 or 443, it may have problems with firewalls and/or proxies. browsers generally require a secure connectio...
...too many connections in order to save itself from denial-of-service attacks. for example, you might keep a table of usernames or id numbers along with the corresponding websocket and other data that you need to associate with that connection. exchanging data frames either the client or the server can choose to send a message at any time — that's the magic of websockets. ...
...And 6 more matches
Using the Web Animations API - Web APIs
u off in the right direction with fun demos and tutorials featuring alice in wonderland. meet the web animations api the web animations api opens the browser’s animation engine to developers and manipulation by javascript. this api was designed to underlie implementations of both css animations and css transitions, and leaves the door open to future animation effects. it is one of the most per
formant ways to animate on the web, letting the browser make its own internal optimizations without hacks, coercion, or window.requestanimationframe(). with the web animations api, we can move interactive animations from stylesheets to javascript, separating presentation from behavior. we no longer need to rely on dom-heavy techniques such as writing css properties and scoping classes onto elements t...
...that leads to wonderland (see the full code on codepen): notice that the background moves, alice spins, and her color changes at an offset from her spinning. we’re going to focus on just alice for this tutorial. here’s the simplified css that controls alice’s animation: #alice { animation: alicetumbling infinite 3s linear; } @keyframes alicetumbling { 0% { color: #000; trans
form: rotate(0) translate3d(-50%, -50%, 0); } 30% { color: #431236; } 100% { color: #000; trans
form: rotate(360deg) translate3d(-50%, -50%, 0); } } this changes alice’s color and her trans
form’s rotation over 3 seconds at a constant (linear) rate and loops infinitely. in the @keyframes block we can see that 30% of the way through each loop (about .9 seconds in), alice’s co...
...of the way through each loop (about .9 seconds in), alice’s color changes from black to a deep burgundy then back again by the end of the loop. moving it to javascript now let’s try creating the same animation with the web animations api. representing keyframes the first thing we need is to create a keyframe object corresponding to our css @keyframes block: var alicetumbling = [ { trans
form: 'rotate(0) translate3d(-50%, -50%, 0)', color: '#000' }, { color: '#431236', offset: 0.3}, { trans
form: 'rotate(360deg) translate3d(-50%, -50%, 0)', color: '#000' } ]; here we’re using an array containing multiple objects. each object represents a key from the original css. however, unlike css, the web animations api doesn’t need to explicitly be told the percentages along the animation...
...And 6 more matches
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
ject relative to that one, you can call getoffsetreferencespace(), passing into it the position and orientation you want the second object to have relative to the position and orientation of the object on which you call getoffsetreferencespace(). ...
...these values are added to the position and orientation of the current reference space and then the result is used as the position and orientation of the newly created xrreferencespace. ...
...getoffsetreferencespace(). teleporting or setting the position of the viewer upon first creating a scene, you may need to set the user's position within the 3d world. you can do that using getoffsetreferencespace(). xrsession.requestreferencespace("local") .then((refspace) => { xrreferencespace = refspace; xrreferencespace = xrreferencespace.getoffsetreferencespace( new xrrigidtrans
form(startposition, {x:0, y:0, z:1.0, w: 1.0})); xrsession.requestanimationframe(drawframe); }); in this code, we obtain a local reference space, then use getoffsetreferencespace() to create a new space whose origin is adjusted to a position given by startposition and whose orientation is looking directly along the z azis. then the first animation frame is requested using xrsession's requestanimati...
...And 6 more matches
ARIA live regions - Accessibility
ite" is used. any region which receives updates that are important for the user to receive, but not so rapid as to be annoying, should receive this attribute. the screen reader will speak changes whenever the user is idle. for regions which are not important, or would be annoying because of rapid updates or other reasons, silence them with aria-live="off". ...
...hat are important for the user to receive, but not so rapid as to be annoying, should receive this attribute. the screen reader will speak changes whenever the user is idle. for regions which are not important, or would be annoying because of rapid updates or other reasons, silence them with aria-live="off". dropdown box updates useful onscreen in
formation a website specializing in providing in
formation about planets provides a dropdown box. ...
...speak changes whenever the user is idle. for regions which are not important, or would be annoying because of rapid updates or other reasons, silence them with aria-live="off". dropdown box updates useful onscreen in
formation a website specializing in providing in
formation about planets provides a dropdown box. when a planet is selected from the dropdown, a region on the page is updated with in
formation about the selected planet. ...
...And 6 more matches
Using the alert role - Accessibility
s how to use the alert role and describes the effect it has on browsers and assistive technology. the alert role is used to communicate an important and usually time-sensitive message to the user. when this role is added to an element, the browser will send out an accessible alert event to assistive technology products which can then notify the user about it. the alert role is most useful for in
formation that requires the user's immediate attention, for example: an invalid value was entered into a
form field the user's login session is about to expire the connection to the server was lost, local changes will not be saved because of its intrusive nature, the alert role must be used sparingly and only in situations where the user's immediate attention is required. dynamic changes that ...
...ology products should listen for such an event and notify the user accordingly: screen readers may interrupt current output (whether it's speech or braille) and immediately announce or display the alert message. screen magnifiers may visually indicate that an alert occurred and what the alert text was. note: opinons may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: adding the role in the html code the snippet below shows how the alert role is added directly into the html source code. the moment the element finishes loading the screen reader should be notified of the alert. if the element was already in the original source code when the page loaded, the screen re...
...adding the role in the html code the snippet below shows how the alert role is added directly into the html source code. the moment the element finishes loading the screen reader should be notified of the alert. if the element was already in the original source code when the page loaded, the screen reader will announce the error immediately after announcing the page title. <h2 role="alert">your
form could not be submitted because of 3 validation errors.</h2> example 2: dynamically adding an element with the alert role this snippet dynamically creates an element with an alert role and adds it to the document structure. let myalert = document.createelement("p"); myalert.setattribute("role", "alert"); let myalerttext = document.createtextnode("you must agree with our terms of service to crea...
...And 6 more matches
Alerts - Accessibility
the problem you have a
form — a contact
form, for example — that you want to put some accessible error checking into. examples of common problems include e-mail addresses which are not valid, or a name field which does not contain at least a first name or a surname. the
form first, please read about the aria-required technique if you have not done so, as this technique expands upon that. ...
... have a
form — a contact
form, for example — that you want to put some accessible error checking into. examples of common problems include e-mail addresses which are not valid, or a name field which does not contain at least a first name or a surname. the
form first, please read about the aria-required technique if you have not done so, as this technique expands upon that. ...
...orm — a contact
form, for example — that you want to put some accessible error checking into. examples of common problems include e-mail addresses which are not valid, or a name field which does not contain at least a first name or a surname. the
form first, please read about the aria-required technique if you have not done so, as this technique expands upon that. ...
...And 6 more matches
@supports - CSS: Cascading Style Sheets
re name-value pairs combined by conjunctions (and), disjunctions (or), and/or negations (not). precedence of operators can be defined with parentheses. declaration syntax the most basic supports condition is a simple declaration (a property name followed by a value, separated by a colon). the declaration must be surrounded by parentheses. the following example returns true if the browser's trans
form-origin property considers 5% 5% valid: @supports (trans
form-origin: 5% 5%) {} function syntax the second basic supports condition is a supports function, the syntax for these is supported by all browsers, but the functions themselves are still being standardized. selector() tests if the browser supports the tested selector syntax. the following example returns true if the browser supports ...
... being standardized. selector() tests if the browser supports the tested selector syntax. the following example returns true if the browser supports the child combinator: @supports selector(a > b) {} the not operator the not operator can precede any expression to create a new expression, resulting in the negation of the original one. ...
...ctor syntax. the following example returns true if the browser supports the child combinator: @supports selector(a > b) {} the not operator the not operator can precede any expression to create a new expression, resulting in the negation of the original one. the following example returns true if the browser's trans
form-origin property doesn't consider 10em 10em 10em valid: @supports not (trans
form-origin: 10em 10em 10em) {} as with any operator, the not operator can be applied to a declaration of any complexity. the following examples are both valid: @supports not (not (trans
form-origin: 2px)) {} @supports (display: grid) and (not (display: inline-grid)) {} note: there is no need to enclose the not operator between two parentheses at the top level. to combine it with other operators, l...
...And 6 more matches
WebKit CSS extensions - CSS: Cascading Style Sheets
property links to the new synax. old prefixed syntax is still supported in some browsers. webkit-prefixed properties on the standards track -webkit-appearance -webkit-font-size-delta -webkit-ma...
...property links to the new synax. old prefixed syntax is still supported in some browsers. webkit-prefixed properties on the standards track -webkit-appearance -webkit-font-size-delta -webkit-mask-composite -webkit-mask-p...
...property links to the new synax. old prefixed syntax is still supported in some browsers. webkit-prefixed properties on the standards track -webkit-appearance -webkit-font-size-delta -webkit-mask-composite -webkit-mask-position-x -webkit-mask-posi...
...And 6 more matches
scale() - CSS: Cascading Style Sheets
when a coordinate value is outside the [-1, 1] range, the element grows along that dimension; when inside, it shrinks. if it is negative, the result a point reflection in that dimension. ...
... when a coordinate value is outside the [-1, 1] range, the element grows along that dimension; when inside, it shrinks. if it is negative, the result a point reflection in that dimension. ...
... when a coordinate value is outside the [-1, 1] range, the element grows along that dimension; when inside, it shrinks. if it is negative, the result a point reflection in that dimension. ...
...And 6 more matches
will-change - CSS: Cascading Style Sheets
l-change css property hints to browsers how an element is expected to change. browsers may set up optimizations before an element is actually changed. these kinds of optimizations can increase the responsiveness of a page by doing potentially expensive work before they are actually required. ...
...expected to change. browsers may set up optimizations before an element is actually changed. these kinds of optimizations can increase the responsiveness of a page by doing potentially expensive work before they are actually required. important: will-change is intended to be used as a last resort, in order to try to deal with existing per
formance problems. it should not be used to anticipate per
formance problems. ...
...se the responsiveness of a page by doing potentially expensive work before they are actually required. important: will-change is intended to be used as a last resort, in order to try to deal with existing per
formance problems. it should not be used to anticipate per
formance problems. /* keyword values */ will-change: auto; will-change: scroll-position; will-change: contents; will-change: trans
form; /* example of <custom-ident> */ will-change: opacity; /* example of <custom-ident> */ will-change: left, top; /* example of two <animateable-feature> */ /* global values */ will-change: inherit; will-change: initial; will-change: unset; proper usage of this property can be a bit tricky: don't apply will-change to too many elements. the browser already tries as har...
...And 6 more matches
Cross-browser audio basics - Developer guides
dio, but you can still <a href="audiofile.mp3">download the music</a>.</p> </audio> note: you can also use an mp4 file instead of mp3. mp4 files typically contain aac encoded audio. you can use type="audio/mp4". (currently, browsers that support mp3 also support mp4 audio). here we define an <audio> element with multiple sources — we do this as not all browsers support the same audio
formats. to ensure reasonable coverage, we should specify at least two different
formats. the two
formats that will give maximum coverage are mp3 and ogg vorbis. we do this using the <source> element, which takes the attributes src and type. src contains the path to the audio file to be loaded (relative or absolute). type is used to in
form the browser of the file type. if omitted, most brows...
...in this case, we've provided a simple paragraph including a link to download the audio directly. the controls attribute on the <audio> element is specified when we require the browser to provide us with default playback controls. ...
...5 audio in more detail. audio html attributes we can specify a number of attributes with the audio tag to further determine the way audio is initialized. autoplay specifying autoplay will cause the audio to start playing as soon as possible and without any user interaction — in short, the audio will autoplay. <audio autoplay> ... </audio> note: this value is often ignored on mobile plat
forms, and its use is not recommended unless really necessary. auto-playing audio (and video) is usually really annoying. plus browsers have policies that will block autoplay entirely in many situations. see the autoplay guide for media and web audio apis for details. loop the loop attribute will ensure that upon getting to the end of the audio clip, the audio clip will loop back to the beginning a...
...And 6 more matches
<keygen> - HTML: Hypertext Markup Language
permitted content none, it is an empty element. ...
... permitted content none, it is an empty element. ...
... permitted content none, it is an empty element. ...
...And 6 more matches
<link>: The External Resource Link element - HTML: Hypertext Markup Language
ed to is related to the containing document. 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 plat
forms, 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. these provide useful hints to allow the browser to choose the most appropriate icon available. you can also provide a media type or query inside a media attribute; this...
...ide useful hints to allow the browser to choose the most appropriate icon available. you can also provide a media type or query inside a media attribute; this resource will then only be loaded if the media condition is true. for example: <link href="print.css" rel="stylesheet" media="print"> <link href="mobile.css" rel="stylesheet" media="screen and (max-width: 600px)"> some interesting new per
formance and security features have been added to the <link> element too. take this example: <link rel="preload" href="myfont.woff2" as="font" type="font/woff2" crossorigin="anonymous"> a rel value of preload indicates that the browser should preload this resource (see preloading content with rel="preload" for more details), with the as attribute indicating the specific class of content being ...
... <track> elements video <video> elements worker worker, sharedworker crossorigin this enumerated attribute indicates whether cors must be used when fetching the resource. cors-enabled images can be reused in the <canvas> element without being tainted. the allowed values are: anonymous a cross-origin request (i.e. with an origin http header) is per
formed, but no credential is sent (i.e. no cookie, x.509 certificate, or http basic authentication). if the server does not give credentials to the origin site (by not setting the access-control-allow-origin http header) the resource will be tainted and its usage restricted. use-credentials a cross-origin request (i.e. with an origin http header) is per
formed along with a credential sent (i.e. a c...
...And 6 more matches
Connection management in HTTP/1.x - HTTP
connection management is a key topic in http: opening and maintaining connections largely impacts the per
formance of web sites and web applications. in http/1.x, there are several models: short-lived connections, persistent connections, and http pipelining. http mostly relies on tcp for its transport protocol, providing a connection between the client and the server. in its infancy, http used a single model to handle such connections. these connections were short-lived: a new one created each time a request needed sending, and closed once the answer had been received. this simple model held an innate limitation on per
formance: opening each tcp connection is a resource-consuming operation. several messages must be exchanged between the client and the server. network latency and bandwidth af...
...l to handle such connections. these connections were short-lived: a new one created each time a request needed sending, and closed once the answer had been received. this simple model held an innate limitation on per
formance: opening each tcp connection is a resource-consuming operation. several messages must be exchanged between the client and the server. network latency and bandwidth affect per
formance when a request needs sending. modern web pages require many requests (a dozen or more) to serve the amount of in
formation needed, proving this earlier model inefficient. two newer models were created in http/1.1. the persistent-connection model keeps connections opened between successive requests, reducing the time needed to open new connections. the http pipelining model goes one step furth...
...hort-lived connections. each http request is completed on its own connection; this means a tcp handshake happens before each http request, and these are serialized. the tcp handshake itself is time-consuming, but a tcp connection adapts to its load, becoming more efficient with more sustained (or warm) connections. short-lived connections do not make use of this efficiency feature of tcp, and per
formance degrades from optimum by persisting to transmit over a new, cold connection. this model is the default model used in http/1.0 (if there is no connection header, or if its value is set to close). in http/1.1, this model is only used when the connection header is sent with a value of close. unless dealing with a very old system, which doesn't support a persistent connection, there is no comp...
...And 6 more matches
Content-Type - HTTP
forbidden header name no cors-safelisted response header yes cors-safelisted request header yes, with the additional restriction that values can't contain a cors-unsafe request header byte: 0x00-0x1f (except 0x08 (tab)), "():<>?@[\]{}, and 0x7f (delete). it also 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. syntax content-type: text/html; charset=utf-8 content-type: multipart/
form-data; boundary=something directives media-type the mime type of the resource or the data. charset the character encoding standard. boundary for multipart entities the boundary directive is required, which consists of 1 to 70 characters from a set of characte...
...undary directive is required, which consists of 1 to 70 characters from a set of characters known to be very robust through email gateways, and not ending with white space. it is used to encapsulate the boundaries of the multiple parts of the message. often, the header boundary is prepended with two dashes and the final boundary has two dashes appended at the end. ...
... to 70 characters from a set of characters known to be very robust through email gateways, and not ending with white space. it is used to encapsulate the boundaries of the multiple parts of the message. often, the header boundary is prepended with two dashes and the final boundary has two dashes appended at the end. ...
...And 6 more matches
Inheritance and the prototype chain - JavaScript
ult, check its prototype. // o.[[prototype]].[[prototype]].[[prototype]] is null, stop searching, // no property found, return undefined. code link setting a property to an object creates an own property. the only exception to the getting and setting behavior rules is when there is an inherited property with a getter or a setter. inheriting "methods" javascript does not have "methods" in the
form that class-based languages define them. in javascript, any function can be added to an object in the
form of a property. an inherited function acts just as any other property, including property shadowing as shown above (in this case, a
form of method overriding). when an inherited function is executed, the value of this points to the inheriting object, not to the prototype object where the func...
...e code below is free-standing (it is safe to assume there is no other javascript on the webpage other than the below code). for the best learning experience, it is highly recommended that you open a console, navigate to the "console" tab, copy-and-paste in the below javascript code, and run it by pressing the enter/return key. (the console is included in most web browser's developer tools. more in
formation is available for firefox developer tools, chrome devtools, and edge devtools.) function dosomething(){} console.log( dosomething.prototype ); // it does not matter how you declare the function, a // function in javascript will always have a default // prototype property. // (ps: there is one exception that arrow function doesn't have a default prototype property) var dosomething = funct...
...additionally, trying to access nonexistent properties will always traverse the full prototype chain. also, when iterating over the properties of an object, every enumerable property that is on the prototy...
...And 6 more matches
Functions - JavaScript
avascript, functions are first-class objects, because they can have properties and methods just like any other object. what distinguishes them from other objects is that functions can be called. in brief, they are function objects. for more examples and explanations, see also the javascript guide about functions. description every function in javascript is a function object. see function for in
formation on properties and methods of function objects. to return a value other than the default, a function must have a return statement that specifies the value to return. a function without a return statement will return a default value. in the case of a constructor called with the new keyword, the default value is the value of its this parameter. for all other functions, the default return value...
...ng the function constructor to create functions is not recommended since it needs the function body as a string which may prevent some js engine optimizations and can also cause other problems. as all other objects, function objects can be created using the new operator: new function (arg1, arg2, ... argn, functionbody) arg1, arg2, ... argn zero or more names to be used by the function as
formal parameters. each must be a proper javascript identifier. functionbody a string containing the javascript statements comprising the function body. invoking the function constructor as a function (without using the new operator) has the same effect as invoking it as a constructor. the generatorfunction constructor note: generatorfunction is not a global object, but could be obtained fro...
...nstructor to create functions is not recommended since it needs the function body as a string which may prevent some js engine optimizations and can also cause other problems. as all other objects, generatorfunction objects can be created using the new operator: new generatorfunction (arg1, arg2, ... argn, functionbody) arg1, arg2, ... argn zero or more names to be used by the function as
formal argument names. each must be a string that con
forms to the rules for a valid javascript identifier or a list of such strings separated with a comma; for example "x", "thevalue", or "a,b". functionbody a string containing the javascript statements comprising the function definition. invoking the generatorfunction constructor as a function (without using the new operator) has the same effe...
...And 6 more matches
preserveAspectRatio - SVG: Scalable Vector Graphics
note that i...
...wo keywords: a required alignment value and an optional "meet or slice" reference as described below: alignment value the alignment value indicates whether to force uni
form scaling and, if so, the alignment method to use in case the aspect ratio of the viewbox doesn't match the aspect ratio of the viewport. the alignment value must be one of the following keywords: none do not force uni
form scaling. scale the graphic content of the given element non-uni
formly if necessary such that the element's bounding box exactly matches the viewport rectangle. note that if <align> is none, then the optional <meetorslice> value is ignored. xminymin - force uni
form scaling. align the <min-x> of the element's viewbox with the smallest x value of the viewport. align the <min-y> of the elemen...
...essary such that the element's bounding box exactly matches the viewport rectangle. note that if <align> is none, then the optional <meetorslice> value is ignored. xminymin - force uni
form scaling. align the <min-x> of the element's viewbox with the smallest x value of the viewport. align the <min-y> of the element's viewbox with the smallest y value of the viewport. xmidymin - force uni
form scaling. align the midpoint x value of the element's viewbox with the midpoint x value of the viewport. align the <min-y> of the element's viewbox with the smallest y value of the viewport. xmaxymin - force uni
form scaling. align the <min-x>+<width> of the element's viewbox with the maximum x value of the viewport. align the <min-y> of the element's viewbox with the smallest y value...
...And 6 more matches
jpm - Archive of obsolete content
dk users in #jetpack on mozilla's irc network. command reference jpm supports the following commands: jpm init create a skeleton add-on as a starting point for your add-on. jpm run launch an instance of firefox with your add-on installed. jpm test runs your add-on's unit tests. jpm xpi package your add-on as an xpi file, which is the install file
format for firefox add-ons. jpm post package your add-on as an xpi file, and then post it to some url. jpm watchpost package your add-on as an xpi file whenever there is a file change and post that to some url. jpm sign package your add-on as an xpi file, and then retrieve a new xpi signed by mozilla. jpm init this command initializes a new add-on from scrat...
...ckage your add-on as an xpi file whenever there is a file change and post that to some url. jpm sign package your add-on as an xpi file, and then retrieve a new xpi signed by mozilla. jpm init this command initializes a new add-on from scratch. create a new directory, change into it, and run jpm init. mkdir my-addon cd my-addon jpm init you'll then be asked to supply some in
formation about your add-on: this will be used to create your add-on's package.json file. title name: this defaults to the name of the directory in which you are running jpm init. unless an id field is present in package.json, jpm prepends "@" to name and use the result as the id field in the add-on's install manifest. version description entry point (which maps to "main" in package.json) auth...
...ry-args '-url mzl.la -jsconsole' --debug run the add-on debugger attached to the add-on. -o --overload path rather than use the sdk modules built into firefox, use the modules found at path. if -o is specified and path is omitted, jpm looks for the jetpack_root environment variable and use its value as the path. see overloading the built-in modules for more in
formation. -p --profile= profile by default, jpm uses a clean temporary firefox profile each time you call jpm run. use the --profile option to instruct jpm to launch firefox with an existing profile. the profile value may be a profile name or the path to the profile. see using profiles for more in
formation. -v --verbose verbose operation. --no-c...
...And 5 more matches
File I/O - Archive of obsolete content
n nsilocalfile interface. creating an nsifile object components.utils.import("resource://gre/modules/fileutils.jsm"); var file = new fileutils.file("/home"); or the same without using fileutils.jsm: var file = components.classes["@mozilla.org/file/local;1"]. createinstance(components.interfaces.nsilocalfile); file.initwithpath("/home"); note: the path should be in the "native"
form (for example"c:\\windows"). if you need to use file:// uris as initializers, see discussion of nsiioservice below. note: you can still get a file object even if the specified file does not exist, and no exception will be thrown. an exception is thrown only when methods that require the file to exist are called, e.g., isdirectory(), moveto(), and so on. getting files in special directories com...
...ce(components.interfaces.nsilocalfile).path); } creating folders fileutils.getdir() can create a folder automatically if it doesn't exist yet: components.utils.import("resource://gre/modules/fileutils.jsm"); var dir = fileutils.getdir("profd", ["dir"], true); the above example creates a folder called "dir" in the user's profile folder. you can also create a directory explicitly; for more in
formation refer to nsifile.create(). 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); use...
...name.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. it returns the user-specified file as nsifile. nsifile and path strings you can use nsifile.path to get a plat
form-specific path string, for example "c:\windows\system32" or "/usr/share". to get a url of a file, use nsiioservice.newfileuri(): // file is nsifile components.utils.import("resource://gre/modules/services.jsm"); var url = services.io.newfileuri(file); // url is a nsiuri; to get the string "file://...", see url.spec to get an nsifile from the 'file://' url, use nsifileurl: // url is a nsiuri; ...
...And 5 more matches
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
ing to convert over to a standards-based design, because they could also immediately envision the benefits to their workload and maintenance of the site. how is the site styled now that you've ripped out all the html-based presentation? technically, there are 13 total stylesheets used at any one time. ...
... design, because they could also immediately envision the benefits to their workload and maintenance of the site. how is the site styled now that you've ripped out all the html-based presentation? technically, there are 13 total stylesheets used at any one time. ...
...age comes into play at small browser window sizes. while floats automatically reconfigure if they don't fit within the window width, absolute positioned columns always remain in the same place, even if it means content in one column begins to overlap another column. both of these put together weren't enough to dissuade me from the advantages of positioning over floats. how does the new design per
form when the pages are printed? we have one css file specifically set up to cover most of the content throughout our pages for print media. by default, all links to screen media css files are explicitly declared as "screen" media instead of "all" media. by doing this, we don't have to override any of the screen styles, giving us a blank slate to start with for print styles. the print styles present ...
...And 5 more matches
Creating a status bar extension - Archive of obsolete content
next » this is the first in a series of articles that will demonstrate how to create increasingly intricate extensions for the firefox browser. some of the samples in this series may be similar to samples you've seen elsewhere, but the goal of this series of articles is to help compile in
formation for new extension developers into one place to make it easy to jump in and get started. note: the extension created by this tutorial won't work in firefox that don't have a static status bar (that is, firefox 4 and up). you can find a more up-to-date tutorial in the xul school tutorial the essentials of an extension. many of the concepts introduced here apply to any xul-based application; however, to keep from getting completely overwhelmed, we're going to focus specifically on firef...
...wser windows. if this sounds a lot like the existing building an extension article, you're right. however, this sample will be expanded upon in later articles in the series. download the sample you can download a copy of this sample to look over -- or to use as the basis for your own extension. download the sample the install manifest the install manifest, install.rdf, is a text file containing in
formation that tells the host application important in
formation about the extension. <?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 meta...
... <!-- describe the firefox versions we support --> <em:targetapplication> <description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>1.5</em:minversion> <em:maxversion>2.0.0.*</em:maxversion> </description> </em:targetapplication> </description> </rdf> let's take a look at some key parts of the manifest. extension identification in
formation certain in
formation is needed so firefox can uniquely identify your extension. in this sample, these fields are: property name description id a unique identification string. before firefox 1.5, this was a guid. starting with firefox 1.5, however, you should use a string in the
form extension-name@creator-domain. version the extension's version number. ...
...And 5 more matches
Frequently Asked Questions - Archive of obsolete content
s to help answer this question: a status page for svg in firefox 1.5+ and a status page for svg in the development trunk. why does mozilla show source code/gibberish instead of svg? there are two possible reasons for this: a simple mistake in the svg file, or a misconfigured server. ...
... if source code is displayed without a gray area at the top, or if you just see gibberish, then the problem is server misconfiguration. 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. ...
...ents 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. mozilla is strict about this, and no, it's not a bug. failing to respect the mime types servers send is incorrect and has been a source of security holes in other browsers. mozilla will not be changing this behaviour. for more in
formation on server configuration for svg see this link. why does mozilla show an "xml parsing error" message instead of svg? this is an xml debugging message to help xml authors correct errors in their xml documents. mozilla will show this message when there's an xml well
formedness error in the file it tried to load. (it doesn't mean there's an error in mozilla.) there are many different xml error...
...And 5 more matches
Venkman Introduction - Archive of obsolete content
he interactive console also allows for execution of arbitrary javascript code. venkman's keyboard shortcuts are the same as leading visual debugging environments, and gdb users should be familiar with venkman's /break, /step, /next, /finish, /frame, and /where commands. on windows, the javascript debugger compares favorably with visual interdev and other large web development tools. on other plat
forms, including mac os and unix, it is alone in offering this degree of flexibility, depth, and power in a visual debugging environment. starting the debugger the javascript debugger is automatically pre-installed in mozilla 1.x but must be installed separately in firefox and other gecko-based products, such as thunderbird and netscape 7.x. fortunately, the xpinstall technology makes it possible to...
...version. when the download is complete, restart your browser (some windows users may also need to restart their computer as well). you can then access the debugger via a new, dynamically created menuitem in the tools menu of that browser, or else restart the browser with a special debugger option. to see which version of venkman you have, type /version in the interactive session view. for more in
formation about the latest improvements and versions, see the venkman development page. there are two ways to start the debugger: from firefox, you can start it by selecting javascript debugger from the tools menu (tools->web development menu in mozilla 1.x and netscape). you can also start the browser with the -venkman command line option, which launches venkman initially instead of an applicati...
...debugger from the tools menu (tools->web development menu in mozilla 1.x and netscape). you can also start the browser with the -venkman command line option, which launches venkman initially instead of an application front end. (note that venkman displays usage data when it starts up: "recorded local startup x, global yyy." this data comes from a counter built in to the application. for more in
formation about this counter and the data, see item 2.2 in the venkman faq.) when you first start venkman, the basic views are arranged as in the screenshot above—though you can customize the layout and presence of the different views however you want, as we describe in the view customization section below. the scripts that have been loaded by the javascript engine appear in the loaded scripts wi...
...And 5 more matches
Creating XPI Installer Modules - Archive of obsolete content
. a xpi file typically contains the resources to be installed (in this case the barley.jar we want to have installed in the mozilla/bin/chrome/ directory) and an install script that guides the installation process. under the chrome/ directory, you'll notice that in addition to the package subdirectories, there are now also a handful of jar files, or java archives (see figure below). jar is a file
format based on the zip file
format and is used for aggregating multiple files into a single file. these archives are redundant with the subdirectories: mozilla now installs both the compressed and uncompressed versions of the ui, though you can change this when you build mozilla yourself. chrome/ us/ us.jar chatzilla/ chatzilla.jar chrome.rdf chromelist.txt classic/ classic.jar comm...
...or/ inspector.jar installed-chrome.txt messenger/ messenger.jar ... in addition to these jar files, there are also several new rdf files. these new files represent a redesign of the way that the mozilla ui is packaged and installed. though the chrome directory still includes subdirectories of uncompressed files by default, a new way to aggregate and distribute the files has improved per
formance, made the ui components more portable and easier to install, and made the installation process a much easier one. however, this new arrangement does not make things much easier for the web or user interface developer. the relatively simple process of finding the appropriate resources (i.e. xul, javascript, or css files) in the chrome subdirectories and editing them with a text editor has been...
... barley/ content/ barley.gif barley.js barley.xul content...
...And 5 more matches
Install Scripts - Archive of obsolete content
for example, you may wish to check versions of files and only install updated files, or perhaps you wish to apply patches to existing files. the install script is even flexible enough to allow you to uninstall files. ...
...lled, come across some kind of error, and abort the whole process without modifying the user's system. the component registry mozilla maintains a file which is a registry of all the components that are currently installed. components include new chrome packages, skins and plugins. when a new component is installed, the registry gets updated. the registry also stores the set of files and version in
formation about the installed components. that way, it is easier to check if a version of your component is already present and only update it if necessary. the component registry works somewhat like the windows registry does. it consists of a hierarchy of keys and values. you don't need to know much about it to create xul applications unless you are creating your own xpcom components. what you do nee...
... if a version of your component is already present and only update it if necessary. the component registry works somewhat like the windows registry does. it consists of a hierarchy of keys and values. you don't need to know much about it to create xul applications unless you are creating your own xpcom components. ...
...And 5 more matches
Property Files - Archive of obsolete content
sign ('#') is treated as a comment: # this is a comment welcomemessage=hello, world! # this is another comment goodbyemessage=come back soon! stringbundles you could write the code to read properties yourself, however xul provides the stringbundle element which does this for you. the element has a number of functions which can be used to get strings from the property file and get other locale in
formation. this element reads in the contents of a property file and builds a list of properties for you. you can then look up a particular property by name. <stringbundleset id="stringbundleset"> <stringbundle id="strings" src="strings.properties"/> </stringbundleset> including this element will read the properties from the file 'strings.properties' in the same directory as the xul file. use a chrom...
... document.getelementbyid("strings"); var nofilesfound=strbundle.getstring("notfoundalert"); alert(nofilesfound); this example first gets a reference to the bundle using its id then, it looks up the string 'notfoundalert' in the property file. the function getstring() returns the value of the string or null if the string does not exist. finally, the string is displayed in an alert box. ...
..."); var nofilesfound=strbundle.getstring("notfoundalert"); alert(nofilesfound); this example first gets a reference to the bundle using its id then, it looks up the string 'notfoundalert' in the property file. the function getstring() returns the value of the string or null if the string does not exist. finally, the string is displayed in an alert box. text
formatting the next method is get
formattedstring(). ...
...And 5 more matches
NPWindow - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary contains in
formation about the target into which the plug-in instance can draw. ...
... « gecko plugin api reference « plug-in side plug-in api summary contains in
formation about the target into which the plug-in instance can draw. ...
.... syntax typedef struct _npwindow { void* window; /* plat
form 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; /* plat
form-dependent additional data */ #endif /* xp_unix */ npwindowtype type; /* window or drawable target */ } npwindow; fields the data structure has the following fields: window plat
form-specific handle to a native window element in the netscape window hierarchy on windows (hwnd) and unix (x window id). mac os: window is a pointer to an np_port. x, y the x and y coordinates for the top ...
...And 5 more matches
Accessible multimedia - Learn web development
and javascript, an understanding of what accessibility is. objective: to understand the accessibility issues behind multimedia, and how to overcome them. multimedia and accessibility so far in this module we have looked at a variety of content and what needs to be done to ensure its accessibility, ranging from simple text content to data tables, images, native controls such as
form elements and buttons, and even more complex markup structures (with wai-aria attributes). this article on the other hand looks at another general class of content that arguably isn't as easy to ensure accessibility for — multimedia. images, videos, <canvas> elements, flash movies, etc., aren't as easily understood by screenreaders or navigated by the keyboard, and we need to give them a helpin...
...), we fire this function. it works out the number of minutes and seconds from the given currenttime value (which is in seconds), adds a leading 0 if either the minute or second value is less than 10, and then creates the display readout and adds it to the time label. further reading this gives you a basic idea of how to add custom player functionality to video/audio player instances. ...
...e rapidly and to a high quality. if you don't want to pay for it, you are likely to get it done at a lower quality, and/or slowly. it is not ok to publish an audio resource but promise to publish the transcript later on — such promises often aren't kept, which will erode trust between you and your users. if the audio you are presenting is something like a face to face meeting or live spoken per
formance, it would be acceptable to take notes during the per
formance, publish them in full along with the audio, then seek help in cleaning up the notes afterwards. transcript examples if you use an automated service, then you'll probably have to use the user interface that the tool provides. for example, take a look at our wait, aria roles have categories? video and choose the three dot menu (. . ...
...And 5 more matches
HTML text fundamentals - Learn web development
nd relevant content, often just reading the headings to begin with. (we usually spend a very short time on a web page.) if they can't see anything useful within a few seconds, they'll likely get frustrated and go somewhere else. search engines indexing your page consider the contents of headings as important keywords for influencing the page's search rankings. without headings, your page will per
form poorly in terms of seo (search engine optimization). severely visually impaired people often don't read web pages; they listen to them instead. this is done with software called a screen reader. this software provides ways to get fast access to given text content. among the various techniques used, they provide an outline of the document by reading out the headings, allowing their users to find ...
...y in terms of seo (search engine optimization). severely visually impaired people often don't read web pages; they listen to them instead. this is done with software called a screen reader. this software provides ways to get fast access to given text content. among the various techniques used, they provide an outline of the document by reading out the headings, allowing their users to find the in
formation they need quickly. if headings are not available, they will be forced to listen to the whole document read out loud. to style content with css, or make it do interesting things with javascript, you need to have elements wrapping the relevant content, so css/javascript can effectively target it. we therefore need to give our content structural markup. active learning: giving our content s...
...you can choose to either save a local copy of our text-start.html starting file and do the work there, or do it in the editable example below. doing it locally will probably be better, as then you'll get to save the work you are doing, whereas if you fill it in to the editable example, it will be lost the next time you open the page. both have pro...
...And 5 more matches
Manipulating documents - Learn web development
in this article we'll look at how to use the dom in detail, along with some other interesting apis that can alter your environment in interesting ways. ...
...eb browser web browsers are very complicated pieces of software with a lot of moving parts, many of which can't be controlled or manipulated by a web developer using javascript. you might think that such limitations are a bad thing, but browsers are locked down for good reasons, mostly centering around security. imagine if a web site could get access to your stored passwords or other sensitive in
formation, and log into websites as if it were you? despite the limitations, web apis still give us access to a lot of functionality that enable us to do a great many things with web pages. there are a few really obvious bits you'll reference regularly in your code — consider the following diagram, which represents the main parts of a browser directly involved in viewing web pages: the window ...
...ts on the web. in javascript, this is represented by the navigator object. you can use this object to retrieve things like the user's preferred language, a media stream from the user's webcam, etc. the document (represented by the dom in browsers) is the actual page loaded into the window, and is represented in javascript by the document object. you can use this object to return and manipulate in
formation on the html and css that comprises the document, for example get a reference to an element in the dom, change its text content, apply new styles to it, create new elements and add them to the current element as children, or even delete it altogether. in this article we'll focus mostly on manipulating the document, but we'll show a few other useful bits besides. the document object model ...
...And 5 more matches
Ember resources and troubleshooting - Learn web development
previous overview: client-side javascript frameworks next our final ember article provides you with a list of resources that you can use to go further in your learning, plus some useful troubleshooting and other in
formation. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them. objective: to provide further resource links and troubleshooting in
formation. further resources ember.js guides tutorial: super rentals ember.js api documentation ember.js discord ...
...an extensive list, but it is a list of things that came up around the time of writing (latest update, may 2020). how do i debug what's going on in the framework? for framework-specific things, there is the ember-inspector add-on, which allows inspection of: routes & controllers components services promises data (i.e: from a remote api — from ember-data, by default) deprecation in
formation render per
formance for general javascript debugging, check out our guides on javascript debugging as well as interacting with the browser's other debugging tools. in any default ember project, there will be two main javascript files, vendor.js and {app-name}.js. both of these files are generated with sourcemaps, so when you open the vendor.js or {app-name}.js to search for relevant co...
...ny default ember project, there will be two main javascript files, vendor.js and {app-name}.js. both of these files are generated with sourcemaps, so when you open the vendor.js or {app-name}.js to search for relevant code, when a debugger is placed, the sourcemap will be loaded and the breakpoint will be placed in the pre-transpiled code for easier correlation to your project code. for more in
formation on sourcemaps, why they're needed, and what the ember-cli does with them, see the advanced use: asset compilation guide. note that sourcemaps are enabled by default. ember-data comes pre-installed; do i need it? not at all. while ember-data solves the most common problems that any app dealing with data will run in to, it is possible to roll your own front-end data client. a common altern...
...And 5 more matches
React interactivity: Editing, filtering, conditional rendering - Learn web development
emplates", rather than the single template it's used so far: the "view" template, when we are just viewing a todo; this is what we’ve used in rest of the tutorial so far. the "editing" template, when we are editing a todo. we're about to create this. ...
...ed so far: the "view" template, when we are just viewing a todo; this is what we’ve used in rest of the tutorial so far. the "editing" template, when we are editing a todo. we're about to create this. ...
...="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...
...And 5 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
orial/03-adding-dynamic-behavior remember to run npm install && npm run dev to start your app in development mode. repl to code along with us using the repl, start at https://svelte.dev/repl/c862d964d48d473ca63ab91709a0a5a0?version=3.23.2 working with todos our todos.svelte component is currently just displaying static markup; let's start making it a bit more dynamic. we'll take the tasks in
formation from the markup and store it in a todos array. we'll also create two variables to keep track of the total number of tasks and the completed tasks. the state of our component will be represented by these three top-level variables. create a <script> section at the top of src/components/todos.svelte and give it some content, as follows: <script> let todos = [ { id: 1, name: 'cre...
...llows: <script> let todos = [ { id: 1, name: 'create a svelte starter app', completed: true }, { id: 2, name: 'create your first component', completed: true }, { id: 3, name: 'complete the rest of the tutorial', completed: false } ] let totaltodos = todos.length let completedtodos = todos.filter(todo => todo.completed).length </script> now let's do something with that in
formation. let's start by showing a status message. find the <h2> heading with an id of list-heading and replace the hardcoded number of active and completed tasks with dynamic expressions: <h2 id="list-heading">{completedtodos} out of {totaltodos} items completed</h2> go to the app, and you should see the "2 out of 3 items completed" message as before, but this time the in
formation is ...
... <ul> {#each todos as todo, index (todo.id)} <li> <input type="checkbox" checked={todo.completed}/> {index}. {todo.name} (id: {todo.id}) </li> {:else} nothing to do here! {/each} </ul> go back to the app; you'll see something like this: now we've seen that this is working, let's generate a complete todo item with each loop of the {#each} directive, and inside embed the in
formation from the todos array: id, name, and completed. 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}/> ...
...And 5 more matches
Deploying our app - Learn web development
le. as such, it's important to create a toolchain that handles these problems in a way that requires as little manual intervention as possible. here's just a few things to consider for this particular project: generating a production build: ensuring files are minimised, chunked, have tree-shaking applied, and that versions are "cache busted". running tests: these can range from "is this code
formatted properly?" to "does this thing do what i expect?", and ensuring failing tests prevent deployment. actually deploying the updated code to a live url: or potentially a staging url so it can be reviewed first. note: cache busting is a new term that we haven't met before in the module. this is the strategy of breaking a browser's own caching mechanism, which forces the browser to download a ...
... netlify bringing down the cost of deployments (both in financial terms and also the time required to actually deploy) it's possible to deploy during development to either share work in progress or to have a pre-release for some other purpose. netlify, amongst other things, also allows you to run pre-deployment tasks, which in our case means that all the production code build processes can be per
formed inside of netlify and if the build is successful, the website changes will be deployed. although netlify offers a drag and drop deployment service, we are intending to trigger a new deployment to netlify each time we push to a github repo. it's exactly these kinds of connected services that we would encourage you to look for when deciding on your own build toolchain. we can commit our code an...
...new deployment to netlify each time we push to a github repo. it's exactly these kinds of connected services that we would encourage you to look for when deciding on your own build toolchain. we can commit our code and push to github and the updated code will automatically trigger the entire build routine. if all is well, we get a live change deployed automatically. the only action we need to per
form is that initial "push". however, we do have to set these steps up, and we'll look at that now. the build process again, because we're using parcel for development, the build option is extremely simple to add. instead of running the server with npx parcel src/index.html, we can run it with npx parcel build src/index.html and parcel will build everything ready for production instead of just runn...
...And 5 more matches
Creating MozSearch plugins
the only difference is the root element and xml namespace. ...
...the only difference is the root element and xml namespace. ...
...n-standard and is intended for internal use within mozilla projects only. it should only be used if your intention is to distribute the search plugin packaged in a firefox extension, or if you are creating plugins meant to be shipped by default in a firefox build. for creating search plugins for installation from the web, see creating opensearch plugins for firefox the plugin file the mozsearch
format is similar to the opensearch
format. the only difference is the root element and xml namespace. example: searching yahoo! the following xml is the bundled firefox 2 search plugin for searching using yahoo!: <searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"> <shortname>yahoo</shortname> <description>yahoo search</description> <inputencoding>utf-8</inputencoding> <image width="...
...And 5 more matches
HTTP logging
note: the web console also offers the ability to peek at http transactions within firefox. http logging generally provides more detailed logging. using about:networking this is available starting with firefox 52. this is the best and easiest way to do http logging. at any point during while your browser is running, you can turn logging on and off. ...
...hich makes the http log much smaller and easier to analyze. launch the browser and get it into whatever state you need to be in just before your bug occurs. open a new tab and type in "about:networking" into the url bar. go to the "logging section" adjust the location of the log file if you don't like the default adjust the list of modules that you want to log: this list has the exact same
format as the moz_log environment variable (see below). generally the default list is ok, unless a mozilla developer has told you to modify it. click on start logging. reproduce the bug (i.e. go to the web site that is broken for you and make the bug happen in the browser) make a note of the value of "current log file". click on stop logging. go to the folder containing the specified log file, a...
...nd that drive c: is your windows startup disk. make the appropriate adjustments if those aren't the case.) reproduce whatever problem it is that you're having. once you've reproduced the problem, exit firefox and look for the generated log files in your temporary directory. you can type "%temp%" directly into the windows explorer location bar to get there quickly. linux this section offers in
formation on how to capture http logs for firefox running on linux. quit out of firefox if it's running. open a new shell. the commands listed here assume a bash-compatible shell. copy and paste the following commands into the shell one at a time. make sure to hit enter after each line. export moz_log=timestamp,rotate:200,nshttp:5,cache2:5,nssockettransport:5,nshostresolver:5,cookie:5 export mo...
...And 5 more matches
Commenting IDL for better documentation
happily, following these recommendations will also help ensure your comments are extremely human-readable, too. don't worry! you don't need to write perfect documentation. ...
...happily, following these recommendations will also help ensure your comments are extremely human-readable, too. don't worry! you don't need to write perfect documentation. ...
...happily, following these recommendations will also help ensure your comments are extremely human-readable, too. don't worry! you don't need to write perfect documentation. ...
...And 5 more matches
Contributing to the Mozilla code base
're sure you have something worthy to contribute. someone else is already working on it! even with no assignee, it is polite to check if someone has recently commented that they're looking at fixing the issue. once you have found something to work on, go ahead and comment! let the bug submitter, reviewer, and component owner know that you'd like to work on the bug. you might receive some extra in
formation, perhaps also made the assignee. fix your pet peeve if there's something you'd like to fix about firefox, thunderbird, or your other favorite mozilla application, this can be a great place to start. there are a number of ways to do this: search bugzilla for relevant keywords. see pages on bugzilla for further help learn the bugzilla component, with which your pet peeve is implemented, ...
...nt, https://developer.mozilla.org/docs/mozilla our reviewer checklist is very useful, if you have a patch near completion, and seek a favorable review utilize our build tool mach, its linting, static analysis, and other code checking features step 3: get your code reviewed once you fix the bug, you can advance to having your code reviewed. when you commit your code, please use the following
format for your commit message: `bug number - what your patch does; r?reviewer` for example, a commit message may look like `bug 1234567 - remove reflow by caching element size. r?jsample` mozilla in most of the projects uses phabricator for code review. who is the right person to ask for a review? if you have a mentored bug: ask your mentor. they will help, or can easily find out. it might be th...
... someone more suitable please select only one reviewer. step 4b: follow it up once you've asked for a review, a reviewer will often respond within a day or two, reviewing the patch, or saying when they will be able to review it, perhaps due to a backlog. if you don't hear back within this time, naturally reach out to them: add a comment to the bug saying 'review ping?', check the "need more in
formation from" box, and add the reviewer's name. if they don't respond within a day or two, you can ask for help on matrix in the #introduction:mozilla.org or #developers:mozilla.org channels, or contact mike hoye directly. don't hesitate to contact your mentor as well if this isn't moving. step 4: repeat thank you! you've fixed your very first bug, and the open web is stronger for it. but don't s...
...And 5 more matches
mach
requirements mach requires a current version of /mozilla-central/ (or a tree derived from there). mach was committed on 2012-sep-26. mach also requires python 2.7. mach itself is python 3 compliant, but modules used by mach likely are not python 3 compliant - so stick to python 2.7. 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. of course, in a random dir you just get a cryptic error message to improve the experience. ...
...so this 3rd point does not make much sense, does it? are there any known issues? yes, of course several! mach is still relatively young ("born" in 2012) and there are a number of bugs and numerous areas for improvement. some larger known issues include: mintty (alternative terminal emulator on wi...
.... for example, bugs in the build command should be filed against firefox build system :: general. bugs against testing commands should be filed somewhere in the testing product. how is building with mach different from building with client.mk, from using make directly? currently, mach build simply invokes client.mk as an ersatz makefile. there are no differences in terms of how the build is per
formed (well, at least there should not be any ideally). however - mach does offer some additional features over manual invocation of client.mk: if on windows, mach will automatically use pymake instead of gnu make, as that is preferred on windows. mach will print timings with each line of output from the build. this gives you an idea of how long things take. mach will colorize terminal output (o...
...And 5 more matches
Developer guide
documentation topics getting started a step-by-step beginner's guide to getting involved with mozilla. for new mozilla developers a directory of articles which are particularly helpful for new mozilla developers. ...
...he entire mozilla development process. managing multiple profiles when working with prerelease versions of firefox, it's often helpful to have multiple firefox profiles, such as one for each channel, or for different kinds of testing. getting documentation updated how to ensure that documentation is kept up to date as you develop. ...
... adding apis to the navigator object how to augment the window.navigator object with additional apis. ...
...And 5 more matches
Overview of Mozilla embedding APIs
own user interface around a webbrowser instance. public classes the following utility classes are available from the xpcom dll. they provide some basic functionality which should be leveraged when building new xpcom components. nscomptr<interface-type> these are templatized smart pointers which transparently deal with xpcom reference counting issues. see the nscomptr user's manual for more in
formation. nsstring there are a collection of string classes which support both unicode and ascii strings. these classes provide a variety of string operations as well as dealing with the memory management issues of storing the underlying data. see the string guide for more details. nsweakptr this is an nscomptr which encapsulates xpcom weak reference support. see the nsiweakreference document...
...string there are a collection of string classes which support both unicode and ascii strings. these classes provide a variety of string operations as well as dealing with the memory management issues of storing the underlying data. see the string guide for more details. nsweakptr this is an nscomptr which encapsulates xpcom weak reference support. see the nsiweakreference document for more in
formation. public return codes ns_succeeded ns_error_failure ns_error_not_implemented public functions the following functions are available from the xpcom dll. ns_initembedding this function initializes the gecko embedding support. this must be the first function call made into gecko. ns_termembedding this function shuts down gecko and cleans up any remaining resources... currently, o...
...globalcomponentmanager this function returns an instance of the component manager service. ns_convertasciitoucs2 this is a helper class which converts an ascii string into a ucs2 string. typically, instances of this class are stack allocated, and wrap ascii arguments which must be converted into ucs2. do_queryinterface this is a helper class which works in conjunction with nscomptr to per
form a simplified call to nsisupports::queryinterface(...) with a typesafe assignment. do_getinterface this function simplfies retrieving interfaces via the nsiinterfacerequestor::getinterface(...) method. using this function, one can use nsisupports instances and still easily access other interfaces via nsiinterfacerequestor. internally, this function tries to convert the nsisupports argument int...
...And 5 more matches
Getting Started with Chat
note that on 2nd march 2020, mozilla moved away from irc to matrix for its public channels, the irc server was shut down. this page is being retained for historical and reference purposes. the general rules and etiquette are still useful for our new home. please see https://wiki.mozilla.org/matrix for up-to-date in
formation. general rules and etiquette once you have your client set up (see software below) and are connected, there are some basic rules you should follow to ensure the most enjoyable and productive experience: as with all mozilla forums and events, agreeing to our community participation guidelines is a requirement for participation. try to keep messages as concise as possible. if you have something long to post, a code snippet for example, use paste.mozilla.o...
...joyable and productive experience: as with all mozilla forums and events, agreeing to our community participation guidelines is a requirement for participation. try to keep messages as concise as possible. if you have something long to post, a code snippet for example, use paste.mozilla.org and paste the generated url in irc instead. when addressing someone directly, try to use name: message
format. for example, "ashughes: good morning!" every channel has its own topic. try to keep your messages within that subject matter. for example, do not talk about thunderbird issues in #firefox. mozilla's channels are most active between 9am and 7pm pst monday to friday, excluding us holidays. when asking a question, be patient. sometimes, it can take a few minutes for people to respond. posting...
...question, be patient. sometimes, it can take a few minutes for people to respond. posting a message like "help!" is not particularly helpful. asking a good question will result in a better experience for both you and the person trying to help. relax and have fun! software there are several different applications which allow you to connect to irc networks. you will need to use the following in
formation to configure the server connection: server: irc.mozilla.org port: 6667 (default) or 6697 (ssl) desktop clients desktop clients tens to allow the most detailed configuration. for example, you can connect using ssl or a non-secure connection, and you can configure the client to automatically connect to a server and join a particular set of channels when you start the client. the followi...
...And 5 more matches
IPDL Tutorial
ool recvinit(const nscstring& pluginpath) = 0; bool recvshutdown() = 0; public: bool sendready() { // generated code to send a ready() message } }; these parent and child abstract classes take care of all the "protocol layer" concerns: serializing data, sending and receiving messages, and checking protocol safety. it is the responsibility of the implementor to create subclasses to per
form the actual work involved in each message. here is a dirt-simple example of how a browser implementor might use ppluginparent. class pluginparent : public ppluginparent { public: pluginparent(const nscstring& pluginpath) { // launch child plugin process sendinit(pluginpath); } ~pluginparent() { sendshutdown(); } protected: bool recvready() { mobservers.notify("ready fo...
...applies in the same way to both directions. so, for example, in synchronous semantics from the child to the parent, the child will block until the parent receives the message and the response arrives, and in asynchronous semantics from the parent to the child the parent will not block. when creating a plugin instance, the browser should block until instance creation is finished, and needs some in
formation returned from the plugin: sync protocol pplugininstance { child: sync init() returns (bool windowless, bool ok); }; we added two new keywords to the plugin protocol, sync and returns. sync marks a message as being sent synchronously. the returns keyword marks the beginning of the list of values that are returned in the reply to the message. async message return values bug 1313200 in...
...ated with extreme prejudice.) preferred semantics use async semantics whenever possible. blocking on replies to messages is discouraged. if you absolutely need to block on a reply, use sync semantics very carefully. it is possible to get into trouble with careless uses of synchronous messages; while ipdl can check and/or guarantee that your code does not deadlock, it is easy to cause nasty per
formance problems by blocking. please don't use rpc semantics. rpc semantics exists mainly to support remoting plugins (npapi), where we have no choice. chrome to content calls (for ipc tabs) must only use async semantics. in order to preserve responsiveness, the chrome process may never block on a content process which may be busy or hung. message delivery order delivery is "in-order", that is, m...
...And 5 more matches
Log.jsm
this module is still under development. until stabilized, expect frequent updates, including different interfaces and behavior in different versions of the plat
form. progress is tracked in bugzilla using dependencies of bug 451283. the log.jsm javascript code module (
formerly named log4moz.js) provides a log4j style api for logging log messages to various endpoints, such as the browser console or a file on disk. to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/log.jsm"); basic usage components.utils.import("resource://gre/modules/log.jsm"); // get a logger, give it a name unique to this chunk of code. // use dots to create a hierarchy, this way you can later change // the log level of sets of loggers und...
...e/modules/log.jsm"); // get a logger, give it a name unique to this chunk of code. // use dots to create a hierarchy, this way you can later change // the log level of sets of loggers under some common root let log = log.repository.getlogger("myextension.myclass"); log.level = log.level.debug; // a console appender logs to the browser console. ...
...reate a hierarchy, this way you can later change // the log level of sets of loggers under some common root let log = log.repository.getlogger("myextension.myclass"); log.level = log.level.debug; // a console appender logs to the browser console. log.addappender(new log.consoleappender(new log.basic
formatter())); // a dump appender logs to stdout. log.addappender(new log.dumpappender(new log.basic
formatter())); // log some messages log.error("oh noes!! something bad happened!"); log.debug("details about bad thing only useful during debugging", {someinfo: "nothing"}); log.warn("here is an error", new error("ouch")); logger levels fatal severe errors that cause premature termination. expect these to be immediately visible on a status console. error other runtime err...
...And 5 more matches
Mozilla Content Localized in Your Language
calization team for your language agrees. all we ask is that you name this page according to this example, "mozilla content in spanish (es-mx)" and add your locale code tag at the bottom. enjoy developing your style guide! your language's style guide abbreviations how are abbreviations expressed in your language? numerals and metrics how are numerals and metrics expressed in your language?
formal and in
formal
forms, and separators (, or .) date
format what are the date
formats for weeks and months are expressed in the following
forms: 1)fully spelled out, 2). 2 or 3 letters and 3). single letter. and what is the order of year, month and day? reference material can be find here calendar calendar view: which date is considered the first day of the week, sunday or monday? is lunar c...
... percentages how are percentages expressed in your language? digit groups how are digit groups expressed in your language? example: 1.23 (decimal separator) or 1,000 (thousand separator) using comma or period. ...
.... ...
...And 5 more matches
Mozilla Web Developer FAQ
ors ask frequently specifically in connection with firefox and other gecko-based browsers. there are links to more general web authoring faqs at the end of this document. what are the quirks mode and the standards mode? gecko has two and a half layout modes: quirks, almost standards and standards. in the standards mode gecko aims to treat documents authored in compliance with the applicable web
format specifications. in the quirks mode—for the purpose of backwards compatibility—gecko mimics some behaviors of legacy browsers in ways that are spec violations. the almost standards mode is like the standards mode except it addresses the issue of the next question by rendering table cells with images in the traditional way. the mode is picked based on the doctype declaration (or the lack ther...
...o check for the existence of the methods and objects you are planning on using. for example, the existence of document.getelementbyid() can be checked as follows: if(document.getelementbyid) { /* code that uses document.getelementbyid() */ } why doesn’t mozilla display my alt tooltips? contrary to a popular belief stemming from the behavior of a couple browsers running on the windows plat
form, alt isn’t an abbreviation for ‘tooltip’ but for ‘alternative’. the value of the alt attribute is a textual replacement for the image and is displayed when the image isn’t. mozilla doesn’t display the alt attribute as a tooltip, because it has been observed that doing so encourages authors to misuse the attribute. when the alternative text is shown in a tooltip, some authors wri...
...e in the browser status bar, for example. at this point some people feel compelled to post a “but ie…” rant in the newsgroups or in bugzilla. please note that mac ie 5 behaves in the same way as mozilla when it comes to the alt and title attributes. windows ie also shows the title attribute in a tooltip. does mozilla support downloadable fonts? downloadable fonts in truetype and opentype
formats (.ttf and .otf) are supported since firefox 3.5. the fonts have to be served from the same origin (protocol, host, port) as the content that uses them unless the fonts are served with the appropriate cross-origin resource sharing http headers. downloadable fonts in the eot
format are not supported. if you use downloadable fonts, please make sure the fonts have the right unicode mappings and ...
...And 5 more matches
DMD
including which heap blocks have been reported by memory reporters. it helps us reduce the "heap-unclassified" value in firefox's about:memory page, and also detects if any heap blocks are reported twice. originally, this was the only mode that dmd had, which explains dmd's name. this is the default mode. "live" mode. in this mode, dmd tracks the current contents of the heap. you can dump that in
formation to file, giving a profile of the live heap blocks at that point in time. this is good for understanding how memory is used at an interesting point in time, such as peak memory usage. "cumulative" mode. in this mode, dmd tracks both the past and current contents of the heap. you can dump that in
formation to file, giving a profile of the heap usage for the entire session. this is good for fin...
...tance, on osx, you can run something like: dmd=1 /applications/firefox\ nightly.app/contents/macos/firefox you can tell it is working by going to about:memory and looking for "save dmd output". if dmd has been properly enabled, the "save" button won't be grayed out. look at the "trigger" section below to see the full list of ways to get a dmd report once you have it activated. note that stack in
formation you get will likely be less detailed, due to being unable to symbolicate. you will be able to get function names, but not line numbers. desktop firefox (linux) build build firefox with these options: ac_add_options --enable-dmd if building via try server, modify browser/config/mozconfigs/linux64/common-opt or a similar file before pushing. launch use mach run --dmd; use --mode to cho...
...[5222] constructing the stack trace table... dmd[5222] constructing the stack frame table... dmd[5222] } in an e10s-enabled build, you'll see separate output for each process. this step can take 10 or more seconds and may make firefox freeze temporarily. if you see the "opened" line, it tells you where the file was saved. it's always in a temp directory, and the filenames are always of the
form dmd-<pid>. desktop firefox (mac) build build with these options: ac_add_options --enable-dmd if building via try server, modify browser/config/mozconfigs/macosx64/common-opt or a similar file before pushing. launch use mach run --dmd; use --mode to choose the mode. add --debug to run under lldb. trigger follow the trigger instructions for linux. note that on mac this step can take 30+ s...
...And 5 more matches
Localization Use Cases
icial branding, we end up with: o brskalniku genders in the system app's apps/system/locales/system, there's a string called crash-banner-os2. crash-banner-os2={{brandshortname}} just crashed. problem definition in some languages, past participles (crashed) must be accorded with the gender of the subject (in case of reflexive verbs) or the gender of the object. in polish, the grammatical
form of crashed depends on the gender of brandshortname. in order to construct a grammatically-correct and naturally-sounding message, we must know the gender of the subject. solution in l20n, the localizer can define the gender (or, in fact, any arbitrary trait) as an attribute of the entity. for polish, we can define brandshortname in shared/branding/official/branding as: <brandshortname "firefo...
...ounding like a robot: <crashbanneros2[brandshortname::_gender] { masculine: "{{ brandshortname }} uległ awarii", feminine: "{{ brandshortname }} uległa awarii", neutral: "{{ brandshortname }} uległo awarii" }> this will give us, depending on the current branding, the following messages: firefox os uległ awarii boot2gecko uległo awarii isolation let's look at how the settings app
formats sizes. first, there is devicestoragehelper.show
formatedsize (sic): function show
formatedsize(element, l10nid, size) { if (size === undefined || isnan(size)) { element.textcontent = ''; return; } // kb - 3 kb (nearest ones), mb, gb - 1.2 mb (nearest tenth) var fixeddigits = (size < 1024 * 1024) ? 0 : 1; var sizeinfo = filesize
formatter.getreadablefilesize(size, fixeddigits);...
...consequently, using the exi...
...And 5 more matches
Build instructions
numerous optional features of nss builds are controlled through make variables. gmake is gnu make, usually your linux-distro-regular "make" binary file, unless maybe it is a bsd make. make variables may be set on the gmake command line, e.g., gmake variable=value variable=value target1 target2 or defined in the environment, e.g. (for posix shells), variable=value; export variable gmake target1 target2 here are some (not all) of the make variables that affect nss builds: build_opt: if set to 1, means do optimized non-debug build. default is debug, non-optimized build. ...
...d in the environment, e.g. (for posix shells), variable=value; export variable gmake target1 target2 here are some (not all) of the make variables that affect nss builds: build_opt: if set to 1, means do optimized non-debug build. default is debug, non-optimized build. use_debug_rtl: if set to 1, on windows, causes build with debug version of the c run-time library. ns_use_gcc: on plat
forms where gcc is not the native compiler, tells nss to build with gcc instead of the native compiler. default is to build with the native compiler. use_64: on plat
forms that support both 32-bit and 64-bit abis, tells nss to build for the 64-bit abi. default is 32-bit abi, except on plat
forms that do not support a 32-bit abi. moz_debug_symbols: tells nss to build with debug symbols, even in an opti...
...in that bash shell. for rhel-5, you need to use the new assembler. you can install the new assembler as root as follows: yum install binutils220 you can then use the new assembler by adding /usr/libexec/binutils220 to the beginning of your build path. this can be done in sh or bash as follows: export path=/usr/libexec/binutils220:$path the following build instructions should work for all plat
forms (with some plat
form-specific changes as noted). build instructions for recent versions (mercurial) clone the nspr and nss repositories. hg clone https://hg.mozilla.org/projects/nspr hg clone https://hg.mozilla.org/projects/nss if you want to build a releases other than the tips of these repositories, then switch to the release tags: cd nspr hg update nspr_4_9_5_rtm cd ../nss hg updat...
...And 5 more matches
NSS tools : pk12util
ion algorithm. -d [sql:]directory specify the database directory into which to import to or export from certificates and keys. 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). if the prefix sql: is not used, then the tool assumes that the given databases are in the old
format. -h tokenname specify the name of the token to import into or export from. -k slotpasswordfile specify the text file containing the slot's password. -k slotpassword specify the slot's password. -m | --key-len keylength specify the desired length of the symmetric key to be used to encrypt the private key. -n | --cert-key-len certkeylength specify the desired length of the symmetric ke...
...ength of the symmetric key to be used to encrypt the certificates and other meta-data. -n certname specify the nickname of the cert and private key to export. -p prefix specify the prefix used on the certificate and key databases. this option is provided as a special case. changing the names of the certificate and key databases is not recommended. -r dumps all of the data in raw (binary)
form. this must be saved as a der file. the default is to return in
formation in a pretty-print ascii
format, which displays the in
formation about the certificates and public keys in the p12 file. -v enable debug logging when importing. -w p12filepasswordfile specify the text file containing the pkcs #12 file password. -w p12filepassword specify the pkcs #12 file password. return codes o 0 -...
...sword should be at least 8 characters long, and should contain at least one non-alphabetic character. enter new password: re-enter password: enter password for pkcs12 file: pk12util: pkcs12 import successful exporting keys and certificates using the pk12util command to export certificates and keys requires both the name of the certificate to extract from the database (-n) and the pkcs#12-
formatted output file to write to. there are optional parameters that can be used to encrypt the file to protect the certificate material. pk12util -o p12file -n certname [-c keycipher] [-c certcipher] [-m|--key_len keylen] [-n|--cert_key_len certkeylen] [-d [sql:]directory] [-p dbprefix] [-k slotpasswordfile|-k slotpassword] [-w p12filepasswordfile|-w p12filepassword] for example: # pk12util -o c...
...And 5 more matches
sslintro.html
if you are inclined to help with this migration, your help would be very much appreciated. upgraded documentation may be found in the current nss reference overview of an ssl application chapter 1 overview of an ssl application ssl and related apis allow compliant applications to configure sockets for authenticated, tamper-proof, and encrypted communications. this chapter introduces some of the basic ssl functions. chapter 2, "getting started with ssl" illustrates their use in sample client and server applications. ...
...uration files, setting global defaults, and setting up callback functions. functions used in the initialization part of an application can include the following: pr_init. initializes nspr. must be called before any other nss functions. pk11_setpasswordfunc. sets the global callback function to obtain passwords for pkcs #11 modules. required. nss_init. sets up configuration files and per
forms other tasks required to run network security services. nss_init is not idempotent, so call it only once. required. ssl_optionsetdefault. changes default values for all subsequently opened sockets as long as the application is running (compare with ssl_seturl which only configures the socket that is currently open). this function must be called once for each default value that needs to be chan...
...to be changed. optional. nss_setdomesticpolicy, nss_setexportpolicy, nss_setfrancepolicy, or ssl_cipherpolicyset. these functions tell the library which cipher suites are permitted by policy (for example, to comply with export restrictions). cipher suites disabled by policy cannot be enabled by user preference. ...
...And 5 more matches
NSS_3.12.3_release_notes.html
nss 3.12.3 requires nspr 4.7.4. see the documentation section for the build instructions. ...
... nss 3.12.3 requires nspr 4.7.4. see the documentation section for the build instructions. ...
...ns. nss 3.12.3 source and binary distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_3_rtm/src/. binary distributions: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_3_rtm/. both debug and optimized builds are provided. go to the subdirectory for your plat
form, dbg (debug) or opt (optimized), to get the tar.gz or zip file. the tar.gz or zip file expands to an nss-3.12.3 directory containing three subdirectories: include - nss header files lib - nss shared libraries bin - nss tools and test programs you also need to download the nspr 4.7.4 binary distributions to get the nspr 4.7.4 header files and shared libraries, which...
...And 5 more matches
NSS Tools certutil
a command-line utility that can create and modify the netscape communicator cert8.db and key3.db database files. it can also list, generate, modify, or delete certificates within the cert8.db file and create or change the password, generate new public and private key pairs, display the contents of the key database, or delete key pairs within the key3.db file. ...
... 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. ...
...geted instead. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database. this document discusses certificate and key database management. for in
formation security module database management, see using the security module database tool. availability see the release notes for the plat
forms this tool is available on. 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. each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options, or with the -h option. options and...
...And 5 more matches
NSS tools : crlutil
modify or delete certificates entries in a particular crl. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation. this document discusses certificate revocation list management. for in
formation on security module database management, see using the security module database tool. for in
formation on certificate and key database management, see using the certificate database tool. 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...
...ocation list from cert database. -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. -m modify existing crl which can be located in cert db or in arbitrary file. if located in file it should be encoded in asn.1 encode
format. -g arguments option arguments modify an action and are lowercase. -b bypass ca signature checks. -p dbprefix specify the prefix used on the nss security database files (for example, my_cert8.db and my_key3.db). this option is provided as a special case. changing the names of the certificate and key databases is not re...
...ments modify an action and are lowercase. -b bypass ca signature checks. -p dbprefix specify the prefix used on the nss security database files (for example, my_cert8.db and my_key3.db). this option is provided as a special case. changing the names of the certificate and key databases is not recommended. -a use ascii
format or allow the use of ascii
format for input and output. this
formatting follows rfc #1113. -c crl-gen-file specify script file that will be used to control crl generation/modification. see crl-cript-file
format below. if options -m|-g is used and -c crl-script-file is not specified, crlutil will read script data from standard input. ...
...And 5 more matches
Property cache
up; examining the shape to see how the property can be accessed; actually carrying out the property access. the property cache is a per-thread cache of the results of steps 1 and 2. when executing certain property-accessing bytecode instructions, the interpreter populates the cache to speed future execution of the same instruction. the jit reads the property cache too, as it needs the same in
formation when recording such an instruction. if there is a cache miss, the jit per
forms parts 1 and 2 of the property access and fills the cache to avoid redoing that work in the interpreter. (in some cases this is necessary for correctness. when recording a getprop, the jit needs to know the result type before the interpreter executes the instruction. it is crucial that jit and interpreter get the s...
...the same jsclass, jsobjectops, prototype, and property specs as x had at t0. to be more precise regarding property specs, y's properties have the same names, getters, setters, property attributes, and slot offsets, and they are in the same order, as x's properties at t0. furthermore, y at t1 has the same number of fixed slots that x had at t0, and either both have a slot array or neither does. ...
...in shadowing guarantee — if at t0 the object x has shape s and a property x.p of x is found along the prototype chain on object x' of shape s', where x !== x', and the lookup called no resolve hooks or non-native lookup ops, and at t1 the object x has shape s, the object x' has shape s', and no shape-regenerating gc occurred, then at t1 the lookup for x.p still finds the same property on x'. ...
...And 5 more matches
SpiderMonkey Internals
their arguments. common cases are inlined in the interpreter loop, breaking any abstractions that stand in the way. so optimizations such as dense arrays and the property cache are, alas, not transparently tucked away in the jsarray.* and jsobj.* files. both guest-star in jsinterp.cpp (to thunderous applause from firefox users). 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. therefore, almost all functions in spidermonkey, api or not, take a jscontext pointer as their first argument. compiler the compiler consumes javascript source code and produces a script which contains bytecode, source annotations, and a pool of string, number, and identifier literals. the s...
...ation request is made. js api users should call js_gc or js_maybegc between script executions or from the operation callback, as often as necessary. because the gc is exact, c/c++ applications must ensure that all live objects, strings, and numbers are gc-reachable. javascript values the type js::value represents a javascript value. the representation is 64 bits and uses nan-boxing on all plat
forms, although the exact nan-boxing
format depends on the plat
form. nan-boxing is a technique based on the fact that in ieee-754 there are 2**53-2 different bit patterns that all represent nan. hence, we can encode any floating-point value as a c++ double (noting that javascript nan must be represented as one canonical nan
format). other values are encoded as a value and a type tag: on x86, arm, a...
...nan-boxing
format depends on the plat
form. nan-boxing is a technique based on the fact that in ieee-754 there are 2**53-2 different bit patterns that all represent nan. hence, we can encode any floating-point value as a c++ double (noting that javascript nan must be represented as one canonical nan
format). other values are encoded as a value and a type tag: on x86, arm, and similar 32-bit plat
forms, we use what we call "nunboxing", in which non-double values are a 32-bit type tag and a 32-bit payload, which is normally either a pointer or a signed 32-bit integer. there are a few special values: nullvalue(), undefinedvalue(), truevalue() and falsevalue(). on x64 and similar 64-bit plat
forms, pointers are longer than 32 bits, so we can't use the nunboxing
format. instead, we use "punboxing"...
...And 5 more matches
SpiderMonkey 17
these release notes are an incomplete draft and were initially seeded from the (now-defunct) 1.8.8 release notes, which were themselves seeded from the 1.8.5 release notes, so lots of the in
formation here isn't actually new to spidermonkey 17. the mozilla javascript team is pleased to announce the release of spidermonkey 17. you can download full source code here: http://ftp.mozilla.org/pub/mozilla.org/js/mozjs17.0.0.tar.gz (md5 checksum: 20b6f8f1140ef6e47daa3b16965c9202). spidermonkey 17 is the javascript engine that shipped in firefox 17. it continues to improve per
formance over previous spidermonkey releases, with ongoing jit compilation work and with the introduction of type inference to enable faster jitted code. it also contains new language and api features described in ...
... jit compilation work and with the introduction of type inference to enable faster jitted code. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. ...
...nference to enable faster jitted code. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. — 25 march 2013 plat
form support spidermonkey 17 is supported on all the plat
forms where firefox 17 runs. ...
...And 5 more matches
Using the Places history service
this page provides a map to the external api. history services interface overview the mozilla history service has undergone many revisions. to maintain backwards compatibility, each version has implemented the older interfaces, resulting in functionality spread across many interfaces. the places history service ("navhistory") implements these history interfaces: nsiglobalhistory2: basic add page, is visited functionality used by the docshell when visiting and rendering pages. ...
...ous implementations the previous nsglobalhistory service stored one entry for each page in history. 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 navhistory service has broken this into two tables (see history service design). the main url table stores the in
formation about the page: url, host name, title, visit count, hidden, and typed. stored separately is the in
formation specific to each visit. this in
formation is called a "visit" in this document and in the code. a visit contains a reference to the url table for the page, the visit date, the transition type (typed, click, redirect, bookmark, etc.), a reference to the referring visit, and the session i...
... the "session id" allows these paths to be reconstructed more easily. ...
...And 5 more matches
Packaging WebLock
on, component installation overview, describes the general installation process in mozilla. the following sections describe the steps you can take to organize the weblock component for distribution and installation. note: the emphasis of this tutorial is on the component development itself, so this section on packaging and installing extensions to gecko is necessarily brief. for more detailed in
formation on packaging and installation of components into gecko-based applications, see http://www.mozilla.org/projects/xpinstall. component installation overview xpinstall is a set of javascript apis for creating installation scripts. using xpinstall, you can create web-based installations for gecko-based applications, mozilla extensions, or individual components. the installation script for the ...
...n overview xpinstall is a set of javascript apis for creating installation scripts. using xpinstall, you can create web-based installations for gecko-based applications, mozilla extensions, or individual components. ...
...ent with the browser into which it is installed (see registration methods in xpcom for more in
formation on registration). the sample installation script shown below uses the mozilla xpinstall technology to manipulate an installer and talk to mozilla'schrome registry as high-level javascript objects. what is the chrome registry? like the windows registry, the chrome registry is a database of in
formation about applications, skins, and other extensions that have been installed in a gecko application. since mozilla and other gecko-based applications are cross-plat
form, this database is abstracted above the operating system or any particular plat
form's registry. the chrome registry lives in a series of rdf/xml files in the application directory of mozilla and other gecko-based browsers, where ...
...And 5 more matches
nsIAccessibleProvider
abpanels object. xultabs 0x00001019 the collection of tab objects, usable in the tabbox and independent of as well. ...
...b objects, usable in the tabbox and independent of as well. ...
...independent of as well. xultext 0x0000101a xultextbox 0x0000101b xulthumb 0x0000101c xultree 0x0000101d xultreecolumns 0x0000101e xultreecolumnitem 0x0000101f xultoolbar 0x00001020 xultoolbarseparator 0x00001021 xultooltip 0x00001022 xultoolbarbutton 0x00001023 x
forms elements constants constant value description x
formscontainer 0x00002000 used for x
forms elements that provide accessible object for itself as well for anonymous content. this property is used for upload, input[type="xsd:gday"] and input[type="xsd:gmonth"] x
formslabel 0x00002001 used for label element. x
formsouput 0x00002002 used for output element. x
formstrigger 0x00002003 used for trigger and submit elements. x
formsinput 0x00002004 used for input and textarea elements. x...
...And 5 more matches
nsIHTMLEditor
in nsidomnode adestinationnode, in long adestinationoffset, in boolean adeleteselection); void insertlinkaroundselection(in nsidomelement aanchorelement); boolean isanonymouselement(in nsidomelement aelement); void makeorchangelist(in astring alisttype, in boolean entirelist, in astring abullettype); boolean nodeisblock(in nsidomnode node); void pasteno
formatting(in long aselectiontype); void rebuilddocumentfromsource(in astring asourcestring); void removealldefaultproperties(); void removeallinlineproperties(); void removedefaultproperty(in nsiatom aproperty, in astring aattribute, in astring avalue); void removeinlineproperty(in nsiatom aproperty, in astring aattribute); void removeinsertionlis...
... returninparagraphcreatesnewparagraph boolean a boolean indicating if a return key pressed in a para...
... returninparagraphcreatesnewparagraph boolean a boolean indicating if a return key pressed in a paragraph creates another paragr...
...And 5 more matches
nsIMsgIncomingServer
filter(); void closecachedconnections(); void configuretemporaryfilters(in nsimsgfilterlist filterlist); void configuretemporaryreturnreceiptsfilter(in nsimsgfilterlist filterlist); obsolete since gecko 1.8 void displayofflinemsg(in nsimsgwindow awindow); boolean equals(in nsimsgincomingserver server); void forgetpassword(); void forgetsessionpassword(); astring generateprettyname
formigration(); boolean getboolattribute(in string name); boolean getboolvalue(in string attr); acstring getcharattribute(in string name); acstring getcharvalue(in string attr); nsilocalfile getfilevalue(in string relpref, in string abspref); nsimsgfilterlist getfilterlist(in nsimsgwindow amsgwindow); long getintattribute(in string name); long getintvalue(in string attr); nsimsgfolde...
...ndow, in nsiurllistener aurllistener); acstring getpasswordwithui(in astring apromptstring, in astring aprompttitle, in nsimsgwindow amsgwindow, out boolean okayvalue); astring getunicharattribute(in string name); astring getunicharvalue(in string attr); boolean isnewhdrduplicate(in nsimsgdbhdr anewhdr); void onuserorhostnamechanged(in acstring oldname, in acstring newname); void per
formbiff(in nsimsgwindow amsgwindow); void per
formexpand(in nsimsgwindow amsgwindow); void removefiles(); void setboolattribute(in string name, in boolean value); void setboolvalue(in string attr, in boolean value); void setcharattribute(in string name, in acstring value); void setcharvalue(in string attr, in acstring value); void setdefaultlocalpath(in nsilocalfile adefaultlocalpath); ...
...logonfallback boolean maxmessagesize long offlinesupportlevel long password acstring passwordpromptrequired boolean if the password for the server is available either via authentication in the current session or from password manager stored entries, return false. otherwise, return true. if password is obtained from password manager, set the password member variable. read only. per
formingbiff boolean port long prettyname astring pretty name - should be "userid on hostname" if the pref is not set. realhostname acstring real hostname of the server (if server name is changed it is stored here) realusername acstring real username of the server (if username is changed it is stored here) redirectortype string obsolete since gecko 1.9 rememberpassword boolean reten...
...And 5 more matches
nsINavHistoryResultViewObserver
drop_on 0 the drag operation ...
... drop_on 0 the drag operation wishes to drop the dragged item onto the indicated...
... drop_on 0 the drag operation wishes to drop the dragged item onto the indicated row. drop_after 1 the drag operation wishes to inser...
...And 5 more matches
nsIXSLTProcessor
content/xslt/public/nsixsltprocessor.idlscriptable xslt processor inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/document-trans
former;1?type=xslt. ...
... content/xslt/public/nsixsltprocessor.idlscriptable xslt processor inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/document-trans
former;1?type=xslt. ...
...this will make the processor use the default-value for all parameters as specified in the stylesheet. void clearparameters(); parameters none. getparameter() gets a parameter if previousl...
...And 5 more matches
nsIXULAppInfo
implemented by: @mozilla.org/xre/app-info;1. ...
...ation about the host application. it can be used to distinguish between different mozilla-based applications. it provides application name, application version, gecko version and more. 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) in xulrunner applications nsixulappinfo obtains app-specific in
formation from application.ini. implemented by: @mozilla.org/xre/app-info;1. to create an instance, use: var xulappinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); the nsixulruntime interface is also implemented by "xre/app-info". it contains advanced in
formation on the xul runtime. attributes attribute type des...
... .getservice(components.interfaces.nsixulappinfo); the nsixulruntime interface is also implemented by "xre/app-info". it contains advanced in
formation on the xul runtime. attributes attribute type description appbuildid acstring the application's build id/date, for example "2004051604". for xulrunner applications, this will be different than the build id of the plat
form. be careful about which one you want. read only. id acstring the xul application's uuid. can be an empty string, if id is not set. has to be defined for advanced application features such as the extension manager and update service. ...
...And 5 more matches
Using the clipboard
the clipboard mozilla provides a number of interfaces for accessing the clipboard. the component @mozilla.org/widget/clipboardhelper;1 can be used to copy text to the clipboard. this component implements the interface nsiclipboardhelper, which has a function copystring that can be used to copy a string. const gclipboardhelper = components.classes["@mozilla.org/widget/clipboardhelper;1"] .getservice(components.interfaces.nsiclipboardhelper); gclipboardhelper.copystring("put me on the clipboard, please."); this example will first create a clipboard helper and then copy a short string to the clipboard. ...
... use them to copy and paste any type of data from your application to the clipboard. three xpcom objects are needed to handle clipboard operations. the first is an object that holds the data to put on the clipboard. the second is the clipboard object. the third is an object which is used to transfer the data from the first object to the clipboard. the clipboard model in mozilla requires you to per
form the following steps to copy data: create an xpcom wrapper for the data which you want to put on the clipboard. this is needed because you can put anything on the clipboard from text to images. create a transferring object. this object can be the component @mozilla.org/widget/transferable;1 which implements the interface nsitransferable. initialize the transferring object with the nsiloadcont...
...bject. you might wonder why a transferring object is needed instead of just putting the object directly on the clipboard. one reason is that some systems do not copy the data right away. instead, they wait until the data is pasted. another reason is that the transferable can hold multiple representations of the same data. for example, a piece of html can be represented in both its original html
form and in plain text. if an application wants to get the data from the clipboard and doesn't understand html, it can use the plain text version. if it does understand html, it can grab that version. the transferring object will hold the clipboard contents until the application has decided what it needs. this allows the clipboard to be used by another application right away. let's break down the ste...
...And 5 more matches
Mozilla technologies
mozilla has several technologies used as components of its projects. these are documented here. accessibility api implementation detailsthese pages contain documentation on mozilla specific implementation details of assistive technology apis.animated png graphicsapng is an extension of the portable network graphics (png)
format, adding support for animated images. apng is a simpler alternative to mng, providing a spec suitable for the most common usage of animated images on the internet.docshelldocshell is the second iteration of what originally started out as webshell. at the moment, the transition from webshell to docshell is not fully completed, but the long-term goal is to remove webshell and switch over entirely to docshell.embedded dialog apifeed content access apifirefox 2...
...it offers increased flexibility and complex querying to mak...
...ntroduce a series of interfaces that make it easy for extension authors to access rss and atom feeds.life after xul: building firefox interfaces with htmlthis page gathers technical solutions to common problems encountered by teams shipping html-based interfaces inside firefox.morkmork is a database file
format invented by david mccusker for the mozilla code since the original netscape database in
formation was proprietary and could not be released open source. starting with mozilla 1.9, it was phased out in favor of sqlite, a more widely-supported file
format.placesplaces is the bookmarks and history management system introduced in firefox 3. it offers increased flexibility and complex querying to make handling the places the user goes easier and more convenient. it also includes new features ...
...And 5 more matches
Paint Flashing Tool - Firefox Developer Tools
the paint flashing tool, when activated, highlights the part of a page that the browser needs to repaint in response to some input: for example, the user moving the mouse or scrolling. with the help of this tool you can figure out whether your website is causing the browser to repaint more than it needs to. because repaints can be per
formance-intensive operations, eliminating unnecessary repaints can improve your website's responsiveness. repaints and responsiveness when the browser renders a web page it parses the html and css, determines how to lay it out, and then paints it to actually display the content on the screen. whenever an event happens that might change a visible part of the web page then the browser must repaint some portion of the page. for example, a repaint will be needed i...
...nt flashing, click the "highlight painted area" icon in the toolbox again. example: css transitions one area where implementation choices can affect repaint efficiency is in css transitions. the example below shows two different ways to move an element using a css transition. ...
.... the example below shows two different ways to move an element using a css transition. the first way applies the transition to the element's margin-left, while the second way moves the element using the trans
form property. ...
...And 5 more matches
Waterfall - Firefox Developer Tools
the waterfall gives you insight into the sorts of things the browser is doing as it runs your site or app. 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. so if you see a sign of a per
formance problem - a drop in the frame rate, for example - you can go to the waterfall to see what the browser was doing at that point in the recording. along the x-axis is time. recorded operations, called markers, are shown as horizontal bars, laid out in a waterfall to reflect the serial nature of the browser's execution. when a marker is selected you'll see more in
formation about it in a sidebar on the right. this ...
...he waterfall to see what the browser was doing at that point in the recording. along the x-axis is time. recorded operations, called markers, are shown as horizontal bars, laid out in a waterfall to reflect the serial nature of the browser's execution. when a marker is selected you'll see more in
formation about it in a sidebar on the right. this includes the marker's duration and some more in
formation that's specific to the marker type. markers the markers for operations are color-coded and labeled. the following operations are recorded: name and description color detailed in
formation dom event javascript code that's executed in response to a dom event. event type for example, "click" or "message". event p...
... layout calculating the position and size of page elements. this operation is sometimes called "reflow". paint drawing pixels to the screen. garbage collection garbage collection event. non-incremental gc events are labeled "(non-incremental)". reason a string indicating the reason gc was per
formed. non-incremental reason if the gc event was non-incremental, the string indicates the reason non-incremental gc was per
formed. new in firefox 46: if the gc event was caused by allocation pressure, a link appears, labeled "show allocation triggers". click the link to see the allocation profile leading up to this gc event. see allocations and garbage collection for m...
...And 5 more matches
DOMMatrixReadOnly.scale() - Web APIs
the scale() method of the dommatrixreadonly interface creates a new matrix being the result of the original matrix with a scale trans
form applied. syntax the scale() method is specified with either one or six values. dommatrix.scale(scalex[, scaley][, scalez][, originx][, originy][, originz]) parameters scalex a multiplier for the scale value on the x-axis. scaley optional a multiplier for the scale value on the y-axis. if not supplied, this defaults to the value of scalex. scalez optional a multiplier for the scale value on the z-axis. if this value is anything other than 1, the resulting matrix will be 3d. originx optional an x-coordinate for the origin of the trans
formation. if no origin is supplied, this defaults to 0. originy optional a y-coordinate for the ...
...e value on the y-axis. if not supplied, this defaults to the value of scalex. scalez optional a multiplier for the scale value on the z-axis. if this value is anything other than 1, the resulting matrix will be 3d. originx optional an x-coordinate for the origin of the trans
formation. if no origin is supplied, this defaults to 0. originy optional a y-coordinate for the origin of the trans
formation. if no origin is supplied, this defaults to 0. originz optional a z-coordinate for the origin of the trans
formation. if no origin is supplied, this defaults to 0. if this value is anything other than 0, the resulting matrix will be 3d. return value returns a dommatrix containing a new matrix being the result of the matrix x and y dimensions being scaled by the given factor, centered o...
...trix.scale(scale[, originx][, originy]) we'll show an example of how you can deal with the cross-browser support implications of this in the examples section, below. examples this svg contains three squares, one red, one blue, and one green, each positioned at the document origin: <svg width="250" height="250" viewbox="0 0 25 25"> <rect width="25" height="25" fill="red" /> <rect id="trans
formed" width="25" height="25" fill="blue" /> <rect id="trans
formedorigin" width="25" height="25" fill="green" /> </svg> this javascript first creates an identity matrix, then uses the scale() method to create a new matrix with a single parameter. we test if the browser supports a six parameter scale() method by creating a new matrix using three parameters and observing it's is2d property — if ...
...And 5 more matches
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
ulation of the content tree difficult in unexpected ways, depending on where it is located. this article explores when difficulties can occur, and looks at what can be done to mitigate resulting problems. what is whitespace? whitespace is any string of text composed only of spaces, tabs or line breaks (to be precise, crlf sequences, carriage returns or line feeds). these characters allow you to
format your code in a way that will make it easily readable by yourself and other people. in fact, much of our source code is full of these whitespace characters, and we only tend to get rid of it in a production build step to reduce code download sizes. html largely ignores whitespace? in the case of html, whitespace is largely ignored — whitespace in between words is treated as a single characte...
......
...example <h1> hello <span> world!</span> </h1> the <h1> element contains only inline elements. in fact it contains: a text node (consisting of some spaces, the word "hello" and some tabs). an inline element (the <span>, which contains a space, and the word "world!"). another text node (consisting only of tabs and spaces). because of this, it establishes what is called an inline
formatting context. this is one of the possible layout rendering contexts that browser engines work with. inside this context, whitespace character processing can be summarized as follows: first, all spaces and tabs immediately before and after a line break are ignored so, if we take our example markup from before and apply this first rule, we get: <h1>◦◦◦hello⏎ <span>◦world!</span...
...And 5 more matches
HTML Drag and Drop API - Web APIs
dragleave ondragleave …a dragged item leaves a valid drop target. dragover ondragover …a dragged item is being dragged over a valid drop target, every few hundred milliseconds. dragstart ondragstart …the user starts dragging an item. (see starting a drag operation.) drop ondrop …an item is dropped on a valid drop target. (see per
forming a drop.) note: neither dragstart nor dragend events are fired when dragging a file into the browser from the os. interfaces the html drag and drop interfaces are dragevent, datatransfer, datatransferitem and datatransferitemlist. the dragevent interface has a constructor and one datatransfer property, which is a datatransfer object. datatransfer objects include the drag event's stat...
...rty for the data item's mime type. the datatransferitem object also has methods to get the drag item's data. the datatransferitemlist object is a list of datatransferitem objects. the list object has methods to add a drag item to the list, remove a drag item from the list, and clear the list of all drag items. a key difference between the datatransfer and datatransferitem interfaces is that the
former uses the synchronous getdata() method to access a drag item's data, but the latter instead uses the asynchronous getasstring() method. note: dragevent and datatransfer are broadly supported on desktop browsers. however, the datatransferitem and datatransferitemlist interfaces have limited browser support. see interoperability for more in
formation about drag-and-drop interoperability. gecko-sp...
...additionally, see the datatransfer reference page for all of the gecko-specific properties and gecko-specific methods. ...
...And 5 more matches
Using the Payment Request API - Web APIs
the payment request api provides a browser-based method of connecting users and their preferred payment systems and plat
forms to merchants that they want to pay for goods and services. this article is a guide to making use of the payment request api, with examples and suggested best practices. the basics of making a payment this section details the basics of using the payment request api to make a payment. note: the code snippets from this section are from our feature detect support demo. creating a new payment request object a payment request always starts with the creation of a new paymentrequest object — using the paymentrequest() constructor. ...
...g the payment request api to make a payment. note: the code snippets from this section are from our feature detect support demo. creating a new payment request object a payment request always starts with the creation of a new paymentrequest object — using the paymentrequest() constructor. this takes two mandatory parameters and one option parameter: methoddata — an object containing in
formation concerning the payment provider, such as what payment methods are supported, etc. details — an object containing in
formation concerning the specific payment, such as the total payment amount, tax, shipping cost, etc. options (optional) — an object containing addtional options related to the payment. so for example, you could create a new paymentrequest instance like so: var request ...
...sh handling payment }); }) } }) paymentrequest.abort() can be used to abort the payment request if required. detecting availability of the payment request api you can effectively detect support for the payment request api by checking if the user's browser supports paymentrequest, i.e. if (window.paymentrequest). in the following snippet, a merchant page per
forms this check, and if it returns true updates the checkout button to use paymentrequest instead of legacy web
forms. const checkoutbutton = document.getelementbyid('checkout-button'); if (window.paymentrequest) { let request = new paymentrequest(buildsupportedpaymentmethodnames(), buildshoppingcartdetails()); checkoutbutton.addeventlistener('click', function() { request.show().then(f...
...And 5 more matches
Resource Timing API - Web APIs
ype of resource that initiated the fetch. this document provides an overview of the resource timing interfaces. for more details about the interfaces including examples see each interface's reference page, using the resource timing api, and the references in the see also section. for a graphical representation of the resource timing processing model see the resource timing phases figure. the per
formanceresourcetiming interface extends the per
formanceentry for per
formance entries which have an entrytype of "resource". high-resolution timestamps several of the resource timing properties return high-resolution timestamps. these timestamps have a domhighrestimestamp type and as its name implies, they represent a high-resolution point in time. this type is a double and its value is a discrete p...
...e header with a value specifying the origin or origins which are allowed to get the restricted timestamp values. the properties which are returned as 0 by default when loading a resource from a domain other than the one of the web page itself: redirectstart, redirectend, domainlookupstart, domainlookupend, connectstart, connectend, secureconnectionstart, requeststart, and responsestart. the per
formanceresourcetiming interface also includes several network timing properties. the redirectstart and redirectend properties return timestamps for redirect start and end times, respectively. likewise, the the domainlookupstart and domainlookupend properties return timestamps for dns lookup start and end times, respectively. this would be a nice place to have a diagram showing the relationships betw...
...ties. the redirectstart and redirectend properties return timestamps for redirect start and end times, respectively. likewise, the the domainlookupstart and domainlookupend properties return timestamps for dns lookup start and end times, respectively. this would be a nice place to have a diagram showing the relationships between these segments of the resource loading time. resource size the per
formanceresourcetiming interface has three properties that can be used to obtain size data about a resource. the transfersize property returns the size (in octets) of the fetched resource including the response header fields plus the response payload body. the encodedbodysize property returns the size (in octets) received from the fetch (http or cache), of the payload body, before removing any applie...
...And 5 more matches
Streams API concepts - Web APIs
some of the concepts and terminology associated with streams might be new to you — this article explains all you need to know. readable streams a readable stream is a data source represented in javascript by a readablestream object that flows from an underlying source — this is a resource somewhere on the network or elsewhere on your domain that you want to get data from. ...
...’d need two copies to do this. writable streams a writable stream is a destination into which you can write data, represented in javascript by a writablestream object. this serves as an abstraction over the top of an underlying sink — a lower-level i/o sink into which raw data is written. the data is written to the stream via a writer, one chunk at a time. a chunk can take a multitude of
forms, just like the chunks in a reader. you can use whatever code you like to produce the chunks ready for writing; the writer plus the associated code is called a producer. when a writer is created and starts writing to a stream (an active writer), it is said to be locked to it. only one writer can write to a writable stream at one time. if you want another writer to start writing to your stream, y...
...onstructor. these currently have very limited availability in browsers. pipe chains the streams api makes it possible to pipe streams into one another (or at least it will do when browsers implement the relevant functionality) using a structure called a pipe chain. there are two methods available in the spec to facilitate this: readablestream.pipethrough() — pipes the stream through a trans
form stream, which is a pair comprised of a writable stream that has data written to it, and a readable stream that then has the data read out of it — this acts as a kind of treadmill that constantly takes data in and trans
forms it to a new state. effectively the same stream is written to, and then the same values are read. a simple example is a text decoder, where raw bytes are written, and then st...
...And 5 more matches
WebGLRenderingContext.getProgramParameter() - Web APIs
possible values: gl.delete_status: returns a glboolean indicating whether or not the program is flagged for deletion. gl.link_status: returns a glboolean indicating whether or not the last link operation was successful. gl.validate_status: returns a glboolean indicating whether or not the last validation operation was successful. ...
...ean indicating whether or not the last link operation was successful. gl.validate_status: returns a glboolean indicating whether or not the last validation operation was successful. gl.attached_shaders: returns a glint indicating the number of attached shaders to a program. gl.active_attributes: returns a glint indicating the number of active attribute variables to a program. ...
...successful. gl.validate_status: returns a glboolean indicating whether or not the last validation operation was successful. gl.attached_shaders: returns a glint indicating the number of attached shaders to a program. gl.active_attributes: returns a glint indicating the number of active attribute variables to a program. gl.active_uni
forms: returns a glint indicating the number of active uni
form variables to a program. ...
...And 5 more matches
Using bounded reference spaces - Web APIs
ns but upon limitations imposed by the real world. this article examines bounded reference spaces as represented by xrboundedreferencespace, describing what they are and how they're used. there are many uses for bounded reference spaces, including projects such as virtual paint studios or 3d construction, modeling, or sculpting systems; training simulations or lesson scenarios; dance or other per
formance-based games; or the preview of 3d objects in the real world using augmented reality. introduction a bounded reference space is one which represents an xr environment in which the user is able to move around physically in the real world while being tracked by the xr hardware, with their movements being then transposed into the simulation. the boundaries established by the bounded reference s...
...out on the floor of the space, which is sensible given the real-world implications otherwise. therefore, the bounded reference space's origin always places the y=0 plane at floor level. the boundary is then defined using an array of 2d coordinates, specifying only the x and z components since y is always 0. these points go around the room in a clockwise direction. note that if the underlying plat
form defines a fixed room-scale origin and boundary, it may initialize any uninitialized values to match that predefined in
formation; this is not unexpected behavior for users of these plat
forms. the space inside the boundary is then the user's safe movement area, within which they are tracked and their movements replicated into the virtual world. although the user's xr system may provide automated d...
...-floor space were supported as well. once the session has been created, our startsessionanimation() function can try to establish a bounded-floor reference space, and if it fails to do so it can then fall back to requesting a local-floor reference space instead (in which we will have to handle boundaries ourselves). this way, our session will start up regardless of whether or not the user's plat
form is able to provide bounded reference spaces. creating the reference space simply requesting support for bounded-floor when calling the xrsystem method requestsession() isn't enough to get a bounded space. you need to ask for one when you call requestreferencespace() as well. that means you need to change the code that calls requestreferencespace() to ask for a bounded reference space, then if t...
...And 5 more matches
ARIA: textbox role - Accessibility
to create a multi-line text box which supports line breaks, as in an html <textarea>, set aria-multiline="true". ...
.... 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. description when an element has the textbox role, the browser sends an accessible textbox event to assistive technologies, which can then notify the user about it. the default is a single line input, in which return or enter submits the
form; in this case, it is preferable to use an html <input> with type="text". to create a multi-line text box which supports line breaks, as in an html <textarea>, set aria-multiline="true". including the html contenteditable attribute ensures the text node is editable. <!-- simple text input field --> <div id="txtboxlabel">enter your five-digit zipcode</div> <div role="textbox" contenteditable="true...
...-haspopup attributes should also be included. the value of aria-controls is the id of the element that contains the list of suggested values. additionally, either the textbox or a containing element with role combobox has a value for aria-haspopup that matches the role of the element that contains the list of suggested values. aria-multiline attribute if aria-multiline="true" is set, the at in
forms the user that the textbox supports multi-line input, with the expectation that enter or return will create a line break rather than submitting the
form. aria does not alter the behavior of the element; rather this feature must be controlled by the developer. if false is set, or the the attribute is omitted and defaults to false, the user expectation is that the control is a single line text box...
...And 5 more matches
WAI-ARIA Roles - Accessibility
e used to define very dynamic and desktop-like web applications.aria: article rolethe article role indicates a section of a page that could easily stand on its own on a page, in a document, or on a website. it is usually set on related content items such as comments, forum posts, newspaper articles or other items grouped together on one page.aria: banner rolea banner role represents general and in
formative content frequently placed at the beginning of the page. this usually includes a logo, company name, search icon, photo related to the page, or slogan.aria: button rolethe button role should be used for clickable elements that trigger a response when activated by the user. adding role="button" will make an element appear as a button control to a screen reader. this role can be used in combina...
...s that trigger a response when activated by the user. adding role="button" will make an element appear as a button control to a screen reader. this role can be used in combination with the aria-pressed attribute to create toggle buttons.aria: cell rolethe cell value of the aria role attribute identifies an element as being a cell in a tabular container that does not contain column or row header in
formation. to be supported, the cell must be nested in an element with the role of row.aria: checkbox rolethe checkbox role is used for checkable interactive controls. elements containing role="checkbox" must also include the aria-checked attribute to expose the checkbox's state to assistive technology.aria: comment rolethe comment landmark role semantically denotes a comment/reaction to some content ...
...n the page, or to a previous comment.aria: complementary rolethe complementary landmark role is used to designate a supporting section that relates to the main content, yet can stand alone when separated. these sections are frequently presented as sidebars or call-out boxes. if possible, use the html <aside> element instead.aria: contentinfo rolethe contentinfo landmark role is used to identify in
formation repeated at the end of every page of a website, including copyright in
formation, navigation links, and privacy statements. this section is commonly called a footer.aria: dialog rolethe dialog role is used to mark up an html based application dialog or window that separates content or ui from the rest of the web application or page. dialogs are generally placed on top of the rest of the page ...
...And 5 more matches
An overview of accessible web applications and widgets - Accessibility
menu bars, file list views, and more can be built with a combination of javascript, css, and html. since the html4 specification doesn't provide built-in tags that semantically describe these kinds of widgets, developers typically resort to using generic elements such as <div> and <span>. while this results in a widget that looks like its desktop counterpart, there usually isn't enough semantic in
formation in the markup to be usable by an assistive technology. the problem dynamic content on a web page can be particularly problematic for users who, for whatever reason, are unable to view the screen. stock tickers, live twitter feed updates, progress indicators, and similar content modify the dom in ways that an assistive technology (at) may not be aware of. that's where aria comes in. exampl...
...m dynamic content on a web page can be particularly problematic for users who, for whatever reason, are unable to view the screen. stock tickers, live twitter feed updates, progress indicators, and similar content modify the dom in ways that an assistive technology (at) may not be aware of. that's where aria comes in. example 1: markup for a tabs widget built without aria labeling. there's no in
formation in the markup to describe the widget's
form and function. <!-- this is a tabs widget. how would you know, looking only at the markup? --> <ol> <li id="ch1tab"> <a href="#ch1panel">chapter 1</a> </li> <li id="ch2tab"> <a href="#ch2panel">chapter 2</a> </li> <li id="quiztab"> <a href="#quizpanel">quiz</a> </li> </ol> <div> <div id="ch1panel">chapter 1 content goes h...
...up into three different types of attributes: roles, states, and properties. roles describe widgets that aren't otherwise available in html 4, such as sliders, menu bars, tabs, and dialogs. properties describe characteristics of these widgets, such as if they are draggable, have a required element, or have a popup associated with them. states describe the current interaction state of an element, in
forming the assistive technology if it is busy, disabled, selected, or hidden. aria attributes are interpreted automatically by the browser and translated to the operating system's native accessibility apis. so an element with role="slider" will be controlled in the same way as a native slider is controlled on the operating system. this provides a much more consistent user experience than was possib...
...And 5 more matches
Web Accessibility: Understanding Colors and Luminance - Accessibility
f particular importance, however, because at the end of the day, understanding of what it is and how it is employed enables accessibility for those who are color-blind, as well as those who can perceive color. it is the luminance contrast that enable the color-blind to distinguish dark against light. luminance must be established before the contrast may be. when speaking of color contrast, w3c
formulas are actually incorporating luminance, not just the colors ("hues") themselves. terminology can be confusing, because different terms are often used to describe the same thing. "luminance" and "saturation" are particularly important to get right. for example, "saturation" is known as "chroma" in some circles. in others, "chroma" and "saturation" are two different concepts. the "l" in the h...
...rs incorporate lightness, not luminance, and this is a significant consideration. note that in that same section of the css color module 3, there are algorigthms available to translate the hsl to rgb. newer technologies, such as opengl and direct3d incorporate support for the srgb gamma curve, although some articles for opengl reference use of rgba rather than srgb. webgl is usually in the rgba
format; see an example of how it is used in "clearing with colors". where accessibility is concerned, however, standards and guidelines are currently written predominantly using the srgb color space, especially as it applies to color contrast ratios. in speaking specifically to relative luminance, wcag's definition of relative luminance notes: "note 2: almost all systems used today to view web co...
...gb value, or as a rgba value, expressed in percentages. em { color: #f00; } /* #rgb */ em { color: #ff0000; } /* #rrggbb */ em { color: #ff0000ff; } /* #rrggbbaa */ em { color: rgb(255, 0, 0); } em { color: rgb(100%, 0%, 0%); } em { color: rgb(255, 0, 0, 1); } em { color: rgba(100%, 0%, 0%, 100%); } conversions are not casual. see the stack exchange article, "
formula to determine the brightness of rgb color". there are many online tools that can convert rgb to hsl for you, with both the rgb hexidecimal and css function syntax. a great example of a tool that converts colors for you is tom jewett's "mini color selector" with hsl, rgb, hex options for checking contrast in the browser. luminance and contrast contrast contrast between colors ("hues") ...
...And 5 more matches
display - CSS: Cascading Style Sheets
the outer type sets an element's participation in flow layout; the inner type sets the layout of children. some values of display are fully defined in their own individual specifications; for example the detail of what happens when display: flex is declared is defined in the css flexible box model specification. ...
...hen display: block or display: inline is specified, will set the inner value to flow. this will result in expected behavior; for example if you specify an element to be block, you would expect that the children of that element would participate in block and inline normal flow layout. inside <display-inside> these keywords specify the element’s inner display type, which defines the type of
formatting context that its contents are laid out in (assuming it is a non-replaced element). valid <display-inside> values: flow the element lays out its contents using flow layout (block-and-inline layout). if its outer display type is inline or run-in, and it is participating in a block or inline
formatting context, then it generates an inline box. otherwise it generates a block container ...
...s out its contents using flow layout (block-and-inline layout). if its outer display type is inline or run-in, and it is participating in a block or inline
formatting context, then it generates an inline box. otherwise it generates a block container box. depending on the value of other properties (such as position, float, or overflow) and whether it is itself participating in a block or inline
formatting context, it either establishes a new block
formatting context (bfc) for its contents or integrates its contents into its parent
formatting context. flow-root the element generates a block element box that establishes a new block
formatting context, defining where the
formatting root lies. table these elements behave like html <table> elements. it defines a block-level box. flex the ...
...And 5 more matches
position - CSS: Cascading Style Sheets
eates a new stacking context when the value of z-index is not auto. the margins of absolutely positioned boxes do not collapse with other margins. fixed the element is removed from the normal document flow, and no space is created for the element in the page layout. it is positioned relative to the initial containing block established by the viewport, except when one of its ancestors has a trans
form, perspective, or filter property set to something other than none (see the css trans
forms spec), in which case that ancestor behaves as the containing block. (note that there are browser inconsistencies with perspective and filter contributing to containing block
formation.) its final position is determined by the values of top, right, bottom, and left. this value always creates a new stacking c...
...tal offset. an absolutely positioned element is an element whose computed position value is absolute or fixed. the top, right, bottom, and left properties specify offsets from the edges of the element's containing block. (the containing block is the ancestor relative to which the element is positioned.) if the element has margins, they are added to the offset. the element establishes a new block
formatting context (bfc) for its contents. a stickily positioned element is an element whose computed position value is sticky. it's treated as relatively positioned until its containing block crosses a specified threshold (such as setting top to value other than auto) within its flow root (or the container it scrolls within), at which point it is treated as "stuck" until meeting the opposite edge of...
...nglish, horizontal japanese, etc.) and right wins when direction is rtl (persian, arabic, hebrew, etc.). accessibility concerns ensure that elements positioned with an absolute or fixed value do not obscure other content when the page is zoomed to increase text size. ...
...And 5 more matches
Content categories - Developer guides
onship among elements of these categories), but they help define and describe the categories' shared behavior and their associated rules, especially when you come upon their intricate details. it's also possible for elements to not be a member of any of these categories. there are three types of content categories: main content categories, which describe common rules shared by many elements.
form-related content categories, which describe rules common to
form-related elements. specific content categories, which describe rare categories shared only by a few elements, sometimes only in a specific context. note: a more detailed discussion of these content categories and their comparative functionalities is beyond the scope of this article; for that, you may wish to read the relevant port...
...nt categories and their comparative functionalities is beyond the scope of this article; for that, you may wish to read the relevant portions of the html specification. main content categories metadata content elements belonging to the metadata content category modify the presentation or the behavior of the rest of the document, set up links to other documents, or convey other out of band in
formation. elements belonging to this category are <base>, <command>, <link>, <meta>, <noscript>, <script>, <style> and <title>. flow content elements belonging to the flow content category typically contain text or embedded content. they are: <a>, <abbr>, <address>, <article>, <aside>, <audio>, <b>,<bdo>, <bdi>, <blockquote>, <br>, <button>, <canvas>, <cite>, <code>, <command>, <data>, <datalist...
...ript>, <script>, <style> and <title>. flow content elements belonging to the flow content category typically contain text or embedded content. ...
...And 5 more matches
User input and controls - Developer guides
relevant apis and events include touch events, pointer lock api, screen orientation api, fullscreen api, drag & drop and more. ...
...relevant apis and events include touch events, pointer lock api, screen orientation api, fullscreen api, drag & drop and more. ...
...n api, drag & drop and more. user input and controls workflow the following diagram illustrates the typical workflow for implementing user input mechanisms: first of all, you need to decide which input mechanisms you want to cover in your application out of mouse, keyboard, finger touch and so on. once you decided the input mechanisms, you can control them using tools offered by the web plat
form or javascript libraries. recommendations available input mechanisms depend on the capabilities of the device running the application: some devices provide touchscreen displays: the web plat
form offers touch events to interpret finger activity on touch-based user interfaces. for devices providing a mouse/touchpad as a pointing method, the pointer lock api helps you in implementing a first pe...
...And 5 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
children experiment with color before they even have the manual dexterity to draw. maybe that's why color is one of the first things people often want to experiment with when learning to develop websites. with css, there are lots of ways to add color to your html elements to create just the look you want. this article is a primer introducing each of the ways css color can be used in html. fortunately, adding color to your html is actually really easy to do, and you can add color to nearly anything. ...
...web technology that supports color. there are graphics technologies that are available on the web which also support color. the html canvas api lets you draw 2d bitmapped graphics in a <canvas> element. see our canvas tutorial to learn more. svg (scalable vector graphics) lets you draw images using commands that draw specific shapes, patterns, and lines to produce an image. 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. webgl the web graphics library is an opengl es-based api for drawing high-per
formance 2d and 3d graphics on the web. see our webgl tutorial to find out more. how to describe a color in order to represent a color in css, you have to find a way to tr...
...this is typically done by breaking down the color into components, such as how much of each of a set of primary colors to mix together, or how bright to make the color. ...
...And 5 more matches
<input type="reset"> - HTML: Hypertext Markup Language
they're rarely useful, and are instead more likely to frustrate users who click them by mistake (often while trying to click the submit button). ...
...they're rarely useful, and are instead more likely to frustrate users who click them by mistake (often while trying to click the submit button). ...
... value a domstring used as the button's label events click supported common attributes type and value idl attributes value methods none value an <input type="reset"> element's value attribute contains a domstring that is used as the button's label. buttons such as reset don't have a value otherwise. <input type="reset" value="reset the
form"> if you don't specify a value, you get an button with the default label (typically "reset," but this will vary depending on the user agent): <input type="reset"> using reset buttons <input type="reset"> buttons are used to reset
forms. if you want to create a custom button and then customize the behaviour using javascript, you need to use <input type="button">, or better still, a <but...
...And 5 more matches
Common MIME types - HTTP
. ...
...mp .bz bzip archive application/x-bzip .bz2 bzip2 archive application/x-bzip2 .csh c-shell script application/x-csh .css cascading style sheets (css) text/css .csv comma-separated values (csv) text/csv .doc microsoft word application/msword .docx microsoft word (openxml) application/vnd.openxml
formats-officedocument.wordprocessingml.document .eot ms embedded opentype fonts application/vnd.ms-fontobject .epub electronic publication (epub) application/epub+zip .gz gzip compressed archive application/gzip .gif graphics interchange
format (gif) image/gif .htm .html hypertext markup language (html) text/html ...
...ument.wordprocessingml.document .eot ms embedded opentype fonts application/vnd.ms-fontobject .epub electronic publication (epub) application/epub+zip .gz gzip compressed archive application/gzip .gif graphics interchange
format (gif) image/gif .htm .html hypertext markup language (html) text/html .ico icon
format image/vnd.microsoft.icon .ics icalendar
format text/calendar .jar java archive (jar) application/java-archive .jpeg .jpg jpeg images image/jpeg .js javascript text/javascript, per the following specifications: https://html.spec.whatwg.org/multipage/#scriptinglanguages https://html.spec.whatwg.org/multipage/#...
...And 5 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
so. webgl textures. images/video frames drawn to a canvas using drawimage(). css shapes from images. this article is a general discussion of cross-origin resource sharing and includes a discussion of the necessary http headers. functional overview the cross-origin resource sharing standard works by adding new http headers that let servers describe which origins are permitted to read that in
formation from a web browser. 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 re...
...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. servers can also in
form clients whether "credentials" (such as cookies and http authentication) should be sent with requests. cors failures result in errors, but for security reasons, specifics about the error are not available to javascript. all the code knows is that an error occurred. the only way to determine what specifically went wrong is to look at the browser's console for details. subsequent sections discuss ...
... no readablestream object is used in the request. note: these are the same kinds of cross-site requests that web content can already issue, and no response data is released to the requester unles...
...And 5 more matches
Using HTTP cookies - HTTP
an http cookie (web cookie, browser cookie) is a small piece of data that a server sends to the user's web browser. the browser may store it and send it back with later requests to the same server. typically, it's used to tell if two requests came from the same browser — keeping a user logged-in, for example. it remembers stateful in
formation for the stateless http protocol. cookies are mainly used for three purposes: session management logins, shopping carts, game scores, or anything else the server should remember personalization user preferences, themes, and other settings tracking recording and analyzing user behavior cookies were once used for general client-side storage. while this was legitimate when they were the only way to store data on the client, it is now recommended...
...thing else the server should remember personalization user preferences, themes, and other settings tracking recording and analyzing user behavior cookies were once used for general client-side storage. while this was legitimate when they were the only way to store data on the client, it is now recommended to use modern storage apis. cookies are sent with every request, so they can worsen per
formance (especially for mobile data connections). modern apis for client storage are the web storage api (localstorage and sessionstorage) and indexeddb. to see stored cookies (and other storage that a web page can use), you can enable the storage inspector in developer tools and select cookies from the storage tree. creating cookies after receiving an http request, a server can send one or more...
...bute and the httponly attribute. a cookie with the secure attribute is sent to the server only with an encrypted request over the https protocol, never with unsecured http, and therefore can't easily be accessed by a man-in-the-middle attacker. insecure sites (with http: in the url) can't set cookies with the secure attribute. however, do not assume that secure prevents all access to sensitive in
formation in cookies; for example, it can be read by someone with access to the client's hard disk. a cookie with the httponly attribute is inaccessible to the javascript document.cookie api; it is sent only to the server. for example, cookies that persist server-side sessions don't need to be available to javascript, and should have the httponly attribute. this precaution helps mitigate cross-site s...
...And 5 more matches
POST - HTTP
ds data to the server. the type of the body of the request is indicated by the content-type header. the difference between put and post is that put is idempotent: calling it once or several times successively has the same effect (that is no side effect), where successive identical post may have additional effects, like passing an order several times. a post request is typically sent via an html
form and results in a change on the server. in this case, the content type is selected by putting the adequate string in the enctype attribute of the <
form> element or the
formenctype attribute of the <input> or <button> elements: application/x-www-
form-urlencoded: the keys and values are encoded in key-value tuples separated by '&', with a '=' between the key and the value. non-alphanumeric charac...
... of the <
form> element or the
formenctype attribute of the <input> or <button> elements: application/x-www-
form-urlencoded: the keys and values are encoded in key-value tuples separated by '&', with a '=' between the key and the value. non-alphanumeric characters in both keys and values are percent encoded: this is the reason why this type is not suitable to use with binary data (use multipart/
form-data instead) multipart/
form-data: each value is sent as a block of data ("body part"), with a user agent-defined delimiter ("boundary") separating each part. the keys are given in the content-disposition header of each part. text/plain when the post request is sent via a method other than an html
form — like via an xmlhttprequest — the body can take any type. as described in the http 1.1...
... is sent as a block of data ("body part"), with a user agent-defined delimiter ("boundary") separating each part. the keys are given in the content-disposition header of each part. text/plain when the post request is sent via a method other than an html
form — like via an xmlhttprequest — the body can take any type. as described in the http 1.1 specification, post is designed to allow a uni
form method to cover the following functions: annotation of existing resources posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; adding a new user through a signup modal; providing a block of data, such as the result of submitting a
form, to a data-handling process; extending a database through an append operation. request has body yes ...
...And 5 more matches
HTTP response status codes - HTTP
http response status codes indicate whether a specific http request has been successfully completed. responses are grouped in five classes: in
formational responses (100–199), successful responses (200–299), redirects (300–399), client errors (400–499), and server errors (500–599). the below status codes are defined by section 10 of rfc 2616. you can find an updated specification in rfc 7231. if you receive a response that is not in this list, it is a non-standard response, possibly custom to the server's software. in
formation responses 100 continue this interim response indicates that everything so far is ok and that the client should continue the request, or ignore the response if the request is already finished. 101 switching protocol this code is sent in respo...
... is typically the response sent after post requests, or some put requests. 202 accepted the request has been received but not yet acted upon. it is noncommittal, since there is no way in http to later send an asynchronous response indicating the outcome of the request. it is intended for cases where another process or server handles the request, or for batch processing. 203 non-authoritative in
formation this response code means the returned meta-in
formation is not exactly the same as is available from the origin server, but is collected from a local or a third-party copy. this is mostly used for mirrors or backups of another resource. except for that specific case, the "200 ok" response is preferred to this status. 204 no content there is no content to send for this request, but the head...
...ent to send for this request, but the headers may be useful. the user-agent may update its cached headers for this resource with the new ones. 205 reset content tells the user-agent to reset the document which sent this request. 206 partial content this response code is used when the range header is sent from the client to request only part of a resource. 207 multi-status (webdav) conveys in
formation about multiple resources, for situations where multiple status codes might be appropriate. 208 already reported (webdav) used inside a <dav:propstat> response element to avoid repeatedly enumerating the internal members of multiple bindings to the same collection. 226 im used (http delta encoding) the server has fulfilled a get request for the resource, and the response is a representati...
...And 5 more matches
Equality comparisons and sameness - JavaScript
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). which operation you choose depends on what sort of comparison you are looking to per
form. briefly: double equals (==) will per
form a type conversion when comparing two things, and will handle nan, -0, and +0 specially to con
form 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 c...
...ling for nan, -0, and +0 (giving it the same behavior as === except on those special numeric values). note that the distinction between these all have to do with their handling of primitives; none of them compares whether the parameters are conceptually similar in structure. for any non-primitive objects x and y which have the same structure but are distinct objects themselves, all of the above
forms will evaluate to false. strict equality using === strict equality compares two values for equality. neither value is implicitly converted to some other value before being compared. if the values have different types, the values are considered unequal. if the values have the same type, are not numbers, and have the same value, they're considered equal. finally, if both values are numbers, they'...
...ed to positive infinity, for example. strict equality treats nan as unequal to every other value -- including itself. (the only case in which (x !== x) is true is when x is nan.) loose equality using == loose equality compares two values for equality, after converting both values to a common type. ...
...And 5 more matches
Grammar and types - JavaScript
javascript is case sensitive. in javascript, instructions are called statements and are separated by semicolons (;). a semicolon is not necessary after a statement if it is written on its own line. but if more than one statement on a line is desired, then they must be separated by semicolons. ecmascript also has rules for automatic insertion of semicolons (asi) to end statements. (for more in
formation, see the detailed reference about javascript's lexical grammar.) it is considered best practice, however, to always write a semicolon after a statement, even when it is not strictly needed. this practice reduces the chances of bugs getting into the code. the source text of javascript script gets scanned from left to right, and is converted into a sequence of input elements which are token...
...ions javascript has three kinds of variable declarations. var declares a variable, optionally initializing it to a value. let declares a block-scoped, local variable, optionally initializing it to a value. const declares a block-scoped, read-only named constant. variables you use variables as symbolic names for values in your application. the names of variables, called identifiers, con
form to certain rules. a javascript identifier must start with a letter, underscore (_), or dollar sign ($). subsequent characters can also be digits (0–9). because javascript is case sensitive, letters include the characters "a" through "z" (uppercase) as well as "a" through "z" (lowercase). you can use most of iso 8859-1 or unicode letters such as å and ü in identifiers. (for more details, se...
...iable in two ways: with the keyword var. for example, var x = 42. this syntax can be used to declare both local and global variables, depending on the execution context. with the keyword const or let. for example, let y = 13. this syntax can be used to declare a block-scope local variable. (see variable scope below.) you can also simply assign a value to a variable for example, x = 42. this
form creates an undeclared global variable. it also generates a strict javascript warning. undeclared global variables can often lead to unexpected behavior. thus, it is discouraged to use undeclared global variables. evaluating variables a variable declared using the var or let statement with no assigned value specified has the value of undefined. an attempt to access an undeclared variable result...
...And 5 more matches
JavaScript modules - JavaScript
r more details.disabled from version 12.0.0: this feature is behind the --experimental-modules runtime flag.available in workerschrome full support 80 full support 80 full support 67disabled disabled from version 67: this feature is behind the experimental web plat
form features preference. to change preferences in chrome, visit chrome://flags.edge full support 80 full support 80 full support 79disabled disabled from version 79: this feature is behind the experimental web plat
form features preference.firefox no su...
...to change preferences in chrome, visit chrome://flags.firefox android no support noopera android no support nosafari ios no support nosamsung internet android no support nonodejs no ...
... no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature. introducing an example to demonstrate usage of modules, we've created a simple set of examples that you can find on github. these examples demonstrate a simple set of modules that create a <canvas> element on a webpage, and then draw (and report in
formation about) different shapes on the canvas. these are fairly trivial, but have been kept deliberately simple to demonstrate modules clearly. note: if you want to download the examples and run them locally, you'll need to run them through a local web server. basic example structure in our first example (see basic-modules) we have a file structure as follows: index.html main.js modules/ ...
...And 5 more matches
Working with objects - JavaScript
for example, in the above code, when the key obj is added to the myobj, javascript will call the obj.tostring() method, and use this result string as the new key. you can also access properties by using a string value that is stored in a variable: var propertyname = 'make'; mycar[propertyname] = 'ford'; propertyname = 'model'; mycar[propertyname] = 'mustang'; you can use the bracket notati...
... new animal type called fishes var fish = object.create(animal); fish.type = 'fishes'; fish.displaytype(); // output:fishes inheritance all objects in javascript inherit from at least one other object. the object being inherited from is known as the prototype, and the inherited properties can be found in the prototype object of the constructor. see inheritance and the prototype chain for more in
formation. indexing object properties you can refer to a property of an object either by its property name or by its ordinal index. if you initially define a property by its name, you must always refer to it by its name, and if you initially define a property by an index, you must always refer to it by its index. this restriction applies when you create an object and its properties with a construct...
...operties with a constructor function (as we did previously with the car object type) and when you define individual properties explicitly (for example, mycar.color = "red"). if you initially define an object property with an index, such as mycar[5] = "25 mpg", you subsequently refer to the property only as mycar[5]. the exception to this rule is array-like object reflected from html, such as the
forms array-like object. you can always refer to objects in these array-like objects by either their ordinal number (based on where they appear in the document) or their name (if defined). for example, if the second <
form> tag in a document has a name attribute of "my
form", you can refer to the
form as document.
forms[1] or document.
forms["my
form"] or document.
forms.my
form. defining properties for an ...
...And 5 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
in this article we will discuss the main essential components of responsive design, with some links to further in
formation where necessary. for web developers, it is now fairly common to be called upon to create a web site or app that changes its user interface depending on the browser or device accessing the site to provide an optimized experience. one approach to this is to create different versions of your site/app for different plat
forms or browsers and serve them appropriately after detecting which browser or plat
form is looking at your site. but this is increasingly inefficient: browser sniffing is inherently error prone, and maintaining multiple copies of your code can turn out to be a nightmare. it is usually much better to create a single version of your code which doesn't...
...this tends to be termed responsive design or adaptive design, two related but different approaches. this is much more reliable, more maintainable, and more future proof. ...
...s the browser supports or what the values of certain browser features are, and then adjusts the code appropriately. this tends to be termed responsive design or adaptive design, two related but different approaches. this is much more reliable, more maintainable, and more future proof. you don't get caught in the situation of having to bring out more new site versions as more new browsers and plat
forms come out, and adjust code as feature support in existing browsers changes. there are disadvantages to this approach as well. if the content, layout, and functionality need to change greatly for different devices, it may not be such a good approach. also, taking an existing site and adding responsiveness to it, to make it mobile/tablet friendly, can be a lot more effort than just creating a sepa...
...And 5 more matches
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
the methods ispointinfill() and ispointinstroke() are not implemented yet (bug 1325319). svgexternalresourcesrequired removed never implemented svgelement.viewportelement and svgel...
... implementation status unknown globaleventhandlers on svgelement implementation status unknown options dictionary attribute for svggraphicselement.getbbox() implemented behind the preference svg.new-getbbox.enabled (bug 999964, bug 1019326) allow leading and trailing whitespace in <length>, <angle>, <number> and <integer> implementation status unknown
form feed (u+000c) in whitespace implementation status unknown svgelement.xmlbase, svgelement.xmllang and svgelement.xmlspace removed implementation status unknown svgviewspec removed implementation status unknown svgelement.style removed implementation status unknown svggraphicselement.gettrans
formtoelement() removed not removed yet svggraph...
... ...
...And 5 more matches
Types of attacks - Web security
s controls and impersonate users. according to the open web application security project, xss was the seventh most common web app vulnerability in 2017. these attacks succeed if the web app does not employ enough validation or encoding. the user's browser cannot detect the malicious script is untrustworthy, and so gives it access to any cookies, session tokens, or other sensitive site-specific in
formation, or lets the malicious script rewrite the html content. cross-site scripting attacks usually occur when 1) data enters a web app through an untrusted source (most often a web request) or 2) dynamic content is sent to a web user without being validated for malicious content. the malicious content often includes javascript, but sometimes html, flash, or any other code the browser can execute...
... an untrusted source (most often a web request) or 2) dynamic content is sent to a web user without being validated for malicious content. the malicious content often includes javascript, but sometimes html, flash, or any other code the browser can execute. the variety of attacks based on xss is almost limitless, but they commonly include transmitting private data like cookies or other session in
formation to the attacker, redirecting the victim to a webpage controlled by the attacker, or per
forming other malicious operations on the user's machine under the guise of the vulnerable site. xss attacks can be put into three categories: stored (also called persistent), reflected (also called non-persistent), or dom-based. stored xss attacks the injected script is stored permanently on the targ...
...gories: stored (also called persistent), reflected (also called non-persistent), or dom-based. stored xss attacks the injected script is stored permanently on the target servers. the victim then retrieves this malicious script from the server when the browser sends a request for data. reflected xss attacks when a user is tricked into clicking a malicious link, submitting a specially crafted
form, or browsing to a malicious site, the injected code travels to the vulnerable website. the web server reflects the injected script back to the user's browser, such as in an error message, search result, or any other response that includes data sent to the server as part of the request. the browser executes the code because it assumes the response is from a "trusted" server which the user has alre...
...And 5 more matches
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. ...
... 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. ...
...o detect and mitigate certain types of attacks, including cross-site scripting (xss) and data injection attacks. these attacks are used for everything from data theft to site defacement to the distribution of malware. connection security transport security layer (tls) the transport layer security (tls) protocol is the standard for enabling two networked applications or devices to exchange in
formation privately and robustly. applications that use tls can choose their security parameters, which can have a substantial impact on the security and reliability of data. this article provides an overview of tls and the kinds of decisions you need to make when securing your content. https https (hypertext transfer protocol secure) is an encrypted version of the http protocol. it uses ssl or tls ...
...And 5 more matches
context-menu - Archive of obsolete content
to communicate to the menu item associated with the content script, the content script can call the postmessage function attached to the global self object, passing it some json-able data. the menu item's "message" event listener will be called with that data. var cm = require("sdk/context-menu"); cm.item({ label: "edit ima...
...lick", function (node, data) {' + ' console.log("you clicked " + data);' + '});', items: [ cm.item({ label: "item 1", data: "item1" }), cm.item({ label: "item 2", data: "item2" }), cm.item({ label: "item 3", data: "item3" }) ] }); communicating with the add-on often you will need to collect some kind of in
formation in the click listener and per
form an action unrelated to content. to communicate to the menu item associated with the content script, the content script can call the postmessage function attached to the global self object, passing it some json-able data. the menu item's "message" event listener will be called with that data. var cm = require("sdk/context-menu"); cm.item({ label: "edit image", context: cm.selectorcontext("img...
...ked: var numclicks = 0; var myitem = require("sdk/context-menu").item({ label: "click me: " + numclicks, contentscript: 'self.on("click", self.postmessage);', onmessage: function () { numclicks++; this.label = "click me: " + numclicks; // setting myitem.label is equivalent. } }); sometimes you might want to update the label based on the context. for instance, if your item per
forms a search with the user's selected text, it would be nice to display the text in the item to provide feedback to the user. in these cases you can use the second method. recall that your content scripts can listen for the "context" event and if your listeners return true, the items associated with the content scripts are shown in the menu. in addition to returning true, your "context" listeners ca...
...And 4 more matches
Appendix: What you should know about open-source software licenses - Archive of obsolete content
some situations, such as education or citation, use in the strong, authorial sense is permitted to readers. any discussion of copyright eventually turns to the fact that some uses are prohibited, so it’s useful to understand what uses are unrestricted. range of uses restricted to author unrestricted book print, publish, revise read music record, per
form, revise listen movie distribute, screen, revise watch software copy, distribute, modify execute licenses are a use permit in order to use (in the authorial sense) a copyrighted work, the user must either receive a use permit from the copyright holder, or must be assigned partial rights by the author. this use permit for a copyrighted work is called a lice...
...ed software can be published under commercial licenses or other different licenses. this is often just called the bsd license. the mit/x11 license is similar in substance. license terms this license has the following simple terms. it’s short, so read it carefully. <program name> copyright (c) <year>, <copyright holder> all rights reserved. 1. ...
... 2. this software is provided "as is" and without warranty. use at your own risk. ...
...And 4 more matches
Setting Up a Development Environment - Archive of obsolete content
ting, there's no official mozilla ide. on the other hand, extensions use the same (or similar) languages that are used for web development, so most text editors and ides are up to the task. most xul tools and plugins you'll find online are merely templates that generate the folder structure for the project, and that's not much help. we recommend komodo edit. it's free, open source, and cross-plat
form. it's based on the mozilla xulrunner plat
form, so it has support for some of the particularities in firefox extension development. komodo edit has automatic completion for xul tags and attributes, and it supports mozilla's css extensions (css values and properties beginning with "-moz"). it has an add-on system similar to the one in firefox, and there are some komodo extensions that provide addit...
... can make it even better. once you're testing and debugging your code, you'll find that constantly building and installing an xpi can be very tedious. this is the reason why we introduced "make install". this only works if your extension is already installed in a firefox profile. just like in the provided project, you need the add-on id and profile location set in the file makefile. we use this in
formation to locate the installation path of the extension and overwrite the installed files. if firefox is open at the time you run "make install", you'll have to restart it in order to see the changes. it's still better than installing the xpi all over again. you may need to alter the profile location in your makefile. in order to set the profile location to the right value, you should read the sup...
...ction dedicated to xpcom in this tutorial, but we'll briefly discuss the impact it has on building the extension. you can skip this section and keep it present as a reference in case you do need to use xpcom in your project. xpcom interfaces are defined using idl files. these are text files that define the attributes and methods in one or more interfaces. these idl files are compiled into binary
form and included in the extension as xpt files. to compile an idl file to xpt, you need a command line tool called xpidl. this tool is included in the mozilla gecko sdk. if you need to compile idls, go to the sdk page and download a compiled version for your system. also note any prerequisites you may need. if your system is not listed in the supported builds, you'll have to build the sdk yourself f...
...And 4 more matches
Promises - Archive of obsolete content
the following page contains examples of many promise-based replacement apis for common operations. these apis allow asynchronous operation to be achieved with a coding style similar to synchronous variants. the following examples make use of the task api, which harnesses generator functions to remove some of the syntactic clutter of raw promises, such that asynchronous promise code more closely resembles synchronous, procedural code. ...
...ile api, which provides a simple, but powerful, interface for reading, writing, and manipulating both text and binary files. it is also available for use off-main-thread in workers as a synchronous api. this interface replaces the previous, complicated xpcom nsifile and streams apis, and their related javascript helper modules. these older interfaces should be avoided, even in their asynchronous
forms, due to their per
formance penalties and needless complexity. representative example usage components.utils.import("resource://gre/modules/osfile.jsm"); task.spawn(function* () { // retrieve file metadata to check modification time. let info = yield os.file.stat(configpath); if (info.lastmodificationdate <= timestamp) return; timestamp = info.lastmodificationdate; ...
...direct usage task.spawn(function* () { // make the initial request. ...
...And 4 more matches
Installing plugins to Gecko embedding browsers on Windows - Archive of obsolete content
resents the windows registry keys plugin installers can parse to determine where to install a given plugin (for mozilla browsers) on windows. since the prospect of embedded gecko browsers raises the scenario of more than one gecko-based browser that a netscape-style plugin can work with, it becomes important to let plugin developers know how to discover these browsers on a windows machine. this in
formation applies to mozilla based browsers that pull the mozilla codebase after the mozilla 0.9.1 milestone release. none of the registry keys mentioned here are written by browsers before the mozilla 0.9.1 timeframe. for example, netscape 6.0 and 6.01 do not write any of these keys into the registry, and thus these keys are not available for plugin vendors to parse for these two browsers. netscape 6...
...re the mozilla 0.9.1 timeframe. for example, netscape 6.0 and 6.01 do not write any of these keys into the registry, and thus these keys are not available for plugin vendors to parse for these two browsers. netscape 6.1 and onwards, however, will write these keys, and so creating a plugin installer that puts the shared object (dll) in the right place becomes much easier, since the relevant meta-in
formation is present in the win32 system registry. these keys are written by the installer of mozilla browsers -- the netscape 6.2 installer, for example, writes these keys to the registry, and so does the mozilla installer (for versions after mozilla 0.9.1). other major commercial browsers based on gecko have committed to providing these keys as well. some gecko-based browsers provide additional info...
...mozilla based browsers won't distinguish between plugins and components, and will pick both up from a common location. however, for netscape 6.1 and netscape 6.2, xpt files, as well as xpcom plugins, ought to go in the components directory. on these browsers, this is the only directory that can "pick up" an xpt file, as well the only directory that can recognize xpcom components. you now have in
formation about the plugins directory for gecko embedding browsers. examples given for "product x.y" were using netscape 6 but other possible mozilla based browsers exist as well; all gecko-based browsers are encouraged to write these keys, so that plugin vendors can write plugin installers that install correctly to all gecko-based browsers. to find the path to the browser executable (exe) applicable...
...And 4 more matches
No Proxy For configuration - Archive of obsolete content
abstract this document provides a comprehensive discussion of the manual proxy feature "no proxy for:", including configuration issues, testing and bugs. audience mozilla users, mozilla developers, mozilla testers. overview as browsers rapidly grew in popularity in the mid-90's, many network administrators added proxy servers. initially, proxy servers were used for access control and per
formance. many networks had limited access to the public network via proxy servers. because the public network was small in scope and connections were slow, a caching proxy could often improve the overall per
formance. this feature was originally designed as a "blacklist" of sites or domains that was within the intranet, and should not be accessed via the proxy server. due to various limitations, this...
...easonably long (2k+ characters) entries. new profiles contain the values "localhost, 127.0.0.1", by default. entry points: preferences | advanced | proxies control-click menu for off line-online icon (network plug) configuration the no proxy list is composed of either domain elements or ipv4 address elements. the elements are separated by either a space (" ") or a comma (","). note for
former-ie users: "*" is supported only at the beginning of domain filters (*.mozilla.org). to block ... put this into "no proxy for" ...for example use... limitations a domain, including sub-domains domain suffix "mozilla.org" does not block domains that end in the same string (amozilla.org) sub-domains domain suffix, starting with a dot ".mozilla.o...
..."<filter>:81" only black-lists port. only applies to one port (no support for ranges and/or multiple ports). port-only filters ":80" or "*:80" are not supported. all non-fqdn hosts, such as intranet hosts the string "<local>" (without quotes) "<local>" bypasses the proxy for all hostnames which have no periods in them. for example: "https://mycompanyintranet/"
formats that are not accepted example domain filters with interior wildcards www.*.com ip address string prefixes 127. or 10.0.* ip addresses with wildcards in quads 10.*.*.* preferences name network.proxy.no_proxies_on default value localhost, 127.0.0.1 by default "localhost" and "127.0.0.1" are excluded, since most people ...
...And 4 more matches
Hidden prefs - Archive of obsolete content
warning: the content of this article may be out of date. it was imported from mozilla.org and last updated in 2002. this page has been flagged by editors or users as needing technical review. until it is fully reviewed, it may contain inaccurate or incorrect in
formation. ...
... warning: the content of this article may be out of date. it was imported from mozilla.org and last updated in 2002. this page has been flagged by editors or users as needing technical review. until it is fully reviewed, it may contain inaccurate or incorrect in
formation. ...
... warning: the content of this article may be out of date. it was imported from mozilla.org and last updated in 2002. this page has been flagged by editors or users as needing technical review. until it is fully reviewed, it may contain inaccurate or incorrect in
formation. ...
...And 4 more matches
Mozilla Application Framework - Archive of obsolete content
use the mozilla framework and make your life easier. we provide a comprehensive framework that does much of the work for you, tools to help you develop your apps, and a community of people to help. ...
...rovides, xulrunner hall of fame the mozilla application framework: for powerful, easy to develop cross-plat
form applications want to build applications? use the mozilla framework and make your life easier. we provide a comprehensive framework that does much of the work for you, tools to help you develop your apps, and a community of people to help. framework xul a comprehensive, cross-plat
form ui toolkit with an easy-to-learn xml language for defining ui structure, a schema for localization, and support for both native and cross-plat
form (using css) look and feel to make writing uis quick and painless. gecko a per
formant web content rendering/editing engine with world-leading support for standards that you can drop into your application with a single line of xul. necko a wick...
... a per
formant web content rendering/editing engine with world-leading support for standards that you can drop into your application with a single line of xul. necko a wicked-fast, extensible networking library with built-in support for many common protocols and a well-defined plug-in interface for custom protocol handling so you can add the protocols you need. xpcom a simple, cross-plat
form component model with multiple language bindings and idl descriptions so you can plug your custom functionality into the framework and connect it with other components. web services built-in support for xmlhttprequest, xml-rpc, soap, and wsdl to enable mozilla-based application authors to take advantage of the exploding world of web services. ...
...And 4 more matches
Space Manager High Level Design - Archive of obsolete content
nd line layout to manage rectangular regions that are occupied and available, for correct handling of floated elements and the elements that flow around them. when elements are floated to the left or right in a layout, they take up space and influence where other elements can be placed. the space manager is responsible for keeping track of where space is taken up and where it is available. this in
formation is used by block layout to correctly compute where other floated elements should be placed, and how much space is available to normal in-flow elements that flow around the floated bits. the space manager works in concert with several other classes to do its job. the classes that are considered part of the space manager are: nsspacemanager nsbanddata nsblockbanddata bandrect / bandlist (...
...frame nsboxtoblockadaptor the general interaction model is to create a space manager for a block frame in the context of a reflow, and to associate it with the blockreflowstate so it is passed down to child frames' reflow methods. after reflow, the space manager is destroyed. during reflow, the space manager stores the space taken up by floats (updatespacemanager in nsblockframe) and provides in
formation about the space available for other elements (getavailablespace in nsblockreflowstate). additionally, there is a need to manage impacts to lines caused by changes to floated elements. this is referred to as propagation of float damage and is handled by the block frame, making use of the space manager. when a float is incrementally reflowed, the space manager is notified if the float's region...
...e if that damage intersects the area of the non-dirty line, marking it dirty if there is intersection. thus, changes to floats on other lines may cause impact to otherwise clean lines, and the space manager facilitates the detection of this. data model class/component diagram nsspacemanager: the central point of management of the space taken up by floats in a block nsbanddata: provides in
formation about the frames occupying a band of occupied or available space nsblockbanddata: a specialization of nsbanddata that is used by nsblockreflowstate to determine the available space, float impacts, and where floats are cleared. essentially a css-specific wrapper for generic nsbanddata. bandrect: keeps the bounds of a band, along with the frames associated with the band. bandrects are a link...
...And 4 more matches
Install Wizards (aka: Stub Installers) - Archive of obsolete content
warning: the content of this article may be out of date. see bundles for the current documentation. what do we mean by installer package? an installer package is an archive file (called xpi--pronounced "zippies"--because of its .xpi extensions) in phil katz zip
format. it contains some files to be installed and the install script, usually named install.js, which contains javascript directives for actions to take during an install including adding files and directories, removing old or obsolete files and directories, executing command line tools, etc. to learn more about the xpinstall and installer packages please refer to the annotated browser xpi installer and the xpinstall api reference. what do we mean by engine code? the xpinstall engine processes installer packages b...
...e about the xpinstall and installer packages please refer to the annotated browser xpi installer and the xpinstall api reference. what do we mean by engine code? the xpinstall engine processes installer packages by reading instructions from their install scripts to extract files and take other install actions. the same xpinstall engine is used by the browser and the stub installers on all plat
forms. the xpinstall engine source resides at: <http://lxr.mozilla.org/seamonkey/sou...xpinstall/src/> what do we mean by stub installer? the install wizards used to install mozilla are lightweight stubs targeted to be around 200 kb disk footprint. users download the stub installers, choose which packages to install, choose the destination directory for the installation, and select from various oth...
...the s...
...And 4 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
introduction the technique described here does not involve any hacking. instead, you make your custom button as a self-contained extension. you can use the sample code provided here to make buttons that do various useful things. ...
...onkey's menu bar, choose view – character encoding – unicode (utf-8). check that the text you typed looks ok with this setting. if your text editor does not support utf-8, search the internet for a better one that you can download. optional tools you can optionally use any image editor to customize the images. ...
...from seamonkey's menu bar, choose tools – web development – javascript console. copy the following code. ...
...And 4 more matches
Introduction - Archive of obsolete content
this tutorial will demonstrate creating a simple find file user interface, much like that provided by the macintosh's sherlock or the find file dialog in windows. note that only the user interface will be created, with only limited functionality. the actual finding of files will not be implemented. a blue line will appear to the left of a paragraph where the find file dialog is being modified. you can follow along by looking for these sections. ...
...d file dialog is being modified. you can follow along by looking for these sections. what is xul and why was it created? xul (pronounced "zool" and rhyming with "cool") was created to make development of the mozilla browser easier and faster. it is an xml language so all features available to xml are also available to xul. most applications need to be developed using features of a specific plat
form making building cross-plat
form software time-consuming and costly. a number of cross-plat
form solutions have been developed in the past. java, for example, has portability as a main selling point. xul is one such language designed specifically for building portable user interfaces. it takes a long time to build an application even for only one plat
form. the time required to compile and debug can ...
...to other languages with little effort. what kinds of user interfaces can be made with xul? xul provides the ability to create most elements found in modern graphical interfaces. some elements that can be created are: input controls such as textboxes and checkboxes toolbars with buttons or other content menus on a menu bar or pop up menus tabbed dialogs trees for hierarchical or tabular in
formation keyboard shortcuts the displayed content can be created from the contents of a xul file or with data from a datasource. in mozilla, such datasources include a user's mailbox, their bookmarks and search results. the contents of menus, trees and other elements can be populated with this data, or with your own data supplied in an rdf file. there are several ways you can use xul: firefox ...
...And 4 more matches
XPCOM Interfaces - Archive of obsolete content
for example, if we wanted to create a mail application, we would need to write scripts which would connect to mail servers to retrieve and send mail. javascript does not have the capability to do such things. the only way to handle this would be to write native code that would get mail. ...
...for example, if we wanted to create a mail application, we would need to write scripts which would connect to mail servers to retrieve and send mail. javascript does not have the capability to do such things. the only way to handle this would be to write native code that would get mail. ...
...for example, if we wanted to create a mail application, we would need to write scripts which would connect to mail servers to retrieve and send mail. javascript does not have the capability to do such things. the only way to handle this would be to write native code that would get mail. ...
...And 4 more matches
Writing Skinnable XUL and CSS - Archive of obsolete content
ed ui packages, from navigator to sidebar to editor. each package has its own skin, css files and images that determine the appearance of that package. in our particular mozilla skin, there is a special package calledglobal. this package contains a special skin called theglobal skin. if you wish for your package to blend in with the other packages, then the skin for your package should inherit in
formation from the global skin in order to reduce the amount of duplication across packages and in order to make the ui as a whole easier to skin. writing css files for a package learn css! this may seem obvious, but many of the nastiest problems we're seeing are being caused by people writing buggy or syntactically incorrect css. read the spec! study a book! know it! love it! make it a part of yo...
.... css files that import another skin file are calledderived skin files. css files that don't import another skin file are calledbase skin files. there is one notable exception to this rule. skin files that don't import any other skin files, but that are only intended to be used in the context of another component's skin are also considered derived skin files, since they are implicitly importing in
formation from the other component's skin. these sorts of files are typically used with reusable overlayable widgets (e.g., the sidebar). your css file should never import another skin file if your file is loaded by a xul overlay. css files that are used by xul overlays should never import the global skin (or any other skin for that matter). they are already derived skins and therefore should not inh...
...e.g., the sidebar). your css file should never import another skin file if your file is loaded by a xul overlay. css files that are used by xul overlays should never import the global skin (or any other skin for that matter). they are already derived skins and therefore should not inherit from global. they should instead rely on the context in which they will appear for color, font, and border in
formation. for example, the sidebar should not import the global skin, since it could appear in messenger and in navigator (which could have two completely different color schemes). if it imported the global skin, then when it was overlayed into navigator, it would potentially clash (if the user's current chosen navigator skin were not inheriting from global). derived skin files should not contain an...
...And 4 more matches
prefwindow - Archive of obsolete content
methods | related ] a specialized window used for preference dialogs. this element should be used in place of the window tag and should contain one or more prefpane elements. a row of buttons appears across the preference dialog, one for each prefpane. each pane will usually group together a set of related preferences. if there is only one prefpane, the navigation area will be hidden. on plat
forms where the convention is to apply changes immediately, the preferences are adjusted as soon as the user interface element is changed. on other plat
forms, the preferences are not applied until the dialog is closed. you can open a preference window using a window's opendialog method as with other dialogs. you can pass the id of a particular pane as the fourth argument to opendialog to open a speci...
... can pass the id of a particular pane as the fourth argument to opendialog to open a specific pane by default. you can also set the lastselected attribute on the prefwindow tag to the id of the pane to start with. normally, you would not set this attribute as it will be set automatically such that the default pane is the same as the one showing when the preferences dialog was last closed. more in
formation is available in the preferences system article. important note for xulrunner-based applications: the preferences system - part of the toolkit - still relies on two browser.* preferences. the first one is browser.preferences.instantapply, a boolean preference. the preference window will not run correctly if you do not set this preference in your application's defaults (see bug 485150 for ...
...s available in the preferences system article. important note for xulrunner-based applications: the preferences system - part of the toolkit - still relies on two browser.* preferences. the first one is browser.preferences.instantapply, a boolean preference. ...
...And 4 more matches
XULRunner Hall of Fame - Archive of obsolete content
ftware. source chatzilla a standalone version of the chatzilla irc client. conkeror a highly programmable web browser with a leopard-oriented design inspired by emacs. source evergreen - staff client evergreen is an open source library system. source ieditweb a client/server based content manager and internet application suite. ...
...a newsletter can be sent to members who sign up on a regular bases. instantbird multi-protocol im client. build instructions komodo edit a multi-language code development tool. ...
... a multi-language code development tool. build instructions pencil the pencil project's unique mission is to build a free and opensource tool for making diagrams and gui prototyping that everyone can use. source qiqqa research manager, reference manager, and pdf manager. xulrunner is embedded to provide automatic search against journal archives, automatic acquisition of bibtex in
formation, and automatic downloading of pdfs. slimerjs slimerjs is a xulrunner application that can be launched with firefox, allowing to execute an external javascript script which can manipulate web content. its goal is to provide a tool like phantomjs, with the same api, except that it runs gecko instead of webkit, and it is not headless (but you can still use xvfb to have a headless slim...
...And 4 more matches
The First Install Problem - Archive of obsolete content
problem definition the first install problem is the name given to the conditions arising when a plugin or embeddable software installs itself on a system first, before any other gecko-based browser. 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. ...
...plugins. on linux, a per-profile installation of plugins seems unavoidable. this document presents windows solutions for plugin vendors. ...
...en write keys in the windows registry giving future netscape gecko browsers the path where the plugin resides and meta-in
formation about how to load the plugin. this document supplements the key parsing methodology suggested for installers. the solution is to encourage plugin vendors to write registry keys to the win32 system registry, like the example application. this document proposes a meta-in
formation model in the win32 registry similar to the one used by microsoft's hkey_classes_root\clsid\ where a new activex control (ocx) on the system presents its uuid as a registry key (identifying the activex control) as well as in
formation about where to find the ocx (e.g. under the inprocserver32 subkey). for mozilla-based browsers, this system would be on a per-module basis, and instead of a uuid...
...And 4 more matches
Browser Feature Detection - Archive of obsolete content
d whether it supports a given operation. this test takes that idea to the extreme and tests a large number of properties and methods to determine the level of support a browser has for particular standards and reports a rating as the percentage of names the browser defines. this article has generally never been more than a way to show off firefox web compatibility, rather than something truly in
formative in a broader sense. therefore, given that it's also badly out of date, it's been archived. you should not rely on any in
formation here. browser sniffing via api name detection the following tables list the api names defined for specific w3c dom apis and lists the percentage of names that your browser actually defines followed by a list of each of the api names tested along with an indicat...
... document.title true true true document.referrer true true true document.domain true true true document.url true true true document.body true true true document.images true true true document.applets true true true document.links true true true document.
forms true true true document.anchors true true true document.cookie true true true document.open() true true true document.close() true true true document.write() true true true document.writeln() true true true document.getelementbyid() true true true docume...
... true true true padding true true true paddingtop true true true paddingright true true true paddingbottom true true true paddingleft true true true textalign true true true textdecoration true true true textindent true true true texttrans
form true true true verticalalign true true true whitespace true true true width true true true wordspacing true true true dom css 2 support for properties/methods in document.body.style</caption> name firefox 1.5 ie 6 & 7 opera 8.54 - 9.01 azimuth true false false bac...
...And 4 more matches
LiveConnect Overview - Archive of obsolete content
aobject a wrapped java object, accessed from within javascript code. javapackage a javascript reference to a java package. 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. see data type conversion for complete in
formation. in some ways, the existence of the liveconnect objects is transparent, because you interact with java in a fairly intuitive way. for example, you can create a java string object and assign it to the javascript variable mystring by using the new operator with the java constructor, as follows: var mystring = new java.lang.string("hello world"); in the previous example, the variable mystring ...
... catches the exception and returns something similar to the following: the java exception is java.lang.classnotfoundexception: string for specialized handling based on the exception type, use the instanceof operator: try { // ... } catch (e) { if (e instanceof java.io.filenotfound) { // handling for filenotfound } else { throw e; } } see exception handling statements for more in
formation about javascript exceptions. java to javascript communication if you want to use javascript objects in java, you must import the netscape.javascript package into your java file. this package defines the following classes: netscape.javascript.jsobject allows java code to access javascript methods and properties. netscape.javascript.jsexception allows java code to handle javascript errors. ...
...o javascript communication if you want to use javascript objects in java, you must import the netscape.javascript package into your java file. this package defines the following classes: netscape.javascript.jsobject allows java code to access javascript methods and properties. netscape.javascript.jsexception allows java code to handle javascript errors. see the javascript reference for more in
formation about these classes. locating the liveconnect classes in older versions of the netscape browser, these classes were distributed along with the browser. starting with javascript 1.2, these classes are delivered in a .jar file; in previous versions of javascript, these classes are delivered in a .zip file. for example, with netscape navigator 4 for windows nt, the classes are delivered in the ...
...And 4 more matches
Audio for Web games - Game development
sphere. web-based audio is maturing fast, but there are still many browser differences to navigate. we often need to decide which audio parts are essential to our games' experience and which are nice to have but not essential, and devise a strategy accordingly. this article provides a detailed guide to implementing audio for web games, looking at what works currently across as wide a range of plat
forms as possible. mobile audio caveats by far the most difficult plat
forms to provide web audio support for are mobile plat
forms. unfortunately these are also the plat
forms that people often use to play games. there are a couple of differences between desktop and mobile browsers that may have caused browser vendors to make choices that can make web audio difficult for game developers to work with. ...
... it is worth noting that autoplay with sound is allowed if: the user has interacted with the domain. on mobile the user has added the site to their home screen. ...
...rk if the browser allows you to change volume (see below). also note that playing and immediately pausing your audio does not guarantee that a small piece of audio won't be played. note: adding a web app to your mobile's homescreen may change its capabilities. in the case of autoplay on ios, this appears to be the case currently. if possible, you should try your code on several devices and plat
forms to see how it works. volume programmatic volume control may be disabled in mobile browsers. the reason often given is that the user should be in control of the volume at the os level and this shouldn't be overridden. buffering and preloading likely as an attempt to mitigate runaway mobile network data use, we also often find that buffering is disabled before playback has been initiated. buf...
...And 4 more matches
Efficient animation for web games - Game development
this article covers techniques and advice for creating efficient animation for web games, with a slant towards supporting lower end devices such as mobile phones. we touch on css transitions and css animations, and javascript loops involving window.requestanimationframe. there are several techniques worth knowing that will improve the per
formance of your game or application whilst also using less battery life, especially on low-end devices. it is worth documenting some of these things, as there is evidence to suggest (in popular and widely-used ui libraries, for example) that they aren’t necessarily common knowledge. first off, let us discuss some basic ideas. help the browser help you if you are using dom for your ui, which i would certainly recommend, you really ought to use c...
...will end up completely visible to the user and can then pre-render that content. when you animate position with javascript, the browser cannot easily make that same assumption, and so you might end up causing it to draw only the newly-exposed region of content, which may introduce slow-down. there are signals at the beginning and end of animations that allow you to attach javascript callbacks and
form a rudimentary
form of synchronisation (though there are no guarantees on how promptly these callbacks will happen). speaking of the assumptions that the browser can make, you should avoid causing it to have to re-layout during animations. in this vein, it is worth trying to stick to animating only trans
form and opacity properties. though some browsers make some effort for other properties to be ...
...ions. in this vein, it is worth trying to stick to animating only trans
form and opacity properties. though some browsers make some effort for other properties to be animated quickly, these are pretty much the only ones semi-guaranteed to be fast across all browsers. something to be careful of is that overflow may end up causing re-layout, or other expensive calculations. if you are setting a trans
form on something that would overlap its container’s bounds, you may want to set overflow: hidden on that container for the duration of the animation. use requestanimationframe when you are animating <canvas> content, or when your dom animations absolutely must synchronise with canvas content animations, do make sure to use window.requestanimationframe, and not older methods such as window.settime...
...And 4 more matches
Tiles and tilemaps overview - Game development
tilemaps are a very popular technique in 2d game development, consisting of building the game world or level map out of small, regular-shaped images called tiles. this results in per
formance and memory usage gains — big image files containing entire level maps are not needed, as they are constructed by small images or image fragments multiple times. this set of articles covers the basics of creating tile maps using javascript and canvas (although the same high level techniques could be used in any programming language.) besides the per
formance gains, tilemaps can also be mapped to a logical grid, which can be used in other ways inside the game logic (for example creating a path-finding graph, or handling collisions) or to create a level editor. some popular games that use this tech...
...mage file. when it's time to draw a tile, only a small section of this bigger image is rendered on the game canvas. the below images shows a tile atlas of 8 x 4 tiles: using an atlas also has the advantage of naturally assigning every tile an index. this index is perfect to use as the tile identifier when creating the tilemap object. the tilemap data structure it is common to group all the in
formation needed to handle tilemaps into the same data structure or object. these data objects (map object example) should include: tile size: the size of each tile in pixels across / pixels down. image atlas: the image atlas that will be used (one or many.) map dimensions: the dimensions of the map, either in tiles across / tiles down, or pixels across / pixels down. visual grid: includes indic...
...e number, 0 or null) is needed to represent empty tiles. square tiles square-based tilemaps are the most simple implementation. a more generic case would be rectangular-based tilemaps — instead of square — but they are far less common. square tiles allow for two perspectives: top-down (like many rpg's or strategy games like warcraft 2 or final fantasy's world view.) side-view (like plat
formers such as super mario bros.) static tilemaps a tilemap can either fit into the visible screen area screen or be larger. in the first case, the tilemap is static — it doesn't need to be scrolled to be fully shown. this case is very common in arcade games like pacman, arkanoid, or sokoban. rendering static tilemaps is easy, and can be done with a nested loop iterating over columns and rows. ...
...And 4 more matches
Pseudo-classes and pseudo-elements - Learn web development
not to know how many words will fit on a line — as that will change if the screen width or font-size changes — it is impossible to robustly do this by adding html. the ::first-line pseudo-element selector will do this for you reliably — if the number of words increases and decreases it will still only select the first line. it acts as if a <span> was magically wrapped around that first
formatted line, and updated each time the line length changed. you can see that this selects the first line of both paragraphs. combining pseudo-classes and pseudo-elements if you wanted to make the first line of the first paragraph bold you could chain the :first-child and ::first-line selectors together. try editing the previous live example so it uses the following css. we are saying that we wan...
...s. :local-link matches links pointing to pages that are in the same site as the current document. :is() matches any of the selectors in the selector list that is passed in. :not matches things not matched by selectors that are passed in as a value to this selector. :nth-child matches elements from a list of siblings — the siblings are matched by a
formula of the
form an+b (e.g. 2n + 1 would match elements 1, 3, 5, 7, etc. all the odd ones.) :nth-of-type matches elements from a list of siblings that are of a certain type (e.g. <p> elements) — the siblings are matched by a
formula of the
form an+b (e.g. 2n + 1 would match that type of element, numbers 1, 3, 5, 7, etc. all the odd ones.) :nth-last-child matches elements f...
...s.) :nth-of-type matches elements from a list of siblings that are of a certain type (e.g. <p> elements) — the siblings are matched by a
formula of the
form an+b (e.g. 2n + 1 would match that type of element, numbers 1, 3, 5, 7, etc. all the odd ones.) :nth-last-child matches elements from a list of siblings, counting backwards from the end. the siblings are matched by a
formula of the
form an+b (e.g. 2n + 1 would match the last element in the sequence, then two elements before that, then two elements before that, etc. ...
...And 4 more matches
Practical positioning examples - Learn web development
kinds of things you can do with positioning. prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css.) objective: to get an idea of the practicalities of positioning a tabbed info-box the first example we'll look at is a classic tabbed info box — a very common feature used when you want to pack a lot of in
formation into a small area. this includes in
formation-heavy apps like strategy/war games, mobile versions of websites where the screen is narrow and space is limited, and compact in
formation boxes where you might want to make lots of in
formation available without having it fill the whole ui. our simple example will look like this once we are finished: note: you can see the finished example runnin...
...it out to get an idea of what you will be building in this section of the article. you might be thinking "why not just create the separate tabs as separate webpages, and just have the tabs clicking through to the separate pages to create the effect?" this code would be simpler, yes, but then each separate "page" view would actually be a newly-loaded webpage, which would make it harder to save in
formation across views, and integrate this feature into a larger ui design. in addition, so-called "single page apps" are becoming very popular — especially for mobile web uis — because having everything served as a single file cuts down on the number of http requests required to view all the content, thereby improving per
formance. note: some web developers take things even further, only having ...
...iews, and integrate this feature into a larger ui design. in addition, so-called "single page apps" are becoming very popular — especially for mobile web uis — because having everything served as a single file cuts down on the number of http requests required to view all the content, thereby improving per
formance. note: some web developers take things even further, only having one page of in
formation loaded at once, and dynamically changing the in
formation shown using a javascript feature such as xmlhttprequest. at this point in your learning however we want to keep things as simple as possible. there is some javascript later on, but only a tiny bit. to start with, we'd like you to make a local copy of the starting html file — info-box-start.html. save this somewhere sensible on your...
...And 4 more matches
Supporting older browsers - Learn web development
accessibility needs. what is the support for the features you want to use? once you know the browsers that come to your site, you can assess any technology that you want to use against how well it is supported and how easily you can provide an alternative for visitors who do not have that technology available. ...
...you can view usage statistics by location — useful if you work on a site that has users mostly for a specific area of the world. you can even link your google analytics account to get analysis based on your user data. ...
...you can view usage statistics by location — useful if you work on a site that has users mostly for a specific area of the world. you can even link your google analytics account to get analysis based on your user data. ...
...And 4 more matches
Example - Learn web development
this the example for a basic payment
form for the article how to structure an html
form. ...
... this the example for a basic payment
form for the article how to structure an html
form. ...
... this the example for a basic payment
form for the article how to structure an html
form. ...
...And 4 more matches
Tips for authoring fast-loading HTML pages - Learn web development
these tips are based on common knowledge and experimentation. an optimized web page not only provides for a more responsive site for your visitors but also reduces the load on your web servers and internet connection. this can be crucial for high volume sites or sites which have a spike in traffic due to unusual circumstances such as breaking news stories. optimizing page load per
formance is not just for content which will be viewed by narrowband dial-up or mobile device visitors. it is just as important for broadband content and can lead to dramatic improvements even for your visitors with the fastest connections. tips reduce page weight page weight is by far the most important factor in page-load per
formance. reducing page weight through the elimination of unnecessary whitespac...
... content and can lead to dramatic improvements even for your visitors with the fastest connections. tips reduce page weight page weight is by far the most important factor in page-load per
formance. reducing page weight through the elimination of unnecessary whitespace and comments, commonly known as minimization, and by moving inline script and css into external files, can improve download per
formance with minimal need for other changes in the page structure. tools such as html tidy can automatically strip leading whitespace and extra blank lines from valid html source. other tools can "compress" javascript by re
formatting the source or by obfuscating the source and replacing long identifiers with shorter versions. minimize the number of files reducing the number of files referenced in ...
...c(es). this may not always be practical; however, you should always take care to use only the minimum necessary number of different domains in your pages. cache reused content make sure that any content that can be cached, is cached, and with appropriate expiration times. in particular, pay attention to the last-modified header. it allows for efficient page caching; by means of this header, in
formation is conveyed to the user agent about the file it wants to load, such as when it was last modified. most web servers automatically append the last-modified header to static pages (e.g. .html, .css), based on the last-modified date stored in the file system. with dynamic pages (e.g. .php, .aspx), this, of course, can't be done, and the header is not sent. so, in particular, for pages which are...
...And 4 more matches
Debugging HTML - Learn web development
nd even simple cases can look a little intimidating to someone who doesn't know anything about rust. debugging doesn't have to be scary though — the key to being comfortable with writing and debugging any programming language or code is familiarity with both the language and the tools. html and debugging html is not as complicated to understand as rust. html is not compiled into a different
form before the browser parses it and shows the result (it is interpreted, not compiled). and html's element syntax is arguably a lot easier to understand than a "real programming language" like rust, javascript, or python. the way that browsers parse html is a lot more permissive than how programming languages are run, which is both a good and a bad thing. permissive code so what do we mean by perm...
...ely correct. the web would probably not be as popular as it is today, if it had been more strict from the very beginning. active learning: studying permissive code it's time to study the permissive nature of html code. first, download our debug-example demo and save it locally. this demo is deliberately written with some built-in errors for us to explore (the html markup is said to be badly-
formed, as opposed to well-
formed). next, open it in a browser. you will see something like this: this immediately doesn't look great; let's look at the source code to see if we can work out why (only the body contents are shown): <h1>html debugging examples</h1> <p>what causes errors in html? <ul> <li>unclosed elements: if an element is <strong>not closed properly, then its effect can s...
...asised?</em> </strong> <em> what is this?</em> the link with the missing double quote has been deleted altogether. the last list item looks like this: <li> <strong>unclosed attributes: another common source of html problems. ...
...And 4 more matches
Document and website structure - Learn web development
ragraph" or "an image"), html also boasts a number of block level elements used to define areas of your website (such as "the header", "the navigation menu", "the main content column"). this article looks into how to plan a basic website structure, and write the html to represent this structure. prerequisites: basic html familiarity, as covered in getting started with html. html text
formatting, as covered in html text fundamentals. how hyperlinks work, as covered in creating hyperlinks. objective: learn how to structure your document using semantic tags, and how to work out the structure of a simple website. basic sections of a document webpages can and will look pretty different from one another, but they all tend to share similar standard components, unless ...
...hat is contained in the main content (for example on a news article page, the sidebar might contain the author's bio, or links to related articles) but there are also cases where you'll find some recurring elements like a secondary navigation system. footer: a strip across the bottom of the page that generally contains fine print, copyright notices, or contact info. it's a place to put common in
formation (like the header) but usually, that in
formation is not critical or secondary to the website itself. the footer is also sometimes used for seo purposes, by providing links for quick access to popular content. a "typical website" could be structured something like this: html for structuring content the simple example shown above isn't pretty, but it is perfectly fine for illustrating a t...
...script> <![endif]--> </head> <body> <!-- here is our main header that is used across all the pages of our website --> <header> <h1>header</h1> </header> <nav> <ul> <li><a href="#">home</a></li> <li><a href="#">our team</a></li> <li><a href="#">projects</a></li> <li><a href="#">contact</a></li> </ul> <!-- a search
form is another commmon non-linear way to navigate through a website. --> <
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...
...And 4 more matches
HTML table basics - Learn web development
r a day of the week, or the timetable for a local swimming pool. tables are very commonly used in human society, and have been for a long time, as evidenced by this us census document from 1800: it is therefore no wonder that the creators of html provided a means by which to structure and present tabular data on the web. how does a table work? the point of a table is that it is rigid. in
formation is easily interpreted by making visual associations between row and column headers. look at the table below for example and find a jovian gas giant with 62 moons. you can find the answer by associating the relevant row and column headers. data about the planets of our solar system (planetary facts taken from nasa's planetary fact sheet - metric. name mass (1024kg) diamet...
... users alike. table styling you can also have a look at the live example on github! one thing you'll notice is that the table does look a bit more readable there — this is because the table you see above on this page has minimal styling, whereas the github version has more significant css applied. be under no illusion; for tables to be effective on the web, you need to provide some styling in
formation with css, as well as good solid structure with html. in this module we are focusing on the html part; to find out about the css part you should visit our styling tables article after you've finished here. we won't focus on css in this module, but we have provided a minimal css stylesheet for you to use that will make your tables more readable than the default you get without any styling. yo...
...finally, use rowspan to make "horse" and "chicken" span across two rows. save and open your code in a browser to see the improvement. note: you can find our finished example at animals-table-fixed.html on github (see it live also). providing common styling to columns there is one last feature we'll tell you about in this article before we move on. html has a method of defining styling in
formation for an entire column of data all in one place — the <col> and <colgroup> elements. these exist because it can be a bit annoying and inefficient having to specify styling on columns — you generally have to specify your styling in
formation on every <td> or <th> in the column, or use a complex selector such as :nth-child(). note: styling columns like this is limited to a few properties: b...
...And 4 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
d, or at a regular interval (e.g. a set number of times per second), discusses what they are useful for, and considers their inherent issues. prerequisites: basic computer literacy, a reasonable understanding of javascript fundamentals. objective: to understand asynchronous loops and intervals and what they are useful for. introduction for a long time, the web plat
form has offered javascript programmers a number of functions that allow them to asynchronously execute code after a certain time interval has elapsed, and to repeatedly execute a block of code asynchronously until you tell it to stop. these functions are: settimeout() execute a specified block of code once after a specified time has elapsed. setinterval() execute a specified block of code repe...
...outs finally, if a timeout has been created, you can cancel it before the specified time has elapsed by calling cleartimeout(), passing it the identifier of the settimeout() call as a parameter. so to cancel our above timeout, you'd do this: cleartimeout(mygreeting); note: see greeter-app.html for a slightly more involved demo that allows you to set the name of the person to say hello to in a
form, and cancel the greeting using a separate button (see the source code also). setinterval() settimeout() works perfectly when you need to run code once after a set period of time. but what happens when you need to run the code over and over again—for example, in the case of an animation? this is where setinterval() comes in. this works in a very similar way to settimeout(), except that the f...
...data is refreshed, or whatever). then, you call it to start the process off. at the end of the function block you call requestanimationframe() with the function reference passed as the parameter, and this instructs the browser to call the function again on the next display repaint. this is then run continuously, as the code is calling requestanimationframe() recursively. note: if you want to per
form some kind of simple constant dom animation, css animations are probably faster. they are calculated directly by the browser's internal code, rather than javascript. if, however, you are doing something more complex and involving objects that are not directly accessible inside the dom (such as 2d canvas api or webgl objects), requestanimationframe() is the better option in most cases. how fast ...
...And 4 more matches
Useful string methods - Learn web development
you simply use the length property. try entering the following lines: let browsertype = 'mozilla'; browsertype.length; this should return the number 7, because "mozilla" is 7 characters long. this is useful for many reasons; for example, you might want to find the lengths of a series of names so you can display them in order of length, or let a user know that a username they have entered into a
form field is too long if it is over a certain length. retrieving a specific string character on a related note, you can return any character inside a string by using square bracket notation — this means you include square brackets ([]) on the end of your variable name. inside the square brackets you include the number of the character you want to return, so for example to retrieve the first lette...
...e'll get you to try your hand at writing some string manipulation code. in each exercise below, we have an array of strings, and a loop that processes each value in the array and displays it in a bulleted list. you don't need to understand arrays or loops right now — these will be explained in future articles. all you need to do in each case is write the code that will output the strings in the
format that we want them in. each example comes with a "reset" button, which you can use to reset the code if you make a mistake and can't get it working again, and a "show solution" button you can press to see a potential answer if you get really stuck. filtering greeting messages in the first exercise we'll start you off simple — we have an array of greeting card messages, but we want to sort t...
... fill in a conditional test inside the if( ... ) structure, to test each string and only print it in the list if it is a christmas message. first think about how you could test whether the message in each case is a christmas message. what string is present in all of those messages, and what method could you use to test whether it is present? you'll then need to write a conditional test of the
form operand1 operator operand2. is the thing on the left equal to the thing on the right? or in this case, does the method call on the left return the result on the right? hint: in this case it is probably more useful to test whether the method call isn't equal to a certain result. playable code <h2>live output</h2> <div class="output" style="min-height: 125px;"> <ul> </ul> </div> <h2>edita...
...And 4 more matches
Command line options
, not a new window in running instance, which allows multiple copies of application to be open at a time. firefox -new-instance -p "another profile" note: not available for windows, see bug 855899. -no-remote do not accept or send remote commands. implies -new-instance. firefox -no-remote -p "another profile" note: since firefox 9, this does really mean what its name implies on all plat
forms, i.e. instances created with this parameter do not accept or send remote commands, see bug 650078. that means that such instances won't be re-used. also when using this argument a new instance is created in any case. -override /path/to/override.ini load the specified override.ini file to override application.ini (browser/app/application.ini). this can be used to suppress the migration wizard ...
...d. also when using this argument a new instance is created in any case. -override /path/to/override.ini load the specified override.ini file to override application.ini (browser/app/application.ini). this can be used to suppress the migration wizard at startup by loading the following override.ini. firefox only. [xre] enableprofilemigrator=0 -profilemanager start with profile manager. short
form: -p without a profile name. -p "profile_name" bypass profile manager and launch application with the profile named profile_name. useful for dealing with multiple profiles. firefox -p "joel user" note: profile_name is case sensitive. if you don't specify a profile name then the profile manager is opened instead. you must use an upper case p on linux with versions older than 7.x, as there lo...
...ger and launch application with the profile named profile_name. useful for dealing with multiple profiles. firefox -p "joel user" note: profile_name is case sensitive. if you don't specify a profile name then the profile manager is opened instead. you must use an upper case p on linux with versions older than 7.x, as there lower case invokes purify mode (memory and leak detection). other plat
forms accept both upper and lower case. -profile "profile_path" start with the profile with the given path. firefox, thunderbird and seamonkey2.x only. "profile_path" can either be an absolute path ("/path/to/profile") or a relative path ("path/to/profile"). note: on mac os x specifying a relative path is not supported anymore from firefox 4.0 and up due to a regression, see bug 673955. browse...
...And 4 more matches
Debugging on Mac OS X
creating a debuggable build first, you need to build the application you're going to debug using --disable-optimize--enable-debug-symbols in your .mozconfig (also add --enable-debug if you want assertions etc. compiled in). ...
... outside the source tree. if you try to do that then xcode will simply copy the source files under the project directory rather than link to them (still the case in xcode 10?) which breaks debugging and the possibility to modify-rebuild-relaunch from inside xcode. these steps were last updated for xcode 10.3: open xcode, and create a new project with file > new project. select the "cross-plat
form" tab then under the "other" template group select the "empty" project type. the click next. name the project and click next. create/select a temporary directory to contain the project and then click create. before going any further, close the project (file > close project) and open finder. find the *.xcodejproj directory in the temporary directory, move it into your mozilla source tree, and then...
...xes is that by default some breakpoints will be listed as "pending", and xcode will not stop at them. if you don't include the mozilla's .lldbinit, you must at least put settings set target.inline-breakpoint-strategy always in your $home/.lldbinit as recommended on debugging mozilla with lldb. the .lldbinit file in the source tree imports many useful mozilla specific lldb settings, commands and
formatters into lldb, but you may need to take one of the following steps to make sure this file is used. if you are using lldb on the command line (independently of xcode) and you will always run it from either the top source directory, the object directory or else the dist/bin subdirectory of the object directory, then adding the following setting to your $home/.lldbinit is sufficient: settings se...
...And 4 more matches
AddonUpdateChecker
the addonupdatechecker is used to download and parse update in
formation for an add-on's update manifest. if all you care about is finding the newest version for an addon then you probably want to use findupdates() instead. ...
...you care about is finding the newest version for an addon then you probably want to use findupdates() instead. to import the addonupdatechecker, use: components.utils.import("resource://gre/modules/addonupdatechecker.jsm"); method overview updateinfo getcompatibilityupdate(in updateinfo updates[], in string version, in boolean ignorecompatibility, in string appversion, in string plat
formversion) updateinfo getnewestcompatibleupdate(in updateinfo updates[], in string appversion, in string plat
formversion) void checkforupdates(in string id, in string type, in string updatekey, string url, in updatechecklistener listener) constants constant description error_timeout the update check timed out. error_download_error there w...
...tibleupdate(in updateinfo updates[], in string appversion, in string plat
formversion) void checkforupdates(in string id, in string type, in string updatekey, string url, in updatechecklistener listener) constants constant description error_timeout the update check timed out. error_download_error there was an error while downloading the update in
formation. error_parse_error the update in
formation was mal
formed in some way. error_unknown_
format the update in
formation was not in any known
format. error_security_error the update in
formation was not signed by the update key used for retrieval. methods getcompatibilityupdate() retrieves the best matching compatibility update for the application from a l...
...And 4 more matches
CustomizableUI.jsm
reaid); string getareatype(aareaid); domelement getcustomizetargetforarea(aareaid, awindow); void reset(); void undoreset(); void removeextratoolbar(); object getplacementofwidget(awidgetid); bool iswidgetremovable(awidgetnodeorwidgetid); bool canwidgetmovetoarea(awidgetid); void getlocalizedproperty(awidget, aprop, a
formatargs, adef); void hidepanelfornode(anode); bool isspecialwidget(awidgetid); void addpanelcloselisteners(apanel); void removepanelcloselisteners(apanel); void onwidgetdrag(awidgetid, aarea); void notifystartcustomizing(awindow); void notifyendcustomizing(awindow); void dispatchtoolboxevent(aevent, adetails, awindow); ...
... nodes will be moved to the panel or removed, but the area's dom node(s) themselves will stay. furthermore, by default the placements of the area will be kept in the saved state (!) and restored if you re-register the area at a later point. this is useful for add-ons that get disabled and then re-enabled (e.g., when they update). you can override this last behavior (and destroy the placements in
formation in the saved state) by passing true for adestroyplacements. parameters aname the name of the area to unregister. adestroyplacements whether to destroy the placements in
formation for the area, too. addwidgettoarea() add a widget to an area. if the area to which you try to add is not known to customizableui, this will throw. if the area to which you try to add has not yet been rest...
... of the default placements in an area, this will remove it from there. it will also remove any dom instances. however, it will keep the widget in the placements for whatever area it was in at the time. you can remove it from there yourself by calling customizableui.removewidgetfromarea(awidgetid). parameters awidgetid the id of the widget to destroy getwidget() get a wrapper object with in
formation about the widget. parameters awidgetid the id of the widget whose in
formation you need return value a wrapper around the widget as described above, or null if the widget is known not to exist (any more). nb: non-null return is no guarantee the widget exists because we cannot know in advance if an xul widget exists or not. getunusedwidgets() get an array of widget wrappers for all t...
...And 4 more matches
Activity Monitor, Battery Status Menu and top
customized "energy" tab. the power-related columns are as follows. energy impact / avg energy impact: see the separate section below. % cpu: cpu usage percentage. this can exceed 100% if multiple cores are being used. idle wake ups: in mac os 10.9 this measured "package idle exit" wakeups. this is the same value as powermetrics' "pkg idle" measurement (i.e. task_power_info::task_plat
form_idle_wakeups obtained from the task_info function.) in mac os 10.10 it appears to have been changed to measure interrupt-level wakeups (a superset of idle wakeups), which are less interesting. this is the same value as powermetrics' "intr" measurement (i.e. task_power_info::task_interrupt_wakeups obtained from the task_info function.) requires high perf gpu: many macs have two gpus: a lo...
...tained from the task_info function.) in mac os 10.10 it appears to have been changed to measure interrupt-level wakeups (a superset of idle wakeups), which are less interesting. this is the same value as powermetrics' "intr" measurement (i.e. task_power_info::task_interrupt_wakeups obtained from the task_info function.) requires high perf gpu: many macs have two gpus: a low-power, low-per
formance integrated gpu, and a high-power, high-per
formance external gpu. using the high-per
formance gpu can greatly increase power consumption, and should be avoided whenever possible. this column indicates which gpu is being used. activity monitor can be useful for cursory measurements, but for more precise and detailed measurements other tools such as powermetrics are better. what does "energy i...
...never possible. this column indicates which gpu is being used. activity monitor can be useful for cursory measurements, but for more precise and detailed measurements other tools such as powermetrics are better. what does "energy impact" measure? "energy impact" is a hybrid proxy measure of power consumption. careful investigation indicates that on mac os 10.10 and 10.11 it is computed with a
formula that is machine model-specific, and includes the following factors: cpu usage, wakeup frequency, quality of service class usage, and disk, gpu, and network activity. the weightings of each factor can be found in one of the the files in /usr/share/pmenergy/mac-<id>.plist, where <id> can be determined with the following command. ioreg -l | grep board-id in contrast, on mac os 10.9 it is comput...
...And 4 more matches
NSPR Error Handling
pr_bad_descriptor_error the file descriptor used as an argument in the preceding function is invalid. ...
... pr_bad_descriptor_error the file descriptor used as an argument in the preceding function is invalid. pr_would_block_error the operation would have blocked, which conflicts with the semantics that have been established. pr_access_fault_error one of the arguments of the preceding function specified an invalid memory address. ...
...t of range of any index that has been allocated to the process. pr_proc_desc_table_full_error the process' table for holding open file descriptors is full. pr_sys_desc_table_full_error the system's table for holding open file descriptors has been exceeded. pr_not_socket_error an attempt to use a non-network file descriptor on a network-only operation. pr_not_tcp_socket_error attempt to per
form a tcp specific function on a non-tcp file descriptor. pr_socket_address_is_bound_erro attempt to bind an address to a tcp file descriptor that is already bound. pr_no_access_rights_error calling thread does not have privilege to per
form the operation requested. pr_operation_not_supported_erro the requested operation is not supported by the plat
form. pr_protocol_not_supported_error the hos...
...And 4 more matches
FIPS Mode - an explanation
nss has a "fips mode" that can be enabled when nss is compiled in a specific way. (note: mozilla does not distribute a "fips mode"-ready nss with firefox.) this page attempts to provide an in
formal explanation of what it is, who would use it, and why. what's a fips? ...
... nss has a "fips mode" that can be enabled when nss is compiled in a specific way. (note: mozilla does not distribute a "fips mode"-ready nss with firefox.) this page attempts to provide an in
formal explanation of what it is, who would use it, and why. what's a fips? ...
...page attempts to provide an in
formal explanation of what it is, who would use it, and why. what's a fips? the united states government defines many (several hundred) "federal in
formation processing standard" (fips) documents. (fips sounds plural, but is singular; one fips document is a fips, not a fip.) fips documents define rules, regulations, and standards for many aspects of handling of in
formation by computers and by people. they apply to all us government employees and personnel, including soldiers in the armed forces. generally speaking, any use of a computer by us government personnel must con
form to all the relevant fips regulations. if you're a us government worker, and you want to use a mozilla software product such as firefox, or any product that uses nss, you will want to u...
...And 4 more matches
NSS 3.24 release notes
nss 3.24 requires netscape portable runtime (nspr) 4.12 or newer. nss 3.24 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_24_rtm/src/ new in nss 3.24 nss 3.24 includes two nss softoken updates, a new function to configure ssl/tls server sockets, and two functions to improve the use of temporary arenas. ...
...tion to configure ssl/tls server sockets, and two functions to improve the use of temporary arenas. new functionality nss softoken has been updated with the latest national institute of standards and technology (nist) guidance (as of 2015): software integrity checks and post functions are executed on shared library load. these checks have been disabled by default, as they can cause a per
formance regression. to enable these checks, you must define symbol nss_force_fips when building nss. counter mode and galois/counter mode (gcm) have checks to prevent counter overflow. additional csps are zeroed in the code. nss softoken uses new guidance for how many rabin-miller tests are needed to verify a prime based on prime size. nss softoken has also been updated to allow nss to...
...eeded, since these can be added to the optional sslextraservercertdata struct provided to ssl_configservercert. also, partial support for rsa probabilistic signature scheme (rsa-pss) certificates has been added. although these certificates can be configured, they will not be used by nss in this version. for functions that use temporary arenas, allocating a portcheaparena on the stack is more per
formant than allocating a plarenapool on the heap. rather than declaring a plarenapool pointer and calling port_newarena/port_freearena to allocate or free an instance on the heap, declare a portcheaparenapool on the stack and use port_initcheaparena/port_destroycheaparena to initialize and destroy it. items allocated from the arena are still created on the heap, only the arena itself is stack-allocat...
...And 4 more matches
PKCS11 FAQ
oken. labels should not have any trailing blank characters. will nss use the random number generation features of pkcs #11? only if you identify your token as the default random number generator. if you do, your token must be able to generate random numbers even when it is not logged in. nss uses installed random number generators if pkcs11_mech_random_flag is set in the installer script. for in
formation on how to do this, see using the jar installation manager to install a pkcs #11 cryptographic module. can mozilla provide a list of all pkcs #11 functions that nss will use? your token should expect to implement all the pkcs #11 functions that make sense for your token. nss continues to evolve, and periodically enhances it's functionality by using a more complete list of pkcs #11 functions...
...means? pkcs #11 certificates that have private keys associated with them are are loaded into the temporary database (in memory) and marked as user certificates. all other certificates in the module are loaded into the temporary database with no special trust bits associated with them. nss is perfectly capable of using token certificates in place. which function does nss use to get login state in
formation? nss calls c_getsessioninfo to get the login/logout state. nss never attempts to cache this in
formation, because login state can change instantly without nss knowing about it (for example, when the user removes the card). you must update all sessions correctly when the state changes. not doing so is a common source of problems. i have noticed that nss sometimes use a session handle value o...
... example, if the rsa slot unwraps a key, nss needs to move that key to a slot that can do the symmetric operations. nss itself uses two tokens internally--one that provides generic cryptographic services without authentication, and one that provides operations based on the keys stored in the user's database and do need authentication. nss does this to avoid having to prompt for a password when per
forming an rsa verify operation, des encryption, and so on. therefore, nss can move keys around when necessary and possible. when operating in fips mode, moving keys is significantly harder. in this case nss uses a single token to handle both key and cert storage and crypto operations. in general, you not should use different slots unless you have a good reason. much of nss's token selection is based...
...And 4 more matches
NSS tools : ssltab
ficates into files in the current directory. the files are named cert.0x, where x is the sequence number of the certificate. if the -s option is used with -h, two separate parts are printed for each record: the plain hex/ascii output, and the parsed ssl output. -x turn on hex/ascii printing of undecoded data inside parsed ssl records. used only with the -s option. this option uses the same output
format as the -h option. -l prefix turn on looping; that is, continue to accept connections rather than stopping after the first connection is complete. -p port change the default rendezvous port (1924) to another port. the following are well-known port numbers: * http 80 * https 443 * smtp 25 * ftp 21 * imap 143 * imaps 993 (imap over ssl) * nntp 119 * nntps 563 (nntp over ssl) usage and examples you...
...nue to accept connections rather than stopping after the first connection is complete. -p port change the default rendezvous port (1924) to another port. the following are well-known port numbers: * http 80 * https 443 * smtp 25 * ftp 21 * imap 143 * imaps 993 (imap over ssl) * nntp 119 * nntps 563 (nntp over ssl) usage and examples you can use the ssl debugging tool to intercept any connection in
formation. although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the in
formation you get in this way is not very useful. for example, assume your development machine is called intercept. the simplest way to use the debugging tool is to execute the following command from a command shell: $ ssltap www.netscape.com the program waits for an...
...gth = 287 (0x11f) > encrypted > } ] [ sslrecord { type = 23 (application_data) version = { 3,0 } length = 160 (0xa0) > encrypted > } ] >-- [ sslrecord { type = 23 (application_data) version = { 3,0 } length = 223 (0xdf) > encrypted > } sslrecord { type = 21 (alert) version = { 3,0 } length = 18 (0x12) > encrypted > } ] server socket closed. example 3 in this example, the -h option turns hex/ascii
format. there is no ssl parsing or decoding. the output is routed to a text file. $ ssltap -h -p 444 interzone.mcom.com:443 > h.txt output connected to interzone.mcom.com:443 --> [ 0: 80 40 01 03 00 00 27 00 00 00 10 01 00 80 02 00 | .@....'......... 10: 80 03 00 80 04 00 80 06 00 40 07 00 c0 00 00 04 | .........@...... 20: 00 ff e0 00 00 0a 00 ff e1 00 00 09 00 00 03 00 | ........á....... 30: 00 06 ...
...And 4 more matches
NSS tools : ssltap
ficates into files in the current directory. the files are named cert.0x, where x is the sequence number of the certificate. if the -s option is used with -h, two separate parts are printed for each record: the plain hex/ascii output, and the parsed ssl output. -x turn on hex/ascii printing of undecoded data inside parsed ssl records. used only with the -s option. this option uses the same output
format as the -h option. -l prefix turn on looping; that is, continue to accept connections rather than stopping after the first connection is complete. -p port change the default rendezvous port (1924) to another port. the following are well-known port numbers: * http 80 * https 443 * smtp 25 * ftp 21 * imap 143 * imaps 993 (imap over ssl) * nntp 119 * nntps 563 (nntp over ssl) usage and examples you...
...nue to accept connections rather than stopping after the first connection is complete. -p port change the default rendezvous port (1924) to another port. the following are well-known port numbers: * http 80 * https 443 * smtp 25 * ftp 21 * imap 143 * imaps 993 (imap over ssl) * nntp 119 * nntps 563 (nntp over ssl) usage and examples you can use the ssl debugging tool to intercept any connection in
formation. although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the in
formation you get in this way is not very useful. for example, assume your development machine is called intercept. the simplest way to use the debugging tool is to execute the following command from a command shell: $ ssltap www.netscape.com the program waits for an...
...gth = 287 (0x11f) > encrypted > } ] [ sslrecord { type = 23 (application_data) version = { 3,0 } length = 160 (0xa0) > encrypted > } ] >-- [ sslrecord { type = 23 (application_data) version = { 3,0 } length = 223 (0xdf) > encrypted > } sslrecord { type = 21 (alert) version = { 3,0 } length = 18 (0x12) > encrypted > } ] server socket closed. example 3 in this example, the -h option turns hex/ascii
format. there is no ssl parsing or decoding. the output is routed to a text file. $ ssltap -h -p 444 interzone.mcom.com:443 > h.txt output connected to interzone.mcom.com:443 --> [ 0: 80 40 01 03 00 00 27 00 00 00 10 01 00 80 02 00 | .@....'......... 10: 80 03 00 80 04 00 80 06 00 40 07 00 c0 00 00 04 | .........@...... 20: 00 ff e0 00 00 0a 00 ff e1 00 00 09 00 00 03 00 | ........á....... 30: 00 06 ...
...And 4 more matches
sslcrt.html
this page is part of the ssl reference that we are migrating into the
format described in the mdn style guide. if you are inclined to help with this migration, your help would be very much appreciated. 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. ...
...ery much appreciated. 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. validating certificates manipulating certificates getting certificate in
formation comparing secitem objects validating certificates cert_verifycertnow cert_verifycertname cert_checkcertvalidtimes nss_cmpcertchainwcanames cert_verifycertnow checks that the current date is within the certificate's validity period and that the ca signature on the certificate is valid. syntax #include <cert.h> secstatus cert_verifycertnow( certcertdbhandle *handle, ...
...tepup certusagesslca certusageemailsigner certusageemailrecipient certusageobjectsigner certusageusercertimport certusageverifyca certusageprotectedobjectsigner wincx the pin argument value to pass to pk11 functions. see description below for more in
formation. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to obtain the error code. description the cert_verifycertnow function must call one or more pk11 functions to obtain the services of a pkcs #11 module. some of the pk11 functions require a pin argument (see ssl_setpkcs11pinarg for details)...
...And 4 more matches
NSS Tools ssltap
ates into files in the current directory. the files are named cert.0x, where x is the sequence number of the certificate. if the -s option is used with -h, two separate parts are printed for each record: the plain hex/ascii output, and the parsed ssl output. -x turn on hex/ascii printing of undecoded data inside parsed ssl records. used only with the -s option. this option uses the same output
format as the -h option. -l turn on looping; that is, continue to accept connections rather than stopping after the first connection is complete. -p port change the default rendezvous port (1924) to another port. the following are well-known port numbers: http 80 https 443 smtp 25 ftp 21 imap 143 imaps 993 (imap over ssl) nntp 119 nntps 563 (nntp over ssl) examples you...
... accept connections rather than stopping after the first connection is complete. -p port change the default rendezvous port (1924) to another port. the following are well-known port numbers: http 80 https 443 smtp 25 ftp 21 imap 143 imaps 993 (imap over ssl) nntp 119 nntps 563 (nntp over ssl) examples you can use the ssl debugging tool to intercept any connection in
formation. although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the in
formation you get in this way is not very useful. for example, assume your development machine is called intercept. the simplest way to use the debugging tool is to execute the following command from a command shell: ssltap www.netscape.com:80 the program waits for...
...ault, the tool closes down after the first connection is complete, so the browser is not able to load images. to make the tool continue to accept connections, switch on looping mode with the -l option. the following examples show the output from commonly used combinations of options. example 1 the s and x options in this example turn on ssl parsing and show undecoded values in hex/ascii
format. the output is routed to a text file. command ssltap.exe -sx -p 444 interzone.mcom.com:443 > sx.txt output output connected to interzone.mcom.com:443--> [alloclen = 66 bytes [ssl2] clienthellov2 { version = {0x03, 0x00} cipher-specs-length = 39 (0x27) sid-length = 0 (0x00) challenge-length = 16 (0x10) cipher-suites = { ...
...And 4 more matches
NSS tools : ssltap
, where x is the sequence number of the certificate. if the -s option is used with -h, two separate parts are printed for each record: the plain hex/ascii output, and the parsed ssl output. -x turn on hex/ascii printing of undecoded data inside parsed ssl records. used only with the -s option. this option uses the same output
format as the -h option. -l prefix turn on looping; that is, continue to accept connections rather than stopping after the first connection is complete. -p port change the default rendezvous port (1924) to another port. the following are well-known port numbers: * http 80 * https 443 * smtp 25 * ftp ...
...ndezvous port (1924) to another port. the following are well-known port numbers: * http 80 * https 443 * smtp 25 * ftp 21 * imap 143 * imaps 993 (imap over ssl) * nntp 119 * nntps 563 (nntp over ssl) usage and examples you can use the ssl debugging tool to intercept any connection in
formation. although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the in
formation you get in this way is not very useful. for example, assume your development machine is called intercept. the simplest way to use the debugging tool is to execute the following command from a command shell: $ ssltap www.netscape.com the pr...
...ength = 160 (0xa0) > encrypted > } ] >-- [ sslrecord { type = 23 (application_data) version = { 3,0 } length = 223 (0xdf) > encrypted > } sslrecord { type = 21 (alert) version = { 3,0 } length = 18 (0x12) > encrypted > } ] server socket closed. example 3 in this example, the -h option turns hex/ascii
format. there is no ssl parsing or decoding. the output is routed to a text file. $ ssltap -h -p 444 interzone.mcom.com:443 > h.txt output connected to interzone.mcom.com:443 --> [ 0: 80 40 01 03 00 00 27 00 00 00 10 01 00 80 02 00 | .@....'......... 10: 80 03 00 80 04 00 80 06 00 40 07 00 c0 00 00 04 | .........@...... 20: 00 ff e0 00 00 0a 00 ff e1 00 00 09 00 00 ...
...And 4 more matches
Rhino overview
people who have used javascript before have done so by adding scripts to their html web pages. however, rhino is an implementation of the core language only and doesn't contain objects or methods for manipulating html documents. rhino contains all the features of javascript 1.7 allows direct scripting of java a javascript shell for executing javascript scripts a javascript compiler to trans
form javascript source files into java class files a javascript debugger for scripts executed with rhino language the javascript language itself is standardized by standard ecma-262 ecmascript: a general purpose, cross-plat
form programming language. rhino 1.3 and greater con
form to edition 3 of the standard. rhino 1.6 and greater implement ecma-357 ecmascript for xml (e4x). see the specification ...
... source files into java class files a javascript debugger for scripts executed with rhino language the javascript language itself is standardized by standard ecma-262 ecmascript: a general purpose, cross-plat
form programming language. rhino 1.3 and greater con
form to edition 3 of the standard. rhino 1.6 and greater implement ecma-357 ecmascript for xml (e4x). see the specification for more in
formation on the standard, and rhino version 1.6r1 release notes for details on the implementation in rhino. in addition, rhino has implemented javaadapters, which allows javascript to implement any java interface or extend any java class with a javascript object. see the enum.js example for more in
formation. numerous books and tutorials on javascript are available. javascript: the definitive guide ...
.... if other properties files with extensions corresponding to the current locale exist, they will be used instead. javascript language versions some behavior in the javascript engine is dependent on the language version. in browser embeddings, this language version is selected using the language attribute of the script tag with values such as "javascript1.2". version 1.3 and greater are ecma con
formant. operators == and != version 1.2 only uses strict equality for the == and != operators. in version 1.3 and greater, == and != have the same meanings as ecma. the operators === and !== use strict equality in all versions. toboolean boolean(new boolean(false)) is false for all versions before 1.3. it is true (and thus ecma con
formant) for version 1.3 and greater. array.prototype.tostring an...
...And 4 more matches
SpiderMonkey Build Documentation
uild the latest spidermonkey source code. before you begin, make sure you have the right build tools for your computer: linux, windows, mac, others. when building a version older than 28, you'll additionally need nspr. and of course, you'll need to get the spidermonkey source code. non-developer (optimized) build use these steps if you want to install spidermonkey for production use or run per
formance benchmarks. (if you want to use spidermonkey as a library in your c++ application, or work on improving spidermonkey itself, do a developer/debug build instead, as described below.) cd js/src # this name should end with "_opt.obj" to make the version control system ignore it. mkdir build_opt.obj cd build_opt.obj /bin/sh ../configure.in # use "mozmake" on windows make a few notes about thi...
...idermonkey itself, do a developer/debug build instead, as described below.) cd js/src # this name should end with "_opt.obj" to make the version control system ignore it. mkdir build_opt.obj cd build_opt.obj /bin/sh ../configure.in # use "mozmake" on windows make a few notes about this: the most common build problems are dependency problems. see the build prerequisites page for your plat
form. spidermonkey does not support building in your source directory. you must configure and build in a separate build directory, as shown above. note: if you are on mac and getting an error similar to "checking whether the c compiler (gcc-4.2 ) works... no configure: error: installation or configuration problem: c compiler cannot create executables." you can try configuring like so: ...
... or unix, you can install spidermonkey on your system with the additional command make install. this installs the shared library to /usr/local/lib, the c header files to /usr/local/include, and the js executable to/usr/local/bin. developer (debug) build for developing and debugging spidermonkey itself, it is best to have both a debug build (for everyday debugging) and an optimized build (for per
formance testing), in separate build directories. thus, in addition to following the steps above, you should also create a debug build using these steps: cd js/src # this name should end with "_dbg.obj" to make the version control system ignore it. mkdir build_dbg.obj cd build_dbg.obj /bin/sh ../configure.in --enable-debug --disable-optimize # use "mozmake" on windows make you can also build debug...
...And 4 more matches
JS_PushArguments
obsolete since javascript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. convert any number of arguments to jsvals and store the resulting jsvals in an array. 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 per
form any necessary conversions. cx also affects the interpretation of
format, if js_addargument
formatter has been called. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. markp void ** ...
... ap va_list (in js_pushargumentsva) the list of arguments to be converted to jsvals. ...
...the interpretation of
format, if js_addargument
formatter has been called. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. markp void ** out parameter. on success, *markp receives the internally allocated stack mark which should be passed to js_poparguments.
format const char * null-terminated string holding a list of
format types to convert the following arguments to. ... various (in js_pusharguments) a variable number of arguments to be converted to jsvals. there must be one argument for each argument described in
format. ap va_list (in js_pushargumentsva) the list of arguments to be converted to jsvals. there must be one argument for each argument described in
format. the type va_li...
...And 4 more matches
SpiderMonkey 1.8.7
firefox 4.0. it is much faster than spidermonkey 1.8, implements es-5 (ecma 262, 5th edition), and contains many new language and api features, described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. ...
...ents es-5 (ecma 262, 5th edition), and contains many new language and api features, described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —22 march 2011 plat
form support spidermonkey 1.8.7 is supported on all the plat
forms where firefox 10 runs. ...
...the following features in earlier versions of spidermonkey have been dropped. ...
...And 4 more matches
SpiderMonkey 31
these release notes are incomplete. the mozilla javascript team is pleased to announce the release of spidermonkey 31. spidermonkey 31 is the javascript engine that shipped in firefox 31. it continues to improve per
formance over previous spidermonkey releases, with a significantly improved garbage collector and other features. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. ...
...detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. the download url is outdated and spidermonkey not release alone! get it here mozilla-esr31 you will find it in "firefox extended support release 31" package on hg release plat
form support spidermonkey 31 is supported on all the plat
forms where firefox 31 runs. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010: msvc8/9 support has been dropped. spidermonkey 31 includes a just-in-time compiler (jit) that compiles javascript to mach...
...ler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010: msvc8/9 support has been dropped. spidermonkey 31 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on some other plat
forms (sparc, mips), the jit is provided but not supported. on all other plat
forms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 31 the first change most embedders will notice is that spidermonkey must now be initialized before it can be used, using the newly-repurposed js_init method.
...And 4 more matches
WebReplayRoadmap
replay was an early-stage experiment and is no longer part of firefox. this document describes existing, planned, and potential features for the firefox developer tools that are based on web replay, along with their ui. the low level, yet flexible architecture (described here) provides an extremely powerful plat
form for implementing debugging and analysis features. we would like to use web replay to radically improve not just the debugging experience but the entire web development experience. to that end, this document will be revised over time as we find new and better ways of helping developers. time travel features more features are planned for the timeline, as described below. retroactive console logging console logging is one of the primary tools most developers use to d...
...umes executing. this restriction is in place to ensure that js executes the same way when replaying as it did while recording. dynamic analysis features an important but as-yet unexploited advantage of being able to exactly replay a web replay recording is that the recording can be analyzed without overhead affecting the user's experience. this section describes some analyses that could be per
formed and be helpful for developers who are either debugging a problem, or trying to understand or improve a complex code base. comparing executions (not yet implemented) comparing the behavior of a recording that exhibits a bug with a second recording that doesn't exhibit the bug should help with quickly locating the source of the problem. doing this well will require some experimentation, but in...
...cordings. 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. these questions can be answered by analyzing one or more recordings to study their behavior in detail. if the debugger could per
form this analysis then it could show this in
formation to developers and help them understand the app even when they are not actively debugging a particular recording. 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 an...
...And 4 more matches
Gecko Roles
role constants are defined in the nsiaccessiblerole interface. role_nothing used when the accessible item doesn't have a strongly defined role. role_titlebar represents a title or caption bar for a window. used by msaa only, this is supported automatically by microsoft windows. role_menubar represents the menu bar (positioned beneath the title bar of a window on most plat
forms or at the top of the screen on mac os x) from which menus are selected by the user. role_scrollbar represents a vertical or horizontal scroll bar, which is part of the client area or used in a control. role_grip represents a special mouse pointer, which allows a user to manipulate user interface elements such as windows. for example, a user clicks and drags a sizing grip in the l...
...d for warning dialogs, etc. role_window represents the window frame, which contains child objects such as a title bar, client, and other objects contained in a window. the role is supported automatically by microsoft windows. role_internal_frame a sub-document. role_menupopup represents a menu, which presents a list of options from which the user can make a selection to per
form an action. role_menuitem represents a menu item, which is an entry in a menu that a user can choose to carry out a command, select an option. role_tooltip represents a tooltip that provides helpful hints; this is generally displayed at the mouse cursor position. role_application represents a main window for an application. role_document represents a document window...
...sed to visually divide a space into two regions, such as a separator menu item or a bar that divides split panes within a window. role_toolbar represents a toolbar, which is a grouping of controls (push buttons or toggle buttons) that provides easy access to frequently used features. role_statusbar represents a status bar, which is an area at the bottom of a window that displays in
formation about the current operation, state of the application, or selected object. the status bar has multiple fields, which display different kinds of in
formation. role_table represents a table that contains rows and columns of cells, and optionally, row headers and column headers. role_columnheader represents a column header, providing a visual label for a column in a table. ro...
...And 4 more matches
Implementation Details
introduction this article is a reference how gecko implements at apis. ...
... introduction this article is a reference how gecko implements at apis. ...
...gecko implements at apis. ...
...And 4 more matches
Mork
at its core, it can be viewed as a set of rows, collections of name-value pairs, which can be organized into various tables. ...
...at its core, it can be viewed as a set of rows, collections of name-value pairs, which can be organized into various tables. ...
...at its core, it can be viewed as a set of rows, collections of name-value pairs, which can be organized into various tables. ...
...And 4 more matches
Querying Places
t, and provide a session id for each visit. this session id is the same for all pages that were reached by clicking links. a new session starts when the user types a new url or follows a bookmark (xxx link to more details about what constitutes a session). results_as_full_visit: this is an extended version of result_type_visit. the results are of type result_type_full_visit and have additional in
formation about the visit, such as the referring visit, and how the transition happened (typed, redirect, link, etc). not yet implemented -- see bug 320831. basic query search parameters const unsigned long time_relative_epoch = 0 const unsigned long time_relative_today = 1 const unsigned long time_relative_now = 2 attribute prtime begintime attribute unsigned long begintimereference readonl...
...this section discusses how to access the result directly, for example, if you are creating your own view...
...this section discusses how to access the result directly, for example, if you are creating your own view or are processing the results instead of displaying them. ...
...And 4 more matches
Creating the Component Code
component registration all xpcom components - whether they're stored in shared libraries (dlls, dsos, dylibs), javascript files, or otherwise - need to be registered before they can be used. registration is a process that happens in all xpcom applications, whether they're embedded gecko clients, mozilla, netscape 7, compuserve, or any other software that uses xpcom. registration provides the in
formation that applications need in order to use components properly. the weblock component must do a number of things to register itself. specifically, the component library has to contain implementations for the component-related interfaces described in this chapter: nsimodule and nsifactory, which are entry points for your implementation code. once your component implements these interfaces, the ...
... it is copied there, run regxpcom from the command line to register that component and all the others in that directory. several new options have been added to regxpcom in versions 1.4 and later. you can run regxpcom with the -h option to see full usage options. registration alternatives a gecko embedding application may provide other ways to register xpcom components. xpinstall, the cross-plat
form installation technology that mozilla uses to install the browser and other components, is one such alternative. it is described further in packaging weblock. you should consult with the authors of the application you wish to extend to see if there are other supported ways. overview of the weblock module source as we mentioned in the previous section, components have layers. there are three main...
...other layer outward is the nsimodule. this interface provides yet another abstraction of the nsifactory object, and may allow for multiple nsifactory objects. the key to this interface is that the return type of getclassobject does not have to be an nsifactory. instead, the nsimodule can ask for implementation details about the xpcom object. this is very useful if the caller is required to know in
formation about the component like its threading module, whether or not it's a singleton, its implementation language, and so forth. the interface used in this case is nsiclassinfo. starting from the outside in, onion peel view of xpcom component creation represents the sequence for constructing an xpcom object. onion peel view of xpcom component creation before we begin looking at the various par...
...And 4 more matches
Introduction to XPCOM for the DOM
and providing several facilities for comparison, initialization, etc... an nscomptr is used like an usual pointer to an interface in most cases. an usual pointer to an interface nsifoo is declared as follows: nsifoo *fooptr; an nscomptr to the same nsifoo interface is declared as follows: nscomptr<nsifoo> fooptr; the rest of the use of nscomptr's is described in the next section. for more in
formation about nscomptr's, please read the user's guide. queryinterface() consider again the class nsfoo that implements two interfaces, nsifoo and nsifoo2: class nsfoo : public nsifoo, public nsifoo2 let's assume an instance of nsfoo was somehow created (this assertion is true most of the time). you would like to manipulate that object with a method defined on the nsifoo interface. the goal is ...
...etter_addrefs(pointer), is the nscomptr counterpart to the usual "&" (address-of) c operator. it means that the getter method will call the addref method for you. this is a contract between the caller, who says "i don't add a reference to this object because you have already done it", and the callee who says "i add a reference to this object, so don't do it!". if both the caller and the callee per
form the addref, the object will be leaked, because one of the two references will never be released! please note that all getter functions have to addref the returned pointer. if you're just using the getter function though, you don't need to worry about it. more about this in the xpcom ownership guide. please also note that some interfaces are not refcounted, like the frames and views. for those y...
...eferences will never be released! please note that all getter functions have to addref the returned pointer. if you're just using the getter function though, you don't need to worry about it. more about this in the xpcom ownership guide. please also note that some interfaces are not refcounted, like the frames and views. for those you have to use raw interface pointers, and you don't have to per
form any manual refcounting. let's say that you now want to execute a function declared on the nsifoo2 interface, also implemented by nsfoo. however, ifooptr does not give you access to that function, since it is a pointer to nsifoo, for the reasons mentioned in section 1.b. xpcom provides a handy method to get a pointer to an interface when you have a pointer to another interface, and both interface...
...And 4 more matches
mozIRegistry
o be a design document for something that never got implemented. introduction the title of this document is completely misleading. it's not really about any "registry interface" so much as it's about how mozilla supports a more dynamic binding between interface clients and the code that actually provides the implementation of those interfaces. ...
... about any "registry interface" so much as it's about how mozilla supports a more dynamic binding between interface clients and the code that actually provides the implementation of those interfaces. it happens that this objective requires storing in
formation about which implementation to use in a place distinct from your source code. and it happens that we've chosen, up till now, to store that in
formation in the "netscape registry" file. ...
...ports a more dynamic binding between interface clients and the code that actually provides the implementation of those interfaces. it happens that this objective requires storing in
formation about which implementation to use in a place distinct from your source code. and it happens that we've chosen, up till now, to store that in
formation in the "netscape registry" file. which explains how this in
formation came to be associated with the notion of a "registry." someday (i hope) this page will be properly titled so that everybody knows it is the place to come to in order to find out how they are supposed to link together the various xpcom components that together
form the mozilla browser. the in
formation below is intended to tell you everything you need to know about how to do that. summary c...
...And 4 more matches
nsIAccessible
the accessible tree is a subset of nodes in the dom tree -- such as documents, focusable elements and text. mozilla creates the implementations of nsiaccessible on demand. [scriptable, uuid=(c7520419-87ec-42bc-98cc-04c0bf173530)] interface nsiaccessible : nsisupports { ... ...
...the accessible tree is a subset of nodes in the dom tree -- such as documents, focusable elements and text. mozilla creates the implementations of nsiaccessible on demand. [scriptable, uuid=(c7520419-87ec-42bc-98cc-04c0bf173530)] interface nsiaccessible : nsisupports { ... ...
...siaccessible.previoussibling to get sibling accessibles nsiaccessible.firstchild, nsiaccessible.lastchild to get first and last child nsiaccessible.children, nsiaccessible.getchildat(), nsiaccessible.childcount to navigate through the children by index accessible position you can use nsiaccessible.indexinparent to get accessible index in its parent. use nsiaccessible.groupposition() to get in
formation about this accessible in its group. relations many accessibles are linked with each other, for example, if one accessible gives the accessible name for another accessible (for example, html:label and html control) then these accessibles are related, please refer to relations documentation for more in
formation. you can get related accessibles by methods nsiaccessible.getaccessiblerelated()...
...And 4 more matches
nsIAppShell
ayer. this interface is designed to be used on the main application thread only. ...
... dispatchnativeevent() obsolete since gecko 1.9 (firefox 3) after event dispatch execute app specific code. void dispatchnativeevent( in prbool arealevent, in voidptr aevent ); parameters arealevent event is real or a null placeholder (macintosh). aevent void pointer to native event structure. exit() exit the handle event loop. void exit(); parameters none. favorper
formancehint() give hint to native event queue notification mechanism. if the native plat
form needs to tradeoff per
formance vs. native event starvation this hint tells the native dispatch code which to favor. the default is to prevent native event starvation. calls to this function may be nested. when the number of calls that pass pr_true is subtracted from the number of calls that pass pr_false is gr...
...int to native event queue notification mechanism. if the native plat
form needs to tradeoff per
formance vs. native event starvation this hint tells the native dispatch code which to favor. the default is to prevent native event starvation. calls to this function may be nested. when the number of calls that pass pr_true is subtracted from the number of calls that pass pr_false is greater than 0, per
formance is given precedence over preventing event starvation. void favorper
formancehint( in boolean favorperfoverstarvation, in unsigned long starvationdelay ); parameters favorperfoverstarvation true to favor event per
formance over event starvation, false to favor event starvation over event per
formance. starvationdelay is only used when favorperfoverstarvation is pr_false. it is the amount of...
...And 4 more matches
nsIAuthPrompt2
netwerk/base/public/nsiauthprompt2.idlscriptable an interface allowing to prompt for a username and password. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) this interface is usually acquired using getinterface on notification callbacks or similar. it can be used to prompt users for authentication in
formation, either synchronously or asynchronously. this interface is implemented by @mozilla.org/login-manager/prompter;1. to create an instance, use: var authprompt2 = components.classes["@mozilla.org/login-manager/prompter;1"] .createinstance(components.interfaces.nsiauthprompt2); method overview nsicancelable asyncpromptauth(in nsichannel achannel, in nsiauthpromptcallback acallback, i...
...nted by @mozilla.org/login-manager/prompter;1. to create an instance, use: var authprompt2 = components.classes["@mozilla.org/login-manager/prompter;1"] .createinstance(components.interfaces.nsiauthprompt2); method overview nsicancelable asyncpromptauth(in nsichannel achannel, in nsiauthpromptcallback acallback, in nsisupports acontext, in pruint32 level, in nsiauthin
formation authinfo); boolean promptauth(in nsichannel achannel, in pruint32 level, in nsiauthin
formation authinfo); constants constant value description level_none 0 the password will be sent unencrypted. no security provided. level_pw_encrypted 1 password will be sent encrypted, but the connection is otherwise insecure. level_secu...
...using a cancel button or similar, the callback's nsiauthpromptcallback.onauthcancelled() method must be called. calling nsicancelable.cancel() on the returned object should close the dialog and must call nsiauthpromptcallback.onauthcancelled() on the provided callback. this implementation may: coalesce identical prompts. this means prompts that are guaranteed to want the same authentication in
formation from the user. a single prompt will be shown; then the callbacks for all the coalesced prompts will be notified with the resulting authentication in
formation. serialize prompts that are all in the same "context" (this might mean application-wide, for a given window, or something else depending on the user interface) so that the user is not deluged with prompts. note: this method may throw...
...And 4 more matches
nsIIDNService
return value the utf-8 encoded equivalent of the hostname. converttodispla...
...hod overview autf8string convertacetoutf8(in acstring input); autf8string converttodisplayidn(in autf8string input, out boolean isascii); acstring convertutf8toace(in autf8string input); boolean isace(in acstring input); autf8string normalize(in autf8string input); methods convertacetoutf8() converts an ace (ascii compatible encoding) hostname into unicode
format, returning a utf-8
format string. this combines two operations: running the rfc 3490 "tounicode" operation on the original string, then converting the resulting unicode string into utf-8
format. autf8string convertacetoutf8( in acstring input ); parameters input the ace encoded hostname to convert into utf-8
format. return value the utf-8 encoded equivalent of the hostname. converttodisplayidn() normalizes a hostna...
...s combines two operations: running the rfc 3490 "tounicode" operation on the original string, then converting the resulting unicode string into utf-8
format. autf8string convertacetoutf8( in acstring input ); parameters input the ace encoded hostname to convert into utf-8
format. return value the utf-8 encoded equivalent of the hostname. converttodisplayidn() normalizes a hostname into utf-8
format if the hostname is in the idn whitelist. if the hostname isn't in the whitelist, it's converted into ace
format. the resulting string is useful for display purposes, and ensures that the encoding is consistent with nsiuri.gethost(). autf8string converttodisplayidn( in autf8string input, out boolean isascii ); parameters input the string to convert to display
format. isascii on return, thi...
...And 4 more matches
nsILoginInfo
nsilogininfo is an object containing in
formation for a login stored by the login manager. to create and manage logins use nsiloginmanager. toolkit/components/passwordmgr/public/nsilogininfo.idlscriptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports implemented by: @mozilla.org/login-manager/logininfo;1. ...
...sisupports implemented by: @mozilla.org/login-manager/logininfo;1. to create an instance, use: var logininfo = components.classes["@mozilla.org/login-manager/logininfo;1"] .createinstance(components.interfaces.nsilogininfo); method overview nsilogininfo clone(); boolean equals(in nsilogininfo alogininfo); void init(in astring ahostname, in astring a
formsubmiturl, in astring ahttprealm, in astring ausername, in astring apassword, in astring ausernamefield, in astring apasswordfield); boolean matches(in nsilogininfo alogininfo, in boolean ignorepassword); attributes attribute type description
formsubmiturl astring the origin, not url, a
form-based login was submitted to. for logins obtained from html ...
...submiturl, in astring ahttprealm, in astring ausername, in astring apassword, in astring ausernamefield, in astring apasswordfield); boolean matches(in nsilogininfo alogininfo, in boolean ignorepassword); attributes attribute type description
formsubmiturl astring the origin, not url, a
form-based login was submitted to. for logins obtained from html
forms, this field is the action attribute from the
form element, with the path removed (for example, "https://www.site.com").
forms with no action attribute default to submitting to their origin url, so that is stored here. this field is null for logins attained from protocol authentications and "" means to match against any
form action. hostname astring the origin, not hostname, to wh...
...And 4 more matches
nsIMsgFolder
flag(in unsigned long flag); void onflagchange(in unsigned long flag); void setprefflag(); nsimsgfolder getfolderswithflag(in unsigned long flags, in unsigned long resultsize, out unsigned long numfolders); nsisupportsarray getallfolderswithflag(in unsigned long aflag); void getexpansionarray(in nsisupportsarray expansionarray); acstring geturi
formsg(in nsimsgdbhdr msghdr); void deletemessages(in nsisupportsarray messages,in nsimsgwindow msgwindow, in boolean deletestorage, in boolean ismove, in nsimsgcopyservicelistener listener, in boolean allowundo); void copymessages(in nsimsgfolder srcfolder, in nsisupportsarray messages,in boolean ismove, in nsimsgwindow msgwindow,in nsimsgcopyservicelistener listener, in boolean isf...
...key); void addmessagedispositionstate(in nsimsgdbhdr amessage,in nsmsgdispositionstate adispositionflag); void markmessagesread(in nsisupportsarray messages, in boolean markread); void markallmessagesread(); void markmessagesflagged(in nsisupportsarray messages, in boolean markflagged); void markthreadread(in nsimsgthread thread); void setlabel
formessages(in nsisupportsarray messages, in nsmsglabelvalue label); nsimsgdatabase getmsgdatabase(in nsimsgwindow msgwindow); void setmsgdatabase(in nsimsgdatabase msgdatabase); nsimsgdatabase getdbfolderinfoanddb(out nsidbfolderinfo folderinfo); nsimsgdbhdr getmessageheader(in nsmsgkey msgkey); boolean shouldstoremsgoffline(in nsmsgkey msgkey); b...
...nt); void listdescendents(in nsisupportsarray descendents); void shutdown(in boolean shutdownchildren); void setinvfeditsearchscope(in boolean asearchthisfolder, in boolean asetonsubfolders); void copydatatooutputstreamforappend(in nsiinputstream aistream, in long alength, in nsioutputstream outputstream); void copydatadone(); void setjunkscore
formessages(in nsisupportsarray amessages, in acstring ajunkscore); void applyretentionsettings(); boolean fetchmsgpreviewtext([array, size_is (anumkeys)] in nsmsgkey akeystofetch, in unsigned long anumkeys, in boolean alocalonly, in nsiurllistener aurllistener); void addkeywordstomessages(in nsisupportsarray amessages, in acstring akeywords); void removekeywordsfro...
...And 4 more matches
nsIPermissionManager
denied. prompt_action 3 prompt user if the permission is allowed. permission expiration constants constant value description expire_never 0 permission never expires. expire_session 1 permission expires at end of session. expire_time 2 permission expires at a specified time. methods add() add permission in
formation and permission type for a given uri. if the permission already exists for a given type, it will be modified. void add( in nsiuri uri, in string type, in pruint32 permission, [optional] in pruint32 expiretype, [optional] in print64 expiretime ); parameters uri the uri to add the permission for. type a unique, case-sensitive ascii string identifying the consumer. consumers s...
...to be unique, with respect to other consumers. permission an integer specifying the permission. see nsipermissionmanager.permission_type_constants. expiretype expiration type of the permission. see nsipermissionmanager.permission_expiration_constants. expiretime time (in milliseconds since jan 1 1970 0:00:00) representing expiration of this permission. addfromprincipal() add permission in
formation and permission type for a given principal. if the permission already exists for a given type, it will be modified. it is internally calling add() method using the nsiuri from the principal. void addfromprincipal( in nsiprincipal principal, in string type, in pruint32 permission, [optional] in pruint32 expiretype, [optional] in print64 expiretime ); parameters principal the p...
...string to be unique, with respect to other consumers. permission an integer specifying the permission. see nsipermissionmanager.permission_type_constants. expiretype expiration type of the permission. see nsipermissionmanager.permission_expiration_constants. expiretime time (in milliseconds since jan 1 1970 0:00:00) representing expiration of this permission. ...
...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. these objects are used during drag-and-drop operations. inherits from: nsisupports last changed in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) implemented by: @mozilla.org/widget/transferable;1. 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. method overview v...
... isprivatedata boolean although this is not a read-only attribute, you should generally avoid changing it, since doing so may cause it not to actually reflect the status of the context in which the transferable was created. nativ...
... isprivatedata boolean although this is not a read-only attribute, you should generally avoid changing it, since doing so may cause it not to actually reflect the status of the context in which the transferable was created. native code only! re...
...And 4 more matches
nsITreeView
layout/xul/base/src/tree/public/nsitreeview.idlscriptable this interface is used by the tree widget to get in
formation about what and how to display a tree widget. inherits from: nsisupports last changed in gecko 22 (firefox 22 / thunderbird 22 / seamonkey 2.19) implementing a nsitreeview in lieu of dom methods for tree creation can improve per
formance dramatically, and removes the need to make changes to the tree manually when changes to the database occur. further in
formation about creating treeviews is given in the xul tutorial. method overview boolean candrop(in long index, in long orientation, in nsidomdatatransfer datatransfer); boolean candropbeforeafter(in long index, in boolean before); obsolete since gecko 1.8 boolean candropon(in long i...
...ng rowindex, in long afterindex); boolean iscontainer(in long index); boolean iscontainerempty(in long index); boolean iscontaineropen(in long index); boolean iseditable(in long row, in nsitreecolumn col); boolean isselectable(in long row, in nsitreecolumn col); boolean isseparator(in long index); boolean issorted(); void per
formaction(in wstring action); void per
formactiononcell(in wstring action, in long row, in nsitreecolumn col); void per
formactiononrow(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(...
...eudoelement to draw the separator. boolean isseparator( in long index ); parameters index the index of the item being asked about. true if the row is a separator. otherwise false. issorted() specifies if there is currently a sort on any column. used mostly by dragdrop to affect drop feedback. boolean issorted(); parameters none. true if the column is sorted. otherwise false. ...
...And 4 more matches
Mail composition back end
onsibility of the back end is for the creation and sending of rfc822 messages. the interface that accomplishes this task is the nsimsgsend interface. the feedback mechanism is provided by a nsimsgsendlistener which is implemented by the caller. the caller has the ability to add or remove listener interfaces to the nsimsgsend object and the interface can support multiple listeners. (for detailed in
formation on the listener interfaces, see the listener interfaces section of this document) nsimsgsend the following describes the methods of the nsimsgsend interface. all of these methods are asynchronous operations. createandsendmessage the createandsendmessage method will create an rfc822 message and send it all in one operation as well as providing the...
...ks will be sent as part of the message in mhtml nsimsgidentity *auseridentity, - the user identity for the person doing the send operation. this will be needed to determine the appropriate folder for copy operations. nsimsgcompfields *fields, - the message composition fields. this will contain all of the relevant header in
formation for message creation prbool digest_p, - this is a flag that says that most of the documents we are attaching are themselves messages, and so we should generate a multipart/digest container instead of multipart/mixed. (it's a minor difference.) prbool dont_deliver_p, - if "dont_deliver_p" is false, ...
... ns_imethod sendmessagefile( nsimsgidentity *auseridentity, - the user identity for the person doing the send operation. this will be needed to determine the appropriate folder for copy operations. nsimsgcompfields *fields, - the message composition fields. ...
...And 4 more matches
Introduction to DOM Inspector - Firefox Developer Tools
n, you'll see that it loads the dom nodes viewer in the document pane and the dom node viewer in the object pane. in the dom nodes viewer, there should be a structured, hierarchical view of the dom. by clicking around in the document pane, you'll see that the viewers are linked; whenever you select a new node from the dom nodes viewer, the dom node viewer is automatically updated to reflect the in
formation for that node. linked viewers are the first major aspect to understand when learning how to use the dom inspector. dom inspector viewers note that these viewers are just two viewers that the dom inspector provides. it's possible to use other viewers, but for now we'll stick to describing the dom nodes viewer and the dom node viewer. you can use the dom nodes viewer in the document pane of...
... find the name and location of particular icon being used in the user interface, which is not an easy task otherwise. if you're inspecting a chrome document, as you select nodes in the dom nodes viewer, the rendered versions of those nodes are highlighted in the user interface itself. (note that there are bugs which prevent the flasher from dom inspector apis from working correctly on certain plat
forms.) if you inspect the main browser window, for example, and select nodes in the dom nodes viewer (other than the elements which have no visible ui as is the case with the endless list of script elements that are loaded into browser.xul), you will see the various parts of the browser interface being highlighted with a blinking red border. you can traverse the structure and go from the topmost par...
...her than the elements which have no visible ui as is the case with the endless list of script elements that are loaded into browser.xul), you will see the various parts of the browser interface being highlighted with a blinking red border. you can traverse the structure and go from the topmost parts parts of the dom tree to lower level nodes, such as the "search-go-button" icon that lets users per
form a query using the selected search engine. now, once you have selected a node like the "search-go-button" node, you can select any one of several viewers to display in
formation about that node in the object pane of the dom inspector application window, all of which are available from the menupopup accessed from the upper left corner of the the object pane. in order to find out what the actua...
...And 4 more matches
Network request list - Firefox Developer Tools
de this behavior by checking "enable persistent logs" in the settings. network request columns you can toggle columns on and off by right-clicking on the table header and choosing the specific column from the context menu. a reset columns command is available on the context menu to reset the columns to their initial configuration. you can also change the width of the columns to help make the in
formation you are looking for easier to view. the mouse pointer changes to a resize icon when you move it over the border of a column. you can drag to manually set the size of column. starting in firefox 76 you can double-click a column divider to resize the column to the left of it to fit its contents. the reset columns command on the context menu also resets the width of the columns to the default ...
...for responses that were blocked by the browser or the server. method: the http request method used. domain: domain of the path requested. if the request used ssl/tls and the connection had security weaknesses such as weak ciphers, you'll see a warning triangle next to the domain. y hover over the domain to see the ip address. there's an icon next to the domain that gives you extra in
formation about the security status of that request. see security icons. file: the basename of the file requested. (starting in firefox 80) on the right edge of the file column, a turtle icon appears if the server waiting time exceeds a threshhold (default: 500 ms). a tooltip explains the problem. you can configure the threshhold in the configuration editor (about:config) by modifying the ...
...indicates why it was blocked. for example, "csp", "malware", "cors missing allow origin", "blocked by [name of extension]". size: the size of the transferred resource. image thumbnails if the request is for an image, hovering over its filename shows a preview of the image in a tooltip: security icons the network monitor displays an icon in the domain column: this gives you extra in
formation about the security status of the request: icon meaning https weak https (for example, a weak cipher was used) failed https (for example, a certificate was invalid) http localhost indicates that the url belongs to a known tracker that would be blocked with content blocking enabled. timeline ...
...And 4 more matches
Console messages - Firefox Developer Tools
pied by the message display pane: each message is displayed as a separate row: time the time the message was recorded. this is not shown by default: you can opt to see timestamps by selecting show timestamps in the console settings menu (gear icon in the console toolbar). icon not all console messages contain icons. the following icons may be used: in
formational message warning error blocked; for network messages in addition, a disclosure triangle indicates that further in
formation is available; clicking it displays or collapses that in
formation. message the message itself. number of occurrences if a line that generates a warning or error is executed more than once, it is only logged once and...
...ategories network network log messages are not shown by default. use the filtering feature to show them. network requests are logged with a line that looks like this: time the time the message was recorded. method the specific http request method. if the request was made as an xmlhttprequest, there's an additional "xhr" tag indicating this. if more in
formation is available, a disclosure triangle lets you display it, in an embedded panel that is identical to the network monitor request details. uri the target uri. summary the http version, response code, and time taken to complete. clicking the response code takes you to the reference page for that code. the context menu for network messages includes a few extra...
...sole with a link back to the original source, not the compressed version. async stack frames stack traces show stack frames for async functions separately from those for synchronous functions. when you run code containing an async function, its traces (console.trace or thrown error) are shown with an async: prefix. css note: css warnings and reflow messages are not shown by default, for per
formance reasons (see bug 1452143). use the filtering feature to show them. some css messages contain a disclosure triangle at the left of the message. click it to view more in
formation about the error, as well as which dom nodes are affected by the error. reflow events the web console also logs reflow events under the css category. a reflow is the name given to the operation in which the browse...
...And 4 more matches
CanvasRenderingContext2D - Web APIs
g drawn after clip() is called appears inside the clipping path only. for an example, see clipping paths in the canvas tutorial. canvasrenderingcontext2d.ispointinpath() reports whether or not the specified point is contained in the current path. canvasrenderingcontext2d.ispointinstroke() reports whether or not the specified point is inside the area contained by the stroking of a path. trans
formations objects in the canvasrenderingcontext2d rendering context have a current trans
formation matrix and methods to manipulate it. the trans
formation matrix is applied when creating the current default path, painting text, shapes and path2d objects. the methods listed below remain for historical and compatibility reasons as svgmatrix objects are used in most parts of the api nowadays and will be...
...e a current trans
formation matrix and methods to manipulate it. the trans
formation matrix is applied when creating the current default path, painting text, shapes and path2d objects. the methods listed below remain for historical and compatibility reasons as svgmatrix objects are used in most parts of the api nowadays and will be used in the future instead. canvasrenderingcontext2d.currenttrans
form current trans
formation matrix (svgmatrix object). canvasrenderingcontext2d.gettrans
form retrieves the current trans
formation matrix being applied to the context. canvasrenderingcontext2d.rotate() adds a rotation to the trans
formation matrix. the angle argument represents a clockwise rotation angle and is expressed in radians. ...
...trans
form current trans
formation matrix (svgmatrix object). canvasrenderingcontext2d.gettrans
form retrieves the current trans
formation matrix being applied to the context. canvasrenderingcontext2d.rotate() adds a rotation to the trans
formation matrix. the angle argument represents a clockwise rotation angle and is expressed in radians. canvasrenderingcontext2d.scale() adds a scaling trans
formation to the canvas units by x horizontally and by y vertically. canvasrenderingcontext2d.translate() adds a translation trans
formation by moving the canvas and its origin x horzontally and y vertically on the grid. canvasrenderingcontext2d.trans
form() multiplies the current trans
formation matrix with the matrix described by its arguments. ...
...And 4 more matches
console - Web APIs
another level. to move back out a level, call groupend(). console.groupcollapsed() creates a new inline group, indenting all following output by another level. however, unlike group() this starts with the inline group collapsed requiring the use of a disclosure button to expand it. to move back out a level, call groupend(). console.groupend() exits the current inline group. console.info() in
formative logging of in
formation. you may use string substitution and additional arguments with this method. console.log() for general output of logging in
formation. you may use string substitution and additional arguments with this method. console.profile() starts the browser's built-in profiler (for example, the firefox per
formance tool). you can specify an optional name for the profile. cons...
... console.table() displays tabular data as a table. console.time() starts a timer with a name specified as an input parameter. up to 10,000 simultaneous timers can run on a given page. console.timeend() stops the specified timer and logs the elapsed time in seconds since it started. ...
... console.table() displays tabular data as a table. console.time() starts a timer with a name specified as an input parameter. up to 10,000 simultaneous timers can run on a given page. console.timeend() stops the specified timer and logs the elapsed time in seconds since it started. console.timelog() logs the value of the specified timer to the console. ...
...And 4 more matches
Introduction to the DOM - Web APIs
ble from a single, consistent api. ...
... property of document object p_list = doc.getelementsbytagname("para") for more in
formation on what technologies are involved in writing javascript on the web, see javascript technologies overview. accessing the dom you don't have to do anything special to begin using the dom. different browsers have different implementations of the dom, and these implementations exhibit varying degrees of con
formance to the actual dom standard (a subject we try to avoid in this documentation), but every web browser uses some document object model to make web pages accessible via javascript. when you create a script–whether it's inline in a <script> element or included in the web page by means of a script loading instruction–you can immediately begin using the api for the document or window elements t...
...bute, for example, and to refer to an array of dom nodes as a nodelist. you'll find these terms and others to be introduced and used throughout the documentation. dom interfaces this guide is about the objects and the actual things you can use to manipulate the dom hierarchy. there are many points where understanding how these work can be confusing. for example, the object representing the html
form element gets its name property from the html
formelement interface but its classname property from the htmlelement interface. in both cases, the property you want is simply in that
form object. but the relationship between objects and the interfaces that they implement in the dom can be confusing, and so this section attempts to say a little something about the actual interfaces in the dom specif...
...And 4 more matches
Element: blur event - Web APIs
blur event fires when an element has lost focus. the main difference between this event and focusout is that focusout bubbles while blur does not. the opposite of blur is focus. ...
...nt fires when an element has lost focus. the main difference between this event and focusout is that focusout bubbles while blur does not. the opposite of blur is focus. ...
...sout bubbles while blur does not. the opposite of blur is focus. ...
...And 4 more matches
Element: focus event - Web APIs
s event fires when an element has received focus. the main difference between this event and focusin is that focusin bubbles while focus does not. the opposite of focus is blur. ...
...ires when an element has received focus. the main difference between this event and focusin is that focusin bubbles while focus does not. the opposite of focus is blur. ...
...in bubbles while focus does not. the opposite of focus is blur. ...
...And 4 more matches
Element.name - Web APIs
name gets or sets the name property of an element in the dom. it only applies to the following elements: <a>, <applet>, <button>, <
form>, <frame>, <iframe>, <img>, <input>, <map>, <meta>, <object>, <param>, <select>, and <textarea>. note: the name property doesn't exist for other elements; unlike tagname and nodename, it is not a property of the node, element or htmlelement interfaces. name can be used in the document.getelementsbyname() method, a
form and with the
form elements collection. when used with a
form or elements collection, it may return a single element or a collection. ...
...her elements; unlike tagname and nodename, it is not a property of the node, element or htmlelement interfaces. name can be used in the document.getelementsbyname() method, a
form and with the
form elements collection. when used with a
form or elements collection, it may return a single element or a collection. ...
... a property of the node, element or htmlelement interfaces. name can be used in the document.getelementsbyname() method, a
form and with the
form elements collection. when used with a
form or elements collection, it may return a single element or a collection. ...
...And 4 more matches
HTMLSelectElement - Web APIs
a:hover text { fill: #0095dd; pointer-events: all;} properties this interface inherits the properties of htmlelement, and of element and node. htmlselectelement.autofocus a boolean reflecting the autofocus html attribute, which indicates whether the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. only one
form-associated element in a document can have this attribute specified. htmlselectelement.disabled a boolean reflecting the disabled html attribute, which indicates whether the control is disabled. if it is disabled, it does not accept clicks. htmlselectelement.
formread only an html
formelement referencing the
form that this element is associated with. if the element is not associated with of a ...
... htmlselectelement.labelsread only a nodelist of <label> elements associated with the element. ...
...bute, containing the name of this control used by servers and dom search functions. htmlselectelement.optionsread only an htmloptionscollection representing the set of <option> (htmloptionelement) elements contained by this element. htmlselectelement.required a boolean reflecting the required html attribute, which indicates whether the user is required to select a value before submitting the
form. htmlselectelement.selectedindex a long reflecting the index of the first selected <option> element. the value -1 indicates no element is selected. htmlselectelement.selectedoptionsread only an htmlcollection representing the set of <option> elements that are selected. htmlselectelement.size a long reflecting the size html attribute, which contains the number of visible items in the contr...
...And 4 more matches
Timing element visibility with the Intersection Observer API - Web APIs
lash or other script in advertising on the web is to record how long each ad is visible, for the purpose of billing and payment of revenues. without the intersection observer api, this winds up being done using intervals and timeouts for each individual ad, or other techniques that tend to slow the page down. using this api lets everything get streamlined by the browser to reduce the impact on per
formance substantially. let's get started! site structure: the html the site's structure is not too complicated. we'll be using css grid to style and lay out the site, so we can be pretty straightforward here: <div class="wrapper"> <header> <h1>a fake blog</h1> <h2>showing intersection observer in action!</h2> </header> <aside> <nav> <ul> <li><a href="#link1">a li...
...since it's theoretically possible to get called multiple times, we only proceed if we haven't alread...
... updating the ad's total visible time counter, then we set their dataset.lastviewstarted property to 0, which indicates that the tab's timer isn't running. if the document has just become visible, we reverse this process: first we go through previouslyvisibleads and set each one's dataset.lastviewstarted to the current document's time (in milliseconds since the document was created) using the per
formance.now() method. then we set visibleads back to previouslyvisibleads and set the latter to null. now the ads are all restarted, and configured to know that they became visible at the current time, so that they will not add up the duration of time the page was tabbed away the next time they're updated. handling intersection changes once per pass through the browser's event loop, each intersecti...
...And 4 more matches
Navigation Timing API - Web APIs
the navigation timing api provides data that can be used to measure the per
formance of a web site. unlike javascript-based libraries that have historically been used to collect similar in
formation, the navigation timing api can be much more accurate and reliable. this article currently describes navigation timing level 1. there is a specification for level 2, but it is not yet covered here. concepts and usage you can use the navigation timing api to gather per
formance data on the client side, which you can then transmit to a server using xmlhttprequest or other techniques. this api lets you measure data that was previously difficult to obtain, such as the amount of time needed to unload the previous page, how long domain lookups take, the total time spent executing the window's load han...
...ion timing api to gather per
formance data on the client side, which you can then transmit to a server using xmlhttprequest or other techniques. this api lets you measure data that was previously difficult to obtain, such as the amount of time needed to unload the previous page, how long domain lookups take, the total time spent executing the window's load handler, and so forth. interfaces per
formance the window.per
formance property returns a per
formance object. 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. per
formancenavigationtiming provides methods and properties to store and retrieve metrics regarding the browser's document navigation events. for example, this interface can b...
...interface is defined by the high resolution time api, the navigation timing api adds two properties: timing and navigation, of the types below. per
formancenavigationtiming provides methods and properties to store and retrieve metrics regarding the browser's document navigation events. for example, this interface can be used to determine how much time it takes to load or unload a document. per
formancetiming used as the type for the value of timing, objects of this type contain timing in
formation that can provide insight into web page per
formance. ...
...And 4 more matches
Navigator - Web APIs
the correct value. navigatorid.appname read only returns a domstring with the official name of the browser. do not rely on this property to return the correct value. navigatorid.appversion read only returns the version of the browser as a domstring. do not rely on this property to return the correct value. navigator.battery read only returns a batterymanager object you can use to get in
formation about the battery charging status. navigator.connection read only provides a networkin
formation object containing in
formation about the network connection of a device. navigator.cookieenabled read only returns false if setting a cookie will be ignored and true otherwise. navigator.geolocation read only returns a geolocation object allowing accessing the location of the device. nav...
...nknown. navigatorlanguage.languages read only returns an array of domstring representing the languages known to the user, by order of preference. navigator.locks read only returns a lockmanager object which provides methods for requesting a new lock object and querying for an existing lock object navigator.mediacapabilities read only returns a mediacapabilities object that can expose in
formation about the decoding and encoding capabilities for a given
format and output capabilities. navigator.maxtouchpoints read only returns the maximum number of simultaneous touch contact points are supported by the current device. navigatorplugins.mimetypes read only returns an mimetypearray listing the mime types supported by the browser. navigator.online read only returns a boolean ind...
...t device. navigatorplugins.mimetypes read only returns an mimetypearray listing the mime types supported by the browser. navigator.online read only returns a boolean indicating whether the browser is working online. navigator.permissions read only returns a permissions object that can be used to query and update permission status of apis covered by the permissions api. navigatorid.plat
form read only returns a string representing the plat
form of the browser. do not rely on this function to return a significant value. navigatorplugins.plugins read only returns a pluginarray listing the plugins installed in the browser. navigatorid.product read only always returns 'gecko', on any browser. this property is kept only for compatibility purpose. navigator.serviceworker read o...
...And 4 more matches
PasswordCredential - Web APIs
the passwordcredential constructor creates a new passwordcredential object. in supporting browsers, an instance of this class may be passed the credential from the init object for global fetch. ...
... var mycredential = new passwordcredential(html
formelement) parameters either of the following: passwordcredentialdata a passwordcredentialdata dictionary containing the following fields: iconurl: (optional) the url of a user's avatar image. id: the id of the user signing in. name: (optional) the name of the user signing in. password: the password of the user signing in. html
formelement a reference to an html
formelement with appropriate input fields. the
form should, at the very least, contain an id and password. it could also require a csrf token. examples this example shows how to set up an html
formelement to caputure data which we'll use to create a passwordcredential object. starting with the
form element. ...
...ord: the password of the user signing in. html
formelement a reference to an html
formelement with appropriate input fields. the
form should, at the very least, contain an id and password. it could also require a csrf token. examples this example shows how to set up an html
formelement to caputure data which we'll use to create a passwordcredential object. starting with the
form element. ...
...And 4 more matches
RTCStatsReport - Web APIs
ding statistics data. calling getstats() on an rtcpeerconnection lets you specify whether you wish to obtain statistics for outbound, inbound, or all streams on the connection. the rtcrtpreceiver and rtcrtpsender versions of getstats() specifically only return statistics available to the incoming or outgoing stream on which you call them. ...
...u specify whether you wish to obtain statistics for outbound, inbound, or all streams on the connection. the rtcrtpreceiver and rtcrtpsender versions of getstats() specifically only return statistics available to the incoming or outgoing stream on which you call them. the statistics objects for each category of statistic in
formation, there is a dictionary whose properties provide the relevant in
formation. ...
...ly return statistics available to the incoming or outgoing stream on which you call them. the statistics objects for each category of statistic in
formation, there is a dictionary whose properties provide the relevant in
formation. properties common to all statistic categories all webrtc statistics objects are fundamentally based on the rtcstats dictionary, which provides the most fundamental in
formation: 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. timestamp a domhighrestimestamp object indicating the time at which the sample was taken for this statistics object. type a domstring indicating the type of statistics the ob...
...And 4 more matches
SVGSVGElement - Web APIs
e is provided. svgsvgelement.pixelunittomillimetery a float representing the size of a pixel unit along the y-axis of the viewport. svgsvgelement.screenpixeltomillimeterx user interface (ui) events in dom level 2 indicate the screen positions at which the given ui event occurred. when the browser actually knows the physical size of a "screen unit", this float attribute will express that in
formation; otherwise, user agents will provide a suitable default value (such as .28mm). svgsvgelement.screenpixeltomillimetery corresponding size of a screen pixel along the y-axis of the viewport. svgsvgelement.usecurrentview the initial view (i.e., before magnification and panning) of the current innermost svg document fragment can be either the "standard" view, i.e., based on attributes on t...
...defining the initial view (i.e., before magnification and panning) of the current innermost svg document fragment. ...
...e values for the corresponding dom attributes that are on svgsvgelement directly the values for trans
form and viewtarget within currentview will be null if the initial view was a link into a <view> element, then: the values for viewbox, preserveaspectratio and zoomandpan within currentview will correspond to the corresponding attributes for the given <view> element the values for trans
form and viewtarget within currentview will be null if the initial view was a link into another element (i.e., other than a <view>), then: the values for viewbox, preserveaspectratio and zoomandpan within currentview will match the values for the corresponding dom attributes that are on svgsvgelement directly for the closest ancestor <svg> element the values for trans
form within currentview ...
...And 4 more matches
Using the Screen Capture API - Web APIs
estriction on the size of the source itself. note: constraints never cause changes to the list of sources available for capture by the screen sharing api. this ensures that web applications can't force the user to share specific content by restricting the source list until only one item is left. while display capture is in effect, the machine which is sharing screen contents will display some
form of indicator so the user is aware that sharing is taking place. note: for privacy and security reasons, screen sharing sources are not enumerable using enumeratedevices(). related to this, the devicechange event is never sent when there are changes to the sources available for getdisplaymedia(). capturing shared audio getdisplaymedia() is most commonly used to capture video of a user's scree...
...ve support for audio in captured screen streams. to request that the screen be shared with included audio, the options passed into getdisplaymedia() might look like this: const gdmoptions = { video: true, audio: true } this allows the user total freedom to select whatever they want, within the limits of what the user agent supports. ...
... screen sharing. potential risks privacy and security issues surrounding screen sharing are usually not overly serious, but they do exist. the largest potential issue is users inadvertently sharing content they did not wish to share. for example, privacy and/or security violations can easily occur if the user is sharing their screen and a visible background window happens to contain personal in
formation, or if their password manager is visible in the shared stream. this effect can be amplified when capturing logical display surfaces, which may contain content that the user doesn't know about at all, let alone see. user agents which take privacy seriously should obfuscate content that is not actually visible onscreen, unless authorization has been given to share that content specifically. ...
...And 4 more matches
WebGLRenderingContext.vertexAttribPointer() - Web APIs
ribpointer(), we specify in what order the attributes are stored, and what data type they are in. in addition, we need to include the stride, which is the total byte length of all attributes for one vertex. also, we have to call gl.enablevertexattribarray() to tell webgl that this attribute should be filled with data from our array buffer. ...
...d, and what data type they are in. in addition, we need to include the stride, which is the total byte length of all attributes for one vertex. also, we have to call gl.enablevertexattribarray() to tell webgl that this attribute should be filled with data from our array buffer. usually, your 3d geometry is already in a certain binary
format, so you need to read the specification of that specific
format to figure out the memory layout. however, if you are designing the
format yourself, or your geometry is in text files (like wavefront .obj files) and must be converted into an arraybuffer at runtime, you have free choice on how to structure the memory. for highest per
formance, interleave the attributes and use the smallest data type that still accurately represents your geometry. the maximum n...
...d on the array buffer, while the third and fourth components are taken from the default value. the default value is vec4(0.0, 0.0, 0.0, 1.0) by default but we can specify a different default value with gl.vertexattrib[1234]f[v](). for example, your vertex shader may be using a position and a color attribute. most meshes have the color specified at a per-vertex level, but some meshes are of a uni
form shade. for those meshes, it is not necessary to place the same color for each vertex into the array buffer, so you use gl.vertexattrib4fv() to set a constant color. querying current settings you can call gl.getvertexattrib() and gl.getvertexattriboffset() to get the current parameters for an attribute, e.g. the data type or whether the attribute should be normalized. keep in mind that these web...
...And 4 more matches
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
ng data that needs real-time priority. this article provides an overview of what rtp is and how it functions in the context of webrtc. note: webrtc actually uses srtp (secure real-time transport protocol) to ensure that the exchanged data is secure and authenticated as appropriate. keeping latency to a minimum is especially important for webrtc, since face-to-face communication needs to be per
formed with as little latency as possible. the more time lag there is between one user saying something and another hearing it, the more likely there is to be episodes of cross-talking and other
forms of confusion. key features of rtp before examining rtp's use in webrtc contexts, it's useful to have a general idea of what rtp does and does not offer. rtp is a data transport protocol, whose mission ...
... use in webrtc contexts, it's useful to have a general idea of what rtp does and does not offer. rtp is a data transport protocol, whose mission is to move data between two endpoints as efficiently as possible under current conditions. those conditions may be affected by everything from the underlying layers of the network stack to the physical network connection, the intervening networks, the per
formance of the remote endpoint, noise levels, traffic levels, and so forth. since rtp is simply a data transport, it is augmented by the closely-related rtp control protocol (rtcp), which is defined in rfc 3550, section 6. rtcp adds features including quality of service (qos) monitoring, participant in
formation sharing, and the like. it isn't adequate for the purposes of fully managing users, member...
...are. capabilities of rtp rtp's primary benefits in terms of webrtc include: generally low latency. packets are sequence-numbered and time-stamped for reassembly if they arrive out of order. this lets data sent using rtp be delivered on transports that don't guarantee ordering or even guarantee delivery at all. ...
...And 4 more matches
XRReferenceSpace - Web APIs
ncespace interface describes the coordinate system for a specific tracked entity or object within the virtual world using a specified tracking behavior. the tracking behavior is defined by the selected reference space type. it expands upon the base class, xrspace, by adding support for several different tracking behaviors as well as to request a new reference space which describes the offset trans
form between the tracked object and another location in the world. all reference spaces—with the sole exception being bounded reference spaces—are described using the xrreferencespace type. bounded spaces are implemented as xrboundedreferencespace objects. these are special spaces which let you establish a perimeter within which it's "safe" for the viewer to move. for xr systems that allow the us...
...ent interface, xrspace (there are none at this time), xrreferencespace inherits methods from eventtarget. xrreferencespace also provides the following methods. 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). the new reference space can be used to trans
form a coordinate from the reference space of the object on which the method is called into a different coordinate space. this is useful for positioning objects while rendering, and to per
form the needed trans
forms when changing the viewer's position and/or orientation in 3d space. events in addition to other events that may be sent to xrspace or eventtarget objects, the following also apply to xrr...
...nt handler property. reference space types the reference space returned by xrsession.requestreferencespace() is either xrreferencespace or xrboundedreferencespace. the "interface" column in the table below indicates which of the two types is returned for each reference space type constant.. reference space descriptors the types of reference space are listed in the table below, with brief in
formation about their use cases and which interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native or...
...And 4 more matches
ARIA: gridcell role - Accessibility
<div role="gridcell">potato</div> <div role="gridcell">cabbage</div> <div role="gridcell">onion</div> elements that have role="gridcell" applied to them must be the child of an element with a role of row. ...
...have rows and/or columns dynamically added, hidden, or removed. use aria-colindex to describe a gridcell's order in the list of columns, and aria-rowindex to describe a gridcell's order in the list of rows. use aria-colcount and aria-rowcount on the parent element with role="grid" applied to it to set the total number of columns or rows. this sample code demonstrates a table-style grouping of in
formation where the third and fourth columns have been removed. aria-colindex is being used to describe the rows' position and allows a person using assistive technology to infer that certain rows have been removed: <div role="grid" aria-colcount="6"> <div role="rowgroup"> <div role="row"> <div role="columnheader" aria-colindex="1">first name</div> <div role="columnheader" aria-coli...
...the ids provided for aria-describedby should correspond to parent elements intended to be the rows and columns. by referencing the parent elements with roles of rowheader or columnheader applied to them via aria-describedby, it allows assistive technology to understand the po...
...And 4 more matches
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
note that currently browsers support this functionality as :matches(), or through an older, prefixed pseudo-class — :any(), including older versions of chrome, firefox, and safari. ...
...to change preferences in chrome, visit chrome://flags. no support 66 — 71notes alternate name disabled notes combinators in the selector list argument may not match correctly (see bug 842157).alternate name uses the non-standard name: :matches()disabled from version 66 until version 71 (exclusive): this feature is behin...
...et to enabled). to change preferences in chrome, visit chrome://flags. no support 66 — 71notes alternate name disabled notes combinators in the selector list argument may not match correctly (see bug 842157).alternate name uses the non-standard name: :matches()disabled from version 66 until version 71 (exclusive): this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 12notes alternate name notes doesn't support combinators.alternate name uses the non-standard name: :-webkit-any()edge full support 79notes disabled full support ...
...And 4 more matches
Box-shadow generator - CSS: Cascading Style Sheets
iv> <div class="ui-slider" data-topic="left" data-min="-300" data-max="700" data-step="1"> </div> <div class="ui-slider-btn-set" data-topic="left" data-type="add"></div> <div class="ui-slider-input" data-topic="left" data-unit="px"></div> </div> <div id="trans
form_rotate" class="slidergroup"> <div class="ui-slider-name"> rotate </div> <div class="ui-slider-btn-set" data-topic="rotate" data-type="sub"></div> <div class="ui-slider" data-topic="rotate" data-min="-360" data-max="360" data-step="1" data-value="0"> </div> ...
...tput" data-topic="element" data-name="element" data-prop="width height background-color position=[relative] box-shadow"> </div> <div class="output" data-topic="before" data-name="element:before" data-prop="content=[""] position=[absolute] width height top left z-index background-color box-shadow trans
form -webkit-trans
form -ms-trans
form"> </div> <div class="output" data-topic="after" data-name="element:after" data-prop="content=[""] position=[absolute] width height top left z-index background-color box-shadow trans
form -webkit-trans
form -ms-trans
form"> </div> </div> </div> ...
...oz-user-select: none; user-select: none; } .slidergroup * { float: left; height: 100%; line-height: 100%; } /* slider */ .ui-slider { height: 10px; width: 200px; margin: 4px 10px; display: block; border: 1px solid #999; border-radius: 3px; background: #eee; } .ui-slider:hover { cursor: pointer; } .ui-slider-name { width: 90px; padding: 0 10px 0 0; text-align: right; text-trans
form: lowercase; } .ui-slider-pointer { width: 13px; height: 13px; background-color: #eee; border: 1px solid #2c9fc9; border-radius: 3px; position: relative; top: -3px; left: 0%; } .ui-slider-btn-set { width: 25px; background-color: #2c9fc9; border-radius: 3px; color: #fff; font-weight: bold; text-align: center; } .ui-slider-btn-set:hover { background-color: #379b4a; cursor: pointer...
...And 4 more matches
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
the appearance css property is used to display an element using plat
form-native styling, based on the operating system's theme. the -moz-appearance and -webkit-appearance properties are non-standard versions of this propery, used (respectively) by gecko (firefox) and by webkit-based (e.g., safari) and blink-based (e.g., chrome, opera) browsers to achieve the same thing. note that firefox and edge also support -webkit-appearance, for compatibility reasons. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...hat firefox and edge also support -webkit-appearance, for compatibility reasons. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the -moz-appearance property was used in xul stylesheets to design custom widgets with plat
form-appropriate styling. it was also used in the xbl implementations of the widgets that ship with the mozilla plat
form. starting with gecko/firefox 80, these uses were changed to -moz-default-appearance, which should never be used outside of internal stylesheets. compatibility note: if you wish to use this property on websites, you should test it very carefully. although it is supported in most mo...
...with gecko/firefox 80, these uses were changed to -moz-default-appearance, which should never be used outside of internal stylesheets. compatibility note: if you wish to use this property on websites, you should test it very carefully. although it is supported in most modern browsers, its implementation varies widely. in older browsers, even the keyword none does not have the same effect on all
form elements across different browsers, and some do not support it at all. the differences are smaller in the newest browsers. syntax /* css basic user interface module level 4 values */ appearance: none; appearance: auto; appearance: menulist-button; appearance: textfield; /* "compat-auto" values, which have the same effect as 'auto' */ appearance: button; appearance: searchfield; appearance: te...
...And 4 more matches
<custom-ident> - CSS: Cascading Style Sheets
the syntax of <custom-ident> is similar to css identifiers (such as property names), except that it is case-sensitive. it consists of one or more characters, where characters can be any of the following: any alphabetical character (a to z, or a to z), any decimal digit (0 to 9), a hyphen (-), an underscore (_), an escaped character (preceded by a backslash, \), a unicode character (in the
format of a backslash, \, followed by one to six hexadecimal digits, representing its unicode code point) note that id1, id1, id1 and id1 are all different identifiers as they are case-sensitive. on the other hand, as there are several ways to escape a character, toto\? and toto\3f are the same identifiers. forbidden values a <custom-ident> must not be placed between single or double quotes as thi...
... grid-row-start grid-row-en...
... grid-row-start grid-row-end grid-column-star...
...And 4 more matches
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
h1 { display: inline; } more recently we have gained css grid layout and flexbox. to access these we also use values of the display property — display: grid and display: flex. only when the value of display is changed do the children become flex or grid items and begin to respond to the other properties in the grid or flexbox specifications. changing an element's display value changes the
formatting context of its direct children. what grid and flexbox demonstrate, however, is that an element has both an outer and an inner display type. the outer display type describes whether the element is block-level or inline-level. the inner display type describes how the children of that box behave. as an example, when we use display: flex we create a block-level container, with flex children. ...
...flexbox demonstrate, however, is that an element has both an outer and an inner display type. the outer display type describes whether the element is block-level or inline-level. the inner display type describes how the children of that box behave. as an example, when we use display: flex we create a block-level container, with flex children. the children are described as participating in a flex
formatting context. you can see this if you take a <span> — normally an inline-level element — and apply display: flex to it. the <span> becomes a block-level element. it behaves as block-level things do in relationship to other boxes in the layout. it’s as if you had applied display: block to the span, however we also get the changed behavior of the children. the live example below has a <span...
...that the parent is now an inline-level box. it therefore behaves like other inline-level things, and doesn't take up the full width (or size in the inline dimension) that a block-level box does. this means that some following text could come up alongside the flex container. the same is true when working with grid layout. using display: grid will give you a block-level box, which creates a grid
formatting context for the direct children. using display: inline-grid will create an inline-level box, which creates a grid
formatting context for the children. the two-value syntax as you can see from the above explanation, the display property has gained considerable new powers. in addition to indicating whether something is block-level or inline-level in relationship to other boxes on the page, ...
...And 4 more matches
perspective-origin - CSS: Cascading Style Sheets
wer is looking. it is used as the vanishing point by the perspective property. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the perspective-origin and perspective properties are attached to the parent of a child trans
formed in 3-dimensional space, unlike the perspective() trans
form function which is placed on the element being trans
formed. syntax /* one-value syntax */ perspective-origin: x-position; /* two-value syntax */ perspective-origin: x-position y-position; /* when both x-position and y-position are keywords, the following is also valid */ perspective-origin: y-position x-position; /* global values...
...nishing point. it can have one of the following values: <length-percentage> indicating the position as an absolute length value or relative to the height of the element. the value may be negative. top, a keyword being a shortcut for the 0 length value. center, a keyword being a shortcut for the 50% percentage value. bottom, a keyword being a shortcut for the 100% percentage value. ...
...: <length-percentage> indicating the position as an absolute length value or relative to the height of the element. the value may be negative. top, a keyword being a shortcut for the 0 length value. center, a keyword being a shortcut for the 50% percentage value. bottom, a keyword being a shortcut for the 100% percentage value. ...
...And 4 more matches
rotate - CSS: Cascading Style Sheets
syntax /* keyword values */ rotate: none; /* angle value */ rotate: 90deg; rotate: 0.25turn; rotate: 1.57rad; /* x, y, or z axis name plus angle */ rotate: x 90deg; rotate: y 0.25turn; rotate: z 1.57rad; /* vector plus angle value */ rotate: 1 1 1 90deg; values angle value an <angle> specifying the angle to rotate the affected element through, around the z axis. equivalent to a rotate() (2d rotation) function. ...
... through. equivalent to a rotatex()/rotatey()/rotatez() (3d rotation) function. vector plus angle value three <number>s representing an origin-centered vector that defines a line around which you want to rotate the element, plus an <angle> specifying the angle to rotate the element through. equivalent to a rotate3d() (3d rotation) function. none specifies that no rotation should be applied. ...
...ez() (3d rotation) function. vector plus angle value three <number>s representing an origin-centered vector that defines a line around which you want to rotate the element, plus an <angle> specifying the angle to rotate the element through. equivalent to a rotate3d() (3d rotation) function. none specifies that no rotation should be applied. ...
...And 4 more matches
scale - CSS: Cascading Style Sheets
syntax /* keyword values */ scale: none; /* single values */ /* values of more than 1 make the element grow */ scale: 2; /* values of less than 1 make the element shrink */ scale: 0.5; /* two values */ scale: 2 0.5; /* three values */ scale: 2 0.5 2; values single number value a <number> specifying a scale factor to make the affected element scale by the same factor along both the x and y axes. ...
...alues two <number>s that specify the x and y axis scaling values (respectively) of a 2d scale. equivalent to a scale() (2d scaling) function with two values specified. three length/percentage values three <number>s that specify the x, y, and z axis scaling values (respectively) of a 3d scale. equivalent to a scale3d() (3d scaling) function. none specifies that no scaling should be applied. ...
...scaling values (respectively) of a 2d scale. equivalent to a scale() (2d scaling) function with two values specified. three length/percentage values three <number>s that specify the x, y, and z axis scaling values (respectively) of a 3d scale. equivalent to a scale3d() (3d scaling) function. none specifies that no scaling should be applied. ...
...And 4 more matches
translate() - CSS: Cascading Style Sheets
the translate() css function repositions an element in the horizontal and/or vertical directions. its result is a <trans
form-function> data type. this trans
formation is characterized by a two-dimensional vector. its coordinates define how much the element moves in each direction. syntax /* single <length-percentage> values */ trans
form: translate(200px); trans
form: translate(50%); /* double <length-percentage> values */ trans
form: translate(100px, 200px); trans
form: translate(100px, 50%); trans
form: translate(30%, 200px); trans
form: translate(30%, 50%); values single <length-percentage> values this value is a <length> or <percentage> representing the abscissa (horizontal, x-coordinate) of the translating vector. the ordinate (vertical, y-coordinate) of the translating vector will ...
...0%, 50%); values single <length-percentage> values this value is a <length> or <percentage> representing the abscissa (horizontal, x-coordinate) of the translating vector. the ordinate (vertical, y-coordinate) of the translating vector will be set to 0. for example, translate(2) is equivalent to translate(2, 0). a percentage value refers to the width of the reference box defined by the trans
form-box property. double <length-percentage> values this value describes two <length> or <percentage> values representing both the abscissa (x-coordinate) and the ordinate (y-coordinate) of the translating vector. a percentage as first value refers to the width, as second part to the height of the reference box defined by the trans
form-box property. cartesian coordinates on ℝ2 homog...
...and the ordinate (y-coordinate) of the translating vector. a percentage as first value refers to the width, as second part to the height of the reference box defined by the trans
form-box property. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 a translation is not a linear trans
formation in ℝ2 and can't be represented using a cartesian-coordinate matrix. ...
...And 4 more matches
Getting Started - Developer guides
this article guides you through the ajax basics and gives you some simple hands-on examples to get you started. what's ajax? ajax stands for asynchronous javascript and xml. in a nutshell, it is the use of the xmlhttprequest object to communicate with servers. it can send and receive in
formation in various
formats, including json, xml, html, and text files. ajax’s most appealing characteristic is its "asynchronous" nature, which means it can communicate with the server, exchange data, and update the page without having to refresh the page. the two major features of ajax allow you to do the following: make requests to the server without reloading the page receive and work with data from the server step 1 – how to make an http request in order to make an http request to the server...
...f the http request object, like this: httprequest.open('get', 'http://www.example.org/some.file', true); httprequest.send(); the first parameter of the call to open() is the http request method – get, post, head, or another method supported by your server. keep the method all-capitals as per the http standard, otherwise some browsers (like firefox) might not process the request. for more in
formation on the possible http request methods, check the w3c specs. the second parameter is the url you're sending the request to. as a security feature, you cannot call urls on 3rd-party domains by default. be sure to use the exact domain name on all of your pages or you will get a "permission denied" error when you call open(). a common pitfall is accessing your site by domain.tld, but attempting ...
...nother domain, see http access control (cors). the optional third parameter sets whether the request is asynchronous. if true (the default), javascript execution will continue and the user can interact with the page while the server response has yet to arrive. this is the first a in ajax. the parameter to the send() method can be any data you want to send to the server if post-ing the request. ...
...And 4 more matches
WAI ARIA Live Regions/API Support - Developer guides
these notes are for developers of screen readers. developers should use the aria live regions developer documentation. firefox 3 contains important improvements to the way the mozilla engine exposes live changes in a document. these features will help screen reader developers improve the quality and per
formance of live region support, both for pages that are marked up with aria live region markup, and for pages where the author did not add any additional markup. please read the aria spec or the live region report to learn about aria live region markup. as always, we're open to questions and suggestions for changes in community forums. events fired for web page mutations what changed in document? atk/at-spi event iaccessible2 event object about to be hidden or remove...
...ue" | "false" (described more below) browser could not calculate this was the root cause of this event explicit user input? does not require author's cooperation. the "container-" prefix is so named because the attribute describes what the final computed property of similar name is for that node. ...
...what the final computed property of similar name is for that node. this means that the at does not need to traverse up the parent chain to get this in
formation. at this time, for properties where the container-[name] attribute has not been set, the at must have code to fall back on the default value as defined in the w3c spec. determining if event was from user input all events will now provide in
formation about whether the event was caused by user input, or was something that the web page caused. this in
formation is retrieved differently on each plat
form, because some plat
forms use asynchronous events. in iaccessible2, this is retrieved from the object attribute "event-from-input", which will be set to "true" or "false". if it is not present, then something went wrong and mozilla was not able...
...And 4 more matches
Developer guides
html learning area hypertext markup language (html) is the core language of nearly all web content. most of what you see on screen in your browser is described, fundamentally, using html. css learning area cascading style sheets (css) is a stylesheet language used to define the presentation of a document written in html. audio and video delivery we can deliver audio and video on the web in several ways, ranging from 'static' media files to adaptive live streams. this article is intended as a starting point for exploring the various delivery mechanisms of web-based media and compatibility with popular browsers. ...
...audio and video delivery we can deliver audio and video on the web in several ways, ranging from 'static' media files to adaptive live streams. this article is intended as a starting point for exploring the various delivery mechanisms of web-based media and compatibility with popular browsers. audio and video manipulation the beauty of the web is that you can combine technologies to create new
forms. having native audio and video in the browser means we can use these data streams with technologies such as <canvas>, webgl or web audio api to modify audio and video directly, for example adding reverb/compression effects to audio, or grayscale/sepia filters to video. this article provides a reference to explain what you need to do. events developer guide events refer to two things: a design ...
... of unicode), and regardless of the encoding used requires web content to declare that encoding. mobile web development this article provides an overview of some of the main techniques needed to design web sites that work well on mobile devices. ...
...And 4 more matches
disabled - HTML: Hypertext Markup Language
often browsers grey out such controls and it won't receive any browsing events, like mouse clicks or focus-related ones. the disabled attribute is supported by <button>, <command>, <fieldset>, <keygen>, <optgroup>, <option>, <select>, <textarea> and <input>. ...
...often browsers grey out such controls and it won't receive any browsing events, like mouse clicks or focus-related ones. the disabled attribute is supported by <button>, <command>, <fieldset>, <keygen>, <optgroup>, <option>, <select>, <textarea> and <input>. ...
...often browsers grey out such controls and it won't receive any browsing events, like mouse clicks or focus-related ones. the disabled attribute is supported by <button>, <command>, <fieldset>, <keygen>, <optgroup>, <option>, <select>, <textarea> and <input>. ...
...And 4 more matches
HTML attribute: required - HTML: Hypertext Markup Language
the boolean required attribute which, if present, indicates that the user must specify a value for the input before the owning
form can be submitted. 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. if the attribute is not included, the :optional pseudo class will match. the attribute is not supported or relevant to range and color, as both have default values. it is also not supported on hidden as it can not be expected that a user to fill out a
form that is hidden. nor is it supported on any of the button types, inc...
...ia-required="true" tells a screen reader that an element (any element) is required, but has no bearing on the optionality of the element. attribute interactions because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also specified. ...
... bearing on the optionality of the element. attribute interactions because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also specified. usability when including the required attribute, provide a visible indication near the control in
forming the user that the input, select or textarea is required. in addition, target required
form controls with the :required pseudo-class, styling them in a way to indicate they are required. this improves usability for sited user. assistive technology should in
form the user that the
form control in mandatory based on the required attribute, but adding aria-required="true" doesn't hurt, in case the browser / screen reader combination does not support required yet. constraint validation if ...
...And 4 more matches
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
he others is called the parent browsing context. the topmost browsing context — the one with no parent — is usually the browser window, represented by the window object. because each browsing context is a complete document environment, every <iframe> in a page requires increased memory and other computing resources. while theoretically you can use as many <iframe>s as you like, check for per
formance problems. content categories flow content, phrasing content, embedded content, interactive content, palpable content. permitted content none. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts embedded content. implicit aria role no corresponding role permitted ari...
...itted parents any element that accepts embedded content. implicit aria role no corresponding role permitted aria roles application, document, img, none, presentation dom interface htmliframeelement attributes this element includes the global attributes. allow specifies a feature policy for the <iframe>. see the article privacy, permissions, and in
formation security for details on security issues and how <iframe> works with feature policy to keep systems safe. allowfullscreen set to true if the <iframe> can activate fullscreen mode by calling the requestfullscreen() method. this attribute is considered a legacy attribute and redefined as allow="fullscreen". allowpaymentrequest set to true if a cross-origin <iframe> should be allowed to...
...es how the browser should load the iframe: eager: load the iframe immediately, regardless if it is outside the visible viewport (this is the default value). lazy: defer loading of the iframe until it reaches a calculated distance from the viewport, as defined by the browser. name a targetable name for the embedded browsing context. this can be used in the target attribute of the <a>, <
form>, or <base> elements; the
formtarget attribute of the <input> or <button> elements; or the windowname parameter in the window.open() method. referrerpolicy indicates which referrer to send when fetching the frame's resource: no-referrer: the referer header will not be sent. no-referrer-when-downgrade (default): the referer header will not be sent to origins without tls (https). origin: ...
...And 4 more matches
<input type="button"> - HTML: Hypertext Markup Language
an <input type="button"> elements' value attribute contains a domstring that is used as the button's label. ...
...ior (their cousins, <input type="submit"> and <input type="reset"> are used to submit and reset
forms, respectively). to make buttons do anything, you have to write javascript code to do the work. ...
...ype="reset"> are used to submit and reset
forms, respectively). to make buttons do anything, you have to write javascript code to do the work. ...
...And 4 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. only simple colors (without alpha channel) are allowed though css colors has more
formats, e.g. color names, functional notations and a hexadecimal
format with an alpha channel. the element's presentation may vary substantially from one browser and/or plat
form to another—it might be a simple textual input that automatically validates to ensure that the color in
formation is entered in the proper
format, or a plat
form-standard color picker, or some kind of custom color picker window. the source for this interactive example is stored in a github repository. if you'd like to...
... note: setting the value to anything that isn't a valid, fully-opaque, rgb color in hexadecimal notation will result in the value being set to #000000. in particular, you can't use css's standardized color names, or any css function synt...
...d 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. while you can input the color in either upper- or lower-case, it will be stored in lower-case
form. the value is never in any other
form, and is never empty. note: setting the value to anything that isn't a valid, fully-opaque, rgb color in hexadecimal notation will result in the value being set to #000000. in particular, you can't use css's standardized color names, or any css function syntax, to set the value. this makes sense when you keep in mind that html and css are separate languages ...
...And 4 more matches
<input type="range"> - HTML: Hypertext Markup Language
ring representation of the selected numeric value; use valueasnumber to get the value as a number. events change and input supported common attributes autocomplete, list, max, min, and step idl attributes list, value, and valueasnumber methods stepdown() and stepup() validation there is no pattern validation available; however, the following
forms of automatic validation are per
formed: if the value is set to something which can't be converted into a valid floating-point number, validation fails because the input is suffering from a bad input. the value won't be less than min. the default is 0. the value won't be greater than max. the default is 100. the value will be a multiple of step. the default is 1. value the value attribute...
...nt similar to the -moz-orient non-standard css property impacting the <progress> and <meter> elements, the orient attribute defines the orientation of the range slider. values include horizontal, meaing the range is rendered horizontally, and vertical, where the range is rendered vertically. note: the following input attributes do not apply to the input range: accept, alt, checked, dirname,
formaction,
formenctype,
formmethod,
formnovalidate,
formtarget, height, maxlength, minlength, multiple, pattern, placeholder, readonly, required, size, src, and width. any of these attributes, if included, will be ignored. examples while the number type lets users enter a number with optional constraints forcing their value to be between a minimum and a maximum value, it does require that they ent...
...ight. when supported, we will be able to make the range vertical, to slide up and down with css by declaring a height value greater than the width value. this is not actually implemented yet by any of the major browsers. (see firefox bug 981916, chrome bug 341071). it also, perhaps, may still be under discussion. in the meantime, we can make the range vertical by rotating it using using css trans
forms, or, by targeting each browser engine with their own method, which includes setting the appearance to slider-vertical, by using a non-standard orient attribute in firefox, or by changing the text direction for internet explorer and edge. consider this range control: <input type="range" id="volume" min="0" max="11" value="7" step="1"> screenshotlive sample this control is horizontal (at lea...
...And 4 more matches
<select>: The HTML Select element - HTML: Hypertext Markup Language
he text contained inside the element. you can include a selected attribute on an <option> element to make it selected by default when the page first loads. the <select> element has some unique attributes you can use to control it, such as multiple to specify whether multiple options can be selected, and size to specify how many options should be shown at once. it also accepts most of the general
form input attributes such as required, disabled, autofocus, etc. you can further nest <option> elements inside <optgroup> elements to create separate groups of options inside the dropdown. for further examples, see the native
form widgets: drop-down content. attributes this element includes the global attributes. autocomplete a domstring providing a hint for a user agent's autocomplete featur...
... disabled this boolean attribute indicates that the user cannot interact with the control. ...
...ts: drop-down content. attributes this element includes the global attributes. autocomplete a domstring providing a hint for a user agent's autocomplete feature. see the html autocomplete attribute for a complete list of values and details on how to use autocomplete. autofocus this boolean attribute lets you specify that a
form control should have input focus when the page loads. only one
form element in a document can have the autofocus attribute. ...
...And 4 more matches
HTTP conditional requests - HTTP
can be used. strong validation strong validation consists of guaranteeing that the resource is, byte to byte, identical to the one it is compared too. this is mandatory for some conditional headers, and the default for the others. strong validation is very strict and may be difficult to guarantee at the server level, but it does guarantee no data loss at any time, sometimes at the expense of per
formance. it is quite difficult to have a unique identifier for strong validation with last-modified. often this is done using an etag with the md5 hash of the resource (or a derivative). weak validation weak validation differs from strong validation, as it considers two versions of the document as identical if the content is equivalent. for example, a page that would differ from another only by a ...
... by a different date in its footer, or different advertising, would be considered identical to the other with weak validation. these same two versions are considered different when using strong validation. building a system of etags that creates weak validation may be complex, as it involves knowing the importance of the different elements of a page, but is very useful towards optimizing cache per
formance. conditional headers several http headers, called conditional headers, lead to conditional requests. these are: if-match succeeds if the etag of the distant resource is equal to one listed in this header. by default, unless the etag is prefixed with 'w/', it per
forms a strong validation. if-none-match succeeds if the etag of the distant resource is different to each listed in this hea...
... if-modified-since succeeds if the last-modified date of the distant resource is more recent than the one given in this header. ...
...And 4 more matches
Content negotiation - HTTP
note: some disadvantages of http content negotiation are explained in a wiki page from whatwg. html5 provides alternatives to content negotiation via, for example, the <source> element. ...
...iation is the most common way to agree on a specific representation of a resource, it has several drawbacks: the server doesn't have total knowledge of the browser. even with the client hints extension, it has not a complete knowledge of the capabilities of the browser. unlike reactive content negotiation where the client makes the choice, the server choice is always somewhat arbitrary. the in
formation by the client is quite verbose (http/2 header compression mitigates this problem) and a privacy risk (http fingerprinting) as several representations of a given resource are sent, shared caches are less efficient and server implementations are more complex. the accept header the accept header lists the mime types of media resources that the agent is willing to process. it is comma-separa...
...is optional. the accept-encoding header the accept-encoding header defines the acceptable content-encoding (supported compressions). the value is a q-factor list (e.g.: br, gzip;q=0.8) that indicates the priority of the encoding values. the default value identity is at the lowest priority (unless otherwise declared). compressing http messages is one of the most important ways to improve the per
formance of a web site, it shrinks the size of the data transmitted and makes better use of the available bandwidth; browsers always send this header and the server should be configured to abide to it and to use compression. the accept-language header the accept-language header is used to indicate the language preference of the user. it is a list of values with quality factors (like: "de, en;q=0.7")...
...And 4 more matches
Proxy Auto-Configuration (PAC) file - HTTP
to match https); in firefox, the preference is network.proxy.autoconfig_url.include_path. host the hostname extracted from the url. this is only for convenience; it is the same string as between :// and the first : or / after that. the port number is not included in this parameter. it can be extracted from the url when necessary. description returns a string describing the configuration. ...
...twork.proxy.autoconfig_url.include_path. host the hostname extracted from the url. this is only for convenience; it is the same string as between :// and the first : or / after that. the port number is not included in this parameter. it can be extracted from the url when necessary. description returns a string describing the configuration. the
format of this string is defined in return value
format below. ...
...nclude_path. host the hostname extracted from the url. this is only for convenience; it is the same string as between :// and the first : or / after that. the port number is not included in this parameter. it can be extracted from the url when necessary. description returns a string describing the configuration. the
format of this string is defined in return value
format below. ...
...And 4 more matches
Redirections in HTTP - HTTP
http has a special kind of response, called a http redirect, for this operation. redirects accomplish numerous goals: temporary redirects during site maintenance or downtime permanent redirects to preserve existing links/bookmarks after changing the site's urls, progress pages when uploading a file, etc. principle in http, redirection is triggered by a server sending a special redirect response to a request. redirect responses have status codes that start with 3, and a location header holding the url to redirect to. ...
...e site's urls, progress pages when uploading a file, etc. principle in http, redirection is triggered by a server sending a special redirect response to a request. redirect responses have status codes that start with 3, and a location header holding the url to redirect to. when browsers receive a redirect, they immediately load the new url provided in the location header. besides the small per
formance hit of an additional round-trip, users rarely notice the redirection. there are several types of redirects, sorted into three categories: permanent redirections temporary redirections special redirections permanent redirections these redirections are meant to last forever. they imply that the original url should no longer be used, and replaced with the new one.search engine robots,...
... content="0; url=https://example.com/"> </head> the content attribute should start with a number indicating how many seconds the browser should wait before redirecting to the given url. always set it to 0 for accessibility compliance. obviously, this method only works with html, and cannot be used for images or other types of content. javascript redirections redirections in javascript are per
formed by setting a url string to the window.location property, loading the new page: window.location = "https://example.com/"; like html redirections, this can't work on all resources, and obviously, this will only work on clients that execute javascript. on the other hand, there are more possibilities: for example, you can trigger the redirect only if some conditions are met. order of precedence ...
...And 4 more matches
A typical HTTP session - HTTP
connection if the transport layer is not tcp). the client sends its request, and waits for the answer. the server processes the request, sending back its answer, providing a status code and appropriate data. as of http/1.1, the connection is no longer closed after completing the third phase, and the client is now granted a further request: this means the second and third phases can now be per
formed any number of times. establishing a connection in client-server protocols, it is the client which establishes the connection. opening a connection in http means initiating a connection in the underlying transport layer, usually this is tcp. with tcp the default port, for an http server on a computer, is port 80. other ports can also be used, like 8000 or 8080. the url of a page to fetch cont...
...ample). a client request consists of text directives, separated by crlf (carriage return, followed by line feed), divided into three blocks: the first line contains a request method followed by its parameters: the path of the document, i.e. an absolute url without the protocol or domain name the http protocol version subsequent lines represent an http header, giving the server in
formation 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). these http headers
form a block which ends with an empty line. the final block is an optional data block, which may contain further data mainly used by the post method. example requests fetching the root page of develope...
...e: get / http/1.1 host: developer.mozilla.org accept-language: fr observe that final empty line, this separates the data block from the header block. as there is no content-length provided in an http header, this data block is presented empty, marking the end of the headers, allowing the server to process the request the moment it receives this empty line. 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 per
formed upon a resource. although they can also be nouns, these requests methods are sometimes referred as htt...
...And 4 more matches
BigInt.prototype.toLocaleString() - JavaScript
this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...e clone https://github.com/mdn/interactive-examples and send us a pull request. syntax bigintobj.tolocalestring([locales [, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose
formatting conventions should be used. in implementations that ignore the locales and options arguments, the locale used and the
form of the string returned are entirely implementation-dependent. ...
... bigintobj.tolocalestring([locales [, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose
formatting conventions should be used. in implementations that ignore the locales and options arguments, the locale used and the
form of the string returned are entirely implementation-dependent. see the intl.number
format() constructor for details on these parameters and how to use them. return value a string with a language-sensitive representation of the given bigint. per
formance when
formatting large numbers of numbers, it is better to create a number
format object and use the function provided by its number
format.
format property. examples using tolocalestring in basic use without specifying a locale, a...
...And 4 more matches
Date - JavaScript
date objects contain a number that represents milliseconds since 1 january 1970 utc. tc39 is working on temporal, a new date/time api. read more about it on the igalia blog and fill out the survey. it needs real-world feedback from web developers, but is not yet ready for production use! description the ecmascript epoch and timestamps a javascript date is fundamentally specified as the number of milliseconds that have elapsed since midnight on january 1, 1970, utc. this date and time is the same as the unix epoch, which is the predominant base value for computer-recorded date and time values. ...
...ate is not of the same value as the maximum safe integer (number.max_safe_integer is 9,007,199,254,740,991). instead, it is defined in ecma-262 that a maximum of ±100,000,000 (one hundred million) days relative to january 1, 1970 utc (that is, april 20, 271821 bce ~ september 13, 275760 ce) can be represented by the standard date object (equivalent to ±8,640,000,000,000,000 milliseconds). date
format and time zone conversions there are a number of methods available to obtain a date in various
formats, as well as to per
form time zone conversions. particularly useful are the functions that output the date and time in coordinated universal time (utc), the global standard time defined by the world time standard. (this time is historically known as greenwich mean time, as utc lies along the mer...
...d since january 1, 1970 00:00:00 utc, with leap seconds ignored. date.parse() parses a string representation of a date and returns the number of milliseconds since 1 january, 1970, 00:00:00 utc, with leap seconds ignored. note: parsing of strings with date.parse is strongly discouraged due to browser differences and inconsistencies. date.utc() accepts the same parameters as the longest
form of the constructor (i.e. 2 to 7) and returns the number of milliseconds since january 1, 1970, 00:00:00 utc, with leap seconds ignored. instance methods date.prototype.getdate() returns the day of the month (1–31) for the specified date according to local time. date.prototype.getday() returns the day of the week (0–6) for the specified date according to local time. date.prototype.get...
...And 4 more matches
Intl.PluralRules() constructor - JavaScript
the intl.pluralrules() constructor creates intl.pluralrules objects. syntax new intl.pluralrules([locales[, options]]) parameters locales optional. a string with a bcp 47 language tag, or an array of such strings. for the general
form and interpretation of the locales argument, see the intl page. options optional. an object with some or all of the following properties: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for in
formation about this option, see the intl page. type the type to use. possible values are: "cardinal" for cardinal numbers (refering to the quantity of things). this is the default value. "ordinal" for ordinal number (refering to the ordering or ranking of things, ...
...ificantdigits in the other. if at least one property from the second group is defined, then the first group is ignored. minimumintegerdigits the minimum number of integer digits to use. possible values are from 1 to 21; the default is 1. minimumfractiondigits the minimum number of fraction digits to use. ...
...e property from the second group is defined, then the first group is ignored. minimumintegerdigits the minimum number of integer digits to use. possible values are from 1 to 21; the default is 1. minimumfractiondigits the minimum number of fraction digits to use. ...
...And 4 more matches
String - JavaScript
some of the most-used operations on strings are to check their length, to build and concatenate them using the + and += string operators, checking for the existence or location of substrings with the indexof() method, or extracting substrings with the substring() method. ...
...also a string primitive'; const string3 = `yet another string primitive`; const string4 = new string("a string object"); string primitives and string objects can be used interchangeably in most situations. see "string primitives and string objects" below. string literals can be specified using single or double quotes, which are treated identically, or using the backtick character `. this last
form specifies a template literal: with this
form you can interpolate expressions. character access there are two ways to access an individual character in a string. the first is the charat() method: return 'cat'.charat(1) // returns "a" the other way (introduced in ecmascript 5) is to treat the string as an array-like object, where individual characters correspond to a numerical index: return '...
...ntroduced in ecmascript 5) is to treat the string as an array-like object, where individual characters correspond to a numerical index: return 'cat'[1] // returns "a" when using bracket notation for character access, attempting to delete or assign a value to these properties will not succeed. the properties involved are neither writable nor configurable. (see object.defineproperty() for more in
formation.) comparing strings in c, the strcmp() function is used for comparing strings. in javascript, you just use the less-than and greater-than operators: let a = 'a' let b = 'b' if (a < b) { // true console.log(a + ' is less than ' + b) } else if (a > b) { console.log(a + ' is greater than ' + b) } else { console.log(a + ' and ' + b + ' are equal.') } a similar result can be achieved u...
...And 4 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. as you may already know, array objects grow and shrink dynamically and can have any javascript value. javascript engines per
form optimizations so that these arrays are fast. ...
...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 it would be helpful for javascript code to be able to quickly and easily manipulate raw binary data. 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. however, typed arrays are not to be confused with normal arrays, as calling array.isarray() on a typed array returns false. moreover, not all methods available for normal arrays are supported by typed arrays (e.g. push and pop). buffers and views: typed array architecture to achieve maximum flexibility and efficiency, javascript typed a...
...typed array returns false. moreover, not all methods available for normal arrays are supported by typed arrays (e.g. push and pop). buffers and views: typed array architecture to achieve maximum flexibility and efficiency, javascript typed arrays split the implementation into buffers and views. a buffer (implemented by the arraybuffer object) is an object representing a chunk of data; it has no
format to speak of and offers no mechanism for accessing its contents. in order to access the memory contained in a buffer, you need to use a view. a view provides a context — that is, a data type, starting offset, and the number of elements — that turns the data into a typed array. arraybuffer the arraybuffer is a data type that is used to represent a generic, fixed-length binary data buffer.
...And 4 more matches
Paths - SVG: Scalable Vector Graphics
egins reading for the next command. all of the commands also come in two variants. an uppercase letter specifies absolute coordinates on the page, and a lowercase letter specifies relative coordinates (e.g., move 10px up and 7px to the left from the last point). coordinates in the d parameter are always unitless and hence in the user coordinate system. later, we will learn how paths can be trans
formed to suit other needs. line commands there are five line commands for <path> nodes. the first command is the "move to" or m, which was described above. it takes two parameters, a coordinate (x) and coordinate (y) to move to. if the cursor was already somewhere on the page, no line is drawn to connect the two positions. the "move to" command appears at the beginning of paths to specify where the...
...ht="200" xmlns="http://www.w3.org/2000/svg"> <path d="m10 10"/> <!-- points --> <circle cx="10" cy="10" r="2" fill="red"/> </svg> there are three commands that draw lines. the most generic is the "line to" command, called with l. l takes two parameters—x and y coordinates—and draws a line from the current position to a new position. l x y (or) l dx dy there are two abbreviated
forms for drawing horizontal and vertical lines. h draws a horizontal line, and v draws a vertical line. both commands only take one parameter since they only move in one direction. h x (or) h dx v y (or) v dy an easy place to start is by drawing a shape. we will start with a rectangle (the same type that could be more easily made with a <rect> element). it's composed of horizontal and verti...
...ommand, called with z. this command draws a straight line from the current position back to the first point of the path. it is often placed at the end of a path node, although not always. there is no difference between the uppercase and lowercase command. z (or) z so our path above could be shortened to: <path d="m 10 10 h 90 v 90 h 10 z" fill="transparent" stroke="black"/> the relative
forms of these commands can also be used to draw the same picture. relative commands are called by using lowercase letters, and rather than moving the cursor to an exact coordinate, they move it relative to its last position. for instance, since our box is 80×80, the <path> element could have been written as: <path d="m 10 10 h 80 v 80 h -80 z" fill="transparent" stroke="black"/> the path will mo...
...And 4 more matches
Referer header: privacy and security concerns - Web security
der. this article describes them, and offers advice on mitigating those risks. the referrer problem the referer (sic) header contains the address of the previous web page from which a link to the currently requested page was followed, which has lots of fairly innocent uses including analytics, logging, or optimized caching. however, there are more problematic uses such as tracking or stealing in
formation, or even just side effects such as inadvertently leaking sensitive in
formation. for example, consider a "reset password" page with a social media link in a footer. if the link was followed, depending on how in
formation was shared the social media site may receive the reset password url and may still be able to use the shared in
formation, potentially compromising a user's security. by the s...
... how can we fix this? much of this risk can be mitigated by sensible design of applications. ...
... how can we fix this? much of this risk can be mitigated by sensible design of applications. a sensible application would remove such risks by making password reset urls only usable for a single use, or when combined with a unique user token, and transmitting sensitive data in different ways. ...
...And 4 more matches
Transport Layer Security - Web security
parameters selected. this article's goal is to help you make these decisions to ensure the confidentiality and integrity communication between client and server. the mozilla operations security (opsec) team maintains a wiki entry with reference configurations for servers. the transport layer security (tls) protocol is the standard for enabling two networked applications or devices to exchange in
formation privately and robustly. applications that use tls can choose their security parameters, which can have a substantial impact on the security and reliability of data. this article provides an overview of tls and the kinds of decisions you need to make when securing your content. history when https was introduced, it was based on secure sockets layer (ssl) 2.0, a technology introduced by nets...
...with it: authentication authentication lets each party to the communication verify that the other party is who they claim to be. encryption data is encrypted while being transmitted between the user agent and the server, in order to prevent it from being read and interpreted by unauthorized parties. integrity tls ensures that between encrypting, transmitting, and decrypting the data, no in
formation is lost, damaged, tampered with, or falsified. a tls connection starts with a handshake phase where a client and server agree on a shared secret and important parameters, like cipher suites, are negotiated. once parameters and a data exchange mode where application data, such http, is exchanged. cipher suites the primary parameters that the tls handshake negotiates is a cipher suite. in...
...governs the encryption of data, separate negotiation methods are used for key agreement and authentication. different software might use different names for the same cipher suites. for instance, the names used in openssl and gnutls differ from those in the tls standards. the cipher names correspondence table on the mozilla opsec team's article on tls configurations lists these names as well as in
formation about compatibility and security levels. configuring your server correctly configuring your server is crucial. in general, you should try to limit cipher support to the newest ciphers possible which are compatible with the browsers you want to be able to connect to your site. the mozilla opsec guide to tls configurations provides more in
formation on recommended configurations. to assist y...
...And 4 more matches
system - Archive of obsolete content
query the add-on's environment and access arguments passed to it. usage querying your environment using the system module you can access environment variables (such as path), find out which operating system your add-on is running on and get in
formation about the host application (for example, firefox or fennec), such as its version. ...
...e querying your environment using the system module you can access environment variables (such as path), find out which operating system your add-on is running on and get in
formation about the host application (for example, firefox or fennec), such as its version. ...
...onment using the system module you can access environment variables (such as path), find out which operating system your add-on is running on and get in
formation about the host application (for example, firefox or fennec), such as its version. ...
...And 3 more matches
Multiple item extension packaging - Archive of obsolete content
an application or by an external program. every multiple item package must provide an install.rdf file (not old-style install.js!) and has the same requirements as an extension except as noted below. there is currently no feature to prevent or warn the user when installing an older version of an extension. multiple item package file layout the multiple item package file layout is a simplified
form of an installable bundle and requires a file extension of xpi. a multiple item package may contain both extensions (e.g. xpi file extension) and themes (e.g. jar file extension). the basic structure is shown below: /install.rdf install manifest /extension1.xpi extension /extension2.xpi extension /theme1.jar th...
...hen specifying em:targetapplication the minversion specified should be the highest minversion and the maxversion specified should be the lowest maxversion from all of the installable bundles contained by the multiple item package for the em:targetapplication. if this is not done, any items that are not compatible will not be installed unless a compatibility check discovers updated compatibility in
formation. installation installation can be per
formed using any of the existing methods used for installing extensions / themes. the same user interface is used for installing a multiple item package (i.e. the individual packages contained in the multiple item package will not be listed). this also allows displaying of signing in
formation for the multiple item package. if a manager (e.g. extension ...
...dd-ons. official references for toolkit api official references. do not add to this list without contacting benjamin smedberg. note that this page is included from the pages listed below. ...
...And 3 more matches
The Box Model - Archive of obsolete content
recommended to keep style code in the skin section of the chrome. as their names should make clear, you can control the flexibility boundaries of elements, thus preventing them from growing or shrinking too much. all css properties involving lengths should be handled with caution. we recommended that you use proportional units (em, %) instead of absolute units (px) whenever possible. using the
former allows the ui to scale proportionately depending on font size settings, which are often changed by users with accessibility limitations. a common exception to this rule is when your css is directly related to images, where you'll usually handle measurements in pixels (px). also, just like in html, you can control the dimensions of inflexible elements using the width and height css properties...
...t didn't have any available horizontal space; the container element needs to either be flexible itself, or have a fixed width larger than its contents. text there are 2 xul elements that are typically used for displaying text: label and description. their behavior is nearly identical, but they are meant to be used in different situations. the label element should be used mainly for text in xul
forms, such as the ones you see in the firefox options / preferences window. here's a typical usage of the label element: <label control="xulschoolhello-greeting-textbox" value="&xulschoolhello.typegreeting.label;" /> <textbox id="xulschoolhello-greeting-textbox" /> the label says something like "type a greeting message", and the textbox next to it allows the user to type the message. the cont...
...g message", and the textbox next to it allows the user to type the message. the control attribute links the label to the textbox. if the user clicks on the label, the textbox will be focused. also, if the user has a screen reader, the label will be read when the focus is placed on the textbox. the description element is used for the rest of the cases, where the text is only meant as additional in
formation and is not related to input elements. handling text in xul may seem simple, but it's actually quite a tricky subject. you always have to keep in mind that localized strings may be significantly longer in other languages, specially much longer than english strings. you should avoid using long blocks text, and also avoid designing your ui so that everything fits just right around text. you sh...
...And 3 more matches
Setting up an extension development environment - Archive of obsolete content
c firefox session. this will utilize distinctive development preferences in about:config. install firefox development extensions specifically for this new developer user profile. edit files in the extensions folder of this profile, and restart the application as this new developer profile. development profile the use of a separate user profile for development can be advantageous, averting per
formance degradation from development related settings, and further isolating personal data (such as bookmarks, extensions, and settings) from your testing environment. you could be running two instances of firefox simultaneously. note: for an extended guide on how to set up even more user profiles, take a look at multiple firefox profiles. this particularly comes in handy for the use of all current...
...lt and uncheck "don't ask at startup" checkbox. click "start firefox". now when you start any version of firefox you may choose any profile you like. development command flags as of gecko 2 (firefox 4), javascript files are cached ("fastload"). the -purgecaches command-line flag disables this behavior. alternatively, you can set the moz_purge_caches environment variable. see this bug for more in
formation. development preferences there is a set of development preferences that, when enabled, allows you to view more in
formation about application activity, thus making debugging easier. however, these preferences can degrade per
formance, so you may want to use a separate development profile when you enable these preferences. accessing firefox development preferences to change preference sett...
...references to change preference settings in thunderbird, open the "preferences" (unix) or "options" (windows) interface. on the "advanced" page, select the "general" tab then click the "config editor" button. recommended development preferences not all preferences are defined by default, and are therefore not listed by default. you will have to create new (boolean) entries for them. for more in
formation about mozilla preferences, refer to the mozillazine article on "about:config". tip: you can install either the developer profile or devprefs add-ons to handle setting these preferences automatically, and skip the rest of this section. devprefs can now be found at https://github.com/noitidart/devprefs. maxversion needs to be set in install.rdf javascript.options.showinconsole = true. l...
...And 3 more matches
Signing an XPI - Archive of obsolete content
uctions are outdated. for an extension to work in firefox it must be signed by mozilla, not by yourself. see signing and distributing your add-on. note: these instructions are for how to test with a self-signed certificate. see signing an extension for a practical guide. introduction this article describes how to sign your own firefox extensions with a code-signing certificate on a windows plat
form. it was developed from the linux article so you want to sign your xpi package? by mozdev group's pete collins. this article is a mirror of the original, with minor re
formatting, some new info and all links updated in march 2010. get network security services 1. download the latest network security services (nss) package from the mozilla ftp site at https://ftp.mozilla.org/pub/mozilla.or.../nss...
...o encrypt your keys. the password should be at least 8 characters long, and should contain at least one non-alphabetic character. enter new password: re-enter password: create a test certificate create a test certificate, using the -p option to set a password for the new certificate c:\projects\codesigning\> signtool -g mytestcert -d . -p"password" using certificate directory: . warning: per
forming this operation while the browser is running could cause corruption of your security databases. if the browser is currently running, you should exit the browser before continuing this operation. enter "y" to continue, or anything else to abort: y enter certificate in
formation. all fields are optional. acceptable characters are numbers, letters, spaces, and apostrophes. certificate common nam...
...l the signed extension either drag and drop or browse to and download the signed xpi. when the mozilla firefox software installation dialog appears the organisation name of the certificate will appear where firefox usually displays unsigned. image obtaining a valid software developer code-signing certificate warning: currently firefox expects xpi files to be signed with certificates that con
form to the older object signing convention, rather than the newer code signing convention. this means that firefox will refuse to install code signed via an intermediate certificate authority such as certum level i unless the user installs that intermediate ca certificate into firefox first. installing the intermediate ca certificate causes firefox to mark the intermediate code signing ca certificate...
...And 3 more matches
Creating a Firefox sidebar extension - Archive of obsolete content
introduction this article is a quick start for the creation of a new sidebar for firefox. what we will do is create a sidebar and register it so it will be available in the menu. ...
...plication. first a simple xul page is created. then the registration files are made and finally the sidebar is packed into an installable xpi file. pre-requisites this article is a quick start, it won't explain all elements of xul, packaging and xpi's. it's preferable you have some basic knowledge of how xul works and how firefox handles extensions. see building an extension for more detailed in
formation about structuring, packaging, and deploying extensions. packages extensions to firefox are installed with packages ("bundles"). an extension package usually contains a "content" provider, which contains the xul code and application logic. optionally locales and skins can be included. most additions are provided with a default tree structure, although not required it is recommended to use t...
...for the sidebar. example 2. chrome/locale/emptysidebar.dtd <!entity emptysidebar.title "emptysidebar"> <!entity openemptysidebar.commandkey "e"> <!entity openemptysidebar.modifierskey "shift accel"> the content folder includes our sidebar, the emptysidebar.xul is shown in example 3. it creates a page holding one label. other elements can be included, please read the xul tutorials for more in
formation. example 3. chrome/content/emptysidebar.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> <?xml-stylesheet href="chrome://browser/skin/browser.css" type="text/css" ?> <!doctype page system "chrome://emptysidebar/locale/emptysidebar.dtd"> <page id="sbemptysidebar" title="&emptysidebar.title;" xmlns="http://www.mozilla.org/keymaster/gatekee...
...And 3 more matches
JavaScript Client API - Archive of obsolete content
service at https://services.mozilla.com/tos/. ...
...you may not imply, either directly or by omission, that your third party client is produced or endorsed by mozilla. by providing access to the firefox sync apis, mozilla is not granting you a license to any of our trademarks. before starting before you start learning the javascript api, you should spend some time on http://docs.services.mozilla...
...ozilla.com/ reading about how the sync service operates. this will help fundamental understanding significantly. api location the sync javascript client api is defined in files in the services/sync/ directory of mozilla-central or similar repository. terminology syncengine the main sync client object. it's what starts all the magic. engine governs the synchronizing of a specific set of in
formation. e.g. there is an engine for bookmarks, tabs, history, preferences, etc. record piece of in
formation that gets synchronized. records are trans
formed to wbo's, uploaded to a collection in a sync server and eventually downloaded by other sync clients. tracker entity that tracks changes to data. each engine has a corresponding tracker which listens for changes to data or events it is intere...
...And 3 more matches
Space Manager Detailed Design - Archive of obsolete content
evel design document for an overview of the space manager, and as an introduction to the classes, structures and algorithms container in this, the detailed design document. nsspacemanager the space manager is the central class is a group of classes that manage the occupied and available space that exists in horizontal bands across a canvas. the primary goal of the space manager is to provide in
formation about those bands of space to support the css notion of floated elements. there are three important parts to the space manager api: the parts that deal with the coordinate space of the space manager, the parts that deal with the regions managed by the space manager, and the parts that manage float impact intervals. the class nsspacemanager is declared in the file nsspacemanger.h. the class i...
...alend + my); } prbool intersectsdamage(nscoord aintervalbegin, nscoord aintervalend) { return mfloatdamage.intersects(aintervalbegin + my, aintervalend + my); } #ifdef debug /** * dump the state of the spacemanager out to a file */ nsresult list(file* out); void sizeof(nsisizeofhandler* ahandler, pruint32* aresult) const; #endif private: // structure that maintains in
formation about the region associated // with a particular frame struct frameinfo { nsiframe* const mframe; nsrect mrect; // rectangular region frameinfo* mnext; frameinfo(nsiframe* aframe, const nsrect& arect); #ifdef ns_build_refcnt_logging ~frameinfo(); #endif }; // doubly linked list of band rects struct bandrect : prcliststr { nscoord mlef...
... this space manager is rooted on. the coordinate space of this space manager is relative to the frame passed in to the constructor. nsspacemanager(nsipresshell* apresshell, nsiframe* aframe); ~nsspacemanager(); operators 'new' and 'delete' are overridden to support a recycler. space manager instances come and go pretty frequently, and this recycler prevents excessive heap allocations and the per
formance penalties associated with it. the #define ns_space_manager_cache_size is used to control the number of space manager instances that can be present in the recycler, currently 4. if more than ns_space_manager_cache_size are allocated at a time,then standard allocation is used. void* operator new(size_t asize); void operator delete(void* aptr, size_t asize); a static method is used to shutdown...
...And 3 more matches
Supporting private browsing mode - Archive of obsolete content
this interface is deprecated since firefox 20, and will probably be completely removed in firefox 21.see supporting per-window private browsing for details. firefox 3.5 introduced private browsing mode, in which potentially private in
formation is not recorded. this includes cookies, history in
formation, download in
formation, and so forth. ...
... doing this is quite easy, using the nsiprivatebrowsingservice interface. detecting private browsing mode determining whether or not the user is currently in private browsing mode is simple. ...
... databases are created to be used for cookies and local storage; these databases are thrown away when private browsing mode is turned off, and the regular databases are re-activated. the temporary cookie and local storage databases start out empty. extensions that may record potentially private in
formation may wish to hook into the private browsing service so that they can avoid saving personal in
formation when private browsing mode is enabled. doing this is quite easy, using the nsiprivatebrowsingservice interface. detecting private browsing mode determining whether or not the user is currently in private browsing mode is simple. just check the value of the privatebrowsingenabled attribute on the nsiprivatebrowsingservice service. var pbs = components.classes["@mozilla.org/privatebrowsing;1...
...And 3 more matches
Tamarin Build System Documentation - Archive of obsolete content
the build stops. the next phase is started when all slaves have completed the previous phase successfully. the compile phase compiles all of the tamarin source code and builds all of the shell executables, any errors will stop the phase and a red box will appear on the slave where the error occurred. the compile phase takes about 20-25 minutes. the smoke phase runs a set of tests on each plat
form until 2 minute is exceeded. the set of smoke tests can contain any shell build and any test suite (including per
formance). the smoke test list is constantly updated to contain the most recent failures, most frequent failures, and the newest testcases. the idea is to catch test failures in a few minutes rather than running the complete test run (1h 45m). the smoke test including downloading th...
...than running the complete test run (1h 45m). the smoke test including downloading the shell takes about 3-4 minutes. the test phase runs all functional testcases including acceptance tests, cmdline tests, and selftests. the acceptance tests are the majority and are run on all shells (release, release-debugger, debug, debug-debugger). the test phase takes approximately 1 hour 45 minutes. the per
formance and deep phases do not run synchronously. the phases run when slaves are available and the other phases do not wait for completion to start the next build. how are builds triggered? checkins (hg push) to http://hg.mozilla.org/tamarin-redux and sandbox requests will trigger a buildbot build when all build slaves are idle the next build begins before the build begins buildbot waits for 2 m...
...; cd scripts edit environment.sh, change the basedir and buildsdir settings (around line 51) basedir=~/hg/tamarin-redux (path to my test repository) (next line) buildsdir=~/hg/builds (a directory to store downloaded builds) always set current working directory to the scripts di...
...And 3 more matches
Uploading and Downloading Files - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file in
formation | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the plat
form (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. the io object and stream objects can be used to ...
...orted api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. the io object and stream objects can be used to upload files to servers in various ways. the exact method depends on the type of upload that you wish to per
form. ...
...nd save dialogs, reading textual data, writing textual data, list of file-related error codes. the io object and stream objects can be used to upload files to servers in various ways. the exact method depends on the type of upload that you wish to per
form. http file upload some web sites allow one to upload a file. this is done by using an html <input> element using the file type from within a
form. when the user selects a file, it can be uploaded to a server. this operation can also be per
formed via a script using the xmlhttprequest object. ...
...And 3 more matches
Menus - Archive of obsolete content
by setting the type attribute of the button to 'menu'. instead of creating a standard button, this will create a button with a small arrow or other indicator. clicking the button will display the menu, allowing a command to be selected. this type of menu would be used when you want to have a set of commands yet don't want to use a menu bar, for example in a dialog box. see menu buttons for more in
formation. toolbarbutton toolbar buttons can also support menus. this works just like it does for other buttons. see menu buttons for more in
formation. menulist a menulist is used when you wish the user to select from a list of items. for this type of menu, one of the items within it is selected. when another item is selected, the label of the item is set as the label of the menulist. other user i...
...ag. usually, the main window for an application will have a menubar across the top of the window. on the macintosh, the menubar is placed along the top of the screen. you do not have to do anything to handle this difference. the first menubar encountered when parsing the xul window will be used as the main menu bar for the window, and on the macintosh, will be hidden from the main window and trans
formed into a native menu bar at the top of the screen. for this reason, a window should only have one menu bar, however, each window can have a different menu bar. the menubar should have menu elements within it, one for each menu. the example below shows a menubar with three menus. <menubar id="sample-menubar"> <menu id="file-menu" label="file"> ... </menu> <menu id="tools-menu" label="t...
...abel="file"> ... </menu> <menu id="tools-menu" label="tools"> ... </menu> <menu id="help-menu" label="help"> ... </menu> </menubar> it's possible to place other elements on a menubar, but remember that they will not appear on a macintosh. so you should ensure that the functionality of these elements is avialable elsewhere. or, you could write code that handles multiple plat
forms in different ways. if you do place other elements on a menubar, you may wish to align them on the far side rather than next to the other menus. you can do this by adding a flexible spacer. <menubar id="sample-menubar"> <menu id="file-menu" label="file"> ... </menu> <spacer flex="1"/> <image src="logo.png"/> </menubar> in this example, a logo image is placed on the end of a menubar...
...And 3 more matches
Keyboard Shortcuts - Archive of obsolete content
creating a keyboard shortcut xul provides methods in which you can define keyboard shortcuts. we've already seen in the section on menus that we can define an attribute called accesskey which specifies the key which a user can press to activate the menu or menu item. in the example below, the file menu can be selected by pressing alt + f together (or some other key combination for a specific plat
form). once the file menu is open, the close menu item can be selected by pressing c. example 1 : source view <menubar id="sample-menubar"> <menu id="file-menu" label="file" accesskey="f"> <menupopup id="file-popup"> <menuitem id="close-command" label="close" accesskey="c"/> </menupopup> </menu> </menubar> you can also use the accesskey attribute on buttons. when the key is press...
...acintosh. shift the user must press the shift key. os the user must press the win key. this is the super key or the hyper key on linux. if this value is used, typically the key combination conflicts with system wide shortcut keys. so, you shouldn't use this value as far as possible. accel the user must press the special accelerator key. the key used for keyboard shortcuts on the user's plat
form. usually, this would be the value you would use. access the user must press the special access key. the key used for access keys on the user's plat
form. your keyboard won't necessarily have all of the keys, in which case they will be mapped to modifier keys that you do have. the key element must be placed inside a keyset element. this element is designed for holding a set of key elements, wh...
...er's plat
form. your keyboard won't necessarily have all of the keys, in which case they will be mapped to modifier keys that you do have. the key element must be placed inside a keyset element. this element is designed for holding a set of key elements, which serves to group all of the key definitions in one place in a file. any key elements outside of a keyset element will not work. each plat
form generally uses a different key for keyboard shortcuts. for example, windows uses the control key and the macintosh uses the command key. it would be inconvenient to define separate key elements for each plat
form. luckily, there is a solution. the modifier accel refers to the special plat
form-specific key used for shortcuts. it works just like the other modifiers, but won't be the same on every pl...
...And 3 more matches
More Event Handlers - Archive of obsolete content
other arguments can be passed to a listener function, if required. the event object has a number of properties which can be examined during an event. ...
... other arguments can be passed to a listener function, if required. the event object has a number of properties which can be examined during an event. ...
...nter is moved onto an element. you could use this to highlight the element, however css provides a way to do this automatically so you shouldn't do it with an event. you might, however, want to display some help text on a status bar. mousemove called when the mouse pointer is moved while over an element. the event may be called many times as the user moves the mouse so you should avoid per
forming lengthy tasks from this handler. mouseout called when the mouse pointer is moved off of an element. you might then unhighlight the element or remove status text. there are also a set of drag related events, which occur when the user holds down a mouse button and drags the mouse around. those events are described in drag and drop. mouse button event properties when a mouse button event...
...And 3 more matches
Trees - Archive of obsolete content
the listbox, where individual listitem and listcell tags are used to specify the rows in the listbox. in a tree, all of the data to be displayed is supplied by a separate object, called a tree view. when it comes time to display a cell, the tree widget will call out to this tree view to determine what to display, which in turn will be drawn by the tree. the tree is smart enough to only ask for in
formation from the view for those rows that need to be displayed. this allows the view to be optimized such that it only needs to load the data for displayed content. for instance, a tree might have thousands of rows, yet most of them will be scrolled off the border of the tree, hidden from view. this means that the tree is scalable to any number of rows without any per
formance problems. of course, th...
...e rows that need to be displayed. this allows the view to be optimized such that it only needs to load the data for displayed content. for instance, a tree might have thousands of rows, yet most of them will be scrolled off the border of the tree, hidden from view. this means that the tree is scalable to any number of rows without any per
formance problems. of course, this is independant of the per
formance of the view object itself. a tree view is an object which implements the nsitreeview interface. this interface contains thirty properties and functions which you may implement. these functions will be called by the tree as necessary to retrieve data and state about the tree. for instance, the getcelltext() function will be called to get the label for a particular cell in the tree. an advant...
...trees can be created with the tree element, which is described in the following sections. there are also two elements used to define the columns to be displayed in the tree. tree this is the outer element of a tree. treecols this element is a placeholder for a set of treecol elements. treecol this is used to declare a column of the tree. by using this element, you can specify additional in
formation about how the data in the columns are sorted and if the user can resize the columns. you should always place an id attribute on a column, as mozilla uses the ids to identify the columns when rearranging and hiding them. this is no longer required in mozilla 1.8 and later, but it is still a good idea to use ids on columns. treechildren this contains the main body of the tree where the indiv...
...And 3 more matches
button - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a button that can be pressed by the user. event handlers can be used to trap mouse, keyboard and other events. it is typically rendered as a grey outset rectangle. you can specify the label of the button using the label attribute or by placing content inside the button. more in
formation is available in the xul tutorial. attributes accesskey, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, icon, image, label, open, orient, tabindex, type properties accesskey, accessibletype, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, image, label, open, orient, tabindex, type examples <button label="press me" oncommand="alert...
...he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
...s is reverse of the order in which they appear in the xul code. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
...And 3 more matches
window - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] describes the structure of a top-level window. it is the root node of a xul document. it is by default a horizontally oriented box. as it is a box, all box attributes can be used. by default, the window will have a plat
form-specific frame around it. to set an icon for the window, create a plat
form-specific icon file <windowid>.ico and/or <windowid>.xpm and place or install these files into the <mozilla-directory>/chrome/icons/default/ directory. the <windowid> is the value of the id attribute on the window. this allows you to have a different icon for each window. without including the css file at "chrome://global/skin/", the window will not be stylized and will be invisible and glitchy when ...
...ndow. this allows you to have a different icon for each window. without including the css file at "chrome://global/skin/", the window will not be stylized and will be invisible and glitchy when opened as a dialog. note: starting in gecko 1.9.2, you can detect when a window is activated or deactivated by watching for the "activate" and "deactivate" events. see window activation events. more in
formation is available in the xul tutorial. attributes accelerated, chromemargin, disablechrome, disablefastfind, drawintitlebar, fullscreenbutton, height, hidechrome, id, lightweightthemes, lightweightthemesfooter, screenx, screeny, sizemode, title, width, windowtype examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <!-- run this example using cop...
...ylesheet 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!! ...
...And 3 more matches
Getting started with XULRunner - Archive of obsolete content
there is an article with a more complicated approach to building xulrunner applications at creating xulrunner apps with the mozilla build system. if you need to change xulrunner itself or integrate it with external binaries you may need to read that article. step 1: download xulrunner you can find a download link on the main xulrunner page here on mdn. ...
...buntu, ...), from version 11.10 (oneiric ocelot), xulrunner is not longer maintained and doesn't exist in ubuntu repository. therefore, either you need to compile xulrunner manually or download a binary release from mozilla's ftp server. one way to achieve this is to run the following script everytime you want to install a new version: firefox_version=`grep -po "\d{2}\.\d+" /usr/lib/firefox/plat
form.ini` arch=`uname -p` xurl=https://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/$firefox_version/runtimes/xulrunner-$firefox_version.en-us.linux-$arch.tar.bz2 cd /opt sudo sh -c "wget -o- $xurl | tar -xj" sudo ln -s /opt/xulrunner/xulrunner /usr/bin/xulrunner sudo ln -s /opt/xulrunner/xpcshell /usr/bin/xpcshell you could also save this script to a file for convenience. note: if you are us...
.../releases/$firefox_version/runtimes/xulrunner-$firefox_version.en-us.linux-$arch.tar.bz2 cd /opt sudo sh -c "wget -o- $xurl | tar -xj" sudo ln -s /opt/xulrunner/xulrunner /usr/bin/xulrunner sudo ln -s /opt/xulrunner/xpcshell /usr/bin/xpcshell you could also save this script to a file for convenience. note: if you are using firefox build from ubuntuzilla repository, replace /usr/lib/firefox/plat
form.ini with /opt/firefox/plat
form.ini. step 2: install xulrunner on windows, unzip the archive someplace reasonable. i unzipped it to a new c:\program files\xulrunner folder. on the mac, extract the tar.bz2 archive, which contains xulrunner as xul.framework. copy this to the /library/frameworks directory, or another location of your choice. on linux, you only need to unpack the archive if you a...
...And 3 more matches
External resources for plugin creation - Archive of obsolete content
d tools there are several open source projects designed to assist with the creation of npapi plugins. please note that even when using these, it is still a good idea to have an understanding of what is going on under the hood, regardless of the level of abstraction provided. framework: firebreath project home page project history description (from the project creators): firebreath is a cross-plat
form browser plugin framework written in c++. plugins created with firebreath work on all major browsers, including firefox 3.0 and later. plat
forms supported include windows, linux, and mac os x (intel). feature highlights include thread safety checks, unicode support (with std::wstring), activex support, built-in drawing model negotiation for mac, automatic type conversion (including javascript a...
... windows, linux, and mac os x (intel). feature highlights include thread safety checks, unicode support (with std::wstring), activex support, built-in drawing model negotiation for mac, automatic type conversion (including javascript arrays and objects), advanced security features, and more. supported development environments are visual studio on windows, xcode on mac, and gcc on linux. all plat
forms rely on cmake for easy cross-plat
form builds. project: nixysa project home page description (from the home page): nixysa is a framework written in python to automatically generate glue code for npapi plugins (plugins for browsers such as google chrome or firefox), letting you easily expose c++ classes to javascript from a simple idl representation. nixysa was originally conceived for the needs o...
... google chrome or firefox), letting you easily expose c++ classes to javascript from a simple idl representation. nixysa was originally conceived for the needs of o3d, but is flexible enough to support a wide range of use cases. project: juce project home page description (from the home page): juce (jules' utility class extensions) is an all-encompassing c++ class library for developing cross-plat
form applications. it contains pretty much everything you're likely to need to create most applications, and is particularly good for creating highly-specialised uis and for handling graphics and sound. supported development environments are xcode, visual studio, gcc (and probably any other modern c++ compiler) browser plugins can be built as npapi (mac/windows), or activex (windows). project: qtbro...
...And 3 more matches
NPEmbedPrint - Archive of obsolete content
mac os: thprint unix: pointer to a npprintcallbackstruct. description the npp_print function passes a pointer to an npprint object (previously allocated by the browser) to the plug-in. ...
... mac os: thprint unix: pointer to a npprintcallbackstruct. description the npp_print function passes a pointer to an npprint object (previously allocated by the browser) to the plug-in. ...
... mac os: thprint unix: pointer to a npprintcallbackstruct. description the npp_print function passes a pointer to an npprint object (previously allocated by the browser) to the plug-in. ...
...And 3 more matches
Encryption and Decryption - Archive of obsolete content
encryption is the process of trans
forming in
formation so it is unintelligible to anyone but the intended recipient. decryption is the process of trans
forming encrypted in
formation so that it is intelligible again. a cryptographic algorithm, also called a cipher, is a mathematical function used for encryption or decryption. in most cases, two related functions are employed, one for encryption and the other for decryption. with most modern cryptography, the ability to keep encrypted in
formation secret is based not on the cryptographic algorithm, which is widely known, but on a number called a key that must be used with the algorithm to produce an encrypted result or to decrypt previously encrypted in
formation. decryption with the correct key is simple. decryption without the correct key...
...m the decryption key and vice versa. with most symmetric algorithms, the same key is used for both encryption and decryption, as shown in figure 1. implementations of symmetric-key encryption can be highly efficient, so that users do not experience any significant time delay as a result of the encryption and decryption. symmetric-key encryption also provides a degree of authentication, since in
formation encrypted with one symmetric key cannot be decrypted with any other symmetric key. thus, as long as the symmetric key is kept secret by the two parties using it to encrypt communications, each party can be sure that it is communicating with the other as long as the decrypted messages continue to make sense. symmetric-key encryption is effective only if the symmetric key is kept secret by th...
...bes how this confirmation process works. key length and encryption strength breaking an encryption algorithm is basically finding the key to the access the encrypted data in plain text. for symmetric algorithms, breaking the algorithm usually means trying to determine the key used to encrypt the text. for a public key algorithm, breaking the algorithm usually means acquiring the shared secret in
formation between two recipients. one method of breaking a symmetric algorithm is to simply try every key within the full algorithm until the right key is found. for public key algorithms, since half of the key pair is publicly known, the other half (private key) can be derived using published, though complex, mathematical calculations. manually finding the key to break an algorithm is called a brute...
...And 3 more matches
Building a Theme - Archive of obsolete content
etadata --> <em:name>my theme</em:name> <em:internalname>sample</em:internalname> <em:description>a test extension</em:description> <em:creator>your name here</em:creator> <em:homepageurl>http://www.example.com/</em:homepageurl> </description> </rdf> sample@example.net - the id of the extension. this is a value you come up with to identify your extension in email address
format (note that it should not be your email). make it unique. you could also use a guid. note: this parameter must be in the
format of an email address, although it does not have to be a valid email address. (example.example.example) 4 - the type of the add-on. '4' declares that it is installing a theme. if you were to install an extension it would be 2 (see install manifests#type for other type co...
... 39.* - the maximum version of firefox you're saying this extension will work with. set this to be no newer than the newest currently available version! in this case, "39.*" indicates that the extension works with firefox 39 and any subsequent 39.x release. themes are compatible by default, unless you set strict compatibility mode for your theme. if you get a message that the install.rdf is mal
formed, it is helpful to load it into firefox using the file->open file command and it will report xml errors to you. see install manifests for a complete listing of the required and optional properties. save the file. styling the browser's ui with css firefox's user interface is written in xul and javascript. xul is an xml grammar that provides user interface widgets like buttons, menus, toolba...
...bars. select the node finding tool (the arrow-plus-box in the top-left corner of the dom inspector), and click on any unused space on a toolbar. this should select a node of type "xul:toolbar" in the dom inspector. from here, you can play around with various different stylings for the toolbar and associated elements. by default, the right pane should show the dom node, which has useful styling in
formation like the css class and node id. the element itself is of id navigator-toolbox, with no idea. to change its style within our theme, we need to write a selector rule to select this class. open up the file chrome/browser/browser.css in your theme. search this file for the #navigator-toolbox selector, and add a background: orange; rule to it. save the file. chrome uris next, we have to tel...
...And 3 more matches
Windows Media in Netscape - Archive of obsolete content
[;optional comments]</em>) the "vendor comment" (ax) following the "vendor version" netscape/7.1 is an indicator that the browser supports the windows media player activex control. for example on windows xp, netscape 7.1's user agent string may be: mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.4) gecko/20030624 netscape/7.1 (ax) if the client was customized by a third party, additional in
formation may be present in the "vendor comment" area of the user agent string. for example: mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.4) gecko/20030624 netscape/7.1 (ax; promostring) although geckoactivexobject is currently available only in netscape 7.1 on windows, it may be the case in the future that it will be available in other gecko-based browsers on other operating systems. detecti...
...cape 7.1. in code deployed for ie, invocations of the sort player.controls.play(); are common, where player is the id of the object element. in netscape 7.1, plugins and activex controls are not exposed to the global namespace, but rather as properties of the document object. accessing properties and controls from the document object works well with ie also, and thus, in order to deploy cross-plat
form code, avoiding syntax that makes use of global namespace is important. here, for example, is a code snippet that works equally well on both netscape 7.1 and ie: <object id="player" height="0" width="0" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6"> <param name="autostart" value="true"> </object> <input type="button" name="playmedia" value="play" onclick="startmediaup()"> <input type="...
...yer) { player.currentplaylist = player.mediacollection.getbyname('preludesteel'); player.controls.play(); } callbacks from within windows media player to web pages: script for event netscape 7.1 supports ie's <script for="activexcontrol" event="activexcontrolevent"> script elements. no netscape browser prior to netscape 7.1 has supported this non-standard way of writing scripts that handle in
formation sent by a plugin or control. a good illustration of the use of this non-standard script element syntax is in creating closed captioning of media content. automatic closed captioning does not work in netscape 7.1 as it does in ie. in ie, a named html element such as a div may be given to the windows media player control and it will be automatically updated with caption data. this does not wor...
...And 3 more matches
Explaining basic 3D theory - Game development
ordinate system used to calculate their position. webgl uses the right-hand coordinate system — the x axis points to the right, the y axis points up, and the z axis points out of the screen, as seen in the above diagram. objects different types of objects are built using vertices. a vertex is a point in space having its own 3d position in the coordinate system and usually some additional in
formation that defines it. every vertex is described by these attributes: position: identifies it in a 3d space (x, y, z). color: holds an rgba value (r, g and b for the red, green, and blue channels, alpha for transparency — all values range from 0.0 to 1.0). normal: a way to describe the direction the vertex is facing. texture: a 2d image that the vertex can use to decorate the surface it is...
...osition: identifies it in a 3d space (x, y, z). color: holds an rgba value (r, g and b for the red, green, and blue channels, alpha for transparency — all values range from 0.0 to 1.0). normal: a way to describe the direction the vertex is facing. texture: a 2d image that the vertex can use to decorate the surface it is part of instead of a simple color. you can build geometry using this in
formation — here is an example of a cube: a face of the given shape is a plane between vertices. for example, a cube has 8 different vertices (points in space) and 6 different faces, each constructed out of 4 vertices. a normal defines which way the face is directed in. also, by connecting the points we're creating the edges of the cube. the geometry is built from a vertex and the face, while mat...
... from vertices and can be a triangle, point or line. a fragment: a 3d projection of a pixel, which has all the same attributes as a pixel. a pixel: a point on the screen arranged in the 2d grid, which holds an rgba color. vertex and fragment processing are programmable — you can write your own shaders that manipulate the output. vertex processing vertex processing is about combining the in
formation about individual vertices into primitives and setting their coordinates in the 3d space for the viewer to see. it's like taking a photo of the given scenery you have prepared — you have to place the objects first, configure the camera, and then take the shot. there are four stages to this processing: the first one involves arranging the objects in the world, and is called model transfor...
...And 3 more matches
3D games on the Web - Game development
ascript that is hardware accelerated. documentation and browser support the webgl project documentation and specification is maintained by the khronos group, not the w3c as with most of the web apis. support on modern browsers is very good, even on mobile, so you don't have to worry about that too much. the main browsers are all supporting webgl and all you need to focus on is optimizing the per
formance on the devices you use. there's an ongoing effort on releasing webgl 2.0 (based on opengl es 3.0) in the near future, which will bring many improvements and will help developers build games for the modern web using current, powerful hardware. explaining the basic 3d theory the basics of 3d theory centers around shapes represented in a 3d space, with a coordinate system being used to calcul...
... (based on opengl es 3.0) in the near future, which will bring many improvements and will help developers build games for the modern web using current, powerful hardware. explaining the basic 3d theory the basics of 3d theory centers around shapes represented in a 3d space, with a coordinate system being used to calculate their positions. see our explaining basic 3d theory article for all the in
formation you need. advanced concepts you can do a lot more with webgl. there are some advanced concepts which you should dive into and learn more about — like shaders, collision detection, or the latest hot topic: virtual reality on the web. shaders it's worth mentioning shaders, which are a separate story on their own. shaders use glsl, a special opengl shading language, with syntax similar to...
...re about — like shaders, collision detection, or the latest hot topic: virtual reality on the web. shaders it's worth mentioning shaders, which are a separate story on their own. shaders use glsl, a special opengl shading language, with syntax similar to c, that is executed directly by the graphics pipeline. ...
...And 3 more matches
Desktop mouse and keyboard controls - Game development
we'll look at this below. ...
...irst, we'd need an event listener to listen for the pressed keys: document.addeventlistener('keydown', keydownhandler, false); document.addeventlistener('keyup', keyuphandler, false); whenever any key is pressed down, we're executing the keydownhandler function, and when press finishes we're executing the keyuphandler function, so we know when it's no longer pressed. to do that we'll hold the in
formation on whether the keys we are interested in are pressed or not: var rightpressed = false; var leftpressed = false; var uppressed = false; var downpressed = false; then we will listen for the keydown and keyup events and act accordingly in both handler functions. inside them we can get the code of the key that was pressed from the keycode property of the event object, see which key it is, and ...
...nt.keycode == 40) { downpressed = true; } else if(event.keycode == 38) { uppressed = true; } } the keyuphandler looks almost exactly the same as the keydownhandler above, but instead of setting the pressed variables to true, we would set them to false. ...
...And 3 more matches
Mobile touch controls - Game development
llows: touchstart is fired when the user puts a finger on the screen. touchmove is fired when they move the finger on the screen while touching it touchend is fired when the user stops touching the screen touchcancel is fired when a touch is cancelled, for example when the user moves their finger outside of the screen. note: the touch events reference article provides more examples and in
formation. pure javascript demo let's implement the mobile support in a little demo available on github, so we can move the player's ship by touching the screen on a mobile device. we will use two events: touchstart and,touchmove both handled by one function. why? the function touchhandler will assign proper variables to the ship's position so that we can use it for both cases: when the player tou...
...anvas would be dragged around the page, which would show the browser scroll bars and look messy. touch events in phaser we don't have to do this on our own; frameworks like phaser offer systems for managing touch events for us — see managing the touch events. pointer theory a pointer represents a single finger on the touch screen. phaser starts two pointers by default, so two fingers can per
form an action at once. captain rogers is a simple game — it can be controlled by two fingers, the left one moving the ship and the right one controlling the ship's gun. there's no multitouch or gestures — everything is handled by single pointer inputs. you can add more pointers to the game by using; this.game.input.addpointer up to ten pointers can be managed simultaneously. the most recently us...
...s. input events instead of using the pointers directly it is also possible to listen for this.game.input events, like ondown, onup, ontap and onhold: this.game.input.ondown.add(itemtouched, this); function itemtouched(pointer) { // do something } the itemtouched() function will be executed when the ondown event is dispatched by touching the screen. the pointer variable will contain the in
formation about the pointer that activated the event. this approach uses the generally available this.game.input object, but you can also detect the actions on any game objects like sprites or buttons by using oninputover, oninputout, oninputdown, oninputup, ondragstart, or ondragstop: this.button.events.oninputover.add(itemtouched, this); function itemtouched(button, pointer) { // do something...
...And 3 more matches
Debugging CSS - Learn web development
h files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn the basics of what browser devtools are, and how to do simple inspection and editing of css. how to access browser devtools the article what are browser developer tools is an up-to-date guide explaining how to access the tools in various browsers and plat
forms. while you may choose to mostly develop in a particular browser, and therefore will become most familiar with the tools included in that browser, it is worth knowing how to access them in other browsers. this will help if you are seeing different rendering between multiple browsers. you will also find that browsers have chosen to focus on different areas when creating their devtools. for exampl...
...{ color: hotpink; font-weight: bold; } above that in the stylesheet however is a rule with a .special selector: .special { color: orange; } as you will recall from the lesson on cascade and inheritance where we discussed specificity, class selectors are more specific than element selectors, and so this is the value that applies. ...
...take a look at the main devtools section, and for more detail on the things we have briefly covered in this lesson see the how to guides. ...
...And 3 more matches
CSS FAQ - Learn web development
style with that style, but you might want to add more later. use an id-specific style when you need to restrict the applied styling rules to one specific block or element. this style will only be used by the element with that particular id. ...
... to connect label and
form elements or for styling elements that must be semantically unique): using classes makes your styling extensible — even if you only have one element to style with a particular ruleset now, you might want to add more later. classes allow you to style multiple elements, therefore they can lead to shorter stylesheets, rather than having to write out the same styling in
formation in multiple rules that use id selectors. shorter stylesheets are more per
formant. class selectors have lower specificity than id selectors, so are easier to override if needed. note: see selectors for more in
formation. how do i restore the default value of a property? initially css didn't provide a "default" keyword and the only way to restore the default value of a property is to exp...
...roperty. /* heading default color is black */ h1 { color: red; } h1 { color: initial; } how do i derive one style from another? css does not exactly allow one style to be defined in terms of another. (see eric meyer's note about the working group's stance). however, assigning multiple classes to a single element can provide the same effect, and css variables now provide a way to define style in
formation in one place that can be reused in multiple places. how do i assign multiple classes to an element? html elements can be assigned multiple classes by listing the classes in the class attribute, with a blank space to separate them. <style type="text/css"> .news { background: black; color: white; } .today { font-weight: bold; } </style> <div class="news today"> ... content of today's news ...
...And 3 more matches
Styling links - Learn web development
a:active { } this order is important because the link styles build on one another, for example the styles in the first rule will apply to all the subsequent ones, and when a link is being activated, it is also being hovered over. if you put these in the wrong order, things won't work properly. to remember the order, you could try using a mnemonic like love fears hate. ...
...a couple of color variations on unvisited and visited links, so they are distinct. the next two rules use a:focus and a:hover to set focused and hovered links to have different background colors, plus an underline to make the link stand out even more. two points to note here are: the underline has been created using border-bottom, not text-decoration — some people prefer this because the
former has better styling options than the latter, and is drawn a bit lower, so doesn't cut across the descenders of the word being underlined (e.g. the tails on g and y). the border-bottom value has been set as 1px solid, with no color specified. doing this makes the border adopt the same color as the element's text, which is useful in cases like this where the text is a different color in each ca...
...ind of content the link points to. let's look at a really simple example that adds an icon to external links (links that lead to other sites.) such an icon usually looks like a little arrow pointing out of a box — for this example, we'll use this great example from icons8.com. let's look at some html and css that will give us the effect we want. ...
...And 3 more matches
What is a Domain Name? - Learn web development
e the website offers. ip addresses are hard to remember and might change over time. to solve all those problems we use human-readable addresses called domain names. deeper dive structure of domain names a domain name has a simple structure made of several parts (it might be one part only, two, three...), separated by dots and read from right to left: each of those parts provides specific in
formation about the whole domain name. tld (top-level domain). tlds tell users the general purpose of the service behind the domain name. the most generic tlds (.com, .org, .net) don't require web services to meet any particular criteria, but some tlds enforce stricter policies so it is clearer what their purpose is. for example: local tlds such as .us, .fr, or .se can require the service to b...
...he letters a through z, digits 0 through 9, and the - character (which may not be the first or last character in the label). a, 97, and hello-strange-person-16-how-are-you are all examples of valid labels. the label located right before the tld is also called a secondary level domain (sld). a domain name can have many labels (or components). it is not mandatory nor necessary to have 3 labels to
form a domain name. for instance, www.inf.ed.ac.uk is a valid domain name. for any domain you control (e.g. mozilla.org), you can create "subdomains" with different content located at each, like developer.mozilla.org, iot.mozilla.org, or wiki.developer.mozilla.org. buying a domain name who owns a domain name? you cannot “buy a domain name”. this is so that unused domain names eventually becom...
...ould quickly fill up with unused domain names that were locked and couldn't be used by anyone. instead, you pay for the right to use a domain name for one or more years. you can renew your right, and your renewal has priority over other people's applications. but you never own the domain name. companies called registrars use domain name registries to keep track of technical and administrative in
formation connecting you to your domain name. note : for some domain name, it might not be a registrar which is in charge of keeping track. for instance, every domain name under .fire is managed by amazon. finding an available domain name to find out whether a given domain name is available, go to a domain name registrar's website. most of them provide a “whois” service that tells you whet...
...And 3 more matches
Adding vector graphics to the Web - Learn web development
ocument. objective: learn how to embed an svg (vector) image into a webpage. note: this article doesn't intend to teach you svg; just what it is, and how to add it to web pages. ...
...doesn't intend to teach you svg; just what it is, and how to add it to web pages. what are vector graphics? 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 in
formation showing exactly where each pixel is to be placed, and exactly what color it should be. popular web raster
formats include bitmap (.bmp), png (.png), jpeg (.jpg), and gif (.gif.) vector images are defined using algorithms — a vector image file contains shape and path definitions that the computer can use to work out what the image should look like when rendered on the screen. the svg
format allows us to create powerful vector graphics for use on the web. to give you an idea of the difference between t...
...xample. you can find this example live on our github repo as vector-versus-raster.html — it shows two seemingly identical images side by side, of a red star with a black drop shadow. the difference is that the left one is a png, and the right one is an svg image. the difference becomes apparent when you zoom in the page — the png image becomes pixellated as you zoom in because it contains in
formation on where each pixel should be (and what color). when it is zoomed, each pixel is simply increased in size to fill multiple pixels on screen, so the image starts to look blocky. the vector image however continues to look nice and crisp, because no matter what size it is, the algorithms are used to work out the shapes in the image, with the values simply being scaled as it gets bigger. n...
...And 3 more matches
Images in HTML - Learn web development
side your alt attribute? it depends on why the image is there in the first place. in other words, what you lose if your image doesn't show up: decoration. you should use css background images for decorative images, but if you must use html, add a blank alt="". if the image isn't part of the content, a screen reader shouldn't waste time reading it. content. if your image provides significant in
formation, provide the same in
formation in a brief alt text – or even better, in the main text which everybody can see. don't write redundant alt text. how annoying would it be for a sighted user if all paragraphs were written twice in the main content? if the image is described adequately by the main text body, you can just use alt="". link. if you put an image inside <a> tags, to turn an image in...
...if you really can't avoid doing this, you should supply the text inside the alt attribute. essentially, the key is to deliver a usable experience, even when the images can't be seen. this ensures all users are not missing any of the content. try turning off images in your browser and see how things look. you'll soon realize how helpful alt text is if the image cannot be seen. note: for more in
formation, see our guide to text alternatives. width and height you can use the width and height attributes to specify the width and height of your image. you can find your image's width and height in a number of ways. for example on the mac you can use cmd + i to get the info display up for the image file. returning to our example, we could do this: <img src="images/dinosaur.jpg" alt="the he...
...the user's needs. the image may also end up looking distorted, if you don't maintain the correct aspect ratio. you should use an image editor to put your image at the correct size before putting it on your webpage. note: if you do need to alter an image's size, you should use css instead. image titles as with links, you can also add title attributes to images, to provide further supporting in
formation if needed. in our example, we could do this: <img src="images/dinosaur.jpg" alt="the head and torso of a dinosaur skeleton; it has a large head with long sharp teeth" width="400" height="341" title="a t-rex on display in the manchester university museum"> this gives us a tooltip on mouse hover, just like link titles: however, this is not recommended — tit...
...And 3 more matches
Drawing graphics - Learn web development
improve when browsers began to support the <canvas> element and associated canvas api — apple invented it in around 2004, and other browsers followed by implementing it in the years that followed. 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 plat
form provides. the below example shows a simple 2d canvas-based bouncing balls animation that we originally met in our introducing javascript objects module: around 2006–2007, mozilla started work on an experimental 3d canvas implementation. this became webgl, which gained traction among browser vendors, and was standardized around 2009–2010. webgl allows you to create real 3d graphics inside ...
...defined by the third and fourth parameters). let's add another rectangle into the mix — a green one this time. add the following at the bottom of your javascript: ctx.fillstyle = 'rgb(0, 255, 0)'; ctx.fillrect(75, 75, 100, 100); save and refresh, and you'll see your new rectangle. this raises an important point: graphics operations like drawing rectangles, lines, and so forth are per
formed in the order in which they occur. think of it like painting a wall, where each coat of paint overlaps and may even hide what's underneath. you can't do anything to change this, so you have to think carefully about the order in which you draw the graphics. note that you can draw semi-transparent graphics by specifying a semi-transparent color, for example by using rgba(). the a value defin...
... 60 degrees, and 30 degrees. in terms of the sides: the longest side is called the hypotenuse the side next to the 60 degree angle is called the adjacent — which we know is 50 pixels, as it is half of the line we just drew. the side opposite the 60 degree angle is called the opposite, which is the height of the triangle we want to calculate. one of the basic trigonometric
formulae states that the length of the adjacent multiplied by the tangent of the angle is equal to the opposite, hence we come up with 50 * math.tan(degtorad(60)). we use our degtorad() function to convert 60 degrees to radians, as math.tan() expects an input value in radians. with the height calculated, we draw another line to (100, 50 + triheight). the x coordinate is simple; it must be halfwa...
...And 3 more matches
Framework main features - Learn web development
e html, these languages know how to read data variables, and this data can be used to streamline the process of writing your ui. 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. dsls can't be read by the browser directly; they must be trans
formed into javascript or html first. trans
formation is an extra step in the development process, but framework tooling generally includes the required tools to handle this step, or can be adjusted to include this step. while it is possible to build framework apps without using these domain-specific languages, embracing them will streamline your development process and make it easier to find help from...
...article> </home> </app> our app component has data that our authorcredit component needs. we could rewrite home and article so that they know to pass props down, but this could get tedious if there are many, many levels between the origin and destination of our data. it's also excessive: home and article don’t actually make use of the author's portrait or byline, but if we want to get that in
formation into the authorcredit, we will need to change home and author to accommodate it. the problem of passing data through many layers of components is called prop drilling, and it’s not ideal for large applications. to circumvent prop drilling, frameworks provide functionality known as dependency injection, which is a way to get certain data directly to the components that need it, without pa...
...nt’s lifecycle is a collection of phases a component goes through from the time it is rendered by the browser (often called mounting) to the time that it is removed from the dom (often called unmounting). each framework names these lifecycle phases differently, and not all give developers access to the same phases. ...
...And 3 more matches
Getting started with React - Learn web development
p. requirements in order to use create-react-app, you need to have node.js installed. it's recommended that you use the long-term support (lts) version. node includes npm (the node package manager), and npx (the node package runner). you may also use the yarn package manager as an alternative, but we'll assume you are using npm in this set of tutorials. ...
...ee package management basics for more in
formation on npm and yarn. if you're using windows, you will need to install some software to give you parity with unix/macos terminal in order to use the terminal commands mentioned in this tutorial. gitbash (which comes as part of the git for windows toolset) or windows subsystem for linux (wsl) are both suitable. see command line crash course for more in
formation on these, and on terminal commands in general. also bear in mind that react and reactdom produce apps that only work on a fairly modern set of browsers — ie9+ by way of some polyfills. it is recommended that you use a modern browser like firefox, safari, or chrome when working through these tutorials. ...
...create-react-app uses this name to make a new directory, then creates the necessary files inside it. ...
...And 3 more matches
Vue resources - Learn web development
onents are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn where to go to find further in
formation on vue, to continue your learning. further resources here’s where you should go to learn more about vue: vue docs — the main vue site. contains comprehensive documentation, including examples, cookbooks, and reference material. this is the best place to start learning vue in depth. vue github repo — the vue code itself. this is where you can report issues and/or contribute ...
...t place to start learning vue in depth. vue github repo — the vue code itself. this is where you can report issues and/or contribute directly to the vue codebase. studying the vue source code can help you better understand how the framework works, and write better code. vue forum — the official forum for getting help with vue. vue cli docs — documentation for the vue cli. ...
... building and publishing your vue app the vue cli also provides us with tools for preparing our app for publishing to the web. you can do this like so: if your local server is still running, end it by pressing ctrl + c in the terminal. ...
...And 3 more matches
Introduction to cross browser testing - Learn web development
e really saying that they should provide an acceptable user experience across different browsers. it is potentially ok for a site to not deliver the exact same experience on all browsers, as long as the core functionality is accessible in some way. on modern browsers you might get something animated, 3d and shiny, whereas on older browsers you might just get a flat graphic representing the same in
formation. as long as the site owner is happy with this, then you have done your job. on the other hand, it is not ok for a site to work fine for sighted users, but be completely inaccessible for visually impaired users because their screen reader application can't read any of the in
formation stored on it. second, when we say "across an acceptable number of web browsers", we don't mean 100% of the b...
... job. on the other hand, it is not ok for a site to work fine for sighted users, but be completely inaccessible for visually impaired users because their screen reader application can't read any of the in
formation stored on it. second, when we say "across an acceptable number of web browsers", we don't mean 100% of the browsers in the world — this is just about impossible. you can make some in
formed calls as to what browsers and devices your users will be using (as we'll discuss in the second article in the series — see gotta test 'em all?), but you can't guarantee everything. as a web developer, you need to agree on a range of browsers and devices that the code definitely needs to work on with the site owner, but beyond that, you need to code defensively to give other browsers the best ...
...ite should work entirely in the last few versions of the most popular desktop and mobile (ios, android, windows phone) browsers — this should include chrome (and opera as it is based on the same rendering engine as chrome), firefox, ie/edge, and safari. it should also provide an acceptable experience on ie 8 and 9, and be accessible with wcag aa compliance. now you know your target testing plat
forms, you should go back and review the required featureset and what technologies you are going to use. for example, if the e-commerce site owner wants a webgl-powered 3d tour of each product built into the product pages, they will need to accept that this just won't work in ie versions before 11. you'd have to agree to provide a version of the site without this feature to users of older ie versions.
...And 3 more matches
Continuous Integration
you understand all the pieces that comprise mozilla's continuous integration systems. taskcluster and treeherder taskcluster, mozilla's continuous integration (ci) system picks up changes pushed to hg. taskcluster generate binary builds for firefox and firefox for android across a variety of operating sytems. after the builds are completed, they are used to run a series of correctness and per
formance tests. the results of taskcluster jobs (both builds and tests) are displayed in treeherder. there is a group of individuals who are constantly monitoring treeherder, looking for broken builds and/or tests. these individuals are known as sheriffs. the sheriffs' role is to "keep the tree green", or in other words, to keep the code in our respositories in a good state, to the extent that the...
...eeherder are ordered by mercurial pushes. each taskcluster job is represented by a colored label; green means a job has succeeded, while other colors represent different kinds of problems. the label text indicates the job type. for a full list of job types, see the help menu in treeherder's upper-right corner. below is a list of the most common. builds b - normal build jobs; these jobs per
form compilation and some compiled-code tests (e.g., 'make check'). be - b2g build jobs for engineering builds; user builds are denoted with b, the same as for desktop and android builds. n and ne - nightly build jobs; these jobs are similar to b and be jobs, but are triggered on a periodic basis instead of being triggered by a push to hg. hf - static rooting hazard analysis s - static analysis v...
... builds that run in ci are clobber builds. clobber builds mean the directory hierarchy, including the local source and object directory are deleted if it exists from a previous build. functional tests these jobs are scheduled after a build job has successfully produced a build. these test jobs can sometimes run even if a build job fails, if the build job failed during 'make check'. talos per
formance tests all per
formance tests displayed in treeherder are run using the talos framework, and denoted by the letter t. these jobs are scheduled at the same time as the correctness jobs. talos is used to execute several suites for desktop firefox and firefox for android; these suites are denoted using lower-case letters, e.g., t(c d g1 o s tp). the talos indicators in treeherder appear green ...
...And 3 more matches
Debugging on Windows
create a visual c++ mozilla project in the directory of the executable by default. attach the debugger to an existing mozilla process. in the visual studio, select debug > attach to process. if you want to debug a content process, you can hover on the tab of page you want to debug, which would show the pid. you can then select the process from dialog opened from "attach to process". for more in
formation, see attach to running processes with the visual studio debugger. debugging release and nightly builds refer to the steps to use the mozilla symbol server and source server. creating a visual c++ project for firefox please refer to the documentation on firefox-source-docs. changing/setting the executable to debug vc++ 6.0: to change or set the executable to debug, go to project > set...
...le to add one dll at a time. vc++ 7.0 automatically finds additional dlls. customizing the debugger's variable value view you can customize how visual c++ displays classes in the variable view. by default vc++ displays "{...}" and you need to click the small + icon to expand the members. ...
... data member you want in whatever order,
formatter however you like instead of just "{...}". you need to locate a file called "autoexp.dat" in your visual c++ installation. by default it will be: vc++ 6.0: c:\program files\microsoft visual studio\common\msdev98\bin\autoexp.dat vc++ 7.0: c:\program files\microsoft visual studio .net 2003\common7\packages\debugger\autoexp.dat the file has in
formation about the
format in the beginning, and after a little practice you should be well on your way. here are some entries that will make your life easier: ;; mozilla (1.7beta and later) nsautostring=<mdata,su> nsstring=<mdata,su> nscstring=<mdata,s> nscautostring=<mdata,s> nsrect=x=<x,d> y=<y,d> width=<width,d>; height=<height,d> nsstaticatomwrapper=<mstaticatom->mstring,s> nsiatom=<mstring,su> ...
...And 3 more matches
Eclipse CDT
h. then, to create the eclipse project and open it, run: ./mach ide eclipse or to create the eclipse project without opening it yet, run: ./mach build-backend -b cppeclipse building the eclipse project should only take a few seconds. in the case of the build-backend command, instructions on how to open the project will be displayed after the command completes. manual setup, and more more in
formation can be found on the eclipse cdt manual setup page. much of that page is redundant (taken care of by the mach setup), but there is still some in
formation there that is relevant that should make its way back here at some point. keeping the index up-to-date as the source changes from day-to-day, you'll want to update the index to keep the code assistance working well. since the compiler opti...
...istance note: indexing, by its very nature, is specific to a given compiler configuration. be aware that when eclipse gives results for any of the actions that follow, it will not include results for sections of the code that are ifdef'ed out by the configuration used to create your object directory. for example, if you are using a mac and you search for callers of nsdisplaylistbuilder::isintrans
form, the results will not include the caller in nsobjectframe.cpp because that caller is wrapped in "#ifndef xp_macosx". just something to keep in mind. ;-) to jump to the definition of a symbol (or the declaration of a symbol if already at the definition), hover over the symbol, hold down the ctrl/cmd key, move the mouse slightly to linkify the symbol, then click on it. (having to move the mouse sl...
...u set during a previous debug session, after which you've since rebuilt). remove any such breakpoints and restart your debug session. known issues there are various known limitations and bugs when it comes to using eclipse with mozilla. eclipse is open source, of course so if anyone feels like doing a bit of java hacking to fix these issues that'd be great. headers are only parsed once for per
formance reasons, eclipse only processes header files that have include guards once, using the compiler options for the first source file it encounters that includes that header (eclipse bug 380511). this is responsible for most of the parse errors in the source files displayed in eclipse. one problem with the "parse once" strategy is that the compiler options for the original source file may ifdef ou...
...And 3 more matches
HTML parser threading
eculatively scanning the tail of document.write() data when the parser blocks without parsing the document.write() data to completion. nshtml5streamparser has one tokenizer/tree builder pair for parsing data from the network. additionally, each nshtml5parser has an associated nshtml5treeopexecutor that turns the output (tree operations; discussed later) of the portable parser core into actions per
formed on the gecko dom. initialization an nshtml5parser is constructed without an nshtml5streamparser due to legacy code structure around parser creation. if the parser is not script-created, nshtml5parser::markasnotscriptcreated() is called to create an nshtml5streamparser for the nshtml5parser. due to legacy interface design oddities, an nshtml5parser is initialized by calling nshtml5parser::parse(...
...arser thread, which would lead to all sorts of badness, because nshtml5streamparser has fields that hold objects that aren't safe to release except from the main thread. the runnables use nshtml5refptr<nshtml5streamparser>. nshtml5refptr sends runnables back to the main thread to call release on nshtml5streamparser on the main thread. normal (non-speculative) parsing initially, dodataavailable per
forms character encoding sniffing on the data if an encoding wasn't declared on the enclosing protocol (http) level. once a unicode decoder has been set up, dodataavailable passes the byte data to the decoder whose output is accumulated into a linked list of nshtml5owningutf16buffer objects. nshtml5owningutf16buffer objects are then passed to the tokenizer in sequence by the parseavailabledata() metho...
...o a linked list of nshtml5owningutf16buffer objects. nshtml5owningutf16buffer objects are then passed to the tokenizer in sequence by the parseavailabledata() method. the tokenizer calls into the tree builder which outputs nshtml5treeoperation objects (tree ops) into a queue. each tree op represents a small operation, such as element creation or appending a node into another, that can later be per
formed on the main thread. note that mtokenizermutex is being held by the parser thread for the entire time that the tokenizer runs. parseavailabledata() checks for parser termination or interruption from time to time. the termination and interruption indicators are guarded by a more narrowly scoped mterminatedmutex, so parseavailabledata() has the opportunity to receive an order to terminate or inter...
...And 3 more matches
Addon
me of the methods and properties are considered "required" and others "optional," which means that the optional methods or property may not exist on addon instances for some types of add-ons. api consumers should take care to verify the existence of these methods or properties before relying on them. ...
... property may not exist on addon instances for some types of add-ons. api consumers should take care to verify the existence of these methods or properties before relying on them. ...
... isactive read only boolean true if the add-on is currently functional. for some add-ons this will change immediately based on the appdisabled and userdisabled properties; for others it will only change after an application restart. iscompatible read only boolean true or false depending on whether the add-on is compatible with the current application version and plat
form version. isplat
formcompatible read only boolean true or false depending on whether the add-on is compatible with the current operating system. name read only string the name of the add-on. pendingoperations read only integer a bitfield holding all of the current operations that are waiting to be per
formed for this add-on. operations are generally de...
...And 3 more matches
AddonManager
the majority of the methods are asynchronous meaning that results are delivered through callbacks passed to the method. the callbacks will be called just once but that may be before or after the method returns. 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. ...
...( in addon addons[] ) parameters addons the array of addons passed back from the asynchronous request constants addoninstall states constant description state_available an install that is waiting to be started. state_downloading an install that is in the process of being downloaded. state_checking an install that is checking for updated in
formation. state_downloaded an install that has finished downloading and is ready to install. state_download_failed an install that failed to download. state_installing an install that is in the process of being installed. state_installed an install that has successfully been installed. state_install_failed an install that has failed to insta...
...rrect_hash the downloaded file did not match the expected hash. error_corrupt_file the file appears to be corrupt. error_file_access there was an error accessing the filesystem. error_signedstate_required the addon must be signed and isn't. update check reasons constant description update_when_user_requested an update check per
formed at the explicit request of the user. update_when_new_app_detected an update check per
formed when a new version of the application has been detected. update_when_new_app_installed an update check per
formed after a new version of the application has been installed. update_when_periodic_update an update check per
formed automatically in the background. u...
...And 3 more matches
Application Translation with Mercurial
d of backslashes (\). so let's go to c:\mozilla by typing cd /c/mozilla/ create a new directory for the source code: mkdir mozilla-aurora initialize the new directory as new repository: hg init mozilla-aurora go into the new directory: cd mozilla-aurora unpack the source code: hg unbundle /path/to/the/downloaded/mozilla-aurora.hg this can take some time, mostly depending on the per
formance of the hard drive. extract the files: hg update obtaining the texts of your localization go back to the parent folder of mozilla-aurora: cd .. find the localization repository for your branch and language on http://hg.mozilla.org/ e.g. for aurora and german (language code 'de'), it is http://hg.mozilla.org/releases/l10n/mozilla-aurora/de/ copy that url to the clipboard. copy the r...
...ext ids ("entities" or "keys"), allowing to quickly find translations for already translated texts. microsoft's terminology search allows fast lookups of localized technical terms. choosing what to translate go to the localization status page and click on the '<number> missing' label of the firefox branch on which you want to translate, e.g. fx_aurora. the page which opens has a bar holding in
formation about how many texts (strings) have already been translated, how many there are in english and your locale and have the same text, and how many are missing in your local. the interesting part follows below as list of missing texts. the first line shows the locale for which the texts are being translated (in this example: de - german). with the second line start the file paths of the files...
...ile. you will see something like this: on the left, you see an overview of the comparison of the english and the non-english file. gray parts indicate blocks of texts which can't be found in that file, dark yellow represents changed lines and light yellow the parts of text in it which is different. below the license header which should never changed, the texts are organized in the following
format: <!entity stringid "text which will be shown in firefox"> as you can see there is a bigger block of text not recognized. this is due to the texts which have in the english versionmoved from below the string with the id privatebrowsingpage.howtostart3 to a position above it. cut and paste these strings in the localized file so their position corresponds to the on in the english file. press t...
...And 3 more matches
Localization technical reviews
this guide provides details on what a localization technical review is, what criteria are used for the technical reviews, and the process for requesting one and following its progress. the technical review process we use for new localizations can be confusing for any trying to start a new localization. we use this review process to per
form quality assurance (qa) testing on your l10n efforts. this ensures that every user who downloads your localized mozilla application receives all of your hard work in a functional product. each qa review helps us in these ways: ensures that your l10n work is visible and functional within the mozilla application. allows us to understand how each l10n team is per
forming their localization work. allows us to discover potential bugs within l10n tools...
...if not all, of your localization work. the merge date for migrating from one product release channel to the next (e.g., aurora to beta, or beta to release) is rapidly approaching. you need to make sure that your work can effectively be compiled into a build for the next release channel. here is a detailed overview of what a technical review is and who it's meant for: a technical review: is per
formed as a qa measure on a revision pushed to a new locale's l10n aurora repo in mercurial. is very comprehensive and covers the entire product. focusses on technical accuracy and completion of l10n work, not translation quality. is only per
formed on the first revision a new locale wants to have released to the public. must be approved prior to migrating your revision from aurora to beta. techn...
...etion of l10n work, not translation quality. is only per
formed on the first revision a new locale wants to have released to the public. must be approved prior to migrating your revision from aurora to beta. technical review evaluation criteria in principal, a technical review's criteria looks for localization issues common to localizing software but within the mozilla context. since it is per
formed on the first revision a l10n team proposes for release, this first revision requires a very detailed and comprehensive
form of review. that being the case, there are some criteria in a technical review that will only ever be considered once, as all reviews after this only evaluate the changes you're adding on top of this revision from release to release. here is some of the criteria we use to ...
...And 3 more matches
Power profiling overview
it serves as a starting point for anybody doing power profiling for the first time. basic physics concepts in physics, power is the rate of doing work. it is equivalent to an amount of energy consumed per unit time. in si units, energy is measured in joules, and power is measured in watts, which is equivalent to joules per second. although power is an instantaneous concept, in practice measurements of it are determined in a non-instantaneous fashion, i.e. by dividing an energy amount by a non-infinitesimal time period. ...
...package or core spends in an idle c-state is called the c-state residency. this is a misleading term — the active state, c0, is also a c-state — but one that is nonetheless common. intel processors have model-specific registers (msrs) containing measurements of how much time is spent in different c-states, and tools such as powermetrics (mac), powertop and turbostat (linux) can expose this in
formation. a wakeup occurs when a core or package transitions from an idle state to the active state. this happens when the os schedules a process to run due to some kind of event. common causes of wakeups include scheduled timers going off and blocked i/o system calls receiving data. maintaining c-state residency is crucial to keep power consumption low, and so reducing wakeup frequency is one of th...
...ul to gradually remove elements from a web page and see how the power-related measurements change. even just switching a tab from the foreground to the background can make a difference. high-context measurements a few power-related measurements can be obtained in a high-context fashion, e.g. with stack traces that clearly pinpoint specific parts of the code as being responsible. standard per
formance profiling tools that measure cpu usage or proxies of cpu usage (such as instruction counts) typically provide high-context measurements. this is useful because high cpu usage typically causes high power consumption. some tools can provide high-context wakeup measurements: dtrace (on mac) and perf (on linux.) source-level instrumentation, such as timerfirings logging, can identify which time...
...And 3 more matches
Named Shared Memory
the chapter describes the nspr api for named shared memory. shared memory allows multiple processes to access one or more common shared memory regions, using it as an interprocess communication channel. the nspr shared memory api provides a cross-plat
form named shared-memory interface that is modeled on similar constructs in the unix and windows operating systems. shared memory protocol named shared memory functions shared memory protocol using named shared memory functions pr_opensharedmemory creates the shared memory segment, if it does not already exist, or opens a connection with the existing shared memory segment if it already exists. pr_attachsharedmemory should be called following pr_opensharedmemory to map the memory segment to an address in the application's address space. p...
...ess. following a call to pr_closesharedmemory, the prsharedmemory object is invalid and cannot be reused. pr_deletesharedmemory should be called before process termination. after you call pr_deletesharedmemory, any further use of the shared memory associated with the name may cause unpredictable results. filenames the name passed to pr_opensharedmemory should be a valid filename for a unix plat
form. pr_opensharedmemory creates file using the name passed in. some plat
forms may mangle the name before creating the file and the shared memory. the unix implementation may use sysv ipc shared memory, posix shared memory, or memory mapped files; the filename may be used to define the namespace. on windows, the name is significant, but there is no file associated with the name. no assumptions about...
...may mangle the name before creating the file and the shared memory. the unix implementation may use sysv ipc shared memory, posix shared memory, or memory mapped files; the filename may be used to define the namespace. on windows, the name is significant, but there is no file associated with the name. no assumptions about the persistence of data in the named file should be made. ...
...And 3 more matches
NSS 3.14 release notes
tr, aes-cts, and aes-gcm support for keying material exporters for tls (rfc 5705) in addition to the above new features, the following major changes have been introduced: support for certificate signatures using the md5 hash algorithm is now disabled by default. the nss license has changed to mpl 2.0. previous releases were released under a mpl 1.1/gpl 2.0/lgpl 2.1 tri-license. for more in
formation about mpl 2.0, please see http://www.mozilla.org/mpl/2.0/faq.html. for an additional explantation on gpl/lgpl compatibility, see security/nss/copying in the source code. export and des cipher suites are disabled by default. non-ecc aes and triple des cipher suites are enabled by default. nss 3.14 source tarballs can be downloaded from https://ftp.mozilla.org/pub/mozilla.org/security/nss/r...
...ngle-part mode (c_encrypt/c_decrypt). they should not use multi-part apis (c_encryptupdate/c_decryptupdate). support for application-defined certificate chain validation callback when using libpkix to better support per-application security policies, a new callback has been added for applications that use libpkix to verify certificates. applications may use this callback to in
form libpkix whether or not candidate certificate chains meet application-specific security policies, allowing libpkix to continue discovering certificate paths until it can find a chain that satisfies the policies. the following types have been added in nss 3.14 certchainverifycallback (in certt.h) certchainverifycallbackfunc (in certt.h) cert_pi_chainverifycallba...
... bug 792681 - new default cipher suites the default cipher suites in nss 3.14 have been changed to better reflect the current security landscape. the defaults now better matc...
...And 3 more matches
NSS 3.37 release notes
nss 3.37 requires nspr 4.19 or newer. nss 3.37 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_37_rtm/src/ notable changes in nss 3.37 the tls 1.3 implementation was updated to draft 28. an issue where nss erroneously accepted hrr requests was resolved. this issue was found by oss fuzz. ...
...otocol, which had already been disabled in a previous release, has been fully removed. nss allows servers now to register alpn handling callbacks to select a protocol. nss supports opening sql databases in read-only mode. nss now requires the sqlite apis of version 3.5.0 or newer. ...
...a previous release, has been fully removed. nss allows servers now to register alpn handling callbacks to select a protocol. nss supports opening sql databases in read-only mode. nss now requires the sqlite apis of version 3.5.0 or newer. ...
...And 3 more matches
NSS PKCS11 Functions
s: if successful, a pointer to a secmodmodule. caller owns the reference if unsuccessful, null. description secmod_loadusermodule loads a new pkcs #11 module into nss and connects it to the current nss trust infrastructure. once the the module has been successfully loaded, other nss calls will use it in the normal course of searching. modulespec specifies how the module should be loaded. more in
formation about module spec is available at pkcs11_module_specs. nss parameters may be specified in module specs used by secmod_loadusermodule. module will continue to function in the nss infrastructure until unloaded with secmod_unloadusermodule. secmod_unloadusermodule unload a pkcs #11 module. syntax #include "secmod.h" extern secstatus secmod_unloadusermodule(secmodmodule *module); parameters...
... to softoken at initialization time under the 'tokens' options. returns the function returns one of these values: if successful, a pointer to a slot. if unsuccessful, null. description open a new database using the softoken. the caller is responsible for making sure the module spec is correct and usable. the caller should ask for one new database per call if the caller wants to get meaningful in
formation about the new database. modulespec is the same data that you would pass to softoken at initialization time under the 'tokens' options. for example, if you would normally specify tokens=<0x4=[configdir='./mybackup' tokendescription='backup']> to softoken if you at init time, then you could specify "configdir='./mybackup' tokendescription='backup'" as your module spec here to open the database...
...ot is read-only. syntax #include <pk11pub.h> #include <prtypes.h> prbool pk11_isreadonly(pk11slotinfo *slot); parameters this function has the following parameter: slot a pointer to a slot info structure. returns the function returns one of these values: if slot is read-only, pr_true. otherwise, pr_false. pk11_setpasswordfunc defines a callback function used by the nss libraries whenever in
formation protected by a password needs to be retrieved from the key or certificate databases. syntax #include <pk11pub.h> #include <prtypes.h> void pk11_setpasswordfunc(pk11passwordfunc func); parameter this function has the following parameter: func a pointer to the callback function to set. description during the course of an ssl operation, it may be necessary for the user to log in to a pkcs ...
...And 3 more matches
PKCS11 Implement
implementing pkcs #11 for nss note: this document was originally for the netscape security library that came with netscape communicator 4.0. this note will be removed once the document is updated for the current version of nss. this document supplements the in
formation in pkcs #11: cryptographic token interface standard, version 2.0 with guidelines for implementors of cryptographic modules who want their products to work with mozilla client software: how nss calls pkcs #11 functions. ...
...th netscape communicator 4.0. this note will be removed once the document is updated for the current version of nss. this document supplements the in
formation in pkcs #11: cryptographic token interface standard, version 2.0 with guidelines for implementors of cryptographic modules who want their products to work with mozilla client software: how nss calls pkcs #11 functions. function-specific in
formation organized in the same categories as the pkcs #11 specification. functions for different kinds of tokens. summarizes the support nss expects from different kinds of tokens. installation. installing modules and in
forming the user of changes in the cryptographic modules settings. semantics unique to nss. miscellaneous nss semantics that affect module implementation. future versions of netsc...
...onlist on startup or when it loads a new module. the function list returned should include all the pkcs 2.0 function calls. if you don't implement a function, you should still provide a stub that returns ckr_function_not_supported. c_getinfo the nss calls c_getinfo on startup or when it loads a new module. the version numbers, manufacturer ids, and so on are displayed when the user views the in
formation. the supplied library names are used as the default library names; currently, these names should not include any double quotation marks. (this is more restrictive than pkcs 2.0 and may change in future versions of nss.). slot and token management c_getslotlist the nss calls c_getslotlist on startup or when it loads a new module, requests all the module's slots, and keeps track of the li...
...And 3 more matches
gtstd.html
if you are inclined to help with this migration, your help would be very much appreciated. upgraded documentation may be found in the current nss reference getting started with ssl chapter 2 getting started with ssl this chapter describes how to set up your environment, including certificate and key databases. ...
...dules, slots, and tokens as shown in the figure, ssl communicates with pkcs #11 modules through the pkcs #11 interface. any pkcs #11 module that supports pkcs #11 can be used with the nss libraries. netscape software uses a file called secmod.db to keep track of the modules available. a pkcs #11 module always has one or more slots, which may be implemented as physical hardware slots in some
form of physical reader (for example, for smart cards) or as conceptual slots in software. each slot for a pkcs #11 module can in turn contain a token, which is the hardware or software device that actually provides cryptographic services and optionally stores certificates and keys. netscape provides three built-in modules with nss and with server and client products: the default netscape intern...
... a pkcs #11 module can in turn contain a token, which is the hardware or software device that actually provides cryptographic services and optionally stores certificates and keys. netscape provides three built-in modules with nss and with server and client products: the default netscape internal pkcs #11 module comes with two built-in tokens: the generic crypto services token per
forms all cryptographic operations, such as encryption, decryption, and hashing. the communicator certificate db token handles all communication with the certificate and key database files (called certx.db and keyx.db, respectively, where x is a version number) that store certificates and keys. the fortezza module is intended for use with fortezza hardware tokens. the fips 140-1 m...
...And 3 more matches
NSS Tools
nss security tools newsgroup: mozilla.dev.tech.crypto overview the nss security tools allow developers to test, debug, and manage applications that use nss. the tools in
formation table below describes both the tools that are currently working and those that are still under development. the links for each tool take you to the source code, documentation, plans, and related links for each tool. the links will become active when in
formation is available. currently, you must download the nss 3.1 source and build it to create binary files for the nss tools. for in
formation about downloading the nss source, see https://developer.mozilla.org/nss/building. if you have feedback or questions, please feel free to post to mozilla.dev.tech.crypto. this newsgroup is the preferred forum for all ...
... about nss and nss tools. overall objectives provide a tool for analyzing and repairing certificate databases (dbck). migrate tools from secutil.h interface to pkcs #11 interface. eliminate redundant functionality in tools. many tools implement private versions of pkcs11init(), opencertdb(), etc. eliminate use of getopt() and replace with nspr calls to get command options (to eliminate plat
form dependencies with getopt()). tools in
formation tool description links certutil 2.0 manage certificate and key databases (cert7.db and key3.db). source, documentation, tasks/plans cmsutil 1.0 per
forms basic cms operations such as encrypting, decrypting, and signing messages. source, documentation crlutil manage certificate revocation li...
... in nss 3.2) source, tasks/plans modutil 1.1 manage the database of pkcs11 modules (secmod.db). add modules and modify the properties of existing modules (such as whether a module is the default provider of some crypto service). source, documentation, tasks/plans pk12util 1.0 import and export keys and certificates between the cert/key databases and files in pkcs12
format. source, documentation, tasks/plans signtool 1.3 create digitally-signed jar archives containing files and/or code. source, documentation, signver 1.1 verify signatures on digitally-signed objects. source, documentation, tasks/plans sslstrength ssl strength documentation ssltap 3.2 proxy requests for an ssl server and displ...
...And 3 more matches
The JavaScript Runtime
the generated bytecodes in turn depend upon runtime support routines. each javascript script or function is compiled to a separate class. ...
...the generated bytecodes in turn depend upon runtime support routines. each javascript script or function is compiled to a separate class. ...
...the generated bytecodes in turn depend upon runtime support routines. each javascript script or function is compiled to a separate class. ...
...And 3 more matches
Scripting Java
le("test.txt") test.txt js> f.exists() true js> f.getname() test.txt static methods and fields can be accessed from the class object itself: js> java.lang.math.pi 3.141592653589793 js> java.lang.math.cos(0) 1 in javascript, unlike java, the method by itself is an object and can be evaluated as well as being called. if we just view the method object by itself we can see the various overloaded
forms of the method: js> f.listfiles function listfiles() {/* java.io.file[] listfiles() java.io.file[] listfiles(java.io.filenamefilter) java.io.file[] listfiles(java.io.filefilter) */} this output shows that the file class defines three overloaded methods listfiles: one that takes no arguments, another with a filenamefilter argument, and a third with a filefilter argument. all the methods return ...
...dditionally, a boolean property of the same name can be defined by an isfoo method. for example, the following code actually calls the file object's getname and isdirectory methods. js> f.name test.txt js> f.directory false calling overloaded methods the process of choosing a method to call based upon the types of the arguments is called overload resolution. in java, overload resolution is per
formed at compile time, while in rhino it occurs at runtime. 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. as an example, consider the following java class that defines a number of overloaded methods and calls them. public class overload { pub...
... and execute it, we get the output f(int) f(string) f(object) because rhino selects an overloaded method at runtime, it calls the more specific type that matches the argument. meanwhile java selects the overloaded method purely on the type of the argument at compile time. ...
...And 3 more matches
Shumway
the whats and whys of shumway shumway is a renderer for adobe flash built entirely in web standards (javascript, webgl, and others). ...
... the whats and whys of shumway shumway is a renderer for adobe flash built entirely in web standards (javascript, webgl, and others). ...
... the whats and whys of shumway shumway is a renderer for adobe flash built entirely in web standards (javascript, webgl, and others). ...
...And 3 more matches
Garbage collection
principal data structures cell a cell is the unit of memory that is allocated and collected by the gc, as used externally. in other words, from the point of view of the rest of the engine, the job of the gc is to allocate cells and automatically collect them. cell is the base class for all classes that are allocated by the gc, e.g., jsobject. allocation kind cells are classified by allocation kind. ...
...chunkbitmap), a bitmap of decommitted arenas, and a chunk header (chunkinfo). the chunkinfo contains a list of unallocated arenas, starting at chunkinfo::freearenashead and linked through arenaheader::next. the chunkinfo also contains some basic stats, such as the number of free arenas. arena an arena is an internal unit of memory allocation. an arena is one page (4096 bytes on almost all plat
forms) and contains an arenaheader, a few pad bytes, and then an array of aligned elements. all elements in an arena have the same allocation kind and size. every arena maintains a list of free spans, starting at arenaheader::firstfreespanoffets. the last cell in each free span (except the last one) holds a freespan for the next free span. free span struct freespan represents a contiguous sequence ...
...chunkbitmap. the mark bitmap has two bits per gc cell, so that it can represent both regular liveness marking ("marked black") as well as reachability from cycle-collected objects ("marked gray"). mark bits are allocated based on the minimum cell size, thus an object comprised of larger cells consumes multiple bits in the bitmap (but only uses two of them.) exact stack rooting api note: the in
formation here is about the implementation of gc roots and their use within spidermonkey. for in
formation on how the rooting apis should be used by embedders, read: gc rooting guide. this in
formation has been split out into a separate article: exact stack rooting. marking todo incremental marking incremental marking means being able to do a bit of marking work, then let the mutator (javascript p...
...And 3 more matches
Introduction to the JavaScript shell
gram included in the spidermonkey source distribution. it is the javascript equivalent of python's interactive prompt, the lisp read-eval-print loop, or ruby's irb. this article explains how to use the shell to experiment with javascript code and run javascript programs. to get the spidermonkey javascript shell, see the spidermonkey build documentation or download a compiled binary for your plat
form from the nightly builds. for a list of other javascript shells, see javascript shells. note: starting with spidermonkey 44 (firefox 44 / thunderbird 44 / seamonkey 2.41), the standard, web-compatible javascript version is used by default (and not js1.7+ anymore). the version() shell builtin is still there for testing legacy features. running the javascript shell the shell offers two modes o...
...rom start when it is given and is not null. kind is either 'all' (default) to count all things or one of 'object', 'double', 'string', 'function', 'qname', 'namespace', 'xml' to count only things of that kind. dumpheap([filename[, start[, tofind[, maxdepth[, toignore]]]]]) added in spidermonkey 1.8 dump the graph of all existing objects (or a specific interesting subgraph) to a file. for more in
formation, see the c/c++ version of this function, js_dumpheap. evalcx(string[, object]) evaluates the javascript code in string. if object is specified, the code is executed in that object, treating it as a sandbox. if string is empty and object is not specified, evalcx() returns a new object with eager standard classes. if string is "lazy" and object is not specified, evalcx() returns a new obje...
...(such as 'maxbytes', 'maxmallocbytes' or 'gcnumber') defined by for_each_gc_param in https://searchfox.org/mozilla-central/source/js/src/builtin/testingfunctions.cpp#464. if value is not specified, gcparam() returns the current value associated with gc parameter named name. if value is specified, it must be convertable to a positive uint32; gcparam() sets gc parameter name to value. for more in
formation, see the c/c++ functions js_getgcparameter and js_setgcparameter. gczeal(level) added in spidermonkey 1.8 debug only. set the level of gc zeal, a debugging feature. this can be 0 for normal periodic garbage collection, 1 for very frequent gc, or 2 for extremely frequent gc. anything other than 0 will make javascript run extremely slow but may help reveal or reproduce gc-related bugs. for ...
...And 3 more matches
SpiderMonkey 1.8.8
these release notes are an incomplete draft and were initially seeded from the 1.8.5 release notes, so lots of the in
formation here isn't actually new to spidermonkey 1.8.8 (nor is it even the case that the version number will be 1.8.8!). the mozilla javascript team is pleased to announce the release of spidermonkey 1.8.8. you can download full source code here: insert-actual-link-when-the-release-happens (md5 checksum: insert-actual-hash-here). spidermonkey 1.8.8 is the javascript engine that shipped in firefox 10.0. it continues to improve per
formance over previous spidermonkey releases, with ongoing jit compilation work and with the introduction of type inference to enable faster jitted code. it also contains new language and api features described in detail below. please l...
...work and with the introduction of type inference to enable faster jitted code. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —insert-actual-release-date-here plat
form support spidermonkey 1.8.8 is supported on all the plat
forms where firefox insert-actual-firefox-version-number-here runs. spidermonkey 1.8.8 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on some other plat
forms (sparc, mips), the jit is provided but not supported. on all o...
...it's the same language, just not as fast. migrating to spidermonkey 1.8.8 the following features in earlier versions of spidermonkey have been dropped. ...
...And 3 more matches
SpiderMonkey 24
ase notes, so they're not necessarily complete or fully accurate. the mozilla javascript team is pleased to announce the release of spidermonkey 24. you can download full source code here: https://ftp.mozilla.org/pub/mozilla.org/js/mozjs-24.2.0.tar.bz2 (sha1: ce779081cc11bd0c871c6f303fc4a0091cf4fe66) spidermonkey 24 is the javascript engine that shipped in firefox 24. it continues to improve per
formance over previous spidermonkey releases, with a significantly improved garbage collector, a new jit compilation mode, and other features. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: ...
...es with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. — dec 16, 2013 the download url still available, but spidermonkey not release alone! get it here mozilla-esr24 if the download url is outdate you will find it in "firefox extended support release 24" package on hg release plat
form support spidermonkey 24 is supported on all the plat
forms where firefox 24 runs. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. (this change was motivated by garbage collector improvements, which lean quite heavily on c++'s support for raii through constructors and destructors.) if you are compiling with microsoft's visual studio, note that the minimum sup...
...rt for raii through constructors and destructors.) if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010: msvc8/9 support has been dropped. spidermonkey 24 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on some other plat
forms (sparc, mips), the jit is provided but not supported. on all other plat
forms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 24 spidermonkey now provides a fully c++ interface, so embedders relying on embeddability in c projects will have to convert to c++, or implement their own a...
...And 3 more matches
SpiderMonkey 45
...
...idermonkey releases. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. you may wish to make the bugs block bug 837921 (aliased as "sm.embedding"). — apr 14, 2016 plat
form support spidermonkey 45 is supported on all plat
forms able to run firefox 45. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note the minimum supported version is msvc 2013. spidermonkey 45 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. ...
...45. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note the minimum supported version is msvc 2013. spidermonkey 45 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on several other plat
forms (sparc, mips), the jit is provided but not supported. on remaining plat
forms the jit is disabled; javascript code runs in an interpreter, as it has in previous versions. it's the same language, just not as fast. migrating to spidermonkey 45 spidermonkey 45 is not binary-compatible with previous releases, nor is it source-code compatible. many jsapi types; functions, and callback signatures, h...
...And 3 more matches
Places Developer Guide
the observer with the bookmarks service var bmsvc = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); bmsvc.addobserver(observer, false); // un-register the observer when done. bmsvc.removeobserver(observer); html import/export the nsiplacesimportexportservice service is used for import and export of bookmarks in the netscape bookmarks html
format. note that this service is only currently available for firefox, not other toolkit-based applications. importing: importhtmlfromfile (nsilocalfile afile, boolean aisinitialimport) - this imports all the bookmarks in the specified file into the current bookmarks collection. if aisinitialimport is true, all pre-existing bookmarks in the toolbar and menu folders will be deleted. note: the m...
...rks in the toolbar and menu folders will be deleted. note: the method importhtmlfromfiletofolder() method was removed in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11). exporting: exporthtmltofile (nsilocalfile afile) - this exports all bookmarks in the toolbar, menu and unfiled bookmarks folders into the specified file. backup/restore the new bookmarks system uses the json
format for storing backups of users' bookmarks. the apis are available via the placesutils api in the utils.js javascript module. var ci = components.interfaces; var cc = components.classes; var cu = components.utils; // import placesutils cu.import("resource://gre/modules/placesutils.jsm"); cu.import("resource://gre/modules/services.jsm"); // create the backup file var jsonfile = services.dirsvc.ge...
...rfaces; var cc = components.classes; var cu = components.utils; // import placesutils cu.import("resource://gre/modules/placesutils.jsm"); cu.import("resource://gre/modules/services.jsm"); // create the backup file var jsonfile = services.dirsvc.get("profd", ci.nsilocalfile); jsonfile.append("bookmarks.json"); jsonfile.create(ci.nsilocalfile.normal_file_type, 0600); // export bookmarks in json
format to file placesutils.backupbookmarkstofile(jsonfile); // restore bookmarks from the json file // note: this *overwrites* all pre-existing bookmarks placesutils.restorebookmarksfromjsonfile(jsonfile); history the toolkit history service is nsinavhistoryservice: var history = cc["@mozilla.org/browser/nav-history-service;1"] .getservice(ci.nsinavhistoryservice); the history servic...
...And 3 more matches
Generating GUIDs
guids are used in mozilla programming for identifying several types of entities, including xpcom interfaces (this type of guids is callled iid), components (cid), and legacy add-ons—like extensions and themes—that were created prior to firefox 1.5. add-ons can (and should) be identified with ids of the
form extensionname@organization.tld since firefox 1.5. warning: if you just want an id for your add-on, generating a guid is almost definitely not what you want to do. using the extensionname@organization.tld
form is approximately one thousand times easier for everyone involved. don't have a domain name? do you have a blog on a subdomain? use that. if all else fails, using extensionname@yourusername.addons.mozilla.org should be fine; no one will care. remember, these are identi...
... you want to do. using the extensionname@organization.tld
form is approximately one thousand times easier for everyone involved. don't have a domain name? do you have a blog on a subdomain? use that. if all else fails, using extensionname@yourusername.addons.mozilla.org should be fine; no one will care. remember, these are identifiers, not e-mail addresses, and they're never resolved. canonical
form the common
form of a guid is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, where each x stands for a hexadecimal digit. there are a number of tools that can be used to generate a guid in the canonical
form. note: if you do choose to use an email-style id for your add-on, you probably don't want it to be a real email address, since it might attract spam. online tools generate guid online uuid (gu...
... windows windows users can use the guidgen tool from microsoft to obtain a guid. (this tool is also part of ms visual c++) linux use /usr/bin/uuidgen. ...
...And 3 more matches
XPCOM changes in Gecko 2.0
of registration for backward compatibility. component manifests all component registration is now handled through manifest files. for extensions, this is the same chrome.manifest currently used to register chrome. xpt files the path of any xpt files must be listed explicitly in a manifest using an interfaces directive: interfaces components/mycomponent.xpt javascript components the registration in
formation for javascript components is no longer located in the component itself; instead, it's located in the manifest. the component is loaded only when the xpcom component manager needs to create a component. chrome.manifest: # the {classid} here must match the classid in mycomponent.js component {e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8} components/mycomponent.js contract @foobar/mycomponent;1 {e6b866...
...utils.generatensgetmodule([mycomponent]); binary components binary components must be listed explicitly in a manifest using a binary-component directive: binary-component components/mycomponent.dll c++ in the component must be changed: a binary component no longer exports a nsgetmodule() function. instead, it exports an nsmodule data symbol which points to a mozilla::module structure. for more in
formation about the mozilla::module structure, see the module.h header file. for an up-to-date example of implementing a dynamic modules, see nssamplemodule.cpp. note that nsigenericfactory.h has been removed. references to nsigenericfactory.h should be replaced with mozilla/moduleutils.h. it is possible for a binary component to be compatible with mozilla 1.9.2 and mozilla 2.0 by using the extra macr...
...tra macro ns_impl_mozilla192_nsgetmodule. see nssamplemodule.cpp for more details. note: binary xpcom components must be recompiled for every new major release of firefox starting with firefox 4. your life would be much easier over the long term if you switch to using js-ctypes instead. also note that extensions using binary components must now use the unpack property in the install manifest. plat
form-specific directories the component/chrome system used to look in plat
form-specific subdirectories of an extension, such as plat
form/winnt_x86-msvc/chrome.manifest on windows. this is no longer supported. you can use the os and abi chrome registration directives to achieve the same effect: binary-component components/windows/mycomponent.dll abi=winnt_x86-msvc binary-component components/mac/mycomp...
...And 3 more matches
Component Internals
the component itself. but where are the components? components reside in modules, and those modules are defined in shared library files that typically sit in the components directory of an xpcom application. a set of default libraries stored in this components directory makes up a typical gecko installation, providing functionality that consists of networking, layout, composition, a cross-plat
form user interface, and others. another, even more basic view of this relationship of components to the files and interfaces that define them is shown in onion peel view of xpcom component creation in the next chapter. the component is an abstraction sitting between the actual module in which it is implemented and the objects that its factory code creates for use by clients. xpcom initialization ...
...registers them: xpcom calls autoregistration start. xpcom registers new components. xpcom calls autoregistration end. complete xpcom startup: xpcom notifies that it's begun. component manifests and type library manifests are described in the following section, xpcom registry manifests. xpcom registry manifests xpcom uses special files called manifests to track and persist in
formation about the components to the local system. there are two types of manifests that xpcom uses to track components: component manifests when xpcom first starts up, it looks for the component manifest, which is a file that lists all registered components, and stores details on exactly what each component can do. xpcom uses the component manifest to determine which components have been overridde...
...the components directory, but there are efforts to move it out of this location to a less application-centric (and thus more user-centric) location. any gecko-based application may choose to locate it elsewhere. xpcom reads this file into an in-memory database. component manifests the component manifest is a mapping of files to components and components to classes. it specifies the following in
formation: location on disk of registered components with file size class id to location mapping contract id to class id mapping the component manifest maps component files to unique identifiers for the specific implementations (class ids), which in turn are mapped to more general component identifiers (contract ids). type library manifests another important file that xpcom reads in is the t...
...And 3 more matches
Using XPCOM Components
will be defined. component examples you can find out more about how you can use the particular components described here in the xpcom api reference. for now, what's important to see is how components like the ones in this section are obtained and used by the mozilla browser. cookie manager cookie management is one of the many sets of functionality that is made available to the browser in the
form of an xpcom component and that can be reused by developers who want similar functionality in their applications. whenever a user accesses the cookie manager dialog to view, organize, or remove cookies that have been stored on the system, they are using the cookiemanager component behind the scenes. the cookie manager dialog shows user interface[cookie-manager-ui] that is presented to the user in ...
...cript, as part of javascript objects that represent instances of components like the cookiemanager. xpconnect is what binds the application code to the user interface of the mozilla browser, to other gecko-based xul, and to javascript environments like xpcshell, which is a command-line javascript interpreter and xpcom tool is built with mozilla. see http://www.mozilla.org/scriptable/ for more in
formation about xpconnect and javascript. this isn't quite all there is to it, of course, but this shows an important aspect of xpcom. the contractual arrangements that xpcom enforces open up the way to binary interoperability - to being able to access, use, and reuse xpcom components at runtime. and they make it possible to use components written in other languages - such as javascript, python, and...
... haven't explained how xpcom makes components available in general. this section discusses practical component use in mozilla. it's divided into three subsections: one about actually finding all these binary components in mozilla and two others corresponding to the two main ways that clients typically access xpcom components: finding mozilla components this book attempts to provide reference in
formation for xpcom components and their interfaces that are frozen as of the time of this writing. the mozilla embedding project tracks the currently frozen interfaces. mozilla also has some tools that can find and display in
formation about the interfaces available in gecko such as the xpcom component viewer, described below, and mxr, which is a web-based source code viewing tool. the challenge to ...
...And 3 more matches
Using XPCOM Utilities to Make Things Easier
t is to be registered with xpcom. the first parameter for each of these macros is an arbitrary string that names the module. in a debugging environment, this string will be printed to the screen when the component library is loaded or unloaded. you should pick a name that makes sense and helps you keep track of things. the four required parts[other-parts] of the structure contain the following in
formation: a human readable class name the class id (cid) the contract id (an optional but recommended argument) a constructor for the given object static const nsmodulecomponentinfo components[] = { { "pretty class name", cid, contract_id, constructor }, // ... }; the important thing to note in the fictitious listing above is that it can support multiple components in a mo...
...dulecomponentinfo above is the name of the component. though it isn't used that much internally at the present time, this name should be something that meaningfully describes the module. the second entry of the nsmodulecomponentinfo is the cid. the usual practice is to put the class id (cid) into a #define and use the define to declare the cid in the components list. ...
... the gecko layout engine and other subsystems that manage large chunks of data. additionally, in some versions of mozilla the string classes support sequences of characters broken up into multiple fragments (fragments which may or may not be null terminated)[nulls-in-strings]. all string classes in xpcom derive from one of two abstract classes[other-string-classes]: nsastring and nsacstring. the
former handles double byte characters, and the latter tends to be used in more general circumstances, but both of these classes define the functionality of a string. you can see these classes being passed as arguments in many of the xpcom interfaces we'll look at in the following chapters. using strings explaining how all the string classes work is outside the scope of this book, but we can show you...
...And 3 more matches
nsICompositionStringSynthesizer
compositionstringsynthesizer.appendclause("foo-".length, compositionstringsynthesizer.attr_convertedtext); compositionstringsynthesizer.appendclause("bar".length, compositionstringsynthesizer.attr_select...
...compositionstringsynthesizer.appendclause("foo-".length, compositionstringsynthesizer.attr_convertedtext); compositionstringsynthesizer.appendclause("bar".length, compositionstringsynthesizer.attr_selectedconvertedtext); comp...
...whose composing string is "foo-bar-buzz" and "bar" is selected to convert, then, first, you need to start composition: domwindowutils.sendcompositionevent("compositionstart", "", ""); next, dispatch composition string with crause in
formation and caret in
formation (optional): // set new composition string with .setstring(). compositionstringsynthesizer.setstring("foo-bar-buzz"); // set clause in
formation with .appendclause(). compositionstringsynthesizer.appendclause("foo-".length, compositionstringsynthesizer.attr_convertedtext); compositionstringsynthesizer.appendclause("bar".length, compositionstringsynthesizer.attr_selectedconvertedtext); compositionstringsynthesizer.appendclause("-buzz".length, compositionstringsynthesizer.attr_convertedtext); // set caret position in the composition...
...And 3 more matches
nsIIOService
inherits from: nsisupports last changed in gecko 1.2 this interface duplicates many of the nsiprotocolhandler methods in a protocol handler independent way (for example newuri() inspects the scheme in order to delegate creation of the new uri to the appropriate protocol handler). ...
...3986). note: most url parsing is done via nsiuri, and in fact the scheme can also be extracted from a url string via nsiuri. this method is provided purely as an optimization. acstring extractscheme( in autf8string urlstring ); parameters urlstring the string for the url to extract the scheme from. return value a string corresponding to the scheme. exceptions thrown ns_error_mal
formed_uri if url string is not of the right
form. getprotocolflags() returns the protocol flags for a given scheme. unsigned long getprotocolflags( in string ascheme ); parameters ascheme the scheme for which to get the protocol flags. return value the value of the protocolflags attribute for the corresponding nsiprotocolhandler. getprotocolhandler() returns a protocol handler for a...
...an absolute url, this parameter is ignored. aloadingnode the loadingdocument of the channel. this is the document/element that will get access to the result of this request. for example for an image load, it's the document in which the image will be loaded. and for a css stylesheet it's the document whose rendering will be affected by the stylesheet. if possible, pass in the element which is per
forming the load. but if the load is coming from a js api (such as xmlhttprequest) or if the load might be coalesced across multiple elements (such as for ) then pass in the document node instead. for loads that are not related to any document, such as loads coming from addons or internal browser features, use null here. aloadingprincipal the loadingprincipal of the channel. the principal of the doc...
...And 3 more matches
nsILocalFile
tes available to non-superuser on the disk volume containing the nsilocalfile. read only. followlinks prbool determines whether or not the nsilocalfile will automatically resolve symbolic links. by default, this value is false on all non-unix systems. as of mozilla 1.7, this attribute is ignored on unix systems. persistentdescriptor acstring on some plat
forms, the value of nsifile.path may be insufficient to uniquely identify the file on the local file system. the persistent descriptor is intended to be used whenever a nsilocalfile needs to be serialized to disk and later recovered. this string is not intended for display to users. note: the value of the followlinks attribute is not encoded in the persistent descriptor. constants ...
... relativefilepath a native relative path. for security reasons, this cannot contain '..' or cannot start with a directory separator '/' . exceptions thrown ns_error_file_unrecognized_path indicates that relativefilepath incorrectly begins with a path separator character or otherwise contains invalid characters. getrelativedescriptor() returns a relative file path in an opaque, cross plat
form format. it is therefore not a native path. acstring getrelativedescriptor( in nsilocalfile fromfile ); parameters fromfile the file from which the descriptor is relative. there is no defined result if this parameter is null. return value an opaque string value with undefined character encoding. this string is not intended for display to users. the result returned from this method may...
...ce. initwithfile() initializes this object with another file. void initwithfile( in nsilocalfile afile ); parameters afile the file this becomes equivalent to. initwithnativepath() used to set the full path that this nsilocalfile references. all current settings will be reset. void initwithnativepath( in acstring filepath ); parameters filepath a string that specifies a plat
form-specific, full path to a file or directory. must be in the native file system character set. exceptions thrown ns_error_file_unrecognized_path indicates that filepath is not an absolute file path or that it contains characters that are invalid for the filesystem. initwithpath() used to set the full path that this nsilocalfile references. all current settings will be reset. void initwith...
...And 3 more matches
Using nsILoginManager
working with the login manager extensions often need to securely store passwords to external sites, web applications, and so on. to do so securely, they can use nsiloginmanager, which provides for secure storage of sensitive password in
formation and nsilogininfo, which provides a way of storing login in
formation. getting nsiloginmanager to get a component implementing nsiloginmanager, use the following: var passwordmanager = components.classes["@mozilla.org/login-manager;1"].getservice( components.interfaces.nsiloginmanager ); most login manager functions take an nsilogininfo object as a parameter. an nsilogininfo object contains the following attributes: hostname,
form submit url, http realm, username, username field, password, and password field. the hostname, username and password ...
...nts.interfaces.nsiloginmanager ); most login manager functions take an nsilogininfo object as a parameter. an nsilogininfo object contains the following attributes: hostname,
form submit url, http realm, username, username field, password, and password field. the hostname, username and password attributes are mandatory, while the other fields are set based on whether the login is for a web page
form or an http/ftp authentication site login. see the nsilogininfo attribute definitions for more details. ...
...her fields are set based on whether the login is for a web page
form or an http/ftp authentication site login. see the nsilogininfo attribute definitions for more details. ...
...And 3 more matches
nsILoginManagerStorage
teria without having to ask the user for their master password in order to decrypt the logins. unsigned long countlogins( in astring ahostname, in astring aactionurl, in astring ahttprealm ); parameters ahostname the hostname to which to restrict the search. specify an empty string to match all hosts. passing null should not match any logins, and should return 0. aactionurl the url of the
form to which the login will be submitted. to match any
form login, specify an empty string. to not match to any
form login, specify null. ahttprealm the http realm for which the login applies. to match logins for any realm, specify an empty string. to not match any realm, specify null. return value the number of logins that match the specified criteria. findlogins() implement this method to search t...
... realm for which the login applies. to match logins for any realm, specify an empty string. to not match any realm, specify null. return value the number of logins that match the specified criteria. findlogins() implement this method to search the login store for logins matching the specified criteria. this method is called by the login manager when looking for saved logins that might apply to a
form or authentication request. void findlogins( out unsigned long count, in astring ahostname, in astring aactionurl, in astring ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins ); parameters count return in this parameter the number of matching logins found by the search. ahostname the hostname to which to restrict the search. for example: "http://www.site.com". specif...
...prealm, [retval, array, size_is(count)] out nsilogininfo logins ); parameters count return in this parameter the number of matching logins found by the search. ahostname the hostname to which to restrict the search. for example: "http://www.site.com". specify an empty string to match all hosts. passing null should not match any logins, and should return a count of 0. aactionurl the url of the
form to which the login will be submitted. to match any
form login, specify an empty string. to not match to any
form login, specify null. ahttprealm the http realm for which the login applies. to match logins for any realm, specify an empty string. to not match any realm, specify null. logins return in this parameter an array of nsilogininfo matching the search criteria. getalldisabledhosts() implem...
...And 3 more matches
nsIMsgHeaderParser
ddr); obsolete since gecko 1.9 void parseheaderaddresses(in string line, out string names, out string addresses, out pruint32 numaddresses); void parseheaderswitharray(in wstring aline, [array, size_is(count)] out wstring aemailaddresses, [array, size_is(count)] out wstring anames, [array, size_is(count)] out wstring afullnames, [retval] out unsigned long count); void re
formatheaderaddresses(in string line, out string re
formattedaddress); wstring re
formatunquotedaddresses(in wstring line); void removeduplicateaddresses(in string addrs, in string other_addrs, in prbool removealiasestome, out string newaddress); string unquotephraseoraddr(in string line, in boolean preserveintegrity); wstring unquotephraseoraddrwstring(in wstring lin...
...g description makefulladdress() given an e-mail address and a person's name, concatenates them together into a single string, doing all the necessary quoting. astring makefulladdress( in astring aname, in astring aaddress ); parameters aname the name of the sender. this should be in utf-8. aaddress the address of the sender. this should be in utf-8. return value a string of the
form name <address>. exceptions thrown missing exception missing description native code only!makefulladdressstring given an e-mail address and a person's name, cons them together into a single string, doing all the necessary quoting (const char* version). string makefulladdressstring( in string aname, in string aaddress ); parameters aname the name of the sender. this should be i...
...laddressstring given an e-mail address and a person's name, cons them together into a single string, doing all the necessary quoting (const char* version). string makefulladdressstring( in string aname, in string aaddress ); parameters aname the name of the sender. this should be in utf-8. aaddress the address of the sender. this should be in utf-8. return value a string of the
form name <address>. exceptions thrown missing exception missing description makefulladdresswstring() obsolete since gecko 1.9 (firefox 3) wstring makefulladdresswstring( in wstring name, in wstring addr ); parameters name the name of the sender. this should be in utf-8. addr the address of the sender. this should be in utf-8. return value a string of t...
...And 3 more matches
nsISelectionPrivate
dom/base/nsiselectionprivate.idlscriptable internal support for content selection handling. inherits from: nsisupports last changed in gecko 35 (firefox 35 / thunderbird 35 / seamonkey 2.32) warning: the content of this article may be out of date. this page wasn't updated since the initial import in 2011. see the idl file linked above for up-to-date in
formation. method overview void addselectionlistener(in nsiselectionlistener newlistener); void endbatchchanges(); void getcachedframeoffset(in nsiframe aframe, in print32 inoffset, in nspointref apoint); native code only! nsienumerator getenumerator(); nsframeselection getframeselection(); native code only! void getrangesforinterval(in nsidomnode beginnode, in print32...
... endplaceholdertransaction will give rise to reflow/refreshing view/scroll, and call times of nstextframe::getpointfromoffset ...
... endplaceholdertransaction will give rise to reflow/refreshing view/scroll, and call times of nstextframe::getpointfromoffset whose return valu...
...And 3 more matches
nsIWebBrowserPersist
ent with this load even if normally they wouldn't be. persist_state_ready 1 persister is ready to save data. persist_state_saving 2 persister is saving data. persist_state_finished 3 persister has finished saving data. encode_flags_selection_only 1 output only the current selection as opposed to the whole document. encode_flags_
formatted 2 for plain text output. convert html to plain text that looks like the html. implies wrap (except inside <pre>), since html wraps. html output: always do prettyprinting, ignoring existing
formatting. encode_flags_raw 4 output without
formatting or wrapping the content. this flag may be used to preserve the original
formatting as much as possible. encode_flags_b...
...ml. implies wrap (except inside <pre>), since html wraps. html output: always do prettyprinting, ignoring existing
formatting. encode_flags_raw 4 output without
formatting or wrapping the content. this flag may be used to preserve the original
formatting as much as possible. encode_flags_body_only 8 output only the body section, no html tags. encode_flags_pre
formatted 16 wrap even if when not doing
formatted output (for example for text fields). encode_flags_wrap 32 wrap documents at the specified column. encode_flags_
format_flowed 64 for plain text output. output for
format flowed (rfc 2646). ...
...this can't (correctly) be done later. encode_flags_absolute_links 128 convert links to absolute links where possible. encode_flags_encode_w3c_entities 256 attempt to encode entities standardized at w3c (html, mathml, and so on.). this is a catch-all flag for documents with mixed contents. ...
...And 3 more matches
nsIZipReader
result in an error. subsequent attempts to access a nsizipentry obtained from this zip reader will cause unspecified behavior. void close(); parameters none. example demonstrating this function: list contents of xpi and read file contents extract() extracts a zip entry into a local file specified by outfile. the entry must be stored in the zip in either uncompressed or deflate-compressed
format for the extraction to be successful. if the entry is a directory, the directory will be extracted non-recursively. void extract( in autf8string zipentry, in nsifile outfile ); parameters zipentry the zip entry to extract. outfile the local file destination used to extract the zip entry. findentries() returns a string enumerator containing the matching entry names. nsiutf8string...
...null (javascript) or emptycstring() (c++) to get all entries; otherwise, use the following syntax: * matches anything. ? matches one character. $ matches the end of the string. [abc] matches one occurrence of a, b, or c. the only character that must be escaped inside the brackets is ]. ^ and - must never appear in the first and second positions within the brackets, respectively. (in the
former case, the behavior specified for '[^az]' will happen.) [a-z] matches any character between a and z. the characters a and z must either both be letters or both be numbers, with the character represented by 'a' having a lower ascii value than the character represented by 'z'. [^az] matches any character except a or z. if ] is to appear inside the brackets as a character to not match, it must ...
... must either both be letters or both be numbers, with the character represented by 'a' having a lower ascii value than the character represented by 'z'. [^az] matches any character except a or z. if ] is to appear inside the brackets as a character to not match, it must be escaped. pat~pat2 returns matches to the pattern 'pat' which do not also match the pattern 'pat2'. this may be used to per
form filtering upon the results of one pattern to remove all matches which also match another pattern. for example, because '*' matches any string and '*z*' matches any string containing a 'z', '*~*z*' will match all strings except those containing a 'z'. note that a pattern may not use '~' multiple times, so a string such as '*~*z*~*y*' is not a valid pattern. (foo|bar) will match either the patter...
...And 3 more matches
XPCOM Interface Reference
this is a reference to the xpcom interfaces provided by the mozilla plat
form. component; nsiprefbranchextensionmanager (toolkit)iaccessible2iaccessibleactioniaccessibleapplicationiaccessiblecomponentiaccessibleeditabletextiaccessiblehyperlinkiaccessiblehypertextiaccessibleimageiaccessiblerelationiaccessibletableiaccessibletable2iaccessibletablecelliaccessibletextiaccessiblevalueidispatchijsdebuggeramiinstallcallbackamiinstalltriggeramiwebinstallinfoamiwebinstalllisteneramiwebinstallpromptamiwebinstallerimgicacheimgicontainerimgicontainerobserverimgidecoderimgidecoderobserverimgiencoderimgiloaderimgirequestinidomutilsjsdistackframemoziasyncfaviconsmoziasynchistorymozicoloranalyzermozijssubscriptloadermozipersonaldictionarymoziplaceinfomoziplacesautocompletemoziregistrymozirepresentativ...
...siblewin32objectnsialertsservicensiannotationobservernsiannotationservicensiappshellnsiappshellservicensiappstartupnsiappstartup_mozilla_2_0nsiapplicationcachensiapplicationcachechannelnsiapplicationcachecontainernsiapplicationcachenamespacensiapplicationcacheservicensiapplicationupdateservicensiarraynsiasyncinputstreamnsiasyncoutputstreamnsiasyncstreamcopiernsiasyncverifyredirectcallbacknsiauthin
formationnsiauthmodulensiauthpromptnsiauthprompt2nsiauthpromptadapterfactorynsiauthpromptcallbacknsiauthpromptprovidernsiauthpromptwrappernsiautocompletecontrollernsiautocompleteinputnsiautocompleteitemnsiautocompletelistenernsiautocompleteobservernsiautocompleteresultnsiautocompletesearchnsibadcertlistener2nsibidikeyboardnsibinaryinputstreamnsibinaryoutputstreamnsiblocklistpromptnsiblocklistservicens...
...eventgroupnsidomeventlistenernsidomeventtargetnsidomfilensidomfileerrornsidomfileexceptionnsidomfilelistnsidomfilereadernsidomfontfacensidomfontfacelistnsidomgeogeolocationnsidomgeopositionnsidomgeopositionaddressnsidomgeopositioncallbacknsidomgeopositioncoordsnsidomgeopositionerrornsidomgeopositionerrorcallbacknsidomgeopositionoptionsnsidomglobalpropertyinitializernsidomhtmlaudioelementnsidomhtml
formelementnsidomhtmlmediaelementnsidomhtmlsourceelementnsidomhtmltimerangesnsidomjswindownsidommousescrolleventnsidommoznetworkstatsnsidommoznetworkstatsdatansidommoznetworkstatsmanagernsidommoztoucheventnsidomnshtmldocumentnsidomnavigatordesktopnotificationnsidomnodensidomofflineresourcelistnsidomorientationeventnsidomparsernsidomprogresseventnsidomserializernsidomsimplegestureeventnsidomstoragensid...
...And 3 more matches
Storage
feature which can be used by web pages to store persistent data or the session store api (an xpcom storage utility for use by extensions). getting started this document covers the storage api and some peculiarities of sqlite. it does not cover sql or "regular" sqlite. you can find some very useful links in the see also section however. for storage api help, you can post to mozilla.dev.apps.plat
form on the news server news.mozilla.org. to report bugs, use bugzilla. the overall procedure for use is: get the storage service - mozistorageservice. open a connection to the database of your choice - mozistorageconnection. create statements to execute on the connection - mozistoragestatement. bind parameters to a statement as necessary. execute the statement. check for errors. reset the s...
...base, but this is not recommended. this extension is treated specially by windows as a known extension for an 'application compatibility database' and changes are backed up by the system automatically as part of system restore functionality. this can result in significantly higher overhead file operation. closing a connection to close a connection on which only synchronous transactions were per
formed, use the mozistorageconnection.close() method. if you per
formed any asynchronous transactions, you should instead use the mozistorageconnection.asyncclose() method. the latter will allow all ongoing transactions to complete before closing the connection, and will optionally notify you via callback when the connection is closed. statements this section demonstrates how you can execute sql stat...
...bound later (described in binding parameters). note: numerical indexes for parameters are always one less than the number you write in the sql. the use of numerical indexes for parameters is strongly discouraged in javascript where named parameters are much easier to use. note: if you need to execute a statement multiple times, caching the result of createstatement will give you a noticeable per
formance improvement because the sql query does not need to be parsed each time. binding parameters in order to effectively use the statements that you create, you have to bind values to the parameters you placed in the statement. a given placeholder can appear multiple times in the same statement, and all instances of it will be replaced with the bound value. if you neglect to bind a value to a par...
...And 3 more matches
MailNews fakeserver
so be used in manual qa tests. basic structure fakeserver is situated entirely under mailnews/test/fakeserver/. it is comprised of three major components: a daemon, a handler, and the server itself. the server itself is found in mailnews/test/fakeserver/maild.js and was largely based off of the httpd fakeserver from network code. it utilizes utf-8 as its transport mechanism and is capable of per
forming proper pipelining of commands. the other two components are specific to the protocol type and found under similar files in the same directory (e.g., smtpd.js). a daemon is in
formation about the server that can be manipulated. an example of such a manipulation is adding a folder or adding messages. daemons should usually persist for the entirety of the test. the handler is the glue between the ...
...// this sets up the fake server var server = new nsmailserver(new handler(daemon)); // port to use. i tend to like using 1024 + default port number myself. // probably best to include as a constant somewhere. also, use something // larger than 1024 for best results. ...
...ewhere. also, use something // larger than 1024 for best results. server.start(port); // set up a nsimsgincomingserver locally localserver.someactionrequiringconnection(); server.per
formtest(); // nothing will be executed until the connection is closed // localserver.closecachedconnections() is generally a good way to do so server.resettest(); // set up second test server.per
formtest(); transaction = server.playtransaction(); // finished with tests server.stop(); } currently, fakeserver provides no means to keep a persistent connection past a test, requiring connections to be closed, possibly forcibly. alternatively, one can wait for the timeout, which occurs after 3 minutes, so not closing connections would make the tests take unbearably long. the server provides...
...And 3 more matches
Working with windows in chrome code
ew window, we usually use a window.open or window.opendialog dom call, like this: var win = window.open("chrome://myextension/content/about.xul", "aboutmyextension", "chrome,centerscreen"); the first parameter to window.open is the uri of the xul file that describes the window and its contents. the second parameter is the window's name; the name can be used in links or
forms as the target attribute. this is different from the user-visible window title, which is specified using xul. the third, and optional, parameter is a list of special window features the window should have. the window.opendialog function works similarly, but lets you specify optional arguments that can be referenced from the javascript code. it also handles window features a little differently, ...
...u can use the content shortcut property to accesss the window object of the content document. for example: // alerts the title of the document displayed in the content-primary widget alert(content.document.title); for example, you can use content.document in a browser.xul overlay to access the web page in the selected tab in a firefox window. some examples use _content instead of content. the
former has been deprecated for a while, and you should use content in the new code. accessing a document in the sidebar firefox has a sidebar, which is implemented as a <browser> element with id="sidebar". to access the elements and variables inside the sidebar, you need to use document.getelementbyid("sidebar").contentdocument or .contentwindow, like when accessing content documents. for more side...
...helltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); this allows you to cross the chrome-content boundaries, and returns the main window object. finding already opened windows the window mediator xpcom component (nsiwindowmediator interface) provides in
formation about existing windows. two of its methods are often used to obtain in
formation about currently open windows: getmostrecentwindow and getenumerator. please refer to the nsiwindowmediator page for more in
formation and examples of using nsiwindowmediator. === example: opening a window only if it's not opened already === xxx tbd passing data between windows when working with multiple windows,...
...And 3 more matches
Initialization and Destruction - Plugins
an example that shows the use of both the np_initialize and np_shutdown methods, see initialize and shutdown example. 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. for more in
formation, see registering plug-ins. plug-ins are native code libraries: .dll files on windows, .so or .dso files on unix, and powerpc shared library files or 68k code resources on mac os. to reduce memory overhead, plug-ins are usually loaded only when needed and released as soon as possible. in the initialization process, the browser passes the plug-in two tables of function pointers for all api c...
...wser passes the plug-in two tables of function pointers for all api calls: one table lists all api calls from the plug-in to the browser. this table is filled out by the browser before the initialization call. the other table lists all api calls from the browser to the plug-in. this table is filled out by the plug-in during the initialization call. the function tables also contain version in
formation that the plug-in checks to verify that it is compatible with the api capabilities provided by the application. to check this in
formation, use npn_version. no plug-in api calls can take place in either direction until the initialization completes successfully, with the exception of the functions np_initialize and np_shutdown, which are not in the function tables. however, because np_initiali...
... is created. 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. at this point, a plug-in can call the npn_setvalue function to specify whether it is windowed (the default) or windowless. plug-in instances are created with npp_new and destroyed with npp_destroy. npp_new in
forms the plug-in of the creation of a new instance with the specified mime type. you can allocate instance-specific private data at this time. nperror npp_new(npmimetype plugintype, npp instance, uint16 mode, int16 argc, char *argn[], char *argv[], npsaveddata *saved); the plugintype parameter represents the mime type of this instance of the plug-in.
...And 3 more matches
Streams - Plugins
data they contain, or data sent by a plug-in without an associated url. although a single stream is associated with one specific instance of a plug-in, a plug-in can have more than one stream object per instance. streams can be produced by the browser and consumed by a plug-in instance, or produced by an instance and consumed by the browser. each stream has an associated mime type identifying the
format of the data in the stream. streams produced by the browser can be automatically sent to or requested by the plug-in instance. the browser calls the plug-in methods npp_newstream, npp_writeready, npp_write, and npp_destroystream to, respectively, create a stream, find out how much data the plug-in can handle, push data into the stream, and delete it. the plug-in instance selects a transmission...
...g-in to tell it when a stream is created and to push more data. in contrast, for streams produced by the plug-in, the plug-in calls the plug-in api methods npp_newstream, npp_write, and npp_destroystream to create a stream, push data into it, and delete it. ...
..., local files or http servers that support byte-range requests). the plug-in can set the output parameter type to one of these transmission modes: np_normal: (default): the plug-in can process the data progressively as it arrives from the network or file system through a series of calls to npp_writeready and npp_write. np_asfileonly: this plug-in gets full random access to the data using plat
form-specific file operations. the browser saves stream data to a local file, and, when the stream is complete, delivers the path of the file through a call to npp_streamasfile. np_asfile: this mode is like np_asfileonly except that data is delivered to the plug-in as it is saved to the file, through a series of calls to npp_write. you should use np_asfileonly whenever possible in preference to np_as...
...And 3 more matches
DevTools API - Firefox Developer Tools
or in its own window (we say that the toolbox is undocked). a toolbox (and all the tools it contains) is linked to a target, which is the object the tools are debugging. a target is usually a web page (a tab), but can be other things (a chrome window, a remote tab,…). in terms of code, each tool has to provide a tooldefinition object. a definition is a js light object that exposes different in
formation about the tool (like its name and its icon), and a build method that will be used later-on to start an instance of this tool. the gdevtools global object provides methods to register a tool definition and to access tool instances. an instance of a tool is called a toolpanel. the toolpanel is built only when the tool is selected (not when the toolbox is opened). there is no way to "close/des...
...mes and handle toolboxes for different tabs and windows. to use the gdevtools api from an add-on, it can be imported with following snippet const { gdevtools } = require("resource:///modules/devtools/gdevtools.jsm"); methods registertool(tooldefinition) registers a new tool and adds a tab to each existing toolbox. ...
... unregistertheme(theme) unregisters the given theme. parameters: theme {themedefinition|string} - the theme definition object or the theme identifier. showtoolbox(target [, toolid [, hosttype [, hostoptions]]]) opens a toolbox for given target either by creating a new one or activating an existing one. ...
...And 3 more matches
Call Tree - Firefox Developer Tools
me. statistically, the number of samples taken in which we were executing a particular function corresponds to the amount of time the browser spent executing it. in this article, we'll use the output of a simple program as an example. if you want to get the program to experiment with your profile, you can find it here. you can find the specific profile we discuss here - just import it to the per
formance tool to follow along. there's a short page describing the structure of this program here. note that we use the same program - the same profile, in fact - in the documentation page for the flame chart. the screenshot below shows the output of a program that compares three sorting algorithms - bubble sort, selection sort, and quicksort. to do this, it generates some arrays filled with rando...
...if your site is making the browser work hard, this might not show up as samples recorded in your code, but it is still your problem. in our example, there are 679 samples assigned to gecko - the second-largest group after bubblesort(). let's expan...
... -> bubblesort() // 1345 -> swap() // 252 -> selectionsort() // 190 -> swap() // 1 -> quicksort() // 103 -> partition() // 12 plat
form data you'll also see some rows labeled gecko, input & events, and so on. these represent internal browser calls. this can be useful in
formation too. if your site is making the browser work hard, this might not show up as samples recorded in your code, but it is still your problem. in our example, there are 679 samples assigned to gecko - the second-largest group after bubblesort(). let's expand that: this result is telling us that 614 of those samples, or about 20% of the total cost, are coming from our sort() call. if we look a...
...And 3 more matches
Intensive JavaScript - Firefox Developer Tools
in this article we'll take an example site whose long-running javascript causes responsiveness problems, and apply two different approaches to fixing them. ...
... in this article we'll take an example site whose long-running javascript causes responsiveness problems, and apply two different approaches to fixing them. ...
... button group to control how to run the javascript: as a single blocking operation in the main thread, as a series of smaller operations in the main thread using requestanimationframe(), or in another thread using a worker. a button to run the javascript, labeled "do pointless computations!". a button to start and stop some css animations. this just gives the browser some background tasks to per
form. leaving the radio button set to "use blocking call in main thread", make a recording: press the "start animations" button start recording a per
formance profile press "do pointless computations!" two or three times stop recording the profile exactly what you see will vary from one machine to another, but it will be something like this: the top half of this is the waterfall overview. ...
...And 3 more matches
Applying styles and colors - Web APIs
r even-width lines, each half ends up being an integer amount of pixels, so you want a path that is between pixels (that is, (3,1) to (3,5)), instead of down the middle of pixels. while slightly painful when initially working with scalable 2d graphics, paying attention to the pixel grid and the position of paths ensures that your drawings will look correct regardless of scaling or any other trans
formations involved. a 1.0-width vertical line drawn at the correct position will become a crisp 2-pixel line when scaled up by 2, and will appear at the correct position. a linecap example the linecap property determines how the end points of every line are drawn. there are three possible values for this property and those are: butt, round and square. by default this property is set to butt. b...
...ced from the inside connection point. if two lines exceed this value, a bevel join gets drawn instead. note that the maximum miter length is the product of the line width measured in the current coordinate system, by the value of this miterlimit property (whose default value is 10.0 in the html <canvas>), so the miterlimit can be set independently from the current display scale or any affine trans
forms of paths: it only influences the effectively rendered shape of line edges. more exactly, the miter limit is the maximum allowed ratio of the extension length (in the html canvas, it is measured between the outside corner of the joined edges of the line and the common endpoint of connecting segments specified in the path) to half the line width. it can equivalently be defined as the maximum allo...
...s ctx.beginpath(); ctx.moveto(0, 100); for (i = 0; i < 24 ; i++) { var dy = i % 2 == 0 ? ...
...And 3 more matches
DataTransfer.types - Web APIs
if the drag operation included no data, this list will be empty. if any files are included in the drag operation, then one of the types will be the string files. ...
...if the drag operation included no data, this list will be empty. if any files are included in the drag operation, then one of the types will be the string files. ...
...if the drag operation included no data, this list will be empty. if any files are included in the drag operation, then one of the types will be the string files. ...
...And 3 more matches
GlobalEventHandlers.oninvalid - Web APIs
the oninvalid property of the globaleventhandlers mixin is an eventhandler that processes invalid events. the invalid event fires when a submittable element has been checked and doesn't satisfy its constraints. the validity of submittable elements is checked before submitting their owner
form, or after the checkvalidity() method of the element or its owner
form is called. ...
...ed before submitting their owner
form, or after the checkvalidity() method of the element or its owner
form is called. syntax target.oninvalid = functionref; var functionref = target.oninvalid; value functionref is a function name or a function expression. the function receives a event object as its sole argument. example this example demonstrates oninvalid and onsubmit event handlers on a
form. html <
form id="
form"> <p id="error" hidden>please fill out all fields.</p> <label for="city">city</label> <input type="text" id="city" required> <button type="submit">submit</button> </
form> <p id="thanks" hidden>your data has been received. ...
... object as its sole argument. example this example demonstrates oninvalid and onsubmit event handlers on a
form. html <
form id="
form"> <p id="error" hidden>please fill out all fields.</p> <label for="city">city</label> <input type="text" id="city" required> <button type="submit">submit</button> </
form> <p id="thanks" hidden>your data has been received. ...
...And 3 more matches
GlobalEventHandlers.onsubmit - Web APIs
the onsubmit property of the globaleventhandlers mixin is an eventhandler that processes submit events. the submit event fires when the user submits a
form. syntax target.onsubmit = functionref; value functionref is a function name or a function expression. the function receives a focusevent object as its sole argument. example this example demonstrates oninvalid and onsubmit event handlers on a
form. ...
... of the globaleventhandlers mixin is an eventhandler that processes submit events. the submit event fires when the user submits a
form. syntax target.onsubmit = functionref; value functionref is a function name or a function expression. the function receives a focusevent object as its sole argument. example this example demonstrates oninvalid and onsubmit event handlers on a
form. html <
form id="
form"> <p id="error" hidden>please fill out all fields.</p> <label for="city">city</label> <input type="text" id="city" required> <button type="submit">submit</button> </
form> <p id="thanks" hidden>your data has been received. ...
... object as its sole argument. example this example demonstrates oninvalid and onsubmit event handlers on a
form. html <
form id="
form"> <p id="error" hidden>please fill out all fields.</p> <label for="city">city</label> <input type="text" id="city" required> <button type="submit">submit</button> </
form> <p id="thanks" hidden>your data has been received. ...
...And 3 more matches
HTMLDialogElement.close() - Web APIs
an optional domstring may be passed as an argument, updating the returnvalue of the the dialog. syntax dialoginstance.close(returnvalue); parameters returnvalue optional a domstring representing an updated value for the htmldialogelement.returnvalue of the dialog. return value void. ...
... returnvalue optional a domstring representing an updated value for the htmldialogelement.returnvalue of the dialog. return value void. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a
form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the
form via the submit button. ...
...tmldialogelement.returnvalue of the dialog. return value void. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a
form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the
form via the submit button. ...
...And 3 more matches
HTMLDialogElement.open - Web APIs
a boolean representing the state of the open html attribute. true means it is set, and therefore the dialog is shown. false means it not set, and therefore the dialog is not shown. the property is now read only — it is possible to set the value to programmatically show or hide the dialog. ...
...ore the dialog is not shown. the property is now read only — it is possible to set the value to programmatically show or hide the dialog. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a
form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the
form via the submit button. ...
...ble to set the value to programmatically show or hide the dialog. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a
form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the
form via the submit button. ...
...And 3 more matches
HTMLDialogElement.show() - Web APIs
the show() method of the htmldialogelement interface displays the dialog modelessly, i.e. still allowing interaction with content outside of the dialog. syntax dialoginstance.show(); parameters none. return value void. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a
form via the show() method. ...
...ssly, i.e. still allowing interaction with content outside of the dialog. syntax dialoginstance.show(); parameters none. return value void. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a
form via the show() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the
form via the submit button. ...
...syntax dialoginstance.show(); parameters none. return value void. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a
form via the show() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the
form via the submit button. ...
...And 3 more matches
HTMLDialogElement.showModal() - Web APIs
tside the dialog is blocked and the content outside it is rendered inert. syntax dialoginstance.showmodal(); parameters none. return value void. exceptions if the dialog is already open (i.e. if the open attribute is already set on the <dialog> element), an invalidstateerror is thrown. ...
...ceptions if the dialog is already open (i.e. if the open attribute is already set on the <dialog> element), an invalidstateerror is thrown. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a
form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the
form via the submit button. ...
...ady set on the <dialog> element), an invalidstateerror is thrown. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a
form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the
form via the submit button. ...
...And 3 more matches
HTMLDialogElement - Web APIs
with content outside of the dialog. htmldialogelement.showmodal() displays the dialog as a modal, over the top of any other dialogs that might be present. interaction outside the dialog is blocked. events close fired when the dialog is closed. also available via the onclose property. ...
... the dialog is blocked. events close fired when the dialog is closed. also available via the onclose property. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a
form via the htmldialogelement.showmodal() function. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() function), or submit the
form via the submit button. ...
... also available via the onclose property. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a
form via the htmldialogelement.showmodal() function. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() function), or submit the
form via the submit button. ...
...And 3 more matches
In depth: Microtasks and the JavaScript runtime environment - Web APIs
nced to include powerful features that enable scheduling of tasks, multi-threaded application development, and so forth. to understand where queuemicrotask() comes into play here, it's helpful to understand how the javascript runtime operates when scheduling and running code. javascript execution contexts note: the details here are generally not important to most javascript programmers. this in
formation is provided as a basis for why microtasks are useful and how they function; if you don't care, you can skip this and come back later if you find that you need to. when a fragment of javascript code runs, it runs inside an execution context. 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 ...
...ed. the main program exits and its execution context is removed from the execution stack; as there are no contexts remaining on the stack, program execution ends. using execution contexts in this manner, each program and function is able to have its own set of variables and other objects. each context additionally tracks the next line in the program that should be run and other in
formation critical to that context's operation. by using the contexts and the context stack in this manner, many of the fundamentals of how a program operates can be managed, including local and global variables, function calls and returns, and so forth. a special note about recursive functions—that is, functions which call themselves, possibly over multiple levels of depth or recursion: each recur...
... thread—which some browsers share across multiple agents—each component of an agent is unique to that agent. here we look at how the runtime functions in slightly more detail. event loops each agent is driven by an event loop, which collects any user and other events, enqueuing tasks to handle each callback. it then runs any pending javascript tasks, then any pending microtasks, then per
forms any needed rendering and painting before looping again to check for pending tasks. your web site or app's code runs in the same thread, sharing the same event loop, as the user interface of the web browser itself. this is the main thread, and in addition to running your site's main code body, it handles receiving and dispatching user and other events, rendering and painting web content, and so ...
...And 3 more matches
Dragging and Dropping Multiple Items - Web APIs
item to add. you should add them in order starting with 0 as you cannot add items at positions farther than the last item, however you can replace existing items by using indices you have already added. using 0 as the index is equivalent to calling setdata(). you can clear an item using the mozcleardataat() method. event.datatransfer.mozcleardataat("text/plain", 1); caution: removing the last
format for a particular index will remove that item entirely, shifting the remaining items down, so the later items will have different indices. for example: var dt = event.datatransfer; dt.mozsetdataat("text/uri-list", "url1", 0); dt.mozsetdataat("text/plain", "url1", 0); dt.mozsetdataat("text/uri-list", "url2", 1); dt.mozsetdataat("text/plain", "url2", 1); dt.mozsetdataat("text/uri-list", "ur...
... // [item1] data=url1, index=0 // [item2] data=url3, index=1 fortunately, you don't normally need to clear items often; it's more common to just add the items only when you know they are nee...
...n the old third item becomes new second item, and its index decreases. // [item1] data=url1, index=0 // [item2] data=url3, index=1 fortunately, you don't normally need to clear items often; it's more common to just add the items only when you know they are needed. common cases where dragging multiple items is used is when dragging multiple files or bookmarks. in this case, add the appropriate
formats for each item. although not required, you should always add the same
formats for each item. the ensures that receiving drop targets can expect consistent data. to check if multiple files are being dragged, check the mozitemcount property. it will be set to the number of items being dragged. if a particular drop target only supports dropping a single item, it could either reject the dragged it...
...And 3 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 per
formed as well as the data needed to per
form the action. properties action a media session action type string taken from the mediasessionaction enumerated type, indicating which type of action needs to be per
formed. see media action types below for possible values. ...
...this property can be used to indicate that you should use the shortest possible method to seek the media. fastseek is not included on the final action in the seek sequence in this situation. ...
...this property can be used to indicate that you should use the shortest possible method to seek the media. ...
...And 3 more matches
Using the Media Capabilities API - Web APIs
ow well media is being handled, in real time. these features include: the ability to query the browser to determine its ability to encode or decode media given a specified set of encoding parameters. these parameters may include the codecs, resolutions, bit rates, frame rates, and other such details. with the media capabilities api, you can determine not just if the browser can support a given
format, but whether or not it can do so efficiently and smoothly. in short, this api replaces—and improves upon—the mediasource method istypesupported() or the htmlmediaelement method canplaytype(). more and more finely-detailed in
formation about the display's properties, so that in
formed decisions can be made when choosing the best
format to play on the user's device. for example, you can use th...
...one feature of this is the ability to detect when the device switches gpus, so you can make appropriate adjustments based on the new gpu's capabilities. ...
...one feature of this is the ability to detect when the device switches gpus, so you can make appropriate adjustments based on the new gpu's capabilities. note: the display capabilities functionality mentioned in the third point above have not yet appeared in any browser. ...
...And 3 more matches
PaymentCurrencyAmount.value - Web APIs
th up to one optional decimal point. an optional leading minus sign ("-") can be included to indicate a negative value, such as to represent a refund or discount. important note: the number given in this string is always specified using the period (".") as the decimal point, rather than the comma (","), even if the user's locale normally uses the comma. you must convert the entered text to this
form or it will not be valid. syntax value = paymentcurrencyamount.value; value a domstring indicating the numeric value of the payment. this must be a valid decimal number, with an optional leading minus sign ("-"), then one or more decimal digits 0 through 9, optionally with a decimal point (".") with at least one digit following it to represent fractional units. there must not be any leading o...
...aymentcurrencyamount.value; value a domstring indicating the numeric value of the payment. this must be a valid decimal number, with an optional leading minus sign ("-"), then one or more decimal digits 0 through 9, optionally with a decimal point (".") with at least one digit following it to represent fractional units. there must not be any leading or trailing whitespace in the string. for uni
formity and consistency, the value is always given using the period (".") as the decimal character, regardless of the user's locale. you need to convert the value to this
format before submitting the payment. see the example verifying a properly
formatted price below for a simple regular expression that can be used to validate the value string prior to submission. examples representing prices this...
... string prior to submission. ...
...And 3 more matches
PaymentRequest.show() - Web APIs
tax paymentpromise = paymentrequest.show(detailspromise); parameters detailspromise optional an optional promise that you can provide if your architecture requires that the payment request's details need to be updated between instantiating the payment interface and the user beginning to interact with it. the promise should resolve with a paymentdetailsupdate object containing the updated in
formation. return value a promise that eventually resolves with a paymentresponse. the promise is resolved when the user accepts the payment request (such as by clicking a "pay" button in the browser's payment sheet). exceptions aborterror the returned promise rejects with an aborterror if the user agent is already showing a payment panel. only one payment panel may be visible at a time acro...
...sponse)) .catch(err => handleerror(err)); } this is functionally equivalent to the processpayment() method using the await syntax. function validateresponse(response) { checkallvalues(response) .then(response => response.complete("success")) .catch(response => response.complete("fail")); } you could even have checkallvalues() be a synchronous function, although that may have per
formance implications you don't want to deal with: function validateresponse(response) { if (checkallvalues(response) { response.complete("success"); } else { response.complete("fail"); } } see the article using promises for more in
formation if you need more in
formation about working with promises. examples in the following example, a paymentrequest object is instantiated before the...
...(response) { response.complete("success"); } else { response.complete("fail"); } } see the article using promises for more in
formation if you need more in
formation about working with promises. examples in the following example, a paymentrequest object is instantiated before the show() method is called. this method triggers the user agent's built-in process for retrieving payment in
formation from the user. the show() method returns a promise that resolves to a paymentresponse object when the user interaction is complete. the developer then uses the in
formation in the paymentresponse object to
format and send payment data to the server. ...
...And 3 more matches
Payment Request API - Web APIs
the payment request api provides a consistent user experience for both merchants and users. it is not a new way for paying for things; rather, it's a way for users to select their preferred way of paying for things, and make that in
formation available to a merchant. payment request concepts and usage many problems related to online shopping-cart abandonment can be traced to checkout
forms, which can be difficult and time consuming to fill out and often require multiple steps to complete. the payment request api is meant to reduce the number of steps needed to complete a payment online, potentially doing away with checkout
forms. it aims to make the checkout process easier, by remembering a user's details, which are then passed along to a merchant hopefully without requiring a html...
... which can be difficult and time consuming to fill out and often require multiple steps to complete. the payment request api is meant to reduce the number of steps needed to complete a payment online, potentially doing away with checkout
forms. it aims to make the checkout process easier, by remembering a user's details, which are then passed along to a merchant hopefully without requiring a html
form. advantages of using the payment request api with "basic-card" (card-based payments): fast purchase experience: users enter their details once into the browser and are then ready to pay for goods and services on the web. they no longer have to fill out the same details repeatedly across different sites. consistent experience on every site (that supports the api): as the payment sheet is cont...
...hich card to use based on past usage patterns or restrictions from the merchant (e.g, "we only accept visa or mastercard"), or allow the user to say which is their default/favorite card. to request a payment, a web page creates a paymentrequest object in response to a user action that initiates a payment, such as clicking a "purchase" button. ...
...And 3 more matches
SVGMatrix - Web APIs
warning: svg 2 replaced the svgmatrix interface by the more general dommatrix and dommatrixreadonly interfaces. properties svgmatrix.a a float representing the a component of the matrix. svgmatrix.b a float representing the b component of the matrix. svgmatrix.c a float representing the c component of the matrix. svgmatrix.d a float representing the d component of the matrix. ...
... the a component of the matrix. svgmatrix.b a float representing the b component of the matrix. svgmatrix.c a float representing the c component of the matrix. svgmatrix.d a float representing the d component of the matrix. svgmatrix.e a float representing the e component of the matrix. svgmatrix.f a float representing the f component of the matrix. ...
...t representing the e component of the matrix. svgmatrix.f a float representing the f component of the matrix. methods svgmatrix.multiply() per
forms matrix multiplication. this matrix is post-multiplied by another matrix, returning the resulting new matrix as svgmatrix. svgmatrix.inverse() returns the inverse matrix as svgmatrix. svgmatrix.translate() post-multiplies a translation trans
formation on the current matrix and returns the resulting matrix as svgmatrix. svgmatrix.scale() post-multiplies a uni
form scale trans
formation on the current matrix and returns the resulting matrix as svgmatrix. svgmatrix.scalenonuni
form() post-multiplies a non-uni
form scale trans
formation on the current matrix and returns the resulting matrix as svgmatrix. svgmatrix.rotate() post-multiplies a ...
...And 3 more matches
Using Service Workers - Web APIs
the premise of service workers one overriding problem that web users have suffered with for years is loss of connectivity. the best web app in the world will provide a terrible user experience if you can’t download it. there have been various attempts to create technologies to solve this problem, and some of the issues have been solved. ...
...th service workers many service workers features are now enabled by default in newer versions of supporting browsers. if however you find that demo code is not working in your installed versions, you might need to enable a pref: firefox nightly: go to about:config and set dom.serviceworkers.enabled to true; restart browser. chrome canary: go to chrome://flags and turn on experimental-web-plat
form-features; restart browser (note that some features are now enabled by default in chrome.) opera: go to opera://flags and enable support for serviceworker; restart browser. microsoft edge: go to about:flags and tick enable service workers; restart browser. you’ll also need to serve your code via https — service workers are restricted to running across https for security reasons. github is ...
...ntry point into using service workers. if ('serviceworker' in navigator) { navigator.serviceworker.register('./sw-test/sw.js', {scope: './sw-test/'}) .then((reg) => { // registration worked console.log('registration succeeded. scope is ' + reg.scope); }).catch((error) => { // registration failed console.log('registration failed with ' + error); }); } the outer block per
forms a feature detection test to make sure service workers are supported before trying to register one. next, we use the serviceworkercontainer.register() function to register the service worker for this site, which is just a javascript file residing inside our app (note this is the file's url relative to the origin, not the js file that references it.) the scope parameter is optional, and can be u...
...And 3 more matches
SpeechSynthesis - Web APIs
properties speechsynthesis also inherits properties from its parent interface, eventtarget. speechsynthesis.paused read only a boolean that returns true if the speechsynthesis object is in a paused state. speechsynthesis.pending read only a boolean that returns true if the utterance queue contains as-yet-unspoken utterances. ...
...utterance); now we'll look at a more fully-fledged example. in our speech synthesiser demo, we first grab a reference to the speechsynthesis controller using window.speechsynthesis. after defining some necessary variables, we retrieve a list of the voices available using speechsynthesis.getvoices() and populate a select menu with them so the user can choose what voice they want. ...
...re fully-fledged example. in our speech synthesiser demo, we first grab a reference to the speechsynthesis controller using window.speechsynthesis. after defining some necessary variables, we retrieve a list of the voices available using speechsynthesis.getvoices() and populate a select menu with them so the user can choose what voice they want. ...
...And 3 more matches
SpeechSynthesisUtterance - Web APIs
language, pitch and volume.) constructor speechsynthesisutterance.speechsynthesisutterance() returns a new speechsynthesisutterance object instance. properties speechsynthesisutterance also inherits properties from its parent interface, eventtarget. speechsynthesisutterance.lang gets and sets the language of the utterance. speechsynthesisutterance.pitch gets and sets the pitch at which the utterance will be spoken at. ...
...ailable via the onstart property. examples in our basic speech synthesiser demo (source), we first grab a reference to the speechsynthesis controller using window.speechsynthesis. after defining some necessary variables, we retrieve a list of the voices available using speechsynthesis.getvoices() and populate a select menu with them so the user can choose what voice they want. ...
... examples in our basic speech synthesiser demo (source), we first grab a reference to the speechsynthesis controller using window.speechsynthesis. after defining some necessary variables, we retrieve a list of the voices available using speechsynthesis.getvoices() and populate a select menu with them so the user can choose what voice they want. ...
...And 3 more matches
Touch events - Web APIs
urface. during this interaction, an application receives touch events during the start, move, and end phases. touch events are similar to mouse events except they support simultaneous touches and at different locations on the touch surface. the touchevent interface encapsulates all of the touchpoints that are currently active. the touch interface, which represents a single touchpoint, includes in
formation such as the position of the touch point relative to the browser viewport. definitions surface the touch-sensitive surface. this may be a screen or trackpad. touch point a point of contact with the surface. this may be a finger (or elbow, ear, nose, whatever, but typically a finger) or stylus. interfaces touchevent represents an event that occurs when the state of touches on t...
...them onto an array of active touchpoints and drawing the start point for the draw as a small circle; we're using a 4-pixel wide line, so a 4-pixel radius circle will show up neatly. drawing as the touches move each time one or more fingers move, a touchmove event is delivered, resulting in our handlemove() function being called. its responsibility in this example is to update the cached touch in
formation and to draw a line from the previous position to the current position of each touch. function handlemove(evt) { evt.preventdefault(); var el = document.getelementbyid("canvas"); var ctx = el.getcontext("2d"); var touches = evt.changedtouches; for (var i = 0; i < touches.length; i++) { var color = colorfortouch(touches[i]); var idx = ongoingtouchindexbyid(touches[i].identi...
...this is done by looking at each touch's touch.identifier property. this property is a unique integer for each touch and remains consistent for each event during the duration of each finger's contact with the surface. this lets us get the coordinates of the previ...
...And 3 more matches
WebGL2RenderingContext.texSubImage3D() - Web APIs
the webgl2renderingcontext.texsubimage3d() method of the webgl api specifies a sub-rectangle of the current texture. ...
... the webgl2renderingcontext.texsubimage3d() method of the webgl api specifies a sub-rectangle of the current texture. ...
...rectangle of the current texture. ...
...And 3 more matches
WebGLRenderingContext.compressedTexImage[23]D() - Web APIs
the webglrenderingcontext.compressedteximage2d() and webgl2renderingcontext.compressedteximage3d() methods of the webgl api specify a two- or three-dimensional texture image in a compressed
format. compressed image
formats must be enabled by webgl extensions before using these methods. ...
... the webglrenderingcontext.compressedteximage2d() and webgl2renderingcontext.compressedteximage3d() methods of the webgl api specify a two- or three-dimensional texture image in a compressed
format. compressed image
formats must be enabled by webgl extensions before using these methods. ...
...exture image in a compressed
format. compressed image
formats must be enabled by webgl extensions before using these methods. ...
...And 3 more matches
Data in WebGL - Web APIs
(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 uni
forms. attributes attributes are glsl variables which are only available to the vertex shader (as variables) and the javascript code. attributes are typically used to store color in
formation, texture coordinates, and any other data calculated or retrieved that needs to be shared between the javascript code and the vertex shader. //init colors var vertexcolors = [ vec4( 0.0, 0.0, 0.0, ...
..., false, 0, 0 ); gl.enablevertexattribarray( vcolor ); //glsl attribute vec4 vcolor; void main() { fcolor = vcolor; } varyings varyings are variables that are declared by the vertex shader and used to pass data from the vertex shader to the fragment shader. this is commonly used to share a vertex's normal vector after it has been computed by the vertex shader. ...
..., 0 ); gl.enablevertexattribarray( vcolor ); //glsl attribute vec4 vcolor; void main() { fcolor = vcolor; } varyings varyings are variables that are declared by the vertex shader and used to pass data from the vertex shader to the fragment shader. this is commonly used to share a vertex's normal vector after it has been computed by the vertex shader. ...
...And 3 more matches
Animating textures in WebGL - Web APIs
« previous in this demonstration, we build upon the previous example by replacing our static textures with the frames of an mp4 video file that's playing. this is actually pretty easy to do and fun to watch, so let's get started. you can use similar code to use any sort of data (such as a <canvas>) as the source for your textures. this example uses the glmatrix library to per
form its matrix and vertex math. you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. getting access to the video the first step is to create the <video> element that we'll use to retrieve the video frames: // will set to true when video can be copied to texture var copyvideo = false; function setupvideo(url) { const video = ...
...ture object, put a single pixel in it, and set its filtering for later use: function inittexture(gl) { const texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); // because video has to be download over the internet // they might take a moment until it's ready so // put a single pixel in the texture so we can // use it immediately. ...
...ittexture(gl) { const texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); // because video has to be download over the internet // they might take a moment until it's ready so // put a single pixel in the texture so we can // use it immediately. const level = 0; const internal
format = gl.rgba; const width = 1; const height = 1; const border = 0; const src
format = gl.rgba; const srctype = gl.unsigned_byte; const pixel = new uint8array([0, 0, 255, 255]); // opaque blue gl.teximage2d(gl.texture_2d, level, internal
format, width, height, border, src
format, srctype, pixel); // turn off mips and set wrapping to clamp to edge so it // will work regardless of the dimensions of the video. gl.texparameteri(gl.textur...
...And 3 more matches
Using DTMF with WebRTC - Web APIs
webrtc doesn't send dtmf codes as audio data. instead, they're sent out-of-band, as rtp payloads. note, however, that although it's possible to send dtmf using webrtc, there is currently no way to detect or receive incoming dtmf. webrtc currently ignores these payloads; this is because webrtc's dtmf support is primarily intended for use with legacy telephone services that rely on dtmf tones to per
form tasks such as: teleconferencing systems menu systems voicemail systems entry of credit card or other payment in
formation passcode entry note: while the dtmf is not sent to the remote peer as audio, browsers may choose to play the corresponding tone to the local user as part of their user experience, since users are typically used to hearing their phone play the tones audibly. sending ...
...simply linked up inline as it is here. html the html for this example is very basic; there are only three elements of importance: an <audio> element to play the audio received by the rtcpeerconnection being "called." a <button> element to trigger creating and connecting the two rtcpeerconnection objects, then sending the dtmf tones. a <div> to receive and display log text to show status in
formation. <p>this example demonstrates the use of dtmf in webrtc. note that this example is "cheating" by generating both peers in one code stream, rather than having each be a truly separate entity.</p> <audio id="audio" autoplay controls></audio><br/> <button name="dial" id="dial">dial</button> <div class="log"></div> javascript let's take a look at the javascript code next.
...dtrack because some browsers have not yet implemented rtcpeerconnection.addtrack(), therefore requiring the use of the obsolete addstream() method, we use this boolean to determine whether or not the user agent supports addtrack(); if it doesn't, we'll fall back to addstream(). this gets figured out in connectanddial(), as shown in starting the connection process. mediaconstraints an object con
forming to the mediaconstraints dictionary specifying the constraints to use when starting the connection. we want an audio-only connection, so video is false, while audio is true. offeroptions an rtcofferoptions object providing options to specify when calling rtcpeerconnection.createoffer(). in this case, we state that we want to receive audio but not video. dialbutton and logelement these varia...
...And 3 more matches
Background audio processing using AudioWorklet - Web APIs
the drawback to scriptprocessornode was simple: it ran on the main thread, thus blocking everything else going on until it completed execution. this was far less than ideal, especially for something that can be as computationally expensive as audio processing. enter audioworklet. ...
...ocess of creating an audio processor using javascript, establishing it as an audio worklet processor, and then using that processor within a web audio application is the topic of this article. it's worth noting that because audio processing can often involve substantial computation, your processor may benefit greatly from being built using webassembly, which brings near-native or fully native per
formance to web apps. implementing your audio processing algorithm using webassembly can make it per
form markedly better. high level overview before we start looking at the use of audioworklet on a step-by-step basis, let's start with a brief high-level overview of what's involved. create module that defines a audio worklet processor class, based on audioworkletprocessor which takes audio from on...
... access the audio context's audioworklet through its audioworklet property, and call the audio worklet's domxref("worklet.addmodule", "addmodule()")}} method to install the audio worklet processor module. ...
...And 3 more matches
Visualizations with Web Audio API - Web APIs
this article explains how, and provides a couple of basic use cases. note: you can find working examples of all the code snippets in our voice-change-o-matic demo. ...
... source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(audioctx.destination); note: you don't need to connect the analyser's output to another node for it to work, as long as the input is connected to the source, either directly or via another node. the analyser node will then capture audio data using a fast fourier trans
form (fft) in a certain frequency domain, depending on what you specify as the analysernode.fftsize property value (if no value is specified, the default is 2048.) note: you can also specify a minimum and maximum power value for the fft data scaling range, using analysernode.mindecibels and analysernode.maxdecibels, and different data averaging constants using analysernode.smoothingtimeconstant. rea...
...y domain, depending on what you specify as the analysernode.fftsize property value (if no value is specified, the default is 2048.) note: you can also specify a minimum and maximum power value for the fft data scaling range, using analysernode.mindecibels and analysernode.maxdecibels, and different data averaging constants using analysernode.smoothingtimeconstant. read those pages to get more in
formation on how to use them. to capture data, you need to use the methods analysernode.getfloatfrequencydata() and analysernode.getbytefrequencydata() to capture frequency data, and analysernode.getbytetimedomaindata() and analysernode.getfloattimedomaindata() to capture wave
form data. these methods copy data into a specified array, so you need to create a new array to receive the data before invo...
...And 3 more matches
Attestation and Assertion - Web APIs
tion certificate. the attestation certificate is built into the authenticator during manufacturing time and is specific to a device model. that is, all "samsung galaxy s8" phones, manufactured at a specific time or particular manufacturing run, have the same attestation certificate. the attestation is returned through the webauthn api as the authenticatorattestationresponse. the attestation
format contains two basic arraybuffers: clientdatajson - an arraybuffer that contains a json representation of what the browser saw when being asked to authenticate. attestationobject - cryptographic attestation that a newly generated keypair was created by that authenticator. contains authenticator data and an attestation statement. the authenticator data contains an attestedcredentialdat...
...attestedcredentialdata field. the attestedcredentialdata field contains the credentialid and credentialpublickey. (the authenticator data is the same structure that is used in the authenticatorassertionresponse. the attestedcredentialdata is an optional field used in attestation. ...
...estedcredentialdata field contains the credentialid and credentialpublickey. (the authenticator data is the same structure that is used in the authenticatorassertionresponse. the attestedcredentialdata is an optional field used in attestation. it is not included when used in the authenticatorassertionresponse.) different devices have different attestation
formats. ...
...And 3 more matches
Using the aria-invalid attribute - Accessibility
description this technique demonstrates how to use the aria-invalid attribute. the aria-invalid attribute is used to indicate that the value entered into an input field does not con
form to the
format expected by the application.this may include
formats such as email addresses or telephone numbers. aria-invalid can also be used to indicate that a required field has not been filled in.the attribute should be programmatically set as a result of a validation process. this attribute can be used with any typical html
form element; it is not limited to elements that have an aria role assigned. values vocabulary: false (default) no errors detected grammar a grammatical error has been detected. spelling a spelling error has been detected. true the value has failed validation. ...
... is not limited to elements that have an aria role assigned. values vocabulary: false (default) no errors detected grammar a grammatical error has been detected. spelling a spelling error has been detected. true the value has failed validation. any value not in this vocabulary should be treated as true. ...
...r has been detected. spelling a spelling error has been detected. true the value has failed validation. any value not in this vocabulary should be treated as true. possible effects on user agents and assistive technology user agents should in
form the user when a field is invalid. application authors should provide suggestions for correcting the problem, if possible. authors may prevent a
form from being submitted. note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: simple
form validation the following snippet shows a simplified version of two
form fields with a validation function attached to the blur event. note that since the default value for ...
...And 3 more matches
Architecture - Accessibility
exposed in leaf nodes as it is in a w3c dom. the text is actually exposed via a special text interface in the parent of the text nodes. it is concatenated together with all its sibling text nodes, and embedded objects between the text nodes are exposed as the unicoded embedded object character '\xfffc'. one reason for this is that there are fewer nodes to pass across process, and that improves per
formance. node types text content (role_text) objects are implemented by nstextaccessible. their text is actually exposed in their parent nshypertextaccessible via nsiaccessibletext. when the hierarchy is finally exposed to atk they are stripped out. they are in the nsiaccessible hierarchy to make it easy for nshypertextaccessible to piece its final text representation together. they are kept in ia...
...et of children from the nsiaccessible hierarchy that are not text or whitespace. atk: same as nsiaccessible, except that text and whitespace leaf nodes are not exposed. the children of any hypertext object are an exact match to the links it exposes. the implementation simply doesn't create atkobjects for a whitespace or text leaf nsiaccessibles. see the atk uses of isembeddedobject() for more in
formation on how we do this. iaccessible2: same as nsiaccessible. text and whitespace leaf nodes are exposed, but are redundant with the in
formation in the parent object's nsiaccessibletext. this is done for backward compatibility with older msaa clients which didn't have access to a text interface. the children of a hypertext object are a superset of the links it exposes. the new system makes it ea...
...cess">my link<img src="image.gif">is cool</a>bye</div> both the <a> and <img> are hyperlinks also, both the <div> and <a> are hypertexts so the <a> is both a hypertext and a hyperlink, because it contains text and is contained within text. this means that we have an exact mirror to the dom, but text lives in the parents instead of in the leaves, which now don't really provide additional useful in
formation. they are only provided under msaa/ia2 for backward compatibility. implementation classes here are some notes on the classes we use: nshypertextaccessible is for any container that may wrap both text and embedded object: nsiaccessibletext is supported if there is potentially any text in the container nsiaccessiblehypertext is supported if there is potentially text and embedded objects t...
...And 3 more matches
Keyboard-navigable JavaScript widgets - Accessibility
xt fields, and tab panels. these widgets are typically composed of <div> and <span> elements that do not, by nature, offer the same keyboard functionality that their desktop counterparts do. this document describes techniques to make javascript widgets accessible with the keyboard. using tabindex by default, when people use the tab key to browse a webpage, only interactive elements (like links,
form controls) get focused. with the tabindex global attribute, authors can make other elements focusable, too. when set to 0, the element becomes focusable by keyboard and script. when set to -1, the element becomes focusable by script, but it does not become part of the keyboard focus order. the order in which elements gain focus when using a keyboard, is the source order by default. in exceptional...
... on the page, which means page authors will have to set (and maintain) tabindex values for all focusable elements on the page whenever they use one or more positive values for tabindex. the following table describes tabindex behavior in modern browsers: tabindex attribute focusable with mouse or javascript via element.focus() tab navigable not present follows the plat
form convention of the element (yes for
form controls, links, etc.). follows the plat
form convention of the element. negative (i.e. tabindex="-1") yes no; author must focus the element with focus() in response to arrow or other key presses. zero (i.e. tabindex="0") yes in tab order relative to element's position in document (note that interactive elements like <a> have...
... programmatically apply focus to the new element, update the tabindex of the focused element to "0", and update the tabindex of the previously focused element to "-1". here's an example of a wai-aria tree view using this technique. tips use element.focus() to set focus do not use createevent(), initevent() and dispatchevent() to send focus to an element. dom focus events are considered in
formational only: generated by the system after something is focused, but not actually used to set focus. use element.focus() instead. use onfocus to track the current focus don't assume that all focus changes will come via key and mouse events: assistive technologies such as screen readers can set the focus to any focusable element. track focus using onfocus and onblur instead. onfocus and onblur ...
...And 3 more matches
::placeholder - CSS: Cascading Style Sheets
webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 usability placeholder text with sufficient color contrast may be interpreted as entered input. placeholder text will also disappear when a person enters content into an <input> element. ...
...ion 1.4.3 | w3c understanding wcag 2.0 usability placeholder text with sufficient color contrast may be interpreted as entered input. placeholder text will also disappear when a person enters content into an <input> element. both of these circumstances can interfere with successful
form completion, especially for people with cognitive concerns. an alternate approach to providing placeholder in
formation is to include it outside of the input in close visual proximity, then use aria-describedby to programmatically associate the <input> with its hint. with this implementation, the hint content is available even if in
formation is entered into the input field, and the input appears free of preexisting input when the page is loaded. most screen reading technology will use aria-describedby to rea...
... <input> with its hint. with this implementation, the hint content is available even if in
formation is entered into the input field, and the input appears free of preexisting input when the page is loaded. most screen reading technology will use aria-describedby to read the hint after the input's label text is announced, and the person using the screen reader can mute it if they find the extra in
formation unnecessary. ...
...And 3 more matches
speak-as - CSS: Cascading Style Sheets
for example, an author can specify a counter symbol to be either spoken as its numerical value or just represented with an audio cue. ...
...l-out the user agent will generate a counter representation as normal and would read it out letter by letter. if the user agent doesn't know how to read out a partiular counter symbol, the user agent might read it out as if the value of speak-as was numbers. <counter-style-name> the name of another counter style, specified as a <custom-ident>. ...
... the name of another counter style, specified as a <custom-ident>. if included, the counter will be spoken out in the
form specified in that counter style, kind of like specifying the fallback descriptor. if the specified style does not exist, speak-as defaults to auto. accessibility concerns assistive technology support is very limited for the speak-as property. do not rely on it to convey in
formation critical to understanding the page's purpose. ...
...And 3 more matches
@font-face - CSS: Cascading Style Sheets
the @font-face css at-rule specifies a custom font with which to display text; the font can be loaded from either a remote server or a locally-installed font on the user's own computer. syntax @font-face { font-family: "open sans"; src: url("/fonts/opensans-regular-webfont.woff2")
format("woff2"), url("/fonts/opensans-regular-webfont.woff")
format("woff"); } descriptors font-display determines how a font face is displayed based on whether and when it is downloaded and ready to use. font-family specifies a name that will be used as the font face value for font properties. font-stretch a font-stretch value. since firefox 61 (and in other modern browsers) this also accepts two values to specify a range that is supported by a font-face, for example font-stretch: 50% 200%; f...
...nts. font-variation-settings allows low-level control over opentype or truetype font variations, by specifying the four letter axis names of the features to vary, along with their variation values. src specifies the resource containing the font data. this can be a url to a remote font file location or the name of a font on the user's computer. to provide the browser with a hint as to what
format a font resource is — so it can select a suitable one — it is possible to include a
format type inside a
format() function: src: url(ideal-sans-serif.woff)
format("woff"), url(basic-sans-serif.ttf)
format("truetype"); the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg". unicode-range the range of unicode code points to be used from th...
...ithout relying on an internet connection. it's common to use both url() and local() together, so that the user's installed copy of the font is used if available, falling back to downloading a copy of the font if it's not found on the user's device. the @font-face at-rule may be used not only at the top level of a css, but also inside any css conditional-group at-rule. font mime types
format mime type truetype font/ttf opentype font/otf web open font
format font/woff web open font
format 2 font/woff2 notes web fonts are subject to the same domain restriction (font files must be on the same domain as the page using them), unless http access controls are used to relax this restriction. @font-face cannot be declared wit...
...And 3 more matches
backface-visibility - CSS: Cascading Style Sheets
t is visible when turned towards the user. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. an element's back face is a mirror image of its front face. ...
...in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. an element's back face is a mirror image of its front face. though invisible in 2d, the back face can become visible when a trans
formation causes the element to be rotated in 3d space. (this property has no effect on 2d trans
forms, which have no perspective.) syntax /* keyword values */ backface-visibility: visible; backface-visibility: hidden; /* global values */ backface-visibility: inherit; backface-visibility: initial; backface-visibility: unset; the backface-visibility property is specified as one of the keywords listed below. values visible the back face is visible when turned towards the user. hidden the...
...ce-visibility: hidden; /* global values */ backface-visibility: inherit; backface-visibility: initial; backface-visibility: unset; the backface-visibility property is specified as one of the keywords listed below. values visible the back face is visible when turned towards the user. hidden the back face is hidden, effectively making the element invisible when turned away from the user.
formal definition initial valuevisibleapplies totrans
formable elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax visible | hidden examples cube with transparent and opaque faces this example shows a cube with transparent faces, and one with opaque faces. html <table> <tr> <th><code>backface-visibility: visible;</code></th> <th><code>backface-visibility:...
...And 3 more matches
font - CSS: Cascading Style Sheets
the system font used in dialog boxes. small-caption the system font used for labeling small controls. status-bar the system font used in window status bars. prefixed system font keywords browsers often implement several more, prefixed, keywords: gecko implements -moz-window, -moz-document, -moz-desktop, -moz-info, -moz-dialog, -moz-button, -moz-pull-down-menu, -moz-list, and -moz-field.
formal definition initial valueas each of the properties of the shorthand:font-style: normalfont-variant: normalfont-weight: normalfont-stretch: normalfont-size: mediumline-height: normalfont-family: depends on user agentapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyespercentagesas each of the properties of the shorthand:font-size: refer to the parent element's ...
...irst-letter and ::first-line.inheritedyespercentagesas each of the properties of the shorthand:font-size: refer to the parent element's font sizeline-height: refer to the font size of the element itselfcomputed valueas each of the properties of the shorthand:font-style: as specifiedfont-variant: as specifiedfont-weight: the keyword or the numerical value as specified, with bolder and lighter trans
formed 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...
... set the font family to sans-serif */...
...And 3 more matches
image-orientation - CSS: Cascading Style Sheets
warning: this property is deprecated in the specification. its functionality may be moved into properties on the <img> and/or <picture> elements, with the possible exception of from-image. the flip and <angle> values were made obsolete in firefox 63. ...
...ecko 63 */ image-orientation: 90deg; /* rotate 90deg */ image-orientation: 90deg flip; /* rotate 90deg, and flip it horizontally */ image-orientation: flip; /* no rotation, only applies a horizontal flip */ syntax values none default initial value. will not apply any additional image rotation; the image is oriented as encoded or as other css property values dictate. from-image the exif in
formation contained in the image will be used to rotate the image appropriately. <angle> obsolete since gecko 63 the <angle> of rotation to apply to the image. it is rounded to the nearest 90deg (0.25turn). flip obsolete since gecko 63 the image is flipped horizontally (i.e., reflected) after the rotation given by the <angle> value is applied. if no <angle> is given, 0deg is used. description...
... the rotation given by the <angle> value is applied. if no <angle> is given, 0deg is used. description this property is intended only to be used for the purpose of correcting the orientation of images which were shot with the camera rotated. it should not be used for arbitrary rotations. ...
...And 3 more matches
min() - CSS: Cascading Style Sheets
) and division ( / ) operators, using standard operator precedence rules. make sure to put a space on each side of the + and - operands. the operands in the expression may be any <length> syntax value. you can (and often need to) combine min() and max() values, or use min() within a clamp() or calc() function. you can provide more than two arguments, if you have multiple constraints to apply. ...
... a maximum font size, ensure that the font can still be scaled at least 200% for readability (without assistive technology like a zoom function). ...
...ability (without assistive technology like a zoom function). mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 examples setting a maximum size for a label and input another use case for css functions is to set a maximum size on responsive
form controls: enabling the width of labels and inputs to shrink as the width of the
form shrinks. let's look at some css: input, label { padding: 2px; box-sizing: border-box; display: inline-block; width: min(40%, 400px); background-color: pink; }
form { margin: 4px; border: 1px solid black; padding: 4px; } here, the
form itself, along with the margin, border, and padding, will be 100% of its parent's width. we declare the input and label to be the lesser of 40% ...
...And 3 more matches
overflow - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...led programmatically (for example, by setting the value of a property such as offsetleft), so the element is still a scroll container. clip like for hidden, the content is clipped to the element's padding box. the difference between clip and hidden is that the clip keyword also forbids all scrolling, including programmatic scrolling. the box is not a scroll container, and does not start a new
formatting context. if you wish to start a new
formatting context, you can use display: flow-root to do so. scroll content is clipped if necessary to fit the padding box. browsers always display scrollbars whether or not any content is actually clipped, preventing scrollbars from appearing or disappearing as content changes. printers may still print overflowing content. auto depends on the user ag...
...ll content is clipped if necessary to fit the padding box. browsers always display scrollbars whether or not any content is actually clipped, preventing scrollbars from appearing or disappearing as content changes. printers may still print overflowing content. auto depends on the user agent. if content fits inside the padding box, it looks the same as visible, but still establishes a new block
formatting context. desktop browsers provide scrollbars if content overflows. overlay behaves the same as auto, but with the scrollbars drawn on top of content instead of taking up space. only supported in webkit-based (e.g., safari) and blink-based (e.g., chrome or opera) browsers. mozilla extensions -moz-scrollbars-none [1] use overflow: hidden instead. -moz-scrollbars-horizontal [1]...
...And 3 more matches
scale3d() - CSS: Cascading Style Sheets
the scale3d() css function defines a trans
formation that resizes an element in 3d space. because the amount of scaling is defined by a vector, it can resize different dimensions at different scales. its result is a <trans
form-function> data type. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this scaling trans
formation is characterized by a three-dimensional vector. its coordinates define how much scaling is done in each direction. if all three coordinates are equal, the scaling is uni
form (isotropic) and the aspect ratio of the element is preserved (this is a homothetic trans
formation). when a coordinate value i...
... sy, sz) values sx is a <number> representing the abscissa of the scaling vector. sy is a <number> representing the ordinate of the scaling vector. sz is a <number> representing the z-component of the scaling vector. ...
...esian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 this trans
formation applies to the 3d space and can't be represented on the plane. ...
...And 3 more matches
translate3d() - CSS: Cascading Style Sheets
its coordinates define how much the element moves in each direction. syntax translate3d(tx, ty, tz) values tx is a <length> or <percentage> representing the abscissa of the translating vector. ty is a <length> or <percentage> representing the ordinate of the translating vector. ...
...its coordinates define how much the element moves in each direction. syntax translate3d(tx, ty, tz) values tx is a <length> or <percentage> representing the abscissa of the translating vector. ty is a <length> or <percentage> representing the ordinate of the translating vector. ...
...moves in each direction. syntax translate3d(tx, ty, tz) values tx is a <length> or <percentage> representing the abscissa of the translating vector. ty is a <length> or <percentage> representing the ordinate of the translating vector. tz is a <length> representing the z component of the translating vector. it can't be a <percentage> value; in that case the property containing the trans
form is considered invalid. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 this trans
formation applies to the 3d space and can't be represented on the plane. a translation is not a linear trans
formation in ℝ3 and can't be represented using a cartesian-coordinate matrix. ...
...And 3 more matches
translateZ() - CSS: Cascading Style Sheets
the translatez() css function repositions an element along the z-axis in 3d space, i.e., closer to or farther away from the viewer. its result is a <trans
form-function> data type. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this trans
formation is defined by a <length> which specifies how far inward or outward the element or elements move. in the above interactive examples, perspective: 550px; (to create a 3d space) and trans
form-style: preserve-3d; (so the children, the 6 sides of the cube, are also positioned in the 3d space), have been set on the cube. note: translatez(tz) is equivalent to translate3d(0, 0,...
...nt to translate3d(0, 0, tz). syntax translatez(tz) values tz a <length> representing the z-component of the translating vector. a positive value moves the element towards the viewer, and a negative value farther away. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 this trans
formation applies to the 3d space and can't be represented on the plane. a translation is not a linear trans
formation in ℝ3 and can't be represented using a cartesian-coordinate matrix. 10000100001t0001 examples in this example, two boxes are created. one is positioned normally on the page, without being translated at all. the second is altered by applying perspective to create a 3d...
...ples in this example, two boxes are created. one is positioned normally on the page, without being translated at all. the second is altered by applying perspective to create a 3d space, then moved towards the user. html <div>static</div> <div class="moved">moved</div> css div { position: relative; width: 60px; height: 60px; left: 100px; background-color: skyblue; } .moved { trans
form: perspective(500px) translatez(200px); background-color: pink; } what really matters here is the class "moved"; let's take a look at what it does. first, the perspective() function positions the viewer relative to the plane that lies where z=0 (in essence, the surface of the screen). a value of 500px means the user is 500 pixels "in front of" the imagery located at z=0. then, the translatez(...
...And 3 more matches
translate - CSS: Cascading Style Sheets
syntax /* keyword values */ translate: none; /* single values */ translate: 100px; translate: 50%; /* two values */ translate: 100px 200px; translate: 50% 105px; /* three values */ translate: 50% 105px 5rem; values single <length-percentage> value a <length> or <percentage> that specifies a 2d translation, with the same translation along both the x and y axes. ...
...ation values (respectively) of a 2d translation. equivalent to a translate() (2d translation) function with two values specified. three values two <length-percentage> and single <length> values that specify the x, y, and z axis translation values (respectively) of a 3d translation. equivalent to a translate3d() (3d translation) function. none specifies that no translation should be applied. ...
...uivalent to a translate() (2d translation) function with two values specified. three values two <length-percentage> and single <length> values that specify the x, y, and z axis translation values (respectively) of a 3d translation. equivalent to a translate3d() (3d translation) function. none specifies that no translation should be applied. ...
...And 3 more matches
Event reference
events can represent everything from basic user interactions to automated notifications of things happening in the rendering model. ...
...peated. css transition events event name fired when transitionstart a css transition has actually started (fired after any delay). transitioncancel a css transition has been cancelled. transitionend a css transition has completed. transitionrun a css transition has begun running (fired before any delay starts). ...
...ove touchstart pointer events pointerover pointerenter pointerdown pointermove pointerup pointercancel pointerout pointerleave gotpointercapture lostpointercapture standard events these events are defined in official web specifications, and should be common across browsers. each event is listed along with the interface representing the object sent to recipients of the event (so you can find in
formation about what data is provided with each event) as well as a link to the specification or specifications that define the event. event name event type specification fired when... abort uievent dom l3 the loading of a resource has been aborted. abort progressevent progress and xmlhttprequest progression has been terminated (not due to an...
...And 3 more matches
Adding captions and subtitles to HTML5 video - Developer guides
captioned video example in this article, we will refer to the video player with captions example. this example uses an excerpt from the sintel open movie, created by the blender foundation. ...
...ou can find the source on github, and also view the example live. html5 and video captions before diving into how to add captions to the video player, there are a number of things that we will first mention, which you should be aware of before we start. captions versus subtitles captions and subtitles are not the same thing: they have significantly different audiences, and convey different in
formation, and it is recommended that you read up on the differences if you are not sure what they are. they are however implemented in the same way technically, so the material in this article will apply to both. for this article we will refer to the text tracks displayed as subtitles, as their content is aimed at hearing people who have difficulty understanding the language of the film, rather than...
...lty understanding the language of the film, rather than deaf or hard-of-hearing people. the <track> element html5 allows us to specify subtitles for a video using the <track> element. ...
...And 3 more matches
Creating and triggering events - Developer guides
e that the event name is 'build'. event.initevent('build', true, true); // listen for the event. elem.addeventlistener('build', function (e) { // e.target matches elem }, false); // target can be any element or other eventtarget. ...
.... event.initevent('build', true, true); // listen for the event. elem.addeventlistener('build', function (e) { // e.target matches elem }, false); // target can be any element or other eventtarget. ...
...ent('build', true, true); // listen for the event. elem.addeventlistener('build', function (e) { // e.target matches elem }, false); // target can be any element or other eventtarget. ...
...And 3 more matches
Event developer guide - Developer guides
ce as web browsers have evolved so that there is no satisfying systematic characterization of the events built-in or defined by modern web browsers. the device on which the web browser is running can trigger events, for example due to a change in its position and orientation in the real world, as discussed partially by the page on orientation coordinate systems and the page on the use of 3d trans
forms. that is different, but similar, to the change in device vertical orientation. the window in which the browser is displayed can trigger events; for example, change size if the user maximizes the window or otherwise changes it. the process loading of a web page can trigger events in response to the completion of different steps in the downloading, parsing, and rendering of the web page for disp...
...stantial work. the structure needs to be reorganized and the pages rewritten. our hope is that everything you need to know about events will go under here. docs creating and triggering eventsthis article demonstrates how to create and dispatch dom events. ...
...red by the browser itself.dom on-event handlersthe web plat
form provides several ways to get notified of dom events. two common styles are: the generalized addeventlistener() and a set of specific on-event handlers.media eventsvarious events are sent when handling media that are embedded in html documents using the <audio> and <video> elements; this section lists them and provides some helpful in
formation about using them.mouse gesture eventsgecko 1.9.1 added support for several mozilla-specific dom events used to handle mouse gestures. these are special movements that can be made with a mouse or trackpad and can be interpreted to per
form specific tasks.mutation eventsmutation events provide a mechanism for a web page or an extension to get notified about changes made to the dom. use mutation...
...And 3 more matches
<address>: The Contact Address element - HTML: Hypertext Markup Language
the html <address> element indicates that the enclosed html provides contact in
formation for a person or people, or for an organization. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the contact in
formation provided by an <address> element's contents can take whatever
form is appropriate for the context, and may include any type of contact in
formation that is needed, such as a physical address, url, email address, phone number, social media handle, geographic coordinates, and so forth. the <address> element should include the name of the person, people, or organization to which the contact in
formation refers. <a...
... content categories flow content, palpable content. ...
... aria role no corresponding role permitted aria roles any dom interface htmlelement prior to gecko 2.0 (firefox 4), gecko implemented this element using the htmlspanelement interface attributes this element only includes the global attributes. usage notes it used to be the case that an <address> element was only supposed to be used to represent the contact in
formation of the document's author. in the latest spec versions however, its definition has been updated so it can now be used to mark up arbitrary addresses. this element should not contain more in
formation than the contact in
formation, like a publication date (which belongs in a <time> element). typically an <address> element can be placed inside the <footer> element of the current section, if any...
...And 3 more matches
<details>: The Details disclosure element - HTML: Hypertext Markup Language
a summary or label can be provided using the <summary> element. a disclosure widget is typically presented onscreen using a small triangle which rotates (or twists) to indicate open/closed status, with a label next to the triangle. if the first child of the <details> element is a <summary>, the contents of the <summary> element are used as the label for the disclosure widget. the source for this interactive example is stored in a github repository. ...
...details.open) { /* the element was toggled open */ } else { /* the element was toggled closed */ } }); examples a simple disclosure example this example shows a <details> element with no provided summary. <details> <p>requires a computer running an operating system. the computer must have some memory and ideally some kind of long-term storage. an input device as well as some
form of output device is recommended.</p> </details> in this situation, the browser will use a default summary string (usually "details"). here's what your browser does with it: providing a summary this example adds a summary to the above example by using the <summary> element inside <details>, like this: <details> <summary>system requirements</summary> <p>requires a computer running an op...
...ils"). here's what your browser does with it: providing a summary this example adds a summary to the above example by using the <summary> element inside <details>, like this: <details> <summary>system requirements</summary> <p>requires a computer running an operating system. the computer must have some memory and ideally some kind of long-term storage. an input device as well as some
form of output device is recommended.</p> </details> the result from this html is this: creating an open disclosure box to start the <details> box in its open state, add the boolean open attribute: <details open> <summary>system requirements</summary> <p>requires a computer running an operating system. the computer must have some memory and ideally some kind of long-term storage. an in...
...And 3 more matches
<dialog>: The Dialog element - HTML: Hypertext Markup Language
dialog permitted aria roles alertdialog dom interface htmldialogelement attributes this element includes the global attributes. the tabindex attribute must not be used on the <dialog> element. open indicates that the dialog is active and can be interacted with. when the open attribute is not set, the dialog shouldn't be shown to the user. usage notes <
form> elements can close a dialog if they have the attribute method="dialog". when such a
form is submitted, the dialog closes with its returnvalue property set to the value of the button that was used to submit the
form. the ::backdrop css pseudo-element can be used to style behind a <dialog> element when the dialog is displayed with htmldialogelement.showmodal(). for example, to dim unreachable con...
...as used to submit the
form. the ::backdrop css pseudo-element can be used to style behind a <dialog> element when the dialog is displayed with htmldialogelement.showmodal(). for example, to dim unreachable content behind the modal dialog. examples simple example <dialog open> <p>greetings, one and all!</p> </dialog> advanced example this example opens a pop-up dialog box that contains a
form, when the "update details" button is clicked. ...
... element when the dialog is displayed with htmldialogelement.showmodal(). for example, to dim unreachable content behind the modal dialog. examples simple example <dialog open> <p>greetings, one and all!</p> </dialog> advanced example this example opens a pop-up dialog box that contains a
form, when the "update details" button is clicked. ...
...And 3 more matches
<label> - HTML: Hypertext Markup Language
ct, please clone https://github.com/mdn/interactive-examples and send us a pull request. associating a <label> with an <input> element offers some major advantages: the label text is not only visually associated with its corresponding text input; it is programmatically associated with it too. this means that, for example, a screenreader will read out the label when the user is focused on the
form input, making it easier for an assistive technology user to understand what data should be entered. you can click the associated label to focus/activate the input, as well as the input itself. this increased hit area provides an advantage to anyone trying to activate the input, including those using a touch-screen device. to associate the <label> with an <input> element, you need to give the <...
...element, you need to give the <input> an id attribute. the <label> then needs a for attribute whose value is the same as the input's id. ...
...in which case the for and id attributes are not needed because the association is implicit: <label>do you like peas? <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. one input can be associated with multiple labels. when a <label> is clicked or tapped and it is associated with a
form control, the resulting click event is also raised for the associated control. attributes this element includes the global attributes. for the id of a labelable
form-related element in the same document as the <label> element. the first element in the document with an id matching the value of the for attribute is the labeled control for this label element, if it is a labelable element. if i...
...And 3 more matches
HTML: Hypertext Markup Language
is and how to use it. html tutorials for articles about how to use html, as well as tutorials and complete examples, check out our html learning area. html reference in our extensive html reference section, you'll find the details about every element and attribute in html. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started beginner's tutorials our html learning area features multiple modules that teach html from the ground up — no previous knowledge required. introduction to html this module sets the stage, getting you used to important concepts and syntax such as looking at applying html to text, how to create hyperlinks, and how to use html to struc...
...html to include multimedia in your web pages, including the different ways that images can be included, and how to embed video, audio, and even entire other webpages. html tables representing tabular data on a webpage in an understandable, accessible way can be a challenge. this module covers basic table markup, along with more complex features such as implementing captions and summaries. html
forms
forms are a very important part of the web — these provide much of the functionality you need for interacting with websites, e.g. registering and logging in, sending feedback, buying products, and more. this module gets you started with creating the client-side/front-end parts of
forms. use html to solve common problems provides links to sections of content explaining how to use html to sol...
... registering and logging in, sending feedback, buying products, and more. this module gets you started with creating the client-side/front-end parts of
forms. use html to solve common problems provides links to sections of content explaining how to use html to solve very common problems when creating a web page: dealing with titles, adding images or videos, emphasizing content, creating a basic
form, etc. advanced topics cors enabled image the crossorigin attribute, in combination with an appropriate cors header, allows images defined by the <img> element to be loaded from foreign origins and used in a <canvas> element as if they were being loaded from the current origin. cors settings attributes some html elements that provide support for cors, such as <img> or <video>, have a cross...
...And 3 more matches
Evolution of HTTP - HTTP
rying images, videos in high resolution and 3d. invention of the world wide web in 1989, while he was working at cern, tim berners-lee wrote a proposal to build a hypertext system over the internet. initially calling it the mesh, it was later renamed to world wide web during its implementation in 1990. built over the existing tcp and ip protocols, it consisted of 4 building blocks: a textual
format to represent hypertext documents, the hypertext markup language (html). a simple protocol to exchange these documents, the hyperttext transfer protocol (http). a client to display (and accidentally edit) these documents, the first web browser called worldwideweb. a server to give access to the document, an early version of httpd. these four building blocks were completed by the end of 1990...
...ng that only html files could be transmitted, but no other type of documents. there were no status or error codes: in case of a problem, a specific html file was send back with the description of the problem contained in it, for human consumption. ...
...e: 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. a lot of interoperability problems were common. in november 1996, in order to solve these annoyances, an in
formational document describing the common practices has been published, rfc 1945. this is the definition of http/1.0 and it is notable that, in the narrow sense of the term, it isn't an official standard. http/1.1 – the standardized protocol in parallel to the somewhat chaotic use of the diverse implementations of http/1.0, and since 1995, well before the publication of http/1.0 document the next...
...And 3 more matches
HTTP caching - HTTP
the per
formance of web sites and applications can be significantly improved by reusing previously fetched resources. web caches reduce latency and network traffic and thus lessen the time needed to display a representation of a resource. by making use of http caching, web sites become more responsive. different kinds of caches caching is a technique that stores a copy of a given resource and serves it back when requested. when a web cache has a requested resource in its store, it intercepts the request and returns its copy instead of re-downloading from the originating server. ...
...inds of caches caching is a technique that stores a copy of a given resource and serves it back when requested. when a web cache has a requested resource in its store, it intercepts the request and returns its copy instead of re-downloading from the originating server. this achieves several goals: it eases the load of the server that doesn’t need to serve all clients itself, and it improves per
formance by being closer to the client, i.e., it takes less time to transmit the resource back. for a web site, it is a major component in achieving high per
formance. on the other side, it has to be configured properly as not all resources stay identical forever: it is important to cache a resource only until it changes, not longer. there are several kinds of caches: these can be grouped into two mai...
...these can be grouped into two main categories: private or shared caches. a shared cache is a cache that stores responses for reuse by more than one user. a private cache is dedicated to a single user. this page will mostly talk about browser and proxy caches, but there are also gateway caches, cdn, reverse proxy caches and load balancers that are deployed on web servers for better reliability, per
formance and scaling of web sites and web applications. private browser caches a private cache is dedicated to a single user. you might have seen "caching" in your browser's settings already. a browser cache holds all documents downloaded via http by the user. this cache is used to make visited documents available for back/forward navigation, saving, viewing-as-source, etc. without requiring an ad...
...And 3 more matches
Compression in HTTP - HTTP
compression is an important way to increase the per
formance of a web site. for some documents, size reduction of up to 70% lowers the bandwidth capacity needs. over the years, algorithms also got more efficient, and new ones are supported by clients and servers. in practice, web developers don't need to implement compression mechanisms, both browsers and servers have it implemented already, but they have to be sure that the server is configured adequately. compression happens at three different levels: first some file
formats are compressed with specific optimized methods, then general encryption can happen at the http level (the resource is transmitted compressed from end to end), and finally compression can be defined at the connection level, between two nodes of an http connection. ...
...if text can typically have as much as 60% redundancy, this rate can be much higher for some other media like audio and video. ...
...a type has some redundancy, that is wasted space, in it. if text can typically have as much as 60% redundancy, this rate can be much higher for some other media like audio and video. 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. engineers designed the optimized compression algorithm used by file
formats designed for this specific purpose. compression algorithms used for files can be grouped into two broad categories: loss-less compression, where the compression-uncompression cycle doesn't alter the data that is recovered. it matches (byte to byte) with the original. for images, gif or png are using loss-less compression. lossy compression, where the cycle alters the original data in a (...
...And 3 more matches
Configuring servers for Ogg media - HTTP
html <audio> and <video> elements allow media presentation without the need for the user to install any plug-ins or other software to do so. this guide covers a few server configuration changes that may be necessary for your web server to correctly serve ogg media files. this in
formation 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. if you don't know whether the ogg file contains audio or video, you can serve it with the mime type application/ogg, and the browser will t...
...erve it with the mime type application/ogg, and the browser will treat it as a video file. most servers don't by default serve ogg media with the correct mime types, so you'll likely need to add the appropriate configuration for this. for apache, you can add the following to your configuration: addtype audio/ogg .oga addtype video/ogg .ogv addtype application/ogg .ogg you can find specific in
formation about possible media file types and the codecs used within them in our comprehensive guide to media types and
formats on the web. in particular, the article on media container
formats will be especially helpful when configuring serers to host media properly. handle http 1.1 byte range requests correctly in order to support seeking and playing back regions of the media that aren't yet downl...
...mes are, the longer this takes, so it's helpful to include key frames at regular intervals. by default, ffmpeg2theora uses one key frame every 64 frames (or about every 2 seconds at 30 frames per second), which works pretty well. note: of course, the more key frames you use, the larger your video file is, so you may need to experiment a bit to get the right balance between file size and seek per
formance. consider using the preload attribute the html <audio> and <video> elements provide the preload attribute, which tells the browser to attempt to download the entire media when the page loads. without preload, the browser only downloads enough of the media to display the first video frame, and to determine the media's duration. preload is off by default, so if getting to video is the point ...
...And 3 more matches
CSP: navigate-to - HTTP
csp version 3 directive type navigation directive default-src fallback no. not setting this allows anything. ...
... csp version 3 directive type navigation directive default-src fallback no. not setting this allows anything. ...
... csp version 3 directive type navigation directive default-src fallback no. not setting this allows anything. ...
...And 3 more matches
Content-Security-Policy - HTTP
the http content-security-policy response header allows web site administrators to control resources the user agent is allowed to load for a given page. with a few exceptions, policies mostly involve specifying server origins and script endpoints. this helps guard against cross-site scripting attacks (xss). for more in
formation, see the introductory article on content security policy (csp). 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. child-src defines the valid sources ...
... the urls which can be used in a document's <base> element. plugin-types restricts the set of plugins that can be embedded into a document by limiting the types of resources which can be loaded. sandbox enables a sandbox for the requested resource similar to the <iframe> sandbox attribute. ...
... used in a document's <base> element. plugin-types restricts the set of plugins that can be embedded into a document by limiting the types of resources which can be loaded. sandbox enables a sandbox for the requested resource similar to the <iframe> sandbox attribute. navigation directives navigation directives govern to which locations a user can navigate or submit a
form, for example. ...
...And 3 more matches
X-DNS-Prefetch-Control - HTTP
this reduces latency when the user clicks a link. header type response header forbidden header name no syntax x-dns-prefetch-control: on x-dns-prefetch-control: off directives on enables dns prefetching. ...
...this reduces latency when the user clicks a link. header type response header forbidden header name no syntax x-dns-prefetch-control: on x-dns-prefetch-control: off directives on enables dns prefetching. ...
... header type response header forbidden header name no syntax x-dns-prefetch-control: on x-dns-prefetch-control: off directives on enables dns prefetching. this is what browsers do, if they support the feature, when this header is not present off disables dns prefetching. this is useful if you don't control the link on the pages, or know that you don't want to leak in
formation to these domains. description dns requests are very small in terms of bandwidth, but latency can be quite high, especially on mobile networks. by speculatively prefetching dns results, latency can be reduced significantly at certain times, such as when the user clicks the link. in some cases, latency can be reduced by a second. the implementation of this prefetching in some browsers allo...
...And 3 more matches
Control flow and error handling - JavaScript
at you can use to incorporate a great deal of interactivity in your application. this chapter provides an overview of these statements. the javascript reference contains exhaustive details about the statements in this chapter. the semicolon (;) character is used to separate statements in javascript code. any javascript expression is also a statement. see expressions and operators for complete in
formation about expressions. block statement the most basic statement is a block statement, which is used to group statements. the block is delimited by a pair of curly brackets: { statement_1; statement_2; ⋮ statement_n; } example block statements are commonly used with control flow statements (if, for, while). while (x < 10) { x++; } here, { x++; } is the block statement. impo...
... in c or java. for example: var x = 1; { var x = 2; } console.log(x); // outputs 2 this outputs 2 because the var x statement within the block is in the same scope as the var x statement before the block. (in c or java, the equivalent code would have outputted 1.) since ecmascript2015, the let and const variable declarations are block-scoped. see the let and const reference pages for more in
formation. conditional statements a conditional statement is a set of commands that executes if a specified condition is true. javascript supports two conditional statements: if...else and switch. if...else statement use the if statement to execute a statement if a logical condition is true. use the optional else clause to execute a statement if the condition is false. an if statement looks like...
...alse values of the boolean object! for example: var b = new boolean(false); if (b) // this condition evaluates to true if (b == true) // this condition evaluates to false example in the following example, the function checkdata returns true if the number of characters in a text object is three. otherwise, it displays an alert and returns false. function checkdata() { if (document.
form1.threechar.value.length == 3) { return true; } else { alert( 'enter exactly three characters. ' + `${document.
form1.threechar.value} is not valid.`); return false; } } switch statement a switch statement allows a program to evaluate an expression and attempt to match the expression's value to a case label. if a match is found, the program executes the associated...
...And 3 more matches
Details of the object model - JavaScript
ociated as the prototype for another object, allowing the second object to share the first object's properties. defining a class in class-based languages, you define a class in a separate class definition. in that definition you can specify special methods, called constructors, to create instances of the class. a constructor method can specify initial values for the instance's properties and per
form other processing appropriate at creation time. you use the new operator in association with the constructor method to create class instances. javascript follows a similar model, but does not have a class definition separate from the constructor. instead, you define a constructor function to create objects with a particular initial set of properties and values. any javascript function can be used...
...o demonstrate how to get the inheritance to work. in these definitions, you cannot specify any property values when you create an object. the newly-created object simply gets the default values, which you can change at a later time. in a real application, you would probably define constructors that allow you to provide property values at object creation time (see more flexible constructors for in
formation). for now, these simple definitions demonstrate how the inheritance occurs. the following java and javascript employee definitions are similar. the only difference is that you need to specify the type for each property in java but not in javascript (this is due to java being a strongly typed language while javascript is a weakly typed language). javascript (using this may cause an error fo...
...e term instance has a specific technical meaning in class-based languages. in these languages, an instance is an individual instantiation of a class and is fundamentally different from a class. in javascript, "instance" does not have this technical meaning because javascript does not have this difference between classes and instances. however, in talking about javascript, "instance" can be used in
formally to mean an object created using a particular constructor function. so, in this example, you could in
formally say that jane is an instance of engineer. similarly, although the terms parent, child, ancestor, and descendant do not have
formal meanings in javascript; you can use them in
formally to refer to objects higher or lower in the prototype chain. creating objects with simple definitions ...
...And 3 more matches
Indexed collections - JavaScript
t1, ..., elementn) let arr = [element0, element1, ..., elementn] element0, element1, ..., elementn is a list of values for the array's elements. when these values are specified, the array is initialized with them as the array's elements. the array's length property is set to the number of arguments. the bracket syntax is called an "array literal" or "array initializer." it's shorter than other
forms of array creation, and so is generally preferred. see array literals for details. to create an array with non-zero length, but without any items, either of the following can be used: // this... let arr = new array(arraylength) // ...results in the same array as this let arr = array(arraylength) // this has exactly the same effect let arr = [] arr.length = arraylength note: in the above c...
...) { a[i] = new array(4) for (let j = 0; j < 4; j++) { a[i][j] = '[' + i + ', ' + j + ']' } } this example creates an array with the following rows: row 0: [0, 0] [0, 1] [0, 2] [0, 3] row 1: [1, 0] [1, 1] [1, 2] [1, 3] row 2: [2, 0] [2, 1] [2, 2] [2, 3] row 3: [3, 0] [3, 1] [3, 2] [3, 3] using arrays to store other properties arrays can also be used like objects, to store related in
formation. const arr = [1, 2, 3]; arr.property = "value"; console.log(arr.property); // logs "value" arrays and regular expressions when an array is the result of a match between a regular expression and a string, the array returns properties and elements that provide in
formation about the match. an array is the return value of regexp.exec(), string.match(), and string.split(). for in
formation on...
...ce they provide sequential access to their characters in a similar way to arrays: array.prototype.foreach.call('a string', function(chr) { console.log(chr) }) typed arrays javascript typed arrays are array-like objects and provide a mechanism for accessing raw binary data. as you already know, array objects grow and shrink dynamically and can have any javascript value. javascript engines per
form optimizations so that these arrays are fast. however, 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 it would be helpful for javascript code to be able to quickly and easily manipulate raw binary data in typed arrays. buffers and views: typed ...
...And 3 more matches
Numbers and dates - JavaScript
integer values up to ±253 − 1 can be represented exactly. ...
...integer values up to ±253 − 1 can be represented exactly. ...
...integer values up to ±253 − 1 can be represented exactly. in addition to being able to represent floating-point numbers, the number type has three symbolic values: +infinity, -infinity, and nan (not-a-number). ...
...And 3 more matches
Date.prototype.toLocaleString() - JavaScript
the source for this interactive example is stored in a github repository. ...
... the source for this interactive example is stored in a github repository. ...
...or this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.tolocalestring([locales[, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose
formatting conventions should be used. in implementations, which ignore the locales and options arguments, the locale used and the
form of the string returned are entirely implementation dependent. see the intl.datetime
format() constructor for details on these parameters and how to use them. the default value for each date-time component property is undefined. but, if the weekday, year, month, and d...
...And 3 more matches
Web media technologies
this article lists the various apis with links to documentation you may find helpful in mastering them. ...
...video files, or as a destination for streamed video content. <video> can also be used as a way to link media apis with other html and dom technologies, including <canvas> (for frame grabbing and manipulation), for example. accessible from javascript as htmlvideoelement objects. <track> the html <track> element can be placed within an <audio> or <video> element to provide a reference to a webvtt
format subtitle or caption track to be used when playing the media. accessible from javascript as htmltrackelement objects. <source> the html <source> element is used within an <audio> or <video> element to specify source media to present. multiple sources can be used to provide the media in different
formats, sizes, or resolutions. accessible from javascript as htmlsourceelement objects. apis ...
... media capture and streams api a reference for the api which makes it possible to stream, record, and manipulate media both locally and across a network. this includes using local cameras and microphones to capture video, audio, and still images. ...
...And 3 more matches
Structural overview of progressive web apps - Progressive web apps (PWAs)
hey both have their advantages and disadvantages, and you can mix the two approaches to some degree. server-side rendering (ssr) means a website is rendered on the server, so it offers quicker first load, but navigating between pages requires downloading new html content. it works great across browsers, but it suffers in terms of time navigating between pages and therefore general perceived per
formance — loading a page requires a new round trip to the server. client-side rendering (csr) allows the website to be updated in the browser almost instantly when navigating to different pages, but requires more of an initial download hit and extra rendering on the client at the beginning. the website is slower on an initial visit, but can be faster to navigate. the best results tend to come wh...
...sted from the server and what is retrieved from the cache with a service worker, which will be explained in detail in the next article — for now let's focus on the structure itself. benefits of the app shell pattern this architecture allows a web site to benefit the most from all the pwa features — it caches the app shell and manages the dynamic content in a way that greatly improves the per
formance. in addition to the basic shell, you can add other features such as add to home screen or push notifications, safe in the knowledge that the app will still work ok if they are not supported by the user's browser — this is the beauty of progressive enhancement. the website feels like a native app with instant interaction and solid per
formance while keeping all the benefits of the web. bein...
...ailable before the website can start rendering. it's different with html, as the browser is actually streaming the data already and you can see when the elements are loaded and rendered on the website. to have the javascript actually work, however, it has to be downloaded in its entirety. the streams api allows developers to have direct access to data streaming from the server. if you want to per
form an operation on the data (for example, adding a filter to a video), you no longer need to wait for all of it to be downloaded and converted to a blob (or whatever). instead, you can start right away. it provides fine-grained control: the stream can be started, chained with another stream, canceled, checked for errors, and more. in theory, streaming is a better model than the app shell model, but...
...And 3 more matches
gradientUnits - SVG: Scalable Vector Graphics
percentages represent values relativ...
...erspaceonuse this value indicates that the attributes represent values in the coordinate system that results from taking the current user coordinate system in place at the time when the gradient element is referenced (i.e., the user coordinate system for the element referencing the gradient element via a fill or stroke property) and then applying the trans
form specified by attribute gradienttrans
form. percentages represent values relative to the current svg viewport. objectboundingbox this value indicates that the user coordinate system for the attributes is established using the bounding box of the element to which the gradient is applied and then applying the trans
form specified by attribute gradienttrans
form. percentages represent values relative to the bounding box for the object. wi...
... relative to the current svg viewport. objectboundingbox this value indicates that the user coordinate system for the attributes is established using the bounding box of the element to which the gradient is applied and then applying the trans
form specified by attribute gradienttrans
form. percentages represent values relative to the bounding box for the object. with this value and gradienttrans
form being the identity matrix, the normal of the linear gradient is perpendicular to the gradient vector in object bounding box space (i.e., the abstract coordinate system where (0,0) is at the top/left of the object bounding box and (1,1) is at the bottom/right of the object bounding box). when the object's bounding box is not square, the gradient normal which is initially perpendicular to the gradi...
...And 3 more matches
SVG In HTML Introduction - SVG: Scalable Vector Graphics
overview this article and its associated example shows how to use inline svg to provide a background picture for a
form. it shows how javascript and css can be used to manipulate the picture in the same way you would script regular html. ...
... stop.end { stop-color:green; } body.invalid stop.end { stop-color:red; } #err { display:none; } body.invalid #err { display:inline; } </style> <script> function signalerror() { document.getelementbyid('body').setattribute("class", "invalid"); } </script> </head> <body id="body" style="position:absolute; z-index:0; border:1px solid black; left:5%; top:5%; width:90%; height:90%;"> <
form> <fieldset> <legend>html
form</legend> <p><label>enter something:</label> <input type="text"> <span id="err">incorrect value!</span></p> <p><input type="button" value="activate!" onclick="signalerror();"></p> </fieldset> </
form> <svg viewbox="0 0 100 100" preserveaspectratio="xmidymid slice" style="width:100%; height:100%; position:absolute; top:0; left:0; z-index:-1;...
... </svg> </body> </html> discussion the page is mainly regular html, css and javascript. the only interesting part is the <svg> element it contains. this element and its children are declared to be in the svg namespace. the element contains a gradient and two shapes filled with the gradient. the gradient color stops have their colors set by css. ...
...And 3 more matches
Using custom elements - Web Components
ture. this article introduces the use of the custom elements api. note: custom elements are supported by default in firefox, chrome, and edge (76). opera and safari so far support only autonomous custom elements. high-level view the controller of custom elements on a web document is the customelementregistry object — this object allows you to register a custom element on the page, return in
formation on what custom elements are registered, etc. to register a custom element on the page, you use the customelementregistry.define() method. this takes as its arguments: a domstring representing the name you are giving to the element. note that custom element names require a dash to be used in them (kebab-case); they can't be single words. a class object that defines the behaviour of the e...
...ples at this point, let's go through some more simple examples to show you how custom elements are created in more detail. autonomous custom elements let's have a look at an example of an autonomous custom element — <popup-info-box> (see a live example). this takes an image icon and a text string, and embeds the icon into the page. when the icon is focused, it displays the text in a pop up in
formation box to provide further in-context in
formation. to begin with, the javascript file defines a class called popupinfo, which extends the generic htmlelement class. class popupinfo extends htmlelement { constructor() { // always call super first in constructor super(); // write element functionality in here ... } } the preceding code snippet contains the constructor() de...
... the shadow dom shadow.appendchild(linkelem); note that <link> elements do not block paint of the shadow root, so there may be a flash of unstyled content (fouc) while the stylesheet loads. many modern browsers implement an optimization for <style> tags either cloned from a common node or that have identical text, to allow them to share a single backing stylesheet. with this optimization the per
formance of external and internal styles should be similar. customized built-in elements now let's have a look at another customized built in element example — expanding-list (see it live also). this turns any unordered list into an expanding/collapsing menu. first of all, we define our element's class, in the same manner as before: class expandinglist extends htmlulistelement { constructor() ...
...And 3 more matches
SDK API Lifecycle - Archive of obsolete content
the api lifecycle aims to balance these competing demands. ...
... from future versions of the sdk while giving developers enough time to update their code. stability index the stability index is adopted from node.js. the sdk uses only four of the six values defined by node.js: experimental the module is not yet stabilized. you can try it out and provide feedback, but we may change or remove it in future versions without having to pass through a
formal deprecation process. unstable the api is in the process of settling, but has not yet had sufficient real-world testing to be considered stable. backwards-compatibility will be maintained if reasonable. if we do have to make backwards-incompatible changes, we will not guarantee the module will go through the
formal deprecation process. stable the module is a fully-support...
... deprecated we plan to change this module, and backwards compatibility should not be expected. don’t start using it, and plan to migrate away from this module to its replacement. ...
...And 2 more matches
package.json - Archive of obsolete content
others, such as lib, permissions, and preferences, represent instructions to the jpm tool itself to generate and include particular code and data structures in your add-on. ...
... others, such as lib, permissions, and preferences, represent instructions to the jpm tool itself to generate and include particular code and data structures in your add-on. ...
... fullname note: this is deprecated along with cfx; it's not available when using jpm. the full name of the package. it can contain spaces. if this key is present, its value will be used as the add-on's em:name element in its install.rdf. harnessclassid note: this is deprecated along with cfx; it's not available when using jpm. string in the guid
format. this is used as a classid of the "harness service" xpcom component. defaults to a random guid generated by cfx. hasembeddedwebextension new in jpm 1.2.0. boolean value: true if the add-on contains an embedded webextension. homepage the url of the add-on's website. this value will be used as the add-on's em:homepageurl element i...
...And 2 more matches
Extension Packaging - Archive of obsolete content
extensions are packaged in a
form of installable bundle which can be downloaded and installed by a user, or provided pre-packaged with an application or by an external program. extensions use a directory structure which can provide chrome, components, and other files to extend the functionality of an xul program. every extension must provide an install.rdf file, which contains metadata about the extension, such as its unique id, version, author, and compatibility in
formation. after the extension files and install.rdf have been prepared, there are several ways to prepare an extension for installation: zip the extension directory into a user-installable xpi (xpinstall) file, unpack the extension directly into the user's application or profile directory, or register the extension in the window...
... from the release of firefox 53, multiple item extension packages are no longer supported and will not load. as a consequence, these packages are no longer accepted by amo. ...
...no longer supported and will not load. as a consequence, these packages are no longer accepted by amo. ...
...And 2 more matches
Adding Events and Commands - Archive of obsolete content
ndow has loaded and then run initialization code: // rest of overlay code goes here. window.addeventlistener( "load", function() { xulschoolchrome.browseroverlay.init(); }, false); you can do something similar with the onunload event, to do any cleanup you may need. please read appendix a for recommendations on how to use the load event to initialize your add-on without having a negative per
formance impact on firefox. another way to attach event handlers, just like html, is to place the handler in the xul code: <overlay id="xulschoolhello-browser-overlay" onload="xulschoolchrome.browseroverlay.init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> we prefer the first method because it keeps a better separation of content and behavior. also, note that the ...
...ouldn't have it. drag and drop. drag and drop operations involve several events. since drag and drop is a complicated thing to manage, there are some high level wrappers that facilitate working with it. also keep in mind that there are 2 drag and drop apis, the newest (and preferred) one introduced in firefox 3.5. event handlers can take an event argument, which is an event object that holds in
formation on the event. you can get in
formation on key modifiers (in case the user was holding a modifier key like alt while per
forming the event), screen coordinates for mouse events, and most importantly, the target element for the event. for example: <button label="&xulschoolhello.defaultgreeting.label;" oncommand="xulschoolchrome.browseroverlay.changegreeting(event);" /> then on the javascrip...
...you to create custom events that you can dispatch and capture. custom events serve as a good communication mechanism, specially when dealing with a somewhat common problem: communication between window xul and web page content. it isn't hard for xul code to control the content on pages being loaded or displayed, as we will see later on, but it can be hard for your extension xul code to receive in
formation from pages in a secure manner. this is because it would be very insecure to have a website js controlling the behavior of firefox and running javascript code with chrome privileges. suppose your extension interacts with pages from a website, and you want some actions on this site to trigger actions in your extension. one way to solve this is to have the actions on the site to generate a cus...
...And 2 more matches
Introduction - Archive of obsolete content
next » welcome to the xul school tutorial! this tutorial is meant to be the stepping stone that will turn you into a professional firefox extension developer in no time. we have poured years of xul experience into it, providing many solutions for problems extension developers commonly run into. xul school was created by appcoast (
formerly glaxstar), one of the few companies dedicated to building high-quality firefox extensions. a team of over a dozen xul developers con
formed glaxstar at the time this tutorial was created, and the combined experiences of years creating firefox extensions are reflected here. with this tutorial you'll learn how to develop firefox extensions. you'll learn how to quickly do the most common tasks in extension development, comparing several d...
...p firefox extensions. you'll learn how to quickly do the most common tasks in extension development, comparing several different approaches to solve them. in most cases we'll provide code samples that you can easily copy and adapt to your needs, as well as some working example extensions. the tutorial aims to be as brief as possible, often falling back on mozilla documentation for more detailed in
formation. you can think of it as a quick guide to the expansive world that is the mozilla plat
form. most links in this documentation are meant to be clicked and read. we'll start with a brief introduction to some key concepts, in case you're not familiar with mozilla and firefox. mozilla and firefox the term mozilla can be used to refer to several concepts: the mozilla project, the mozilla foundat...
...firefox 2), it is strongly recommended that you aim to support modern firefox versions, to encourage users to stay up to date with security fixes. a release that is more than 6 months old is likely vulnerable to published security bugs. firefox and other mozilla applications can be seen as composed of two different parts: a user interface layer that is distinct for each project, and a common plat
form on top of which the interface layer is built. the user interface is built with technology known as xul, and the plat
form is known as xulrunner. xul xul (pronounced "zool") is one of many technologies used for creating mozilla-based products and extensions. it is only one part of the development landscape, but given that it's practically exclusive to mozilla, it tends to be used to identify all ...
...And 2 more matches
Mozilla Documentation Roadmap - Archive of obsolete content
knowing where to look is critical and non trivial. ...
...es it easy to expand and evolve with the help of the community. having said that, there are a few problems with it. first of all, the in-site search is not reliable, so we recommend using a search engine like google, with queries such as "mdc javascript code modules" or "javascript code modules site:developer.mozilla.org". secondly, there are several important articles that are very lacking in in
formation, like the preferences system page. and finally, what we mentioned in our xpcom section: almost no documentation on xpcom components. the documentation on interfaces is very complete, but it isn't nearly as useful as the documentation that existed at xulplanet and was later taken down. xulplanet allowed you to navigate between interfaces and their related components, which makes locating comp...
...xulplanet and was later taken down. xulplanet allowed you to navigate between interfaces and their related components, which makes locating components very easy. hopefully this will be corrected in the future. in the meantime, you can still navigate xulplanet using the wayback machine. mdc should be your first stop when looking for documentation. if you find it lacking or missing some piece of in
formation, please consider adding it once you've found it. everyone looking for it later will thank you for it. the amo developer hub the amo developer hub is a great guide for add-on developers. it includes links to tutorials and documentation, development tools, and most notably, the mozilla add-ons forum. this is a great place to ask questions and have them answered by experienced developers. it ...
...And 2 more matches
Documentation for BiDi Mozilla - Archive of obsolete content
ble of tasks such as reversing and shaping text, symmetric swapping, numeric translation, etc., no special text rendering is needed, though there may be a call to a native api to set the base text direction (for example settextalign on windows). for systems without bidi capabilities, the methods in nsiubidiutils are used. note that we are not affected by buggy bidi implementations on specific plat
forms, since the plat
form never sees a text fragment with mixed directionality, and is not expected to do anything more complicated than displaying left-to-right text from left to right or right-to-left text from right to left. in some circumstances, even on a plat
form with bidi capability, the layout code has to reverse text fragments or to allow for the fact that they are displayed in reverse. in g...
...ext fragments or to allow for the fact that they are displayed in reverse. in general, this happens whenever we are dealing with less than a whole frame. examples of this are in nstextframe::painttextslowly; nstextframe::paintunicodetext when a selection is displayed; nstextframe::getposition; nstextframe::getpointfromoffset. text in visual mode must also be reversed before display on a bidi plat
form. text fields and composer the specification of the bidi changes to composer was posted in the editor and i18n newsgroups, and responses there were taken into account. the implementation is mostly in layout code, especially in nsselection.cpp and nscaret.cpp. other bidi functionality clipboard: based on bidi options in preferences, the text mode of the clipboard may be "logical", "visual" or "a...
...erted (if needed) so that mozilla displays it (from a bidi point of view) as it would be displayed by a visual clipboard viewer. in "logical" mode, the text copied into the clipboard is converted (if needed) so that a logical application will display it (from a bidi point of view) as it is displayed by mozilla. text pasted from the clipboard is treated exactly as if it came from a logical source.
form controls: based on bidi options in preferences, the text mode of
form controls may be "logical", "visual" or "like containing document". we have also tested behaviour of all controls with dir=rtl and added support where necessary. some support added for alignment in tables and lists, and fixes for problems with different combinations of dir and align. improvements to lists with hebrew and arabic ...
...And 2 more matches
Nanojit - Archive of obsolete content
it is an acronym for "low-level intermediate representation". ...
...e tamarin jit and the spidermonkey jit (a.k.a. tracemonkey) use nanojit as their back end. you can get nanojit by cloning the tamarin-redux mercurial repository at http://hg.mozilla.org/tamarin-redux. it's in the nanojit directory. the input for nanojit is a stream of nanojit lir instructions. the term lir is compiler jargon for a language used internally in a compiler that is usually cross-plat
form but very close to machine language. it is an acronym for "low-level intermediate representation". a compiler's lir is typically one of several partly-compiled representations of a program that a compiler produces on the way from raw source code to machine code. an application using nanojit creates a nanojit::lirbuffer object to hold lir instructions. it creates a nanojit::lirbufwriter object to...
...piler produces on the way from raw source code to machine code. an application using nanojit creates a nanojit::lirbuffer object to hold lir instructions. it creates a nanojit::lirbufwriter object to write instructions to the buffer. then it wraps the lirbufwriter in zero or more other lirwriter objects, all of which implement the same interface as lirbufwriter. this chain of lirwriter objects
forms a pipeline for the instructions to pass through. each lirwriter can per
form an optimization or other task on the program as it passes through the system and into the lirbuffer. once the instructions are in the lirbuffer, the application calls nanojit::compile() to produce machine code, which is stored in a nanojit::fragment. internally to nanojit, another set of filters operates on the lir as ...
...And 2 more matches
RDF Datasource How-To - Archive of obsolete content
from) the original document put together by robert churchill. what is a datasource? the "rdf universe" consists of a set of statements about internet resources; for example, "my home page was last modified april 2nd", or "that news article was sent by bob". in the most abstract sense, a datasource is a collection of such statements. more concretely, a datasource is a translator that can present in
formation as a collection of rdf statements. for example, a "file system datasource" would translate the file system into statements like "/tmp is a directory" and "/tmp/foo is contained within /tmp". an "imap datasource" would use the imap protocol to translate your mail server's inbox as a collection of statements like "message number 126's subject is 'make money fast on the internet'" and "message ...
...lements nsirdfdatasource. typically, you provide a parser for reading in some sort of static storage (e.g., a data file); the parser translates the datafile into a series of calls to assert() to set up the in-memory datasource. when flush() is called, or the last reference to the datasource is released, a routine walks the in-memory datasource and re-serializes the graph back to the original file
format. for examples of an implementation like this, look at the rdf/xml datasource or the bookmarks datasource. you may want to choose this implementation if your primary goal is to "wrap" a legacy data store. this implementation may cause problems if your data store can be modified "on the fly" by other agents. aggregate the in-memory datasource. this is an extreme case of delegation, where you us...
...ceeded(rv)) { nsirdfdatasource* mydatasource; rv = rdf->getdatasource("rdf:my-datasource", &mydatasource); if (ns_succeeded(rv)) { // ...do something to mydatasource here... ns_release(mydatasource); } nsservicemanager::releaseservice(krdfservicecid, rdf); } displaying rdf as content now that you've gone through all this pain to expose your in
formation as a datasource, you probably want to see it. using xul, you can display the contents of your datasource in a tree control, a menu, or a toolbar. in fact, you can convert rdf to an arbitrary content model using xul templates. the following xul fragment illustrates how to instantiate a tree control whose body is "rooted" to a resource (http://foo.bar.com/) that your datasource describes: <win...
...And 2 more matches
XML in Mozilla - Archive of obsolete content
mozilla has a relatively good support for xml. several world wide web consortium (w3c) recommendations and drafts from the xml family of specifications are supported, as well as other related technologies. this page is outdated. please help updating it with current in
formation. supported core xml w3c recommendations the core xml support includes parsing xml without validation (we use the expat parser), displaying xml with css, manipulating xml documents with scripts via dom, associating stylesheets with xml documents, and namespaces in xml. the core support is very good with few bugs. dtds and other external entities mozilla does not load external entities from the web. mozilla can load external entities whose system identifier uses the chrome protocol. this feature is used mainly ...
... whose system identifier is a relative path, and the xml declaration states that the document is not standalone (default), in which case mozilla will try to look for the entity under <bin>/res/dtd directory. mozilla may also make an exception with xhtml documents, see below. mozilla will read internal (dtd) subsets, and in special circumstances external dtds as explained above and will use this in
formation to recognize id type attributes, default attribute values, and general entities. other notes a lot of the document object model (dom, w3c recommendations and drafts) applies to xml. likewise, the cascading style sheets (css, w3c recommendations and drafts) style language can be used to style xml documents. the code for most the core xml can be found in the following directories on the mozill...
...1.9.1 internet-draft document.load(), document.async part of dom level 3 load & save module, a w3c working draft xhtml we have reasonable xhtml support, most things should work. we treat xhtml documents differently depending on the mime type (or file suffix if files are loaded from local discs). files that go through the html code path are not checked for well-
formedness. you will also notice not all xhtml features are supported when you exercise the html code path. 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. you ...
...And 2 more matches
Reading from Files - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file in
formation | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the plat
form (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. reading data from a file involves getting a reference to...
...xtual data, writing textual data, list of file-related error codes. reading data from a file involves getting a reference to a file and then creating an input stream to read from it. an input stream provides a means of reading bytes, strings or other values from the file. while there is only one method to create an input stream, it provides a number of options to control exactly how reading is per
formed. for instance, there are options to read a file as if it were text or a binary file. using the
former will cause characters in the stream to be interpreted with a particular character encoding. in addition, lines may be read by reading the file up until a linefeed character is detected. a binary stream would be used to read bytes or numbers encoded within the file. to create an input stream, fi...
...are optional so they do not need to be specified if they aren't needed. these extra arguments will be discussed later. you can also specify to read from a binary file by using the flag 'binary' instead of 'text'. the difference is that text streams process the bytes being read into characters in a particular character encoding whereas binary streams always read bytes. first, let's look at reading
form text files. reading text files characters are interpreted from a text input stream using a specified character encoding. this means that if a character within the file occupies several bytes, it will converted into a single character when read. this is done automatically as long as you specify the 'text' flag to nsiscriptableio.newinputstream(). the default character encoding is utf-8 which means...
...And 2 more matches
IO - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file in
formation | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the plat
form (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. files and streams this section describes how to access a...
...ere are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. files and streams this section describes how to access and get in
formation about files, read from files and create and write files. using files a xul application or extension may access files on disk, and either read or write to files. a file is accessed via a file object. to get a reference to a file object use nsiscriptableio.getfile(). the following example will retrieve a reference to a file located in the profile directory named sample.txt. var file = io.getfi...
...to a file object use nsiscriptableio.getfile(). the following example will retrieve a reference to a file located in the profile directory named sample.txt. var file = io.getfile("profile", "sample.txt"); the nsiscriptableio object is a global object always available within an application or extension. it provides a number of useful functions for dealing with files. ...
...And 2 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
h-autocomplete requires seamonkey 2.1 the user's default search engine's suggestions are searched. places-tag-autocomplete requires seamonkey 2.1 the user's places tags are searched. mydomain new in thunderbird 3 requires seamonkey 2.0 the user's email domain is suggested. history requires seamonkey 2.0 the user's url history is searched.
form-history requires seamonkey 2.0 search the values that the user has entered into
form fields. file (linux only) the local file system is searched. gloda new in thunderbird 3 addrbook new in thunderbird 3 requires seamonkey 2.0 the user's address book is searched. ldap new in thunderbird 25 requires seamonkey 2.22 the user's ldap dir...
...hange this attribute. if false, the default, autocomplete is enabled. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
...nt. there is no default. the timer starts after the user types a character. if the user types another character, the timer resets. 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. autocomplete a textbox that supports autocomplete. for more in
formation about autocomplete textboxes, see the autocomplete documentation (xpfe [thunderbird/seamonkey]) (firefox) number a textbox that only allows the user to enter numbers. in addition, arrow buttons appear next to the textbox to let the user step through values. there are several attributes that allow the number textbox to be configured, including decimalplaces, min, max, increment, wraparou...
...And 2 more matches
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
rent window of the toolbar you wish to insert a button). see below for the list of common palette ids. class="toolbarbutton-1" makes the toolbar button appear correctly in icons and text mode; it also adjusts padding. set the command to be executed when the button is clicked in the oncommand attribute. if you need to handle middle-click, add this line after the oncommand line. ...
...overs creating an entire toolbar, rather than just a button, it has a great explanation of the techniques we'll use here. icon size toolbar buttons can have two different sizes -- big and small. this means you'll need to provide two icons for each of your toolbar buttons. ...
...kaging section in this article; you may need to include .jar references if you are delivering your extension as an .xpi file. common mistakes this is a list of the most common mistakes made by extension authors, including both symptoms and solutions. problem: the whole set of default buttons is painted on the toolbar or in the customize toolbars window, instead of your own icon. caused by: mal
formed or not applied stylesheet. solution: check to be sure your stylesheet is correct, make sure your contents.rdf (or chrome.manifest) is correct, and be sure you didn't forget to apply the stylesheet to customizetoolbar.xul. a list of commonly overlayed windows with toolbars url application and affected window(s) palette id chrome://browser/content/browser.xul firefox...
...And 2 more matches
Complete - Archive of obsolete content
d them. if you want to see these techniques in action, then you can download and install the complete allcustom extension: allcustom.xpi (the link is external only because this wiki does not support xpi files.) the extension does not contain any useful functions. it is just an extended code sample. to see the code, use a jar tool or zip tool to unpack the xpi file that you downloaded. for more in
formation about developing extensions, see the main extensions page here. features of this extension this extension is a more complex version of the original custom toolbar button extension. it provides a user interface in two languages (english and french). it supports firefox, thunderbird, sunbird and flock—these are referred to as "firefox etc." in the rest of this page. it also supports seamonke...
...structure this extension's internal name is allcustom. it uses this name as the default file name throughout. where you see a url in the code with no file name, the application uses this default file name and an extension appropriate for the type of file expected. the extension is supplied as a xpi, which is compressed to reduce download times. the xpi contains: install.rdf in
formation about the extension chrome.manifest registration data for firefox etc. install.js installation script for seamonkey chrome directory containing the extension code chrome/allcustom.jar the extension jar defaults/preferences directory containing a preferences file inside the j...
...roach used here is optimistic. the extension is assumed to work in any future version of the application. to adopt this approach, set the maxversion to a large number like 99. the problem with this approach is that when changes in an application do make the extension fail, users might have bad experiences ranging from error messages that they cannot understand to crashes and data loss. for more in
formation about version checks, see: extension versioning, update and compatibility the installed jar to use disk space efficiently on the end user's computer, the three directories (content, locale, skin) are packed in a jar file. it is normally uncompressed, trading off some disk space for speed. this jar file will be installed as-is on the end user's computer, and unpacked at run-time by the applic...
...And 2 more matches
Creating a Wizard - Archive of obsolete content
each page contains a single question or a set of related questions. ...
...of the window tag. the content of the wizard element includes the content of each page of the wizard. the pages of the wizard are created using the wizardpage element. you can place whatever content you want inside each wizardpage. note that wizards currently only work properly from chrome urls. the wizard consists of several sections. the exact layout will vary according to the os for the plat
form. wizards will generally be displayed using customs that are familiar to the user of a particular os. a typical layout will include a title across the top, a set of navigation buttons across the bottom and the page contents in between. the title across the top is created using the title attribute, much like one would use for regular windows. the navigation buttons are created automatically. an e...
...radio value="small" label="small"/> <radio value="large" label="large"/> </radiogroup> <radiogroup> <caption label="gender"/> <radio value="male" label="male"/> <radio value="female" label="female"/> </radiogroup> </wizardpage> </wizard> this wizard has two pages, one that has a drop-down menu and the other with a set of radio buttons. the wizard will be
formatted automatically, with a title across the top and a set of buttons along the bottom. the user can navigate between the pages of the wizard with the back and next buttons. these buttons will enable and disable themselves at the appropriate moments. in addition, on the last page, the finish button will appear. all of this is automatic, so you don't have to do anything to manipulate the pages. th...
...And 2 more matches
Custom Tree Views - Archive of obsolete content
tree view holds the data to be displayed in the tree. creating a custom view so far, we have only been using the built-in content tree view. in this section, we will look at creating a custom view. this is necessary when the page has a lot of data or that data is highly nested. for instance, 5000 rows of treeitems would load too slowly. you might also implement a custom view when you want to per
form computations on the data to be displayed. since the view can store and retrieve the data in the most suitable manner for the kind of data used, the tree can be used even when there are hundreds of thousands of rows to be displayed. note: the tree-related interfaces changed in gecko 1.8. see tree widget changes for details. to implement a custom view, you will need to create an object which impl...
...ty. the following example shows this: <tree id="my-tree" flex="1"> <treecols> <treecol id="namecol" label="name" flex="1"/> <treecol id="datecol" label="date" flex="1"/> </treecols> <treechildren/> </tree> to assign data to be displayed in the tree, the view object needs to be created which is used to indicate the value of each cell, the total number of rows plus other optional in
formation. the tree will call methods of the view to get the in
formation that it needs to display. in general, although the tree view has thirty or so functions that may be implemented, you only need to implement the ones that the tree will call. three methods that you should implement are listed below. rowcount this property should be set to the total number of rows in the tree. getcelltext(...
... this example can be used for a tree with 10,000 rows. the contents of the cells in the first column will be set to the text 'row x' where x is the row number. the contents of the cells in the second column will be set to 'february 18'. the if statement in the function getcelltext() compares the id p...
...And 2 more matches
Document Object Model - Archive of obsolete content
dom introduction the document object model (dom) is used to store the tree of xul nodes. when an xul file is loaded, the tags are parsed and converted into a hierarchical document structure of nodes, one for each tag and block of text. the dom structure may be examined and modified using various methods provided for this purpose. specific xul elements also provide additional functions which may be used. each xul file that is loaded will have its own document displayed in a window or frame. ...
...etelementbyid() method. we've added the id attribute to a number of elements in the find file dialog. for example, we could get the state of a check box by using the code below: var state = document.getelementbyid('casecheck').checked; the value casecheck corresponds to the id of the case sensitive checkbox. once we have an indication of whether it is checked or not, we can use the state to per
form the search. we could do something similar for the other check box, or any other element that has an id. we'll need to get the text in the input field for example. our find files example it doesn't make sense to have the progress bar and the dummy tree data displayed when the find files dialog is first displayed. these were added so that we could see them. let's take them out now and have them ...
...d. first, we need to make them initially invisible. the hidden attribute is used to control whether an element is visible or not. we'll change the progress meter so that its initially hidden. also, we'll add an id attribute so that we can refer to it in a script to show and hide it. while we're at it, let's also hide the splitter and results tree as we only need to show them after a search is per
formed. <tree id="results" hidden="true" flex="1"> . . . <splitter id="splitbar" resizeafter="grow" hidden="true"/> <hbox> <progressmeter id="progmeter" value="50%" style="margin: 4px;" hidden="true"/> we've added the hidden attribute and set the value to true. this causes the element to be hidden when it first appears. next, let's add a function that is called when the find button i...
...And 2 more matches
Tree View Details - Archive of obsolete content
losed. nesting level every row in the tree has a nesting level. the topmost rows are at level 0, the children of those rows are at level 1, their children at level 2 and so on. the tree will query the view for each row by calling its getlevel method to find out the level of that row. the view will need to return 0 for the outermost rows and higher values for inner rows. the tree will use this in
formation to determine the hierarchical structure of the rows. in addition to the getlevel method, there is a hasnextsibling function which, given a row, should return true if there is another row afterwards at the same level. this function is used, specifically, to draw the nesting lines along the side of the tree. the getparentindex method is expected to return the parent row of a given row, that ...
...hether a row is open. this is described in a later section. a non-empty container will be displayed with a twisty next to it so that the user may open and close the row to see child items. empty containers will not have a twisty, but will still be treated like a container. when the user clicks the twisty to open a row, the tree will call the view's toggleopenstate method. the view should then per
form any necessary operations to retrieve the child rows and then update the tree with the new rows. note: as of this writing (gecko 2.0), custom nsitreeview implementations must be prepared to handle a call to toggleopenstate for any row index which returns true for a call to iscontainer, regardless of whether the container is empty. review of the methods here is a review of the methods needed t...
...ice function to insert a new row for each item. for solids, three items will be inserted. finally, the tree box's rowcountchanged function needs to be called. recall that treebox is a tree box object and was set earlier by a call to the settree function. the tree box object will be created by the tree for you and you can call its functions. in this case, we use the rowcountchanged function to in
form the tree that some rows were added to the underlying data. the tree will then redraw the tree as needed and the result is that the child rows will appear inside the container. the various other functions implemented above such as getlevel and iscontainer are used by the tree to determine how to draw the tree. the rowcountchanged function takes two arguments, the index where the first row was ins...
...And 2 more matches
Using Remote XUL - Archive of obsolete content
cascading style sheets (css) to change their appearance; use javascript to define their behavior. global web site navigation most web sites today have poor global navigation (features for locating and visiting pages across the entire site). it is difficult to discern the site's basic structure and available resources, which makes it hard to locate a particular page or find the one with the in
formation you want. part of the problem is that html has limited features for navigation. its primary mechanism--the hyperlink--was designed to be interspersed in content. html-based navigation bars take up too much space, dhtml menus are slow and buggy, and site maps make you go to an intermediate page to find the in
formation you want. xul's navigation-oriented widgets, like toolbars, menus, and tr...
... toolbars, menus, and trees, are a better way to provide web site navigation because they can fit a lot of navigation into a small space, render quickly, and work well. note: the downside to using xul is that it only works with browsers that understand it. this isn't a problem inside an organization that uses mozilla-based browsers exclusively, but for other sites you may need to provide another
form of navigation as well. prerequisites to understand this tutorial you should have experience with tag-based languages like html along with basic javascript, css, and the dom. knowledge of xml and its syntax is useful but not required. you also need a text editor and a web browser that can render xul, like mozilla, or firefox. if you build a xul file along with this tutorial and put it onto a we...
...left-hand side of its pages to provide site navigation. the bar consists of a set of links organized into four main categories: the mozilla organization, developer docs, testing, and tools. the bar also contains two links that are independent of any category: faq and search. the categorized links are analogous to menu items organized into menus, where clicking the link/selecting the menu item per
forms some function, so we'll use xul menu elements to implement them in our document. the independent links, on the other hand, are similar to xul buttons, which per
form a function when pressed, so we'll use the button element for those. <?xml version="1.0"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menubar> <menu label="the mozilla organization" /> ...
...And 2 more matches
Application Update - Archive of obsolete content
nabling the options --enable-updater and --enable-update-packaging on your configure will build you mar. compiled versions of mar are available in the gecko sdk under the folder /host/bin for your os. in order to generate sha1 hashes i installed shash. ...
...el% for example pref("app.update.url", "https://yourserver.net/update/3/%product%/%version%/%build_id%/%build_target%/%locale%/%channel%/%os_version%/%distribution%/%distribution_version%/update.xml"); // url user can browse to manually if for some reason all update installation // attempts fail. pref("app.update.url.manual", "http://yourserver.net/yourpage"); // a default value for the "more in
formation about this update" link // supplied in the "an update is available" page of the update wizard. pref("app.update.url.details", "http://yourserver.net/yourpage"); // user-settable override to app.update.url for testing purposes. //pref("app.update.url.override", ""); // interval: time between checks for a new version (in seconds) // default=1 day pref("app.update.interval", 86400);...
...this is off in firefox by default since we show a // upgrade start page instead! other apps may wish to show this ui, and supply // a whatsnewurl field in their brand.properties that contains a link to a page // which tells users what's new in this new update. pref("app.update.showinstalledui", false); // 0 = suppress prompting for incompa...
...And 2 more matches
Debugging a XULRunner Application - Archive of obsolete content
see also debugging javascript prefs setting the following prefs will make your debugging life much easier! preferences should be in a .js file in the directory %appname%/defaults/preferences/. ...
... console to enable a console on windows, start xulrunner with the -console argument. note that -console goes after the application.ini argument: e.g. xulrunner.exe /path/to/application.ini -console to output text to the console, use dump("my text here\n");. this will only work if the pref pref("browser...
...rue); pref("javascript.options.showinconsole", true); pref("javascript.options.strict", true); pref("nglayout.debug.disable_xul_cache", true); pref("nglayout.debug.disable_xul_fastload", true); don't forget to change these preferences back to their defaults when you've finished debugging; leaving them as-is can significantly harm per
formance and usability. see: preference reference for more in
formation about these preferences. console to enable a console on windows, start xulrunner with the -console argument. note that -console goes after the application.ini argument: e.g. xulrunner.exe /path/to/application.ini -console to output text to the console, use dump("my text here\n");. this will only work if the pref pref("browser.dom.window.dump.enabled", true) is enabled. to output dump ca...
...And 2 more matches
2006-10-20 - Archive of obsolete content
summary: mozilla.dev.builds - october 14th to october 20th 2006 linux reference plat
form 1.8.1 october 18th: marcus is wondering about the linux plat
form that is currently used to compile both public releases of firefox and xulrunner. on october 18th marcus responded to his original post and expanded on the original content of his question. marcus claims that when he builds firefox using centos he encounters crashes (segmentation faults) under linux distributions such as gentoo, suse and fedora. he also points out that when he per
forms a local build any of those plat
forms (gentoo, suse and fedora) he doesn't encounter any problems on the same machine. adding extension to extensions/ folder originally posted on oct 19th: christopher finke is currently learning how to com...
...njamin smedberg mentioned in his post that jan vávra needs to add the extension files to the packaging manifest, which is used to create the installer. in jan vávra's case he is modifying the thunderbird installer so he needs to modify "mail/installer/windows/packages-static" announcements decommissioning sparky on friday on october 17th j. paul reed announced that: sparky, the linux per
formance test machine for the 1.8 branchs, is being decommissioned. he also added that the linux per
formance test data is now being provided by bl-bldlnx01. paul would like to hear from anyone who is against this decision. he can be contacted via: email: preed@mozilla.com irc: preed on irc.mozilla.org phone: 650.903.0800 x256 uploading language packs to amo on october 17th benjamin smedberg bro...
...ext few days. this will make the language packages available to everyone. if you anyone has questions please feel free to ask benjamin smedberg. you can do this by replying to the following post. discussions sparky and comet going away on friday on october 19th j. paul reed posted the following discussion: j. paul reed stated that he is also going to decommission comet, the machine that per
formed seamonkey trunk gtk1 builds, this friday. j. paul reed's long-term goal is to remove old incompatible hardware. on the same day robert kaiser responded to j. paul reed's post: robert kaiser shared the following in
formation about comet and btek machines: comet and btek are used as machines that upload nightly gtk1 builds. comet and btek are currently the fastest-cycling tinderboxes availab...
...And 2 more matches
NPAPI plugin developer guide - Archive of obsolete content
plugins are shared libraries that users can install to display content that the application itself can't display natively. for example, the adobe flash plug-in is used to access flash content (including videos and certain interactive applications), and the quicktime and realplayer plugins are used to play special
format videos in a web page. important: plugins are now a legacy technology. they are not available on most mobile devices. mozilla encourages website developers to avoid using plugins wherever possible. if there are plugin features which are not available in the web plat
form, we encourage developers to post their use cases to mozilla.dev.plat
form project list, so that mozilla can prioritize web plat
form work to make those use cases possible. plugins are written using npapi, th...
...i plugin api reference. to make your plugin scriptable from web pages, use npruntime. ...
...ules for html elements using the appropriate attributes using the embed element for plug-in display using custom embed attributes plug-in references plug-in development overview writing plug-ins registering plug-ins ms windows unix mac os x drawing a plug-in instance handling memory sending and receiving streams working with urls getting version and ui in
formation displaying messages on the status line making plug-ins scriptable building plug-ins building, plat
forms, 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 ...
...And 2 more matches
NPFullPrint - Archive of obsolete content
values: true: plug-in takes complete control of the printing process and prints full-page. ...
...values: true: plug-in takes complete control of the printing process and prints full-page. ...
...values: true: plug-in takes complete control of the printing process and prints full-page. ...
...And 2 more matches
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
be used for all add-ons including extensions, themes and plugins. plugin packages should only need to package a small set of files in the following structure in the xpi file: install.rdf plugins/ pluginlib.dll plugintypes.xpt the install.rdf file contains an install manifest that describes the plugin to the user. the library and scripting interfaces are held in the plugins directory. ...
...at describes the plugin to the user. the library and scripting interfaces are held in the plugins directory. plat
form-specific files gecko 1.9.2 (firefox 3.6) and earlier prior to gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), it was possible to package multiple plugin libraries for different operating systems into a single xpi bundle. in the xpi you can use the following structure: plat
form/ linux_x86-gcc3/ plugins/ libplugin.so darwin_ppc-gcc3/ plugins/ libplugin.dylib more specific in
formation can be found in the plat
form-specific subdirectories documentation. gecko 2.0 (firefox 4) and later gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) removed support for plat
form-specific subdirectories. instead, you need to place the di...
... th...
...And 2 more matches
NSPR Release Engineering Guide - Archive of obsolete content
this paper is for engineers per
forming
formal release for the netscape portable runtime (nspr) across all plat
forms. nspr generally follows the iplanet product lifecycle. ...
... this paper is for engineers per
forming
formal release for the netscape portable runtime (nspr) across all plat
forms. nspr generally follows the iplanet product lifecycle. ...
...r/include/prinit.h with release numbers build all targets, debug and optimized on all plat
forms using local directories run the test suite on all targets verify release numbers show up in binaries resolve testing anomalies tag the tree with nsprpub_release_x_y_z_beta beta release checkout a whole new tree using the tag from above build all targets, debug and optimized on all plat
forms using the command: gmake release mdist=<dir>/mdist build_number=vx.y.z [build_opt=1 | use_debug_rtl=1] copy the bits from mdist to /share/builds/components/nspr20/.vx.y.z 1 run explode.pl run the test suite on all targets, using binaries & headers from shipped bits resolve testing anomalies tag the tree with nsprpub_release_x_y[_z] release candidate checkout a whole new tree ...
...And 2 more matches
Security - Archive of obsolete content
curity articles is highly discouraged. doing so may put your systems at risk. digital signaturesencryption and decryption address the problem of eavesdropping, one of the three internet security issues mentioned at the beginning of this document. ...
...icles is highly discouraged. doing so may put your systems at risk. digital signaturesencryption and decryption address the problem of eavesdropping, one of the three internet security issues mentioned at the beginning of this document. ...
... decryption address the problem of eavesdropping, one of the three internet security issues mentioned at the beginning of this document. but encryption and decryption, by themselves, do not address another problem: tampering.encryption and decryptionencryption is the process of trans
forming in
formation so it is unintelligible to anyone but the intended recipient. decryption is the process of trans
forming encrypted in
formation so that it is intelligible again.introduction to public-key cryptographypublic-key cryptography and related standards and techniques underlie the security features of many products such as signed and encrypted email, single sign-on, and secure sockets layer (ssl) communications. this document introduces the basic concepts of public-key cryptography. for an overview of ssl...
...And 2 more matches
Create Your Own Firefox Background Theme - Archive of obsolete content
it it right now! creating a theme header image the header image is displayed as the background of the top of the browser window, nestling in behind the toolbars, address bar, search bar and the tab strip. it will be anchored to the top-right corner of the browser window. view a sample theme header here. ...
... online image editor resources pixlr — pixlr offers professional and easy-to-use tools for creating and editing images within a browser. photoshop — tweak, rotate and touch up photos with photoshop® express, a free online photo editor. ...
...firefox, or newer versions with certain add-ons installed, the footer image is displayed as the background of the bottom of the browser window, behind the add-on and find bars. it will be anchored to the bottom-left corner of the browser window. footer images are optional. view a sample theme footer here. ...
...And 2 more matches
Properly Using CSS and JavaScript in XHTML Documents - Archive of obsolete content
if you're writing xhtml (as opposed to regular html) you should understand the fundamental differences between html 4 and xhtml. xhtml is xml, not html one of the primary misunderstandings about xhtml is that it is just another version of html. 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. ...
...net 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 con
form to the strict rules for authoring and displaying xml. proper xhtml is an application of xml and as such requires that authors follow strict rules when authoring xhtml. in particular: raw < and & characters are not allowed except inside of cdata sections (<![cdata[ ... ]]>). comments (<!—— ... ——>) must not contain double dashes (——). content contained within comments (<!—— .
...le and script tags can cause several different problems in xhtml when it is treated as xml rather than html. javascript contains characters which can not exist in xhtml javascript typically contains characters which can not exist in xhtml outside of cdata sections. <script type="text/javascript"> var i = 0; while (++i < 10) { // ... } </script> note that this example is not well
formed xhtml since the use of raw < is only allowed as a part of markup in xhtml or xml. use of comments inside inline style and script authors who are familiar with html commonly enclose the contents of inline style and script tags in comments in order to hide the contents of the tags from browsers which do not understand them. <style type="text/css"> <!-- body {background-color: blue; color: y...
...And 2 more matches
XUL Parser in Python - Archive of obsolete content
to sort of fool around with it. python's support for xml (and potential with xul) is extensive, and so it's more a matter of choosing an approach and hooking things up than anything else. source code the source code for the xul parser is available. it only runs as a hard-coded script right now, so if you want to use it you have to go in and changes some of the stuff like chrome_dir and which in
formation you want out. it also, i'm afraid, only works on the win32 plat
form, where the <tt>dir</tt> command it depends on gets you your xul files. again, you can easily use <tt>ls</tt> instead, as i should have done, and pick up some extra support. i will make these adjustments and change it into a real module when i get a second, so that someone can instantiate the parser from their own scripts and...
...n') for a in el_list[item].values(): w.write('<tr><td class="at">' + a + '</td>') with these modifications, the script creates an output more like a periodic table of xul elements. until i spruce it up a little, this is just a very basic demonstration of using python's xml parser with xul. but mozilla's upcoming support for languages like perl and python will really open up the mozilla plat
form to tools and approaches of this kind--and make now a good time to start thinking about how these various technologies will be put together. the first level of support for python in mozilla will apparently be for python modules made available as xpcom objects. extending on the approach in this script, then, you could imagine a kind of introspective xul chrome that could modify and replicate itself...
...ill be put together. the first level of support for python in mozilla will apparently be for python modules made available as xpcom objects. extending on the approach in this script, then, you could imagine a kind of introspective xul chrome that could modify and replicate itself by calling services from the xulparser and xulwriter xpcom objects. ...
...And 2 more matches
Index - Game development
an actually developing it. remember that it's no use to have the best game in the world if no one knows it exists. 11 techniques for game development games, guide this page lists essential core techniques for anyone wanting to develop games using open web technologies. 12 2d collision detection 2d, games, javascript, collision detection one of the simpler
forms of collision detection is between two rectangles that are axis aligned — meaning no rotation. the algorithm works by ensuring there is no gap between any of the 4 sides of the rectangles. any gap means a collision does not exist. 13 3d collision detection 3d, games, javascript, bounding boxes, collision detection this article provides an introduction to the different bound...
... are getting started working with 3d. 23 glsl shaders beginner, glsl, opengl, shader, texture shader, three.js, vertex shader shaders use glsl (opengl shading language), a special opengl shading language with syntax similar to c. glsl is executed directly by the graphics pipeline. there are two types of shaders: vertex shaders and fragment (pixel) shaders. vertex shaders trans
form shape positions into 3d drawing coordinates. fragment shaders compute the renderings of a shape's colors and other attributes. 25 async scripts for asm.js games, javascript, asm.js, async every medium or large game should compile asm.js code as part of an async script to give the browser the maximum flexibility to optimize the compilation process. in gecko, async compilation ...
...sphere. web-based audio is maturing fast, but there are still many browser differences to navigate. we often need to decide which audio parts are essential to our games' experience and which are nice to have but not essential, and devise a strategy accordingly. this article provides a detailed guide to implementing audio for web games, looking at what works currently across as wide a range of plat
forms as possible. 27 crisp pixel art look with image-rendering 2d, 3d, css, canvas, games, javascript, webgl, image-rendering, pixel this article discusses a useful technique for giving your canvas/webgl games a crisp pixel art look, even on high definition monitors. 28 efficient animation for web games animation, games, javascript this article covers techniq...
...And 2 more matches
Effective connection type - MDN Web Docs Glossary: Definitions of Web-related terms
the values of 'slow-2g', '2g', '3g', and '4g' are determined using observed round-trip times and downlink values. 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. 2g 1400ms 70 kbps the network is suited for transfers of small images. ...
... only such as text-only pages. 2g 1400ms 70 kbps the network is suited for transfers of small images. 3g 270ms 700 kbps the network is suited for transfers of large assets such as high resolution images, audio, and sd video. 4g 0ms ∞ the network is suited for hd video, real-time video, etc. ...
... 4g 0ms ∞ the network is suited for hd video, real-time video, etc. effectivetype is a property of the network in
formation api, exposed to javascript via the navigator.connection object. ...
...And 2 more matches
Styling tables - Learn web development
ooking at a typical html table. well, i say typical — most html table examples are about shoes, or the weather, or employees; we decided to make things more interesting by making it about famous punk bands from the uk. the markup looks like so: <table> <caption>a summary of the uk's most famous punk bands</caption> <thead> <tr> <th scope="col">band</th> <th scope="col">year
formed</th> <th scope="col">no. of albums</th> <th scope="col">most famous song</th> </tr> </thead> <tbody> <tr> <th scope="row">buzzcocks</th> <td>1976</td> <td>9</td> <td>ever fallen in love (with someone you shouldn't've)</td> </tr> <tr> <th scope="row">the clash</th> <td>1976</td> <td>6</td> <td>london calling</td> ...
...the following css to the bottom of your style.css file: /* zebra striping */ tbody tr:nth-child(odd) { background-color: #ff33cc; } tbody tr:nth-child(even) { background-color: #e495e4; } tbody tr { background-image: url(noise.png); } table { background-color: #ff33cc; } earlier on you saw the :nth-child selector being used to select specific child elements. it can also be given a
formula as a parameter, so it will select a sequence of elements. the
formula 2n-1 would select all the odd numbered children (1, 3, 5, etc.) and the
formula 2n would select all the even numbered children (2, 4, 6, etc.) we've used the odd and even keywords in our code, which do exactly the same things as the aforementioned
formulae. in this case we are giving the odd and even rows different (lurid) c...
... your table into logical chunks and provide extra places to apply css to, so it is easier to layer styles on top of one another if required. use zebra striping to make alternative rows easier to read. use text-align to line up your <th> and <td> text, to make things neater and easier to follow. test your skills! we have covered a lot in this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: tables. summary with styling tables now behind us, we need something else to occupy our time. the next article explores debugging css — how to solve problems such as layouts not looking like they should, or properties not applying when you think they should. this ...
...And 2 more matches
What is CSS? - Learn web development
is css for? as we have mentioned before, css is a language for specifying how documents are presented to users — how they are styled, laid out, etc. a document is usually a text file structured using a markup language — html is the most common markup language, but you may also come across other markup languages such as svg or xml. presenting a document to a user means converting it into a
form usable by your audience. browsers, like firefox, chrome, or edge , are designed to present documents visually, for example, on a computer screen, projector or printer. note: a browser is sometimes called a user agent, which basically means a computer program that represents a person inside a computer system. browsers are the main type of user agent we think of when talking about css, however, i...
...he only one. there are other user agents available — such as those which convert html and css documents into pdfs to be printed. css can be used for very basic document text styling — for example changing the color and size of headings and links. it can be used to create layout — for example turning a single column of text into a layout with a main content area and a sidebar for related in
formation. it can even be used for effects such as animation. have a look at the links in this paragraph for specific examples. css syntax css is a rule-based language — you define rules specifying groups of styles that should be applied to particular elements or groups of elements on your web page. for example "i want the main heading on my page to be shown as large red text." the following code...
...d text." the following code shows a very simple css rule that would achieve the styling described above: h1 { color: red; font-size: 5em; } the rule opens with a selector . this selects the html element that we are going to style. in this case we are styling level one headings (<h1>). we then have a set of curly braces { }. inside those will be one or more declarations, which take the
form of property and value pairs. each pair specifies a property of the element(s) we are selecting, then a value that we'd like to give the property. before the colon, we have the property, and after the colon, the value. css properties have different allowable values, depending on which property is being specified. in our example, we have the color property, which can take various color values. we ...
...And 2 more matches
create fancy boxes - Learn web development
! i want to be fancy.</div> ok, that's a very small bit of html, what can we tweak on that element? all of the following: its box model properties: width, height, padding, border, etc. its background properties: background, background-color, background-image, background-position, background-size, etc. its pseudo-element: ::before and ::after and some aside properties like: box-shadow, trans
form, outline, etc. so we have a very large playground. let the fun begin. box model tweak the box model alone allows us to do some basic stuff, like adding simple borders, making squares, etc.. it starts to get interesting when you push the properties to the limit by having negative padding and/or- margin by having border-radius larger than the actual size of the box. making circles <div class...
...ient( 85deg, rgba(0,0,0,0) 83%, #9f8fa4 83%), linear-gradient(175deg, rgba(0,0,0,0) 70%, #74a6ae 70%), linear-gradient( 85deg, rgba(0,0,0,0) 80%, #74a6ae 80%); } gradients can be used in some very creative ways. if you want to see some crazy examples, take a look at lea verou's css patterns. just remember that such use of gradient is quite expensive, per
formance wise. if you want to learn more about gradient, feel free to get into our dedicated article. pseudo-elements when styling a single box, you could find yourself limited and could wish to have more boxes to create even more amazing styles. most of the time, that leads to polluting the dom by adding extra html element for the unique purpose of style. even if it is necessary, it's somewhat con...
... /* this is the size of the clouds left ear */ width : 100px; height : 100px; /* we sligthly move it to the right */ right : -60px; /* to make sure that the bottom of the cloud remains flat, we must make the bottom left corner of the right ear square. */ border-bottom-left-radius: 0; } blockquote a more practical example of using pseudo-elements is to build a nice
formatting for html <blockquote> elements. so let's see an example with a slightly different html snippet (which provide us an opportunity to see how to also handle design localization): <blockquote>people who think they know everything are a great annoyance to those of us who do. <i>isaac asimov</i></blockquote> <blockquote lang="fr">l'intelligence, c'est comme les parachutes, quand on n'en a pas, o...
...And 2 more matches
How can we design for all types of users? - Learn web development
e (using the max-width property). if you want an elastic/responsive website, and you don't know what the browser's default width is, you can use the max-width property to allow up to 70 characters per line and no more: div.container { max-width:70em; } alternative content for images, audio, and video websites often include stuff besides plain text. images images can be either decorative or in
formative, but there's no guarantee that your users can see them. for example, visually impaired users rely on a screen reader, which can only handle text. your readers may be using a very strict intranet that blocks images originating from a cdn. your readers may have disabled images to save bandwidth, especially on mobile devices (see below). decorative images they're just for decoration a...
...ntee that your users can see them. for example, visually impaired users rely on a screen reader, which can only handle text. your readers may be using a very strict intranet that blocks images originating from a cdn. your readers may have disabled images to save bandwidth, especially on mobile devices (see below). decorative images they're just for decoration and don't convey any real in
formation. they could most often be replaced by a background image. make sure they feature an empty alt attribute: <img src="deco.gif" alt=""> so they don't clog up the text. in
formative images they are used to convey in
formation, hence their name. they can, for instance, feature a graph, or show a person's gesture, or any other in
formation. at minimum, you must provide a relevant alt attribute. i...
...this attribute's value is a url pointing towards a resource explicitly describing in detail the image's content. note: the use and even the existence of longdesc has been debated for quite some time. ...
...And 2 more matches
Example 2 - Learn web development
this is the second example that explain how to build custom
form widgets. ...
... this is the second example that explain how to build custom
form widgets. ...
...<option>banana</option> <option>strawberry</option> <option>apple</option> </select> <div class="select"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> <
form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top ...
...And 2 more matches
Test your skills: Advanced styling - Learn web development
this aim of this skill test is to assess whether you've understood our advanced
form styling and ui pseudo-classes articles. note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. advanced
form styling 1 in our first advanced styling tasks, we want you to handle making a search input as consistent as possible across browsers — a trickier task than with standard text inputs, even on modern browsers. we've already provided you with a basic reset to build upon. first of all, try giving the search box a consistent width, height, padd...
...want you to handle making a search input as consistent as possible across browsers — a trickier task than with standard text inputs, even on modern browsers. we've already provided you with a basic reset to build upon. first of all, try giving the search box a consistent width, height, padding, and border color across browsers. you'll find that some browsers will not behave in terms of the
form element's height. this is due to native os styling being used in some cases. how can you remove this native styling? once you've removed the native styling, you'll need to add back one of the features it was providing, to keep same look and feel we originally had. how do you do this? one thing that is inconsistent across browsers (particularly looking at safari here) is the position of the stan...
...fter the search input to help you attach it, should you need it. can you figure out a sensible way to attach it, and can you use some css to get it to sit to the right of the search box, and be lined up vertically as well? try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. advanced
form styling 2 in our next task we provide you with a set of three radio buttons. we want you to give them custom styling. we've already provided you with a basic reset to build upon. first of all, get rid of their default styling. next, give the radio buttons a reasonable base style — the style they have when the page first loads. this can be anything you like, but you probably want to set a ...
...And 2 more matches
Example - Learn web development
this is the example code for the article your first html
form. ...
... this is the example code for the article your first html
form. ...
... this is the example code for the article your first html
form. ...
...And 2 more matches
The web and web standards - Learn web development
on (also try searching for "history of the web" in your favorite search engine and see what you get, if you are interested in more detail.) in the late 1960s, the us military developed a communication network called arpanet. this can be considered a forerunner of the web, as it worked on packet switching, and featured the first implementation of the tcp/ip protocol suite. ...
...they received a fair amount of interest, enough to convince timbl's bosses to allow him to go ahead and create a global hypertext system. ...
... put some time in to studying all the different technologies you need to use, all the techniques and best practices you need to know, and all the typical patterns you'll be called upon to implement. it'll take you a few months to really start to get into it, and then you'll need to keep learning so that your knowledge stays up-to-date with all the new tools and features that appear on the web plat
form, and keep practicing and refining your craft. the only constant is change. does this sound hard? don't worry — we aim to give you everything you need to know to get started, and things will get easier. once you embrace the constant change and uncertainty of the web, you'll start to enjoy yourself. as a part of the web community, you'll have an entire web of contacts and useful material to hel...
...And 2 more matches
From object to iframe — other embedding technologies - Learn web development
— you just need to be careful. read on... browser makers and web developers have learned the hard way that iframes are a common target (official term: attack vector) for bad people on the web (often termed hackers, or more accurately, crackers) to attack if they are trying to maliciously modify your webpage, or trick people into doing something they don't want to do, such as reveal sensitive in
formation like usernames and passwords. because of this, spec engineers and browser developers have developed various security mechanisms for making <iframe>s more secure, and there are also best practices to consider — we'll cover some of these below. clickjacking is one kind of common iframe attack where hackers embed an invisible iframe into your document (or embed your document into their own ...
...herefore you should give embedded content only the permissions needed for doing its job. of course, this applies to your own content, too. a container for code where it can be used appropriately — or for testing — but can't cause any harm to the rest of the codebase (either accidental or malicious) is called a sandbox. unsandboxed content can do way too much (executing javascript, submitting
forms, popup windows, etc.) by default, you should impose all available restrictions by using the sandbox attribute with no parameters, as shown in our previous example. if absolutely required, you can add permissions back one by one (inside the sandbox="" attribute value) — see the sandbox reference entry for all the available options. one important note is that you should never add both allow-scr...
..., you can configure your server to send an appropriate x-frame-options header. this can prevent other websites from embedding your content in their web pages (which would enable clickjacking and a host of other attacks), which is exactly what the mdn developers have done, as we saw earlier on. note: you can read frederik braun's post on the x-frame-options security header for more background in
formation on this topic. obviously, it's rather out of scope for a full explanation in this article. 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 i...
...And 2 more matches
Responsive images - Learn web development
responsive images are just one part of responsive design, a future css topic for you to learn. ...
...problems, and they do to a certain degree — they are small in file size and scale well, and you should use them wherever possible. however, they aren't suitable for all image types. vector images are great for simple graphics, patterns, interface elements, etc., but it starts to get very complex to create a vector-based image with the kind of detail that you'd find in say, a photo. raster image
formats such as jpegs are more suited to the kind of images we see in the above example. this kind of problem didn't exist when the web first existed, in the early to mid 90s — back then the only devices in existence to browse the web were desktops and laptops, so browser engineers and spec writers didn't even think to implement solutions. responsive image technologies were implemented recently to ...
...you can see an example of this in our responsive.html example on github (see also the source code): <img srcset="elva-fairy-480w.jpg 480w, elva-fairy-800w.jpg 800w" sizes="(max-width: 600px) 480px, 800px" src="elva-fairy-800w.jpg" alt="elva dressed as a fairy"> the srcset and sizes attributes look complicated, but they're not too hard to understand if you
format them as shown above, with a different part of the attribute value on each line. each value contains a comma-separated list, and each part of those lists is made up of three sub-parts. let's run through the contents of each now: srcset defines the set of images we will allow the browser to choose between, and what size each image is. each set of image in
formation is separated from the previous ...
...And 2 more matches
Functions — reusable blocks of code - Learn web development
ns we've made use of functions built in to the browser a lot in this course. ...
...ured javascript objects yet — you can wait until our later module that will teach you all about the inner workings of objects, and how to create your own. for now, we just wanted to clear up any possible confusion of method versus function — you are likely to meet both terms as you look at the available related resources across the web. the built-in code we've made use of so far come in both
forms: functions and methods. you can check the full list of the built-in functions, as well as the built-in objects and their corresponding methods here. you've also seen a lot of custom functions in the course so far — functions defined in your code, not inside the browser. anytime you saw a custom name with parentheses straight after it, you were using a custom function. in our random-canvas-cir...
...again, this looks something like this: mybutton.onclick = function() { alert('hello'); // i can put as much code // inside here as i want } function parameters some functions require pa...
...And 2 more matches
Introduction to web APIs - Learn web development
e browser — taking an audio track, altering its volume, applying effects to it, etc. in the background, the browser is actually using some complex lower-level code (e.g. c++ or rust) to do the actual audio processing. but again, this complexity is abstracted away from you by the api. third-party apis are not built into the browser by default, and you generally have to retrieve their code and in
formation from somewhere on the web. for example, the twitter api allows you to do things like displaying your latest tweets on your website. it provides a special set of constructs you can use to query the twitter service and return specific in
formation. relationship between javascript, apis, and other javascript tools so above, we talked about what client-side javascript apis are, and how they ...
...scripting language built into browsers that allows you to implement functionality on web pages/apps. note that javascript is also available in other programming environments, such as node. browser apis — constructs built into the browser that sits on top of the javascript language and allows you to implement functionality more easily. third-party apis — constructs built into third-party plat
forms (e.g. twitter, facebook) that allow you to use some of those plat
form's functionality in your own web pages (for example, display your latest tweets on your web page). javascript libraries — usually one or more javascript files containing custom functions that you can attach to your web page to speed up or enable writing common functionality. examples include jquery, mootools and react. java...
... applying new styles to your page, etc. every time you see a popup window appear on a page or some new content displayed, for example, that's the dom in action. find out more about these types of api in manipulating documents. apis that fetch data from the server to update small sections of a webpage on their own are very commonly used. this seemingly small detail has had a huge impact on the per
formance and behaviour of sites — if you just need to update a stock listing or list of available new stories, doing it instantly without having to reload the whole entire page from the server can make the site or app feel much more responsive and "snappy". apis that make this possible include xmlhttprequest and the fetch api. you may also come across the term ajax, which describes this technique. f...
...And 2 more matches
Video and Audio APIs - Learn web development
<div></div> <span aria-label="timer">00:00</span> </div> <button class="rwd" data-icon="b" aria-label="rewind"></button> <button class="fwd" data-icon="f" aria-label="fast forward"></button> </div> </div> the whole player is wrapped in a <div> element, so it can all be styled as one unit if needed. the <video> element contains two <source> elements so that different
formats can be loaded depending on the browser viewing the site. the controls html is probably the most interesting: we have four <button>s — play/pause, stop, rewind, and fast forward. each <button> has a class name, a data-icon attribute for defining what icon should be shown on each button (we'll show how this works in the below section), and an aria-label attribute to provide an unders...
...only when you are hovering/focusing over the player do the controls appear at full opacity. we lay out the buttons inside the control bar using flexbox (display: flex), to make things easier. ...
...l opacity. we lay out the buttons inside the control bar using flexbox (display: flex), to make things easier. ...
...And 2 more matches
Arrays - Learn web development
h console.log(). some useful array methods in this section we'll look at some rather useful array-related methods that allow us to split strings into array items and vice versa, and add new items into arrays. converting between strings and arrays often you'll be presented with some raw data contained in a big long string, and you might want to separate the useful items out into a more useful
form and then do things to them, like display them in a data table. to do this, we can use the split() method. in its simplest
form, this takes a single parameter, the character you want to separate the string at, and returns the substrings between the separator as items in an array. note: okay, this is technically a string method, not an array method, but we've put it in with arrays as it goes well...
...urrent item price to that total in each iteration of the loop, so that at the end of the code the correct total is printed onto the invoice. you might need an assignment operator to do this. we want you to change the line just below // number 5 so that the itemtext variable is made equal to "current item name — $current item price", for example "shoes — $23.99" in each case, so the correct in
formation for each item is printed on the invoice. this is just simple string concatenation, which should be familiar to you. playable code <h2>live output</h2> <div class="output" style="min-height: 150px;"> <ul> </ul> <p></p> </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="pl...
... body { margin: 10px; background-color: #f5f9fa; } active learning: top 5 searches a good use for array methods like push() and pop() is when you are maintaining a record of currently active items in a web app. in an animated scene for example, you might have an array of objects representing the background graphics currently displayed, and you might only want 50 displayed at once, for per
formance or clutter reasons. as new objects are created and added to the array, older ones can be deleted from the array to maintain the desired number. in this example we're going to show a much simpler use — here we're giving you a fake search site, with a search box. the idea is that when terms are entered in the search box, the top 5 previous search terms are displayed in the list. when the num...
...And 2 more matches
Handling text — strings in JavaScript - Learn web development
basic computer literacy, a basic understanding of html and css, an understanding of what javascript is. objective: to gain familiarity with the basics of strings in javascript. the power of words words are very important to humans — they are a large part of how we communicate. since the web is a largely text-based medium designed to allow humans to communicate and share in
formation, it is useful for us to have control over the words that appear on it. html provides structure and meaning to our text, css allows us to precisely style it, and javascript contains a number of features for manipulating strings, creating custom welcome messages and prompts, showing the right text labels when needed, sorting terms into the desired order, and much more. pretty much all of the ...
...if it can. 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. try this: let mynum = 123; let mystring = mynum.tostring(); typeof mystring; these constructs can be really useful in some situations. for example, if a user enters a number into a
form's text field, it's a string. however, if you want to add this number to something, you'll need it to be a number, so you could pass it through number() to handle this. we did exactly this in our number guessing game, in line 54. template literals another type of string syntax that you may come across is template literals (sometimes referred to as template strings). this is a newer syntax that ...
... modern browsers, and the only place you'll find a lack of support is internet explorer. many of our examples still use standard string literals, but we will include more template literals going forward. see our template literals reference page for more examples and details of advanced features. test your skills! you've reached the end of this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: strings. note that this also requires knowledge from the next article, so you might want to read that first. conclusion so that's the very basics of strings covered in javascript. in the next article, we'll build on this, looking at some of the built-in methods avai...
...And 2 more matches
Inheritance in JavaScript - Learn web development
l() methods defined. later you'll see how these can be inherited by other constructors. say we wanted to create a teacher class, like the one we described in our initial object-oriented definition, which inherits all the members from person, but also includes: a new property, subject — this will contain the subject the teacher teaches. an updated greeting() method, which sounds a bit more
formal than the standard greeting() method — more suitable for a teacher addressing some students at school. defining a teacher() constructor function the first thing we need to do is create a teacher() constructor — add the following below the existing code: function teacher(first, last, age, gender, interests, subject) { person.call(this, first, last, age, gender, interests); this.subje...
... library — most of the popular options have an easy set of functionality available for doing inheritance more easily and quickly. coffeescript for example provides class, extends, etc. a further exercise in our oop theory section, we also included a student class as a concept, which inherits all the features of person, and also has a different greeting() method from person that is much more in
formal than the teacher's greeting. have a look at what the student's greeting looks like in that section, and try implementing your own student() constructor that inherits all the features of person(), and implements the different greeting() function. note: if you have trouble getting this to work, have a look at our finished version (see it running live also). object member summary to summarize...
...inheritance, and to keep careful track of where you define your methods and properties. it is possible to start writing code that temporarily modifies the prototypes of built-in browser objects, but you should not do this unless you have a really good reason. too much inheritance can lead to endless confusion, and endless pain when you try to debug such code. ultimately, objects are just another
form of code reuse, like functions or loops, with their own specific roles and advantages. if you find yourself creating a bunch of related variables and functions and want to track them all together and package them neatly, an object is a good idea. objects are also very useful when you want to pass a collection of data from one place to another. both of these things can be achieved without use of co...
...And 2 more matches
Object-oriented JavaScript for beginners - Learn web development
can quickly get very complicated, and giving it a full treatment now would probably confuse more than help. the basic idea of oop is that we use objects to model real world things that we want to represent inside our programs, and/or provide a simple way to access functionality that would otherwise be hard or impossible to make use of. objects can contain related data and code, which represent in
formation about the thing you are trying to model, and functionality or behavior that you want it to have. object data (and often, functions too) can be stored neatly (the official word is encapsulated) inside an object package (which can be given a specific name to refer to, which is sometimes called a namespace), making it easy to structure and access; objects are also commonly used as data stores t...
...ften, functions too) can be stored neatly (the official word is encapsulated) inside an object package (which can be given a specific name to refer to, which is sometimes called a namespace), making it easy to structure and access; objects are also commonly used as data stores that can be easily sent across the network. defining an object template let's consider a simple program that displays in
formation about the students and teachers at a school. here we'll look at oop theory in general, not in the context of any specific programming language. 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. there are lots of things you could know about a person (their address, height, shoe size, dna ...
... features directly on them as needed. this is really useful — teachers and students share many common features such as name, gender, and age, so it is convenient to only have to define those features once. you can also define the same feature separately in different classes, as each definition of that feature will be in a different namespace. for example, a student's greeting might be of the
form "yo, i'm [firstname]" (e.g yo, i'm sam), whereas a teacher might use something more
formal, such as "hello, my name is [prefix] [lastname], and i teach [subject]." (e.g hello, my name is mr griffiths, and i teach chemistry). note: the fancy word for the ability of multiple object types to implement the same functionality is polymorphism. just in case you were wondering. you can now create obj...
...And 2 more matches
Aprender y obtener ayuda - Learn web development
e times when you'll get stuck and feel frustrated — even professional web developers feel like this regularly — and it pays to know about the most effective ways to try and get help so you can progress in your work. this article provides some hints and tips in both of these areas that will help you get more out of learning web development, as well as further reading so you can find out more in
formation about each sub-topic should you wish.. effective learning let's move straight on and think about effective learning. different learning methods it is interesting to consider that there are two main ways in which your brain learns things — focused and diffuse learning: focused learning is what you might more traditionally associate with academic subjects. you concentrate deeply on a ...
... learning — or thinking — at once. so which one should you choose? you might think that focused learning is better for studying, but in reality, both are very important. focused thinking is great for concentrating hard on specific subjects, getting into deep problem solving, and improving your mastery of the techniques required — strengthening the neural pathways in your brain where that in
formation is stored. it isn't however very good at getting an understanding of "the big picture", and unlocking new neural pathways when you are trying to understand new subjects or solve new problems that you haven't come across before. for that, you need diffuse thinking. this is the opposite of focus — you let your brain wander around the wider landscape, searching around for connections you di...
... to learn enough to build a website for my local amateur tennis club. i want to learn html and css so i can expand my job role to take over updating the content on our company website. the following are not quite as reasonable: i want to go from a complete beginner to becoming a senior web developer in three months. i want to start my own company and build a social network that will out-per
form facebook, in two years. what do you need to get there? once you've worked out your goal, it is a good idea to research what you'll need to achieve the goal. for example: materials i need: a computer internet access pens and paper knowledge i need: how to use html, css, javascript, and associated tools and best practices to build web sites and web applications (we can definitely help...
...And 2 more matches
Deployment and next steps - Learn web development
rgument, which tells rollup to watch files and rebuild on changes. ...
...er'; const production = !process.env.rollup_watch; export default { input: 'src/main.js', output: { sourcemap: true,
format: 'iife', name: 'app', file: 'public/build/bundle.js' }, plugins: [ svelte({ // enable run-time checks when not in production dev: !production, // we'll extract any component css out into // a separate file - better for per
formance css: css => { css.write('public/build/bundle.css'); } }), later on in the same file you'll also see how rollup minimizes our scripts in production mode and launches a local server in development mode: // in dev mode, call `npm run start` once // the bundle has been generated !production && serve(), // watch the `public` directory and refresh the ...
...all you need is a web server capable of serving static files, which means you have plenty of options to choose from. let's look at a couple of examples. note: the following section could be applied to any client-side static web site requiring a build step, not just svelte apps. deploying with vercel one of the easiest ways to deploy a svelte application is using vercel. vercel is a cloud plat
form specifically tailored for static sites, which has out-of-the-box support for most common front-end tools, svelte being one of them. to deploy our app, follow these steps. register for an account with vercel. navigate to the root of your app and run npx vercel; the first time you do it, you'll be prompted to enter your email address, and follow the steps in the email sent to that addr...
...And 2 more matches
Understanding client-side JavaScript frameworks - Learn web development
ntations of these features differ? how do they relate to "vanilla" javascript or html? after that, we'll provide some tutorials covering the essentials of some of the different framework choices, to provide you with enough context and familiarity to start going into greater depth yourself. we want you to go forward and learn about frameworks in a pragmatic way that doesn't forget about web plat
form fundamental best practices such as accessibility. get started now, with "introduction to client-side frameworks" prerequisites you should really learn the basics of the core web languages first before attempting to move on to learning client-side frameworks — html, css, and especially javascript. your code will be richer and more professional as a result, and you'll be able to troubleshoot ...
...h "introduction to client-side frameworks" prerequisites you should really learn the basics of the core web languages first before attempting to move on to learning client-side frameworks — html, css, and especially javascript. your code will be richer and more professional as a result, and you'll be able to troubleshoot problems with more confidence if you understand the fundamental web plat
form features that the frameworks are building on top of. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started introductory guides 1. introduction to client-side frameworks we begin our look at frameworks with a general overview of the area, looking at a brief history of javascri...
... in this article we learn about routing or url-based filtering as it is sometimes referred to. we'll use it to provide a unique url for each of the three todo views — "all", "active", and "completed". 6. ember resources and troubleshooting our final ember article provides you with a list of resources that you can use to go further in your learning, plus some useful troubleshooting and other in
formation. vue tutorials note: vue tutorials last tested in may 2020, with vue 2.6.11. if you need to check your code against our version, you can find a finished version of the sample vue app code in our todo-vue repository. for a running live version, see https://mdn.github.io/todo-vue/dist/. 1. getting started with vue now let's introduce vue, the third of our frameworks. in this article,...
...And 2 more matches
Learn web development
the learning area is being added to regularly. we have started keeping learning area release notes to show what has changed — keep checking back frequently! if you have questions regarding topics you'd like to see covered or feel are missing, drop us a message on our discourse forum. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started where to start complete beginner: if you are a complete beginner to web development, we'd recommend that you start by working through our getting started with the web module, which provides a practical introduction to web development. beyond the basics: if you have a bit of knowledge already, the next step is to learn html and css in det...
...guage that we can use to style and layout our web content, as well as adding behavior like animation. this topic provides comprehensive coverage of css. javascript — dynamic client-side scripting javascript is the scripting language used to add dynamic functionality to web pages. this topic teaches all the essentials needed to become comfortable with writing and understanding javascript. web
forms — working with user data web
forms are a potent tool for interacting with users — most commonly, they are used for collecting data from users, or allowing them to control a user interface. in the articles listed below, we'll cover all the essential aspects of structuring, styling, and interacting with web
forms. accessibility — make the web usable by everyone accessibility is the practi...
...ce. in the articles listed below, we'll cover all the essential aspects of structuring, styling, and interacting with web
forms. accessibility — make the web usable by everyone accessibility is the practice of making web content available to as many people as possible regardless of disability, device, locale, or other differentiating factors. this topic gives you all you need to know. web per
formance — making websites fast and responsive web per
formance is the art of making sure web applications download fast and are responsive to user interaction, regardless of a user's bandwidth, screen size, network, or device capabilities. ...
...And 2 more matches
Accessible Toolkit Checklist
please contact the mozilla accessibility community with questions or feedback. the work when implementing a new toolkit it's important to: implement standard keyboard behavior, which can vary from plat
form to plat
form. expose your ui - a way for assistive technologies such as screen readers, screen magnifiers and voice dictation software to understand your software. provide theme compatibility with the operating system, at least as an option. some low vision users will be running your software with high contrast or large font themes. go beyond section 508. implement true usability for everyone, and make your toolkit follow the guidelines for each plat
form. the approaches there are two basic kinds of toolkits, which each provide different challenges when implementing accessibi...
...since the individual widgets predominately come from the operating system, they already implement standard keyboard commands and follow the operating system's visual theme. ...
...endors when parts of your msaa solution isn't working. often these kinds of toolkits don't use a separate window for each control; in that case remember to generate a unique 32 bit child id for each control so that the msaa event system can call back for the right iaccessible for each event. the checklist this checklist is currently only for microsoft windows, but should be expanded to include in
formation about linux and os x. it is maintained by the mozilla accessibility community. contributions are welcome. general dialogs/windows/general escape key cancels dialogs and refocuses the previously focused on the parent window. alt+f4 closes windows, similar to escape but even works on dialogs without cancel button alt+space opens window menu with restore, move, size, m...
...And 2 more matches
Accessibility and Mozilla
yes 5.5. we are optimistic that jaws support will catch up this year. in recent articles from both afb's access world and nfb's voice of the nation's blind, reviewers found no significant roadblocks in moving to firefox from internet explorer for screen reader users. ...
...e same keyboard commands are still available, so users can become comfortable and productive right away.accessibility in
formation for core gecko developersboth end users and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night.accessibility in
formation for ui designers and developerswhen you design user interfaces with accessibility in mind, they will work for more people. this page describes a number of design-related aspects to look out for, in no particular order.accessibility/liveregiondevguidethis page is currently under construction. this developer's guide lays out general guidelines that assistive technology (at) developers can use...
... about their web browsing experience to download a new piece of software. websites such as online magazines with sophisticated audiences are now reporting upwards of 25% firefox usage.embedding api for accessibilityevent process procedurethis diagram outlines how events are processed within gecko. ...
...And 2 more matches
Theme concepts
f the browser by adding images to the header area of the firefox browser; this is the area behind the menu bar, toolbars, address bar, search bar, and tab strip. these theme options can be implemented as static themes (although the theme images themselves may be animated) or as dynamic themes created in a browser extension. if you have a lightweight theme it will be converted to this new theme
format automatically before lightweight themes are deprecated. you do not need to port your theme. however, please feel free to update your themes to use any of the new features described here. static themes static themes are specified using the same resources as a browser extension: a manifest.json file to define the theme components with those components stored in the same folder as the manifest.
... any of the new features described here. static themes static themes are specified using the same resources as a browser extension: a manifest.json file to define the theme components with those components stored in the same folder as the manifest.json file or a sub folder. these resources are then packed in a zip for publication on addons.mozilla.org (amo) or for self-distribution. for more in
formation on self-distribution, visit signing and distributing your add-on. you can also use the theme generator on amo to create a static theme. additionally, firefox color can be used to preview customizations to the browser's theme with options to share and export a theme. a theme and browser extension functionality cannot be defined in one package, such as including a theme to complement an ext...
...[ "weta.png", "weta-left.png"] }, and their alignment by: "properties": { "additional_backgrounds_alignment": [ "right top" , "left top" ] }, full details of how to setup this theme can be found in the themes example weta_mirror. full details of the alignment options can be found in the "theme" key description. static animated themes it is possible to create an animated theme using an apng
format image, as in the themes example animated. however, remember that rapid animations, such as the one in the example might be too distracting for a practical theme. you can also animate themes programmatically, which we discuss in dynamic themes. updating static themes if your static theme is hosted on amo, you can upload a new version using the developer hub with the following steps: visit ...
...And 2 more matches
Adding a new CSS property
this document assumes that you have a specifcation for the property available. ...
... the other entries for examples. this will cause tests of your new property to be added to many of the mochitests in layout/style/test, which can be run with the command "./mach mochitest -f plain layout/style/". then, unless you're implementing a shorthand property, you need to decide which style struct the computed value of the property should go in. (again, see the gecko overview for more in
formation.) it should generally be grouped with related properties. remember that each style struct contains only properties that inherit by default or only properties that do not. (which set the property is in is given in the specification, which says "inherited: yes" or "inherited: no" in the property's definition.) also note that some of the style structs intentionally contain only properties s...
...ains only properties that inherit by default or only properties that do not. (which set the property is in is given in the specification, which says "inherited: yes" or "inherited: no" in the property's definition.) also note that some of the style structs intentionally contain only properties set/reset by a particular common shorthand property; this improves the effectiveness of some of the per
formance and memory optimizations done with the rule tree, and thus we should avoid adding a property not reset by that shorthand to such a struct. once you know which struct you're going to use (or that the property is a shorthand), you can add appropriate entry to nscssproplist.h. again, see the documentation at the top of the file and the other entries for examples, and also see the next section ...
...And 2 more matches
Benchmarking
debug builds debug builds (--enable-debug) and non-optimized builds (--disable-optimize) are much slower. any per
formance metrics gathered by such builds are largely unrelated to what would be found in a release browser. rust optimization level local optimized builds are compiled with rust optimization level 1 by default, unlike nightly builds, which use rust optimization level 2. this setting reduces build times significantly but comes with a serious hit to runtime per
formance for any rust code (for example stylo and webrender). ...
...zation level 2. this setting reduces build times significantly but comes with a serious hit to runtime per
formance for any rust code (for example stylo and webrender). add the following to your mozconfig in order to build with level 2: ac_add_options rustc_opt_level=2 gc poisoning many firefox builds have a diagnostic tool that causes crashes to happen sooner and produce much more actionable in
formation, but also slow down regular usage substantially. in particular, "gc poisoning" is used in all debug builds, and in optimized nightly builds (but not opt developer edition or beta builds). ...
...set it to false to match a release build. (this may be disabled for many situations in the future. ...
...And 2 more matches
A bird's-eye view of the Mozilla framework
author: susan d. tiner last updated date: 11/23/05 statement of purpose the purpose of this article is to provide a high-level technical overview of the architecture of the extensible, object-based mozilla application framework. it examines what happens when the user per
forms a simple user interface (ui) action such as clicking a link in the contents panel of the help viewer window shown below. the article focuses on the architecture of the overall framework supporting the mozilla application suite, not the architecture of the individual applications themselves. prerequisites this article assumes you have access to mozilla sources and are familiar with the directory structure of the source tree. the code samples in the article are based on mozilla/5.0 (windows; u; windows ...
...stem toolkit defines the termwidget as a pre-defined object that encapsulates both the command actions and data associated with a graphical user interface (gui) control. the various x toolkit implementations provide a set of widgets for ui controls such as menus, command buttons, dialog boxes and scroll bars. the mozilla xptoolkit module provides a similar set of facilities for building cross-plat
form ui controls implemented as xml user interface language (xul) packages. a xul package consists of a xul description of the ui widget cascading style sheets customizing appearance javascript services implementing the ui behavior a package (also known as chrome) is really just a bundling of a set of ui widgets and associated services implementing a particular application feature. chrome and e...
...o a dom tree, and handles the layout and rendering of the document pages. the nglayout engine also parses xul ui controls into a dom tree and handles rendering of the ui. core services modules such as the nglayout engine comprise the core application services available to other core modules, and xul packages core application modules are implemented as a set of one or more xpcom (cross-plat
form com) objects. xpcom object model before getting into the details of the ui example, it's helpful to have a basic understanding of the xpcom object model. mozilla architectural modules are comprised of groups of related xpcom objects that provide services to and access services from each other through dynamically queryable interfaces. object model at a glance mozilla dynamically loads and inte...
...And 2 more matches
Debugging
debugging a project as large as mozilla can be a daunting task. fortunately, over the years, mozilla developers have come up with not just technologies and features to help you debug code, but have devised tips and techniques that can help too. also available are assorted tools that you can use when debugging. ...
...orm debugging javascript code how to debug javascript code, with a focus on debugging code in the mozilla project itself. debugging a xulrunner application tips and suggestions that will help you debug your xulrunner based application. debugging update problems learn how to debug update problems in mozilla-based applications. debugging the mozilla plat
form using debuggers with mozilla debugging mozilla on windows faq questions (and answers) about debugging mozilla on windows. debugging mozilla on os x questions (and answers) about debugging mozilla on os x. debugging mozilla with gdb gdb is our primary debugger on mac and linux. debugging mozilla with lldb lldb is the new debugger on mac. ...
...g mozilla on windows. debugging mozilla on os x questions (and answers) about debugging mozilla on os x. debugging mozilla with gdb gdb is our primary debugger on mac and linux. debugging mozilla with lldb lldb is the new debugger on mac. advanced debugging techniques understanding crash reports how to read crash reports, which are full of in
formation yet often not easy to interpret and act on. debugging a minidump windows crash reports include a minidump, which contains a lot of in
formation about the application when it crashed. debugging mozilla with valgrind valgrind is a memory debugger for mac and linux. it is slow, but good for tracking down difficult memory safety bugs. replay debugging firefox with vmware ...
...And 2 more matches
Gecko Logging
logging framework declaring a log module lazylogmodule defers the creation the backing logmodule in a thread-safe manner and is the preferred method to declare a log module. multiple lazylogmodules with the same name can be declared, all will share the same backing logmodule. ...
...or passing into the logging macros detailed below. note: log module names can only contain specific characters. the first character must be a lowercase or uppercase ascii char, underscore, dash, or dot. subsequent characters may be any of those, or an ascii digit. #include "mozilla/logging.h" static mozilla::lazylogmodule sfoolog("foo"); logging interface a basic interface is provided in the
form of 2 macros and an enum class. mozilla logging macros moz_log(module, level, message) outputs the given message if the module has the given log level enabled. module - the log module to use. level - the log level of the message. message - a printf-style message to output. must be enclosed in parentheses. moz_log_test(module, level) ...
.... log level numeric value purpose mozilla logging levels disabled 0 indicates logging is disabled. this should not be used directly in code. error 1 an error occurred, generally something you would consider asserting in a debug build. warning 2 a warning often indicates an unexpected state. info 3 an in
formational message, often indicates the current program state. debug 4 a debug message, useful for debugging but too verbose to be turned on normally. verbose 5 a message that will be printed a lot, useful for debugging program flow and will probably impact per
formance. example usage code sample #include "mozilla/logging.h" using mozilla::loglevel; static mozi...
...And 2 more matches
Index
3 building firefox with rust code build documentation, gecko, build, rust in may 2015 the rust programming language reached its 1.0 stability milestone, and various experiments with writing parts of gecko in rust began. ...
...tone, and various experiments with writing parts of gecko in rust began. rust code first shipped in august 2016 with the release of firefox 48. it became a requirement for building gecko in february 2017 with firefox 54. 8 experimental features in firefox experimental, firefox, preferences, features this page lists features that are in nightly versions of firefox along with in
formation on how to activate them, if necessary. 10 firefox ui considerations for web developers activity stream, firefox, icons, mozilla, new tab, newtab, ui, web, web development, favicon there are a number of places within the firefox user interface where web sites are listed for the user to choose a destination to visit or a site to manage in some way. one example is the new t...
...o visit or a site to manage in some way. one example is the new tab page, which includes a "top sites" section showing sites you visit that firefox thinks you're likely to want to visit again, as well as potentially some sites that have been pinned to always appear in that space. 11 firefox and the "about" protocol firefox, guide, mozilla, protocols there is a lot of useful in
formation about firefox hidden away behind the about: url protocol. the most useful is the url about:config, which displays preferences and settings that can be inspected and changed. 141 index firefox, index, mozilla found 168 pages: 142 linux compatibility matrix the following table lists the available library versions for the mozilla.org-distributed firefo...
...And 2 more matches
Firefox
firefox is mozilla's popular web browser, available for multiple plat
forms including windows, macos, and linux on the desktop and all android and ios mobile devices. with broad compatibility, the latest in web technologies, and powerful development tools, firefox is a great choice for both web developers and end users. firefox is an open source project; much of the code is contributed by our huge community of volunteers. here you can learn about how to contribute to the firefox project and you will also find links to in
formation about the construction of firefox add-ons, using the developer tools in firefox, and other topics. learn how to create add-ons for firefox, how to develop and build firefox itself, and how the internals of firefox and its subprojects work. project documentation...
... developer guide our developer guide provides details on how to get and compile the firefox source code, how to find your way around, and how to contribute to the project. ...
...ut the internals of firefox and its build system, so you can find your way around in the code. developer guide our developer guide provides details on how to get and compile the firefox source code, how to find your way around, and how to contribute to the project. contents experimental features in firefoxthis page lists features that are in nightly versions of firefox along with in
formation on how to activate them, if necessary.firefox and the "about" protocolthere is a lot of useful in
formation about firefox hidden away behind the about: url protocol. the most useful is the url about:config, which displays preferences and settings that can be inspected and changed.firefox ui considerations for web developersthere are a number of places within the firefox user interface where w...
...And 2 more matches
Using the Browser API
his last attribute is necessary for security reasons if you plan to load content from an untrusted/unknown origin. if you don't use it, you run the risk of your application being compromised by a malicious web site. it is implied for webextensions, which always run in a separate content process from web content. aside from the iframe, there are some basic controls: <button> elements, a simple <
form> to implement the browser controls, and a search bar. the search bar also contains buttons, as well as a
form to type search requests into. you can see the full html listing here. the javascript implementation to wire up the functionality required by our simple browser, we've written some basic javascript (see the full javascript listing.) wiring up the back and forward buttons early on in th...
...or example: function canmovebwd() { browser.getcangoback().then(function(result) { if (result) { back.disabled = false; console.log("it's possible to navigate the history backward."); } else { back.disabled = true; console.log("it's not possible to navigate the history backward."); } }); } implementing the url bar the url bar for our simple browser is a <
form> containing a single text <input>. when you tap the url bar, you can enter a url using the built-in firefox os keyboard (although note that we haven't implemented anything sophisticated in this app, like autofilling the http://, etc.). when you press the keyboard's return button, the 'submit' event is fired, which we handle like this: url
form.addeventlistener('submit',function(e) { e.preventde...
...efox os keyboard (although note that we haven't implemented anything sophisticated in this app, like autofilling the http://, etc.). when you press the keyboard's return button, the 'submit' event is fired, which we handle like this: url
form.addeventlistener('submit',function(e) { e.preventdefault(); browser.src = urlbar.value; urlbar.blur(); }); we first call preventdefault() to stop the
form just submitting and reloading the page — which is really not what we want. we then set the browser iframe's src attribute to equal the value of the url bar, which causes the new url to be loaded in the iframe. finally, we call blur() on the url bar to stop focusing it, so the keyboard moves off the screen, allowing us to get our full screen view back. there's another event listener added later...
...And 2 more matches
Gecko SDK
ers and tools to develop xpcom components which can then in turn e.g. be accessed from xul using javascript. note that in order to develop such components, you do not need the full sources of e.g. firefox, since you do not access parts of the front end from within a component. furthermore, since a component contains basic functionality, it is intended to run with every product of the mozilla plat
form. ...
... the gecko sdk contains all of the necessary tools and headers for making scriptable npapi plugins including the xpidl compiler/linker and the latest npapi.h. ...
... note: you can subscribe to a calendar of the firefox release schedule. also, you can view the schedule on the web. unpack the sdk tarball to some suitable location. issues with the os x sdk if you need to use the xpidl utility to compile idl files on os x, it's likely that you will receive a strange error when running the tool t...
...And 2 more matches
Internationalized Domain Names (IDN) Support in Mozilla Browsers
rs for user input into a browser's location bar or url's embedded in web pages. at the network protocol level, there is no change in the restriction that only a subset of ascii characters be used in url/uri. if end users input non-ascii characters as part of a domain name or if a web page contains a link using a non-ascii domain name, the application must convert such input into a special encoded
format using only the usual ascii subset characters. rfc 3490 (internationalizing domain names in applications (idna)) defines characters used in idn to be drawn from unicode standard 3.2. it also defines how an application should process non-ascii characters in such a way to con
form to existing host name character restrictions. how mozilla browsers handle non-ascii domain names unicode and nameprep...
... the process will convert uppercase characters to lowercase ones (case folding), unify characters with multiple representation, e.g. conversion of half-width kana characters in japanese into full-width ones (normalization), eliminate prohibited characters (e.g. ...
...h ones (normalization), eliminate prohibited characters (e.g. space), eliminate ambiguities in bi-directional text (e.g. arabic and hebrew), and check whether or not unassigned characters in the unicode repertoire are used -- allowing them for "query strings" but disallowing them for "stored strings" such as the data input for domain name registration. this process is called "nameprep" and is per
formed according to rfc 3491 (nameprep: a stringprep profile for internationalized domain names (idn)) and rfc 3454 (preparation of internationalized strings ("stringprep")). ascii-compatible encoding (ace) the next step is to convert the 8-bit characters in unicode to 7-bit ones using only restricted ascii characters. during the discussion phase of the idn protocols development, there were some com...
...And 2 more matches
Introduction to Layout in Mozilla
ata flow source document arrives via network apis incrementally “pumped” through the single-threaded layout engine parse, compute style, render; repeat css used for rendering all content content theoretically separate from “presentation” key data structures content node elements, attributes, leaves dom frame rectangular
formatting primitive geometric in
formation [0..n] per content node 2nd thru nth are “continuations” style context non-geometric in
formation may be shared by adjacent frames reference counted, owned by frame view clipping, z-order, transparency [0..1] per frame, owned by frame widget native window [0..1]...
...reset style context object is a placeholder for partially computed stylistic data style data is computed lazily, as it is asked for reflow recursively compute geometry (x, y, ...
...fficiency vs. responsiveness trade-off frame construction runs to completion css parsing runs to completion reflow runs to completion (mostly) painting runs to completion future (?) tech talks content model and dom - jst, jkeiser parser and content sink (esp. ...
...And 2 more matches
OS.File.Info
instances of os.file.info may be obtained by: calling global method os.file.stat() either from the main thread or from a worker thread; calling instance method stat() of os.file either from the main thread or from a worker thread. ...
...n) { if (reason instanceof os.file.error && reason.becausenosuchfile) { // |somepath| does not represent anything } else { // some other error } } ) example: determining the owner of a file let promise = os.file.stat() promise.then( function onsuccess(info) { if ("unixowner" in info) { // info.unixowner holds the owner of the file } else { // in
formation is not available on this plat
form } } ); evolution of this example bug 802534 will introduce the ability to check whether field unixowner appears in os.file.info.prototype, which will make it possible to write faster code. global object os.file.info methods object tomsg(in os.file.info value) os.file.tomsg convert an instance of os.file.info to a
form that c...
... issymlink true if the false is a symbolic link, false otherwise. ...
...And 2 more matches
PerfMeasurement.jsm
note: at present, perfmeasurement.jsm is only functional on linux, but it is planned to add support for windows (bug 583322) and osx (bug 583323) as well, and we welcome patches for other operating systems. ...
...note: at present, perfmeasurement.jsm is only functional on linux, but it is planned to add support for windows (bug 583322) and osx (bug 583323) as well, and we welcome patches for other operating systems. ...
... thread being profiled. cpu_migrations uint64 the number of times the profiled thread migrated from one cpu core to another. 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 plat
form doesn't support all of the event types you specified when creating the perfmeasurement object. constants event mask constants these constants are used to construct the mask indicating which events you want to monitor. constant value description cpu_cycles 0x00000001 measure cpu cycles elapsed. instructions 0x00000002 measure the number of instructions executed. cache_references 0x0000...
...And 2 more matches
WebRequest.jsm
you can use this api to implement a content policy in an add-on (for example, an ad or script blocker), as you could using nsicontentpolicy. more generally, you can also use this api instead of http request observers. you can use webrequest.jsm in either the chrome or content processes. ...
...e third argument to your addlistener() call. this tells the browser to wait for your event listener to return before continuing with the request. next, return an object from the listener that contains instructions for what the browser should do with this request. there are four things you can do with a request: cancel it redirect it modify request headers modify response headers. to per
form one of these operations, include a property with the appropriate name in the object returned from the listener, and assign it the desired value, as detailed in the table below: operation available in return property cancel onbeforerequest cancel boolean value set to true. see some examples of canceling requests. redirect onbeforesendhea...
... http request headers that will be sent. this is only included if you set "requestheaders" in the opt_extrainfospec argument. onsendheaders triggered just before sending headers. if you modified headers in onbeforesendheaders, you'll see the modified version here. note that you can't pass "blocking" for this event, so you can't modify or cancel the request from this event: it's in
formational only. opt_extrainfospec values name description "requestheaders" include request headers in the argument passed to the listener. listener argument name type description url string target of the request. windowid number the id of the window making the request, as an outerwindowid. parentwindowid ...
...And 2 more matches
JavaScript code modules
along with download links and documentation, that extension developers can use in their code. standard code modules addonmanager.jsm an interface to install, manage, and uninstall add-ons. addonrepository.jsm provides a search of add-ons in the repository. assert.jsm implements the commonjs unit testing specification version 1.1, which provides a basic standardized interface for per
forming in-code logical assertions with optional, customizable error reporting. bookmarkhtmlutils.jsm provides utility functions for importing and exporting bookmarks from the old-school "bookmarks.html" style bookmark files. ctypes.jsm provides an interface that allows javascript code to call native libraries without requiring the development of an xpcom component. customizableui.jsm allows you...
...ui.jsm allows you to interact with customizable buttons and items in firefox's main window ui. deferredtask.jsm run a task after a delay. dict.jsm provides an api for key/value pair dictionaries. downloadlastdir.jsm supplies the path to the directory into which the last download occurred. downloads.jsm provides a single entry point to interact with the downloading capabilities of the plat
form. fileutils.jsm provides helpers for dealing with files. geometry.jsm provides routines for per
forming basic geometric operations on points and rectangles. http.jsm a wrapper for xmlhttprequest that provides convenient and simplified api for dealing with http requests. jni.jsm abstracts the js-ctypes to provide an interface that allows javascript code to call code running in native jvms. ...
...ic operations on points and rectangles. http.jsm a wrapper for xmlhttprequest that provides convenient and simplified api for dealing with http requests. jni.jsm abstracts the js-ctypes to provide an interface that allows javascript code to call code running in native jvms. iso8601dateutils.jsm provides routines to convert between javascript date objects and iso 8601 date strings. log.jsm (
formerly log4moz) provides a log4j style api for logging, log messages to various endpoints, such as the browser console or a file on disk. netutil.jsm provides helpful networking utility functions, including the ability to easily copy data from an input stream to an output stream asynchronously. openlocationlasturl.jsm provides access to the last url opened using the "open location" option...
...And 2 more matches
Localizing with Mozilla Translator
if you decide to use mozillatranslator, be sure you have java 1.7 or above installed on your system. like most cat tools, mozillatranslator employs glossaries and translation memory to leverage your work from previous translations, thus cutting time and effort when localizing new versions of mozilla applications. ...
...central matches '''locale/en-us''' and '''browser/locales/chrome''' matches '''locale/browser'''. so, what you have to do is export partial glossaries in each link point of the ''old'' product and import them in the corresponding link point of the ''new'' point. your keep original and fuzzy flags will be honored for each string. there will be some exceptions. files hanging directly from the plat
form neutral plat
form can't be part of a partial glossary (because they are not components), and plat
form neutral itself can't be selected either, since it is not a component, but a plat
form. for these few files, you will have to export them individually and reimport them. if you are a ''not so good'' mt user, however, you can just create a new product (or several ones; see next recipe to know why), ...
...e -> update on them (you'll get a list of all the strings) and then run edit -> autotranslate. most of the strings will be automatically filled, although if you do this you should review them, because for en-us strings with several possible translations, mt will choose one of them, which could not be the one you want. from cvs to mercurial in mt so, you have a firefox product in mt with a plat
form neutral and, inside it, several directories (''components'' in mt terminology) more or less like the second sample above, checked out from cvs. now, you want to start working directly on mozilla-central (and l10n-central). what should you do? the first thing to do, once you have your mercurial local repository up and working, is create a new product... or more. with good oldie cvs, you could che...
...And 2 more matches
Release phase
you've made it! you've setup up your local and remote environments, you've selected your l10n tools and projects, done some localization and even some testing! now you're ready for the final phase: becoming an official l10n release. here, we'll continue to stay true to the original intent of this guide and only present you with the technical in
formation you need to become an official release. we'll primarily focus on getting your release repository setup and the mercurial commands you'll need to know to use that repository. for more in
formation on the release part of the l10n process, visit the mozilla wiki here. your official release repository now that your locale has been registered, the localization files will live on mozilla mercurial server at hg.mozilla.org. depending on which b...
...e correct user set under the hg.mozilla.org host. this should be your mozilla ldap account name. next, try issuing the following command: $ ssh hg.mozilla.org if ssh is working fine, you should see the following message: no interactive shells allowed here! connection to hg.mozilla.org closed. if you don't see this message, try running the same command in a more verbose mode (with the debugging in
formation): $ ssh -vvv hg.mozilla.org this should tell you why your connection is not succeeding. if you can't figure it out on your own, copy the output of the above command, paste it on http://pastebin.mozilla.org and ask in #l10n on the irc.mozilla.org server. technical and sign-off reviews you've done some localization work and your ready for it to be released. the merge date for migrating from on...
... for the next release channel. do you know whether to ask for technical review of your work or a sign-off review? do you know what what exactly is reviewed in each process? technical and sign-off reviews apply to different localizations in different ways. here's the basic difference between the two. technical review sign-off review per
formed as a qa measure on a revision pushed to a new locale's l10n aurora repo in mercurial. very comprehensive. covers the entire product. focus is on technical accuracy and completion of l10n work; not translation quality. only per
formed on the first revision a new locale wants to have released to the public. must be approved prior to migrating your revision f...
...And 2 more matches
Mozilla Quirks Mode Behavior
p>, <pre cols>, <pre width>. orphaned dd has generated content :before instead of margin (bug 5119). indent nested dl elements (bug 8749). map acts like an inline, not a block. give floated img a 3px margin (bug 58899). residual style tags' size info does not take precedence over heading tags' size (bug 77352). use box-sizing:border-box for most input types and textarea. give
form a margin-bottom:1em (bug 41806). in quirks mode css class and id names are case insensitive. in standards mode they are case sensitive. (this also applies to getelementsbyclassname.) stylesheets linked in the document with an advisory mime type of text/css will still be treated as css even if the server gives a content-type header other than text/css. the css parser accepts colors not b...
...ng removed in firefox 27, for interoperability. (bug 915053) an empty string for the background attribute sets the background url to empty only in quirks mode. the topmargin, bottommargin, leftmargin, and rightmargin attributes on body are supported only in quirks mode (bug 9258). obsolete since gecko 35 (firefox 35.0 / thunderbird 35.0 / seamonkey 2.32) (bug 95530) this quirk is now html5 con
form and has been adopted in standards mode. the scrollleft, scrolltop, scrollwidth, and scrollheight properties are relative to body in quirks mode (instead of html) (bug 211030). html (1-7) and css (xx-small - xx-large) font sizes are calculated slightly differently (see bug 18136). the :hover and :active pseudo-classes will only be applied to links, and only if there is no other pseudo-class in...
...nd only if there is no other pseudo-class in the selector. to match other elements, the selector must include a tag name, id, class or attribute. prior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3), there was no class check, so the :hover pseudoclass was not applied to class selectors; for example, .someclass:hover did not work. prior to gecko 36, it also applied to images, and
form controls but the quirk has been adapted to match the behavior of other browser (bug 783213). prior to gecko 36, the quirk was also applied if another pseudo-class was used in the same selector, if a pseudo-element was used in the selector, or if it was part of a pseudo-class argument (bug 783213). quirks mode has document.all support (undetected). images (img elements) without alt attributes ...
...And 2 more matches
BloatView
if it finds leaks, you can use refcount tracing and balancing to discover the root cause. how to build with bloatview build with --enable-debug or --enable-logrefcnt. how to run with bloatview the are two environment variables that can be used. xpcom_mem_bloat_log if set, this causes a bloat log to be printed on program exit, and each time nstracerefcnt::dumpstatistics is called. this log contains data on leaks and bloat (a.k.a. usage). xpcom_mem_leak_log this is similar to xpcom_mem_bloat_log, but restricts the log to only show data on leaks. you can set these environment variables to any of the following values. 1 - log to stdout. ...
...otal total 1754408 432556 179828 404184 2770976 nsstr 20 6261600 3781900 1120920 1791340 12955760 222760 48760 13280 76160 360960 nshashkey 8 610568 1842400 2457872 1134592 6045432 32000 536 568 1216 34320 nstexttrans
former 548 8220 469088 1414936 1532756 3425000 0 0 0 0 0 nsstylecontextdata 736 259808 325312 489440 338560 1413120 141312 220800 -11040 94944 446016 nslinelayout 1100 2200 225500 402600 562100 1192400 0 0 0 0 0 nslocalfile 424 558832 199...
...d show references buttons show the same statistics but counting objects or addref'd references rather than bytes. comparing bloat logs you can also compare any two bloat logs (either those produced when the program shuts down, or written to the bloatlogs directory) by running the following program. ...
...And 2 more matches
Memory reporting
nter-based reporters maintain a counter that is incremented on each relevant allocation and decremented on each relevant deallocation. traversal-based reporters are preferable, for the following reasons. they are less error-prone. we've had multiple bugs in the past with counter-based reporters. the cost of reporting isn't incurred unless the memory reporter is queried. they provide more in
formation to dmd, which is a tool that helps keep about:memory's "heap-unclassified" number low. see below for more details. sometimes counter-based reporters are unavoidable, particularly when writing memory reporters for third-party code that cannot be modified. a simple example imagine a simple string class with the following data fields: class mystring { private: char *mbuffer; // he...
... big it is (via moz_malloc_usable_size). all this is probably not what you'd expect, but the above functions have the following crucial features. they let you measure the mystring object itself or not as necessary. this is important because sometimes an object might be embedded in another object that is measured separately. and the names make it clear exactly what is being measured. on plat
forms that allow it, they count the actual memory in use, including "slop" bytes caused by the heap allocator rounding up request sizes (a.k.a. internal fragmentation). if slop bytes aren't measured they'll end up in about:memory's heap-unclassified entry, which is bad. the size is not computed analytically. for example, sizeof doesn't appear anywhere. this is a good thing, because computing sizes an...
...nt64_t, this is because (a) you can't use size_t in idl, and (b) not every "amount" is a bytes measurement. so it's best to mostly use size_t and convert to int64_t as late as possible. you don't always need both sizeofexcludingthis and sizeofincludingthis. implement one or both as needed. if you have both, sizeofexcludingthis is the interesting one; sizeofincludingthis always has the same basic
form. and here's how you'd write a memory reporter if there was a single global mystring object. mystring *gmystring; class mystringreporter moz_final : public nsimemoryreporter { moz_define_malloc_size_of(mallocsizeof) public: ns_decl_isupports ns_method collectreports(nsihandlereportcallback* ahandlereport, nsisupports* adata) { // btw: if gmystring wasn't a pointer, you'd use ...
...And 2 more matches
Refcount tracing and balancing
refcount tracing and balancing are advanced techniques for tracking down leak of refcounted objects found with bloatview. the first step is to run firefox with refcount tracing enabled, which produces one or more log files. refcount tracing logs calls to addref and release, preferably for a particular set of classes, including call-stacks in symbolic
form (on plat
forms that support this). refcount balancing is a follow-up step that analyzes the resulting log to help a developer figure out where refcounting went wrong. how to build for refcount tracing build with --enable-debug or --enable-logrefcnt. how to run with refcount tracing on there are several environment variables that can be used. first, you select one of three environment variables to choose what kind of logging you wa...
...thout xpcom_mem_log_classes and/or xpcom_mem_log_objects, because without some filtering the logging will be completely useless due to how slow the browser will run and how large the logs it produces will be. xpcom_mem_comptr_log this environment variable enables logging of additions and releases of objects into nscomptrs. ...
...this results in slower code, but at least you get some data about where the leaks might be occurring from. ...
...And 2 more matches
TimerFirings logging
the first two values identify the thread. this is not especially useful. the next value is the process id (pid). this is useful in a multi-process scenario. next is the timer kind, one of fn (function), iface (interface) or obs (observer), which are the three kinds of timers that gecko supports. then comes the function kind, one of one_shot (a single-use timer), slack or precise (repe...
...s useful in a multi-process scenario. next is the timer kind, one of fn (function), iface (interface) or obs (observer), which are the three kinds of timers that gecko supports. then comes the function kind, one of one_shot (a single-use timer), slack or precise (repeating timers of differing precision). then comes the timer period, measured in milliseconds. finally there is the identifying in
formation for the timer. function timers have an in
formative label. interface and observer timers only have an address, which is less useful, but they are uncommon enough that this usually doesn't matter much. the above example shows only timers from c++ within gecko. there are also timers for settimer or setinterval calls in javascript code, as the following sample shows. -991946880[7f46c365ba00]:...
...[7f3219c48000]: [6835] fn timer (one_shot 100 ms): [content] http://edition.cnn.com/:5:7231 711637568[7f3219c48000]: [6835] fn timer (one_shot 100 ms): [content] http://a.visualrevenue.com/vrs.js:6:9423 these js timers are annotated with [content] and show the javascript source location where they were created. they can come from chrome code within firefox, or from web content. the in
formative labels are only present on function timers that have had their creation site annotated. for unannotated function timers, there are three possible behaviours. first, on mac the code uses dladdr to get the name immediately, and the output will look like the following. 2082435840[100445640]: [81190] fn timer (one_shot 8000 ms): [from dladdr] gfxfontinfoloader::delayedstartcallback(nsitimer*, ...
...And 2 more matches
TraceMalloc
l malloc, calloc , realloc, and free calls (this currently covers all operator new and delete calls in mozilla, too). to enable tracemalloc in your build, configure with --enable-trace-malloc. the built mozilla application will support the following additional command-line options: --trace-malloc filename the application will log allocation and deallocation events with stack traces in a binary
format to the given file. if filename is -, nothing is written to a file, but tracemalloc will be active and will track live allocations and their stack traces. --shutdown-leaks=filename on shutdown, the application will save live allocations (with stack traces) to the given file. analyzing the trace-malloc log tools such as bloatblame (tools/trace-malloc/bloatblame.cpp) can be used to process file...
...thing is written to a file, but tracemalloc will be active and will track live allocations and their stack traces. --shutdown-leaks=filename on shutdown, the application will save live allocations (with stack traces) to the given file. analyzing the trace-malloc log tools such as bloatblame (tools/trace-malloc/bloatblame.cpp) can be used to process filename. try running with the unified output
format option, -u. the output is a large html file that hyperlinks ancestor and descendent libraries, classes, and functions that call into one another, attributing malloc blame up and down each graph. bloatblame accumulates allocation counts and ignores free calls. if you run with --trace-malloc -, your code can call ns_tracemallocdumpallocations(pathname) at opportune times, and a human-readable lis...
...e, change the current log file to the default log file given by the --trace-malloc command line argument. tracemalloclogtimestamp(caption) - log a timestamp event to the current log file, annotating the log even with the caption string. tracemallocdumpallocations(pathname) - dump a human-readable listing of all traced, live allocations. see nstracemalloc.h for detailed comments on the log file
format. analyzing the shutdown log the shutdown log is a basic tool for finding memory leaks. the shutdown log contains the stack trace of every allocation that has not been deallocated by shutdown. some of these are false positives, allocations that are truly needed until shutdown. ideally, these would be freed explicitly, to make it easier to find real leaks using the shutdown log. here is a how-to ...
...And 2 more matches
Leak And Bloat Tests
method current method: measure leaks and bloats, in a similar way to firefox (using xpcom_mem_leak_log and --trace-malloc). the method of testing memory bloat and leaks will be the same sequence of events, using the same set of test data. ...
... method current method: measure leaks and bloats, in a similar way to firefox (using xpcom_mem_leak_log and --trace-malloc). the method of testing memory bloat and leaks will be the same sequence of events, using the same set of test data. ...
...ults. manually running tests setting up build set up build thunderbird or seamonkey with your standard mozconfig file, but with the following options set: ac_add_options --enable-debug ac_add_options --enable-trace-malloc running the tests in your <objdir> run the following command: make mailbloat this will run the tests and produce some result files. ...
...And 2 more matches
NSPR Contributor Guide
we (the nspr module owners) sometimes disappoint our contributors when we must reject their contributions. we reject contributions for a variety of reasons. some of these reasons are not obvious to an outside observer. nspr wishes to document some guidelines for those who would contribute to nspr. these guidelines should help the contributor in crafting his contribution, increasing its likelihood for acceptance. ...
...spr library, for example: libnspr4.dll nspr is mostly complete. new apis are driven mostly by the os vendors as they add new features. should you decide that there's something that nspr does not cover that should be covered, let's talk. your proposed api should encapsulate a relatively low level capability as would be found in a system call or libc. your new feature must be implemented on all plat
forms supported by nspr. when you consider a new api for nspr ask yourself if your proposed feature can implement it across all plat
forms supported by nspr. if several plat
forms cannot be made to implement your api, then it is not a good candidate for inclusion in nspr. before you begin what may be a substantial effort in making a candidate feature for nspr, talk to us. we may tell you that you have a...
...ry tree and built as a separate library. these libraries exist, for the most part, as "legacy" code from nspr 1.0. [note that the current nspr module owners do not now nor never have been involved with nspr 1.0.]. such is life. that said: there are some libraries that implement functions intended for use with applications using nspr, such as ...nsprpub/lib/libc/plgetopt.*. ...
...And 2 more matches
Nonblocking IO In NSPR
the central thread invokes that io function on the file descriptor. creating a nonblocking socket only sockets can be made nonblocking. regular files always operate in blocking mode. this is not a serious constraint as one can assume that disk i/o never blocks. fundamentally, this constraint is due to the fact that nonblocking i/o and <tt>select()</tt> are only available to sockets on some plat
forms (e.g., winsock). in nspr, a new socket returned by <tt>pr_newtcpsocket()</tt> or <tt>pr_newudpsocket()</tt> is always created in blocking mode. one can make the new socket nonblocking by using <tt>pr_setsockopt()</tt> as in the example below (error checking is omitted for clarity): <tt>prfiledesc *sock;</tt> <tt>printn optval = 1;</tt> <tt>sock = pr_newtcpsocket();</tt> /* * make the socket non...
...y <tt>pr_accept()</tt> or <tt>pr_acceptread()</tt> on a blocking, listening socket may be a recycled socket previously used in a <tt>pr_transmitfile()</tt> call. since <tt>pr_transmitfile()</tt> only operates in blocking mode, this recycled socket can only be reused in blocking mode, hence the above constraint. because these constraints only apply to nt, it is advised that you test your cross-plat
form code that uses nonblocking io on nt early in the development cycle. these constraints are enforced in the debug nspr library by assertions. differences from blocking io in nonblocking mode, the timeout argument for the io functions is ignored. <tt>pr_acceptread()</tt> and <tt>pr_transmitfile()</tt> only work on blocking sockets. they do not make sense in nonblocking mode. <tt>pr_write()</tt...
...king mode block until the entire buffer is sent. in nonblocking mode, they cannot block, so they may return with just sending part of the buffer. pr_poll() or pr_select()? <tt>pr_select()</tt> is deprecated, now declared in <tt>private/pprio.h</tt>. use <tt>pr_poll()</tt> instead. the current implementation of <tt>pr_select()</tt> simply calls <tt>pr_poll()</tt>, so it is sure to have worse per
formance. also, native file descriptors (socket handles) cannot be added to <tt>pr_fd_set</tt>, i.e., the functions <tt>pr_fd_nset</tt>, <tt>pr_fd_nclr</tt>, <tt>pr_fd_nisset</tt> do not work. pr_available() when <tt>pr_available()</tt> returns 0, it may mean one of two things: there is no data available for reading on that socket. i.e., <tt>pr_recv()</tt> would block (a blocking socket) or fail ...
...And 2 more matches
PR_GetOpenFileInfo64
description pr_getopenfileinfo64 is the 64-bit version of pr_getopenfileinfo. ...
... description pr_getopenfileinfo64 is the 64-bit version of pr_getopenfileinfo. ...
... description pr_getopenfileinfo64 is the 64-bit version of pr_getopenfileinfo. ...
...And 2 more matches
4.3.1 Release Notes
rt to explicitly set the key usage for the generated private key jss 4.3.1 is tri-licensed under mpl 1.1/gpl 2.0/lgpl 2.1. new in jss 4.3.1 a list of bug fixes and enhancement requests were implemented in this release can be obtained by running this bugzilla query jss 4.3.1 requires nss 3.12.5 or higher. ...
...s release can be obtained by running this bugzilla query jss 4.3.1 requires nss 3.12.5 or higher. ssl3 & tls renegotiation vulnerability see cve-2009-3555 and us-cert vu#120541 for more in
formation about this security vulnerability. all ssl/tls renegotiation is disabled by default in nss 3.12.5 and therefore will be disabled by default with jss 4.3.1. this will cause programs that attempt to per
form renegotiation to experience failures where they
formerly experienced successes, and is necessary for them to not be vulnerable, until such time as a new safe renegotiation scheme is standardized by the ietf. if an application depends on renegotiation feature, it can be enabled by setting the environment variable nss_ssl_enable_renegotiation to 1. by setting this environmental variable, the fix pr...
...fault) sslsocket.ssl_renegotiate_unrestricted - renegotiate without restriction, whether or not the peer's client hello bears the renegotiation info extension (like we always did in the past). sslsocket.ssl_renegotiate_requires_xtn - not yet implemented explicitly set the key usage for the generated private key in pkcs #11, each keypair can be marked with the operations it will be used to per
form. ...
...And 2 more matches
NSS_3.12.1_release_notes.html
nss 3.12.1 requires nspr 4.7.1. see the documentation section for the build instructions. ...
... nss 3.12.1 requires nspr 4.7.1. see the documentation section for the build instructions. ...
... nss 3.12.1 source and binary distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_1_rtm/src/. binary distributions: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_1_rtm/. both debug and optimized builds are provided. go to the subdirectory for your plat
form, dbg (debug) or opt (optimized), to get the tar.gz or zip file. the tar.gz or zip file expands to an nss-3.12.1 directory containing three subdirectories: include - nss header files lib - nss shared libraries bin - nss tools and test programs you also need to download the nspr 4.7.1 binary distributions to get the nspr 4.7.1 header files and shared libraries, which nss 3.12.
...And 2 more matches
NSS 3.12.4 release notes
<center> 2009-08-20 </center> <center>newsgroup: mozilla.dev.tech.crypto</center> introduction network security services (nss) 3.12.4 is a patch release for nss 3.12. the bug fixes in nss 3.12.4 are described in the "bugs fixed" section below. nss 3.12.4 is tri-licensed under the mpl 1.1/gpl 2.0/lgpl 2.1. distribution in
formation this release is built from the source, at the cvs repository rooted at cvs.mozilla.org:/cvsroot, with the cvs tag nss_3_12_4_rtm. nss 3.12.4 requires nspr 4.8. this is not a hard requirement. our qa tested nss 3.12.4 with nspr 4.8, but it should work with nspr 4.7.1 or later. you can check out the source from cvs by cvs co -r nspr_4_8_rtm nspr cvs co -r nss_3_12_4_rtm nss see the documentation section for the build instructions. nss 3.12.4 source is also available...
...rs need be escaped between brackets. unnecessary escaping is permitted. [a-z] matches any character between a and z, inclusive. the two range-definition characters must be alphanumeric ascii. if one is upper case and the other is lower case, then the ascii non-alphanumeric characters between z and a will also be in range. [^a-z] matches any character except those between a and z, inclusive. these
forms cannot be combined, e.g [a-gp-z] does not work. exclusions: as a top level, outter-most expression only, the expression foo~bar will match the expression foo, provided it does not also match the expression bar. either expression or both may be a union. except between brackets, any unescaped ~ is an exclusion. at most one exclusion is permitted. exclusions cannot be nested (contain other exclusio...
...gs have been fixed in nss 3.12.4. ...
...And 2 more matches
NSS 3.21 release notes
nss 3.21 requires nspr 4.10.10 or newer. nss 3.21 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_21_rtm/src/ security fixes in nss 3.21 bug 1158489 / cve-2015-7575 - prevent md5 downgrade in tls 1.2 signatures. ...
...moduleex - create a new secmodmodule structure from module name string, module parameters string, nss specific parameters string, and nss configuration parameter string. the module represented by the module structure is not loaded. the difference with secmod_createmodule is the new function handles nss configuration parameter strings. ...
...k_tls12_key_mat_params{_ptr} - parameters {or pointer} for ckm_tls12_key_and_mac_derive ck_tls_kdf_params{_ptr} - parameters {or pointer} for ckm_tls_kdf ck_tls_mac_params{_ptr} - parameters {or pointer} for ckm_tls_mac in sslt.h sslhashtype - identifies a hash function sslsignatureandhashalg - identifies a signature and hash function sslpreliminarychannelinfo - provides in
formation about the session state prior to handshake completion new macros in nss.h nss_rsa_min_key_size - used with nss_optionset and nss_optionget to set or get the minimum rsa key size nss_dh_min_key_size - used with nss_optionset and nss_optionget to set or get the minimum dh key size nss_dsa_min_key_size - used with nss_optionset and nss_optionget to set or get the minimum ...
...And 2 more matches
nss tech note1
em are extensively used and are part of the public nss api : the "classic" asn.1 decoder, written by lisa repka . this was written to be a generic decoder, that includes both der (distinguished encoding rules) and ber (basic encoding rules).† it handles both streaming and non-streaming input. the "quickder" decoder, written by julien pierre for nss 3.6 . ...
...for this reason, i will first describe all the common functionality of the two decoders, before outlining their differences. ...
...iversal, application-specific, context-specific, and private. you can specify the class of the tag using the macros sec_asn1_universal, sec_asn1_application, sec_asn1_context_specific and sec_asn1_private. universal is the default tag class and does not have to be specified, as the value of the class type is zero. the method type : whether the component type is constructed or primitive. this in
formation is stored in the next lowest tag bit (number 5). you can use the macro sec_asn1_constructed for a constructed component type. a sec_asn1_primitive macro is also provided, but does not need to be included as it is zero. the tag number. it is stored in the lower 5 tag bits (number 0 through 4). the asn.1 standard only defines tag numbers in the universal class. if you you are using a tag of...
...And 2 more matches
nss tech note7
the industry standard for rsa signing and encryption is pkcs #1. nss supports pkcs #1 v1.5. nss doesn't yet support pkcs #1 v2.0 and v2.1, in particular oaep, but oaep support is on our to-do list. your contribution is welcome. data types nss uses the following data types to represent keys: seckeypublickey: a public key, defined in "keythi.h". seckeyprivatekey: a private key, defined in "keythi.h". pk11symkey: a symmetric key (often called a session key), defined in "secmodt.h". ...
...mended. to prevent denial-of-service attacks with huge public keys, nss disallows modulus size greater than 8192 bits. how are these keys created in nss? there are a few possibilities. rsa key pairs may be generated inside a crypto module (also known as a token). use pk11_generatekeypair() to generate a key pair in a crypto module. key pairs may be generated elsewhere, exported in encrypted
form, and imported into a crypto module. public keys may be imported into nss. call seckey_importderpublickey() with type=ckk_rsa to import a der-encoded rsa public key. if you have the modulus and public exponent, you need to first encode them into an rsa public key and then import the public key into nss. pkcs #1 defines an rsa public key as a sequence of modulus and public exponent, both of w...
...g of the data. pk11_sign does not do the ber encoding of the hash (as is done in sgn_ functions). if you are trying to just send data, use pk11_pubencryptpkcs1. pk11_pubencryptraw is the lowest level function. it takes a modulus size data and does a raw rsa operation on the data. it's used to support ssl2, which modifies the key encoding to include the ssl version number. ...
...And 2 more matches
Notes on TLS - SSL 3.0 Intolerant Servers
day which incorrectly implement the ssl 3.0 specification. this incorrect implementation causes them to reject connection attempts from clients that are compliant with the ssl 3.0 and tls (aka ssl 3.1) specifications. netscape 6.x/7.x and mozilla browsers (0.9.1 and later versions) correctly implement the tls specification, and the users cannot utilize sites which have this problem. technical in
formation the ssl 3.0 and tls (aka ssl 3.1) specs both contain a provision -- the same provision -- for detecting "version rollback attacks". it is designed to permit a server to detect a man-in-the-middle that is altering the ssl client hello (connection) requests as they pass from the client to the server, altering them by changing the protocol version number to a lower version number. this feature...
... products that have implemented the roll-back detection incorrectly are not interoperable with tls/ssl spec-compliant clients. normally the servers which have this problem are not equipped to deal with the tls protocol, but instead of rolling back to ssl 3.0 as the rollback provision provides, they terminate/drop the connection, thus resulting in most cases a blank page display. for up-to-date in
formation, you can read a bugzilla bug report which keeps track of this problem with mozilla-based browsers. see bug 59321. servers currently known to exhibit this intolerant behavior as of this writing, this problem has been reported for the following servers: (wherever there is an upgraded version which fixes the problem, it is indicated by an asterisked remark in the parentheses. ) domino-go-w...
...earlier (* update to 1.3.6.4) ibm_http_server/1.3.12.1 or earlier (* update to 1.3.12.2) java web server 2 osu/3.2 - decthreads http server for openvm stronghold/2.2 webmail v. 3.6.1 by infinite technologies (* update available) n.b. there might be servers other than those listed above which exhibit this problem. if you find such a server, feel free to add it to this page. for up-to-date in
formation, you can read this bug 59321 which keeps a list of tls/ssl 3.0 intolerant servers. users: how to avoid this problem? netscape 6.1 preview release 1, or mozilla 0.9.1 and earlier these versions shipped with the tls option turned on as the default but with no way to deal with the problem servers. if you are using these old versions, please update to the latest netscape or mozilla versions. ...
...And 2 more matches
Overview of NSS
including the following: mozilla products, including firefox, thunderbird, seamonkey, and firefox os. aol instant messenger (aim) open source client applications such as evolution, pidgin, apache openoffice, and libreoffice. server products from red hat: red hat directory server, red hat certificate system, and the mod_nss ssl module for the apache web server. server products from oracle (
formerly sun java enterprise system), including oracle communications messaging server and oracle directory server enterprise edition. suse linux enterprise server supports nss and the mod_nss ssl module for the apache web server. nss includes a framework to which developers and oems can contribute patches, such as assembler code, to optimize per
formance on their plat
forms. nss 3.x has been certifi...
... enterprise system), including oracle communications messaging server and oracle directory server enterprise edition. suse linux enterprise server supports nss and the mod_nss ssl module for the apache web server. nss includes a framework to which developers and oems can contribute patches, such as assembler code, to optimize per
formance on their plat
forms. nss 3.x has been certified on 18 plat
forms. for more detailed in
formation about nss, see wiki.mozilla.org and nss faq. source code for a java interface to nss is available in the mozilla cvs tree. for details, see network security services for java. nss makes use of netscape portable runtime (nspr), a plat
form-neutral open-source api for system functions designed to facilitate cross-plat
form development. like nss, nspr has been battle...
...ss, see wiki.mozilla.org and nss faq. source code for a java interface to nss is available in the mozilla cvs tree. for details, see network security services for java. nss makes use of netscape portable runtime (nspr), a plat
form-neutral open-source api for system functions designed to facilitate cross-plat
form development. like nss, nspr has been battle-tested in multiple products. for more in
formation, see the nspr project page. interoperability and open standards you can use nss to support a range of security standards in your application, including the following: ssl v3. the secure sockets layer (ssl) protocol allows mutual authentication between a client and server and the establishment of an authenticated and encrypted connection. tls v1.3 (rfc 8446), tls v1.2 (rfc 5246), tls v1...
...And 2 more matches
FC_GetInfo
the version is 2.20 (major=0x02, minor=0x14). manufacturerid: the pkcs #11 library manufacturer, "mozilla foundation", padded with spaces to 32 characters and not null-terminated. flags: should be 0. ...
...the version is 2.20 (major=0x02, minor=0x14). manufacturerid: the pkcs #11 library manufacturer, "mozilla foundation", padded with spaces to 32 characters and not null-terminated. flags: should be 0. ...
...the version is 2.20 (major=0x02, minor=0x14). manufacturerid: the pkcs #11 library manufacturer, "mozilla foundation", padded with spaces to 32 characters and not null-terminated. flags: should be 0. ...
...And 2 more matches
FC_GetTokenInfo
manufacturerid: id of the device manufacturer, "mozilla foundation", padded with spaces to 32 characters and not null-terminated. ...
... manufacturerid: id of the device manufacturer, "mozilla foundation", padded with spaces to 32 characters and not null-terminated. ...
...ular token in the system. syntax ck_rv fc_gettokeninfo(ck_slot_id slotid, ck_token_info_ptr pinfo); parameters fc_gettokeninfo has two parameters: slotid the id of the token's slot pinfo points to a ck_token_info structure description fc_gettokeninfo returns in
formation about the token in the specified slot. on return, the ck_token_info structure that pinfo points to has the following in
formation: label: the label of the token, assigned during token initialization, padded with spaces to 32 bytes and not null-terminated. manufacturerid: id of the device manufacturer, "mozilla foundation", padded with spaces to 32 characters and not null-terminated. model: model of the device, "nss 3", padded with spaces to 16 characters and not null-terminated. serialnumber: the device's serial n...
...And 2 more matches
pkfnc.html
if you are inclined to help with this migration, your help would be very much appreciated. upgraded documentation may be found in the current nss reference pkcs #11 functions chapter 7 pkcs #11 functions this chapter describes the core pkcs #11 functions that an application needs for communicating with cryptographic modules. in particular, these functions are used for obtaining certificates, keys, and passwords. ...
..._isreadonly(pk11slotinfo *slot); parameters this function has the following parameter: slot a pointer to a slot info structure. returns the function returns one of these values: if slot is read-only, pr_true. otherwise, pr_false. pk11_setpasswordfunc defines a callback function used by the nss libraries whenever in
formation protected by a password needs to be retrieved from the key or certificate databases. syntax #include <pk11func.h> #include <prtypes.h> void pk11_setpasswordfunc(pk11passwordfunc func); parameter this function has the following parameter: func a pointer to the callback function to set. description during the course of...
....h> void pk11_setpasswordfunc(pk11passwordfunc func); parameter this function has the following parameter: func a pointer to the callback function to set. description during the course of an ssl operation, it may be necessary for the user to log in to a pkcs #11 token (either a smart card or soft token) to access protected in
formation, such as a private key. such in
formation is protected with a password that can be retrieved by calling an application-supplied callback function. the callback function is identified in a call to pk11_setpasswordfunc that takes place during nss initialization. the callback function set up by pk11_setpasswordfunc has the following prototype: typedef char *(*pk11passwordfunc)( pk11slotinfo ...
...And 2 more matches
Necko Architecture
l cnvts - stream converters stremcnv - stream converter service these libraries will change with time and illustrate the modularity of necko. architecture after a few iterations of our original design, the current necko architecture looks something like this: urls necko's primary responsibility is moving data from one location, to another location. these locations are represented in the
form we have all grown to know and love as uris. a url implements the uri interface. the uri interface does resource-generic things like getting/setting the scheme, or getting/setting the spec (everything beyond the first colon ':'). urls provide getting/setting of paths, hosts, ports, filenames, etc. urls are the most commonly used
form of a uri. because of their importance, necko provides its own st...
...s its own standard implementation of urls (with class id ns_standardurl_cid), which does all of the standard parsing necessary for most urls. necko also provides a simple uri implementation for convenience. uris (recall that a url is just one implementation of a uri) can be created as individual components independently of necko, or they can be retrieved via the nsiioservice interface. for more in
formation see uris and urls. if you want to provide your own resource implementation for foo urls, you simply need to implement the nsiuri interface. nsiioservice acts as the central point of access to urls and channels (nsichannel) in necko. given a string representation of a url, you can ask the nsiioservice for a url instance representing that string. once you have a url interface in hand (nsiurl),...
...p to the nsistreamlistener implementation to decide what to do with these various notifications. the ondataavailable() notification provides a chance for the nsistreamlistener to actually retrieve data that the channel has acquired. one of the arguments to the ondataavailable() notification is an nsiinputstream (which can be considered the underlying data). streams necko represents data in the
form of streams (nsibasestream is the root interface. nsiinputstream is read from. nsioutputstream is written to). streams provide a generic interface to the data and allow for many underlying implementations that permit multiple data sources to be used. as a user, you don't care where the data came from, or where it "is," as long as you get the data. the data may be in memory, it may be on disk, or i...
...And 2 more matches
Rebranding SpiderMonkey (1.8.5)
efault brand for spidermonkey 1.8.5 is 'mozjs185'. mkdir build-$brand-release cd build-$brand-release configure this build of spidermonkey with the desired options. for example: ../configure --enable-ctypes --with-system-nspr note: your desired configuration may be different. the only required part in this step is the ../configure command. so far, so good. now for the tricky parts. we need to per
form a recursive find and replace text operation on all files in the current directory. 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 per
form the recursive find and replace text operation. if you have failed to insert your brand name in any of the previous steps where it is called for, you must d...
...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. ...
...le: $(pkg_config_files) those two lines should be modified to read back: install:: $brand.pc @echo pkg_config_file: $brand.pc note: while it is possible to automate the manual editing process, this has been discouraged due to the fact that these files are automatically generated and very little constant data can be depended upon. ...
...And 2 more matches
Creating JavaScript jstest reftests
directory overview in the js/src/tests directory, there are a few important subdirectories. ...
...gressions 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. per
formance tests or stress tests tests of spidermonkey's com
formance to the ecmascript standard a brief history: in 2017, spidermonkey started comsuming test262, a comprehensive tests suite for ecmascript implementations. before using test262, spidermonkey had a fair number of internal tests of con
formance to ecmascript, and many of those tests remain in the js/src/non262 directory as regressions. t...
...it is maintained by tc39, the ecmascript standard's technical committee. mozilla manually imports these tests into the js/src/tests/test262 directory. ...
...And 2 more matches
FOSS
getting started here. ...
...getting started here. ...
...ry using the gobject introspection mechanism) objective caml http://alain.frisch.fr/soft.html#spider - bindings to embed spidermonkey in ocaml applications perl http://jspl.msg.mx/ - bindings to cross-embed spidermonkey and perl. includes a js shell that allows you to use cpan modules from javascript. python http://pypi.python.org/pypi/python-spidermonkey wxwidgets gluescript (
formerly wxjavascript) code generators jsapigen - generates bindings for embedding spidermonkey in c applications extensions http://code.google.com/p/jslibs/ - zlib, sqlite, nspr, ode, libpng, libjpeg, libffi, (...) libraries for spidermonkey http://www.jsdb.org/ - a js shell with native objects for files, networks, databases, compression, email, etc. http://code.google.com/p/...
...And 2 more matches
SpiderMonkey 1.8.5
firefox 4.0. it is much faster than spidermonkey 1.8, implements es-5 (ecma 262, 5th edition), and contains many new language and api features, described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. ...
...ents es-5 (ecma 262, 5th edition), and contains many new language and api features, described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —22 march 2011 plat
form support spidermonkey 1.8.5 is supported on all the plat
forms where firefox 4 runs. spidermonkey 1.8.5 includes a just-in-time compiler (jit) (several, actually) that compiles javascript to machine code, for a significant speed increase. it is supported only on x86, x86_64 and arm architectures. on other plat
forms, the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migratin...
...de for js_addnamedroot and js_removeroot. since jsdoubles are now stored in the jsval, instead of on the heap, we no longer need to define roots for them. compartments spidermonkey 1.8.5 introduces the concept of compartments. a compartment is a global object, a context, and a set of related objects with no outside references (crosscompartment wrappers excepted). the new garbage collector can per
form per-container garbage collection, which can be a significant per
formance improvement for certain workloads. no compartment may execute js code or call into jsapi on two os threads at the same time. for more in
formation, see spidermonkey compartments. type changes jsval the base data type, jsval, which represents all possible values in javascript, has changed from 32- to 64-bits wide, and the und...
...And 2 more matches
Thread Sanitizer
what is thread sanitizer? thread sanitizer (tsan) is a fast data race detector for c/c++ programs. it uses a compile-time instrumentation to check all non-race-free memory access at runtime. unlike other tools, it understands compiler-builtin atomics and synchronization and therefore provides very accurate results with no real false positives. more in
formation on how tsan works can be found on the thread sanitizer wiki. public builds note: no public builds are available at this time yet. manual build build prerequisites note: this section assumes you're using linux to build. threadsanitizer does not work on mac osx yet. llvm/clang the tsan instrumentation is implemented as an llvm pass and integrated into clang. the version of clang you need to use depends on what firefox rel...
...sing llvm symbolizer for faster/better traces by default, tsan traces are symbolized because otherwise, the runtime suppression list wouldn't work. the default way of symbolizing the traces is much slower than using llvm-symbolizer for that purpose: llvm ships with a symbolizer binary that tsan will readily use to immediately output symbolized traces much faster. furthermore, additional debug in
formation is included in traces when llvm-symbolizer is used. to use it, either make sure the llvm-symbolizer binary is in your path or set the environment variable tsan_options="external_symbolizer_path=/path/to/llvm-symbolizer" before running the process. if you've built tsan as described above, then you will want to set the variable to $llvm_home/build/bin/llvm-symbolizer. ignoring known races in...
... llvm-symbolizer binary is in your path or set the environment variable tsan_options="external_symbolizer_path=/path/to/llvm-symbolizer" before running the process. if you've built tsan as described above, then you will want to set the variable to $llvm_home/build/bin/llvm-symbolizer. ignoring known races in some cases, races can be confirmed to be benign and fixing them would cause possible per
formance issues. tsan offers two possibilities to ignore such known races. compile-time blacklisting functions with racy memory access can be flagged, such that the compiler will not instrument them. in our codebase, this is done using the moz_tsan_blacklist macro on the function definition. it will expand to the appropriate attributes if the compiler supports them. compile-time blacklisting is the ...
...And 2 more matches
Animated PNG graphics
authors the apng specification was authored by: stuart parmenter <pavlov@pavlov.net> vladimir vukicevic <vladimir@pobox.com> andrew smith <asmith15@littlesvr.ca> overview apng is an extension of the portable network graphics (png)
format, adding support for animated images. it is intended to be a replacement for simple animated images that have traditionally used the gif
format, while adding support for 24-bit images and 8-bit transparency. apng is a simpler alternative to mng, providing a spec suitable for the most common usage of animated images on the internet. apng is backwards-compatible with png; any png decoder should be able to ignore the apng-specific chunks and display a single image. terminology the default image is the image described by the standard 'idat' chunks, and...
...ent black rectangle, with width and height dimensions from the 'ihdr' chunk. the default image may be included as the first frame of the animation by the presence of a single 'fctl' chunk before 'idat'. otherwise, the default image is not part of the animation. subsequent frames are encoded in 'fdat' chunks, which have the same structure as 'idat' chunks, except preceded by a sequence number. in
formation for each frame about placement and rendering is stored in 'fctl' chunks. the full layout of 'fdat' and 'fctl' chunks is described below. the boundaries of the entire animation are specified by the width and height parameters of the png 'ihdr' chunk, regardless of whether the default image is part of the animation. the default image should be appropriately padded with fully transparent pixel...
...ted as if it were 100 (that is, delay_num then specifies 1/100ths of a second). if the the value of the numerator is 0 the decoder should render the next frame as quickly as possible, though viewers may impose a reasonable lower bound. frame timings should be independent of the time required for decoding and display of each frame, so that animations will run at the same rate regardless of the per
formance of the decoder implementation. dispose_op specifies how the output buffer should be changed at the end of the delay (before rendering the next frame). valid values for dispose_op are: value constant description 0 apng_dispose_op_none no disposal is done on this frame before rendering the next; the contents of the output buffer are left as is. 1 apn...
...And 2 more matches
The Places database
f the page. no two entries may have the same value in the url column. moz_hosts: one entry in this table is created each time you visit a new host. it contains the host url, frequency of access, if typed or not, and it's prefix (https://, ftp://, etc). history tables moz_historyvisits: one entry in this table is created each time you visit a page. it contains the date, referrer, and other in
formation specific to that visit. it contains a reference to the moz_places table which contains the url and other global statistics. see history service design for more in
formation. bookmarks tables moz_bookmarks: this table contains bookmarks, folders, separators and tags, and defines the hierarchy. the hierarchy is defined via the parent column, which points to the moz_bookmarks record which ...
... this table are mapped to records in the moz_bookmarks table. bookmarks, folders and separators are descendants of the bookmarks root, while tags and tagged uris are descendants of the tag root. moz_keywords: this table is a unique list of keywords. the moz_bookmarks table has a keyword_id column that maps to a record in moz_keywords table. see manipulating bookmarks using places for more in
formation. annotation tables moz_anno_attributes: contains the names of all the annotations in the system and a name id. there should be relatively few unique names. moz_annos: contains the values of page annotations. it maps a page (reference to moz_places) and an annotation name (reference to moz_anno_attributes) to the value of the annotation. moz_items_annos: contains the values of boo...
...s) and an annotation name (reference to moz_anno_attributes) to the value of the annotation. favicon table moz_favicons: this contains a list of unique favicon uris and data. one or more pages in moz_places refer to each entry. when no pages reference a favicon, the icon entry will be deleted. 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. expiration expiration is handled in toolkit/components/places/nsplacesexpiration.js. this algorithm determines the lifetime of all objects in the places system. periodically at runtime, the following happens to expire pages: expire visits that are older than the history expiration threshold. delete the history entries ...
...And 2 more matches
How to build an XPCOM component in JavaScript
this is a "hello world" tutorial for creating an xpcom component in javascript. this tutorial does not describe how and why xpcom works the way it does, or what every bit of the example code does. that's been detailed elsewhere. this tutorial will show you what you need to do to get a component working in as few and as simple steps as possible. implementation this example component will expose a single method, which returns the string "hello world!". ...
...xpcom uses a dialect of idl to define interfaces, called xpidl. here's the xpidl definition for our helloworld component: helloworld.idl #include "nsisupports.idl" [scriptable, uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)] interface nsihelloworld : nsisupports { string hello(); }; note that you must generate a new uuid for each xpcom component that you create. see generating guids for more in
formation. compiling the typelib your interface definition must be compiled into a binary
format (xpt) in order to be registered and used within mozilla applications. the compilation can be done using the gecko sdk. you can learn how to get mac, linux, and windows versions of the gecko sdk by reading the article gecko sdk. for code outside the tree note: on windows if you download the gecko sdk wi...
...uppercase i, not a lowercase l.) this will create the typelib file helloworld.xpt in the current working directory. for a new component in firefox/thunderbird/b2g if you are adding a new feature to applications in the mozilla-central repository, you can create a makefile listing the idl files and the build system will automatically generate the typelib. a sample makefile.in # this source code
form is subject to the terms of the mozilla public # license, v. 2.0. if a copy of the mpl was not distributed with this # file, you can obtain one at http://mozilla.org/mpl/2.0/. depth = @depth@ topsrcdir = @top_srcdir@ srcdir = @srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk # module specifies where header files from this makefile are installed # use dom if your component implements...
...And 2 more matches
Setting up the Gecko SDK
« previousnext » this chapter provides basic setup in
formation for the gecko software development kit (sdk) used to build the weblock component in this tutorial. the following four sections tell the developer how to download and organize the gecko sdk and create a new project in which components like weblock can be created. downloading and setting the sdk the gecko sdk provides all of the tools, headers, and libraries that you need to build xpcom components. the sdk is available for windows, linux, and mac operating systems, and versions for other operating systems are being developed, and can be retrieved from as a single archive from the following plat
form-specific locations (need correction for last version (now 1.9.2.8). there is now separate archive with gecko-sdk, jus...
...y your component. xpcom exports a number of binaries that should be mentioned at this point. the table below refers to the windows file names for the executables. 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 in
formation 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. building a microsoft visual cpp project once you set up the gecko sdk, you can create a microsoft visual c++ project to handle component development wit...
...l visual studio or the express edition, allowing the user to be able to create commercial extensions without buying the full version of visual studio and allowing them to use their own editors. first, you need to get the sdk, this project uses the following tools to compile the extension for use. tools needed gecko 1.9.2 sdk: http://releases.mozilla.org/pub/mozi....win32.sdk.zip windows plat
form sdk: http://www.microsoft.com/downloads/e...displaylang=en moztools: http://ftp.mozilla.org/pub/mozilla.o...8-moztools.zip the windows plat
form sdk has the c++ compiler/linker needed, moztools has several tools and libraries needed for this example. setting up the tools this is probably the most difficult part. install the microsoft sdk, change all further in this example from c:\program fi...
...And 2 more matches
Language bindings
onents.components.exceptioncomponents.exception is a javascript constructor to create nsixpcexception objects. ...
...ave predictably. this is useful for privileged code, such as add-on code, to access variables and apis defined in web content.components.utils.exportfunctionthis function provides a safe way to expose a function from a privileged scope to a less-privileged scope.components.utils.forcegccomponents.utils.forcegc lets scripts force a garbage collection cycle. the mozilla javascript engine will per
form garbage collection automatically when the javascript heap grows beyond a certain size. this mechanism doesn't account for any native (c++) xpcom objects hanging off javascript objects though. in many cases a javascript application will have internal knowledge of javascript objects referencing large (trees of) xpcom objects and know when they are no longer reachable. in this case it can be importa...
... transparent wrapper to the underlying object.javaxpcomjavaxpcom allows for communication between java and xpcom, such that a java application can access xpcom objects, and xpcom can access any java class that implements an xpcom interface. javaxpcom is not actively maintained.plxpcomplxpcom (perl xpcom) provides language bindings letting you use xpcom from perl code. ...
...And 2 more matches
nsIApplicationUpdateService
it also provides utilities for selecting and downloading update patches. ...
...r the update checker being used for background update checking. read only. canapplyupdates boolean true if the update service can download and install updates. indicates if the current user has access privileges to the install directory. read only. cancheckforupdates boolean true if the update service can check for updates. application updates might be disabled by the application and the plat
form the application is running on. read only. canupdate boolean true if the update service is able to download and install updates. this depends on whether or not the current user has the necessary access privileges for the install directory. read only. obsolete since gecko 1.9.1.7pre isdownloading boolean true if a download is in progress, otherwise false. read only. methods adddownloadliste...
...oolean true if the update service is able to download and install updates. this depends on whether or not the current user has the necessary access privileges for the install directory. read only. obsolete since gecko 1.9.1.7pre isdownloading boolean true if a download is in progress, otherwise false. read only. ...
...And 2 more matches
nsIDownloadManager
this interface is deprecated as of firefox 26. please use downloads.jsm instead. toolkit/components/downloads/public/nsidownloadmanager.idlscriptable this interface lets applications and extensions communicate with the download manager, adding and removing files to be downloaded, fetching in
formation about downloads, and being notified when downloads are completed. inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) implemented by: @mozilla.org/download-manager;1. to get the service, use: var downloadmanager = components.classes["@mozilla.org/download-manager;1"] .getservice(components.interfaces.nsidownloadmanager); method overview nsidownload adddownload(in short adownloadtype, in nsiuri asource,...
...there are downloads that can be cleaned up (removed) that is downloads that have completed, have failed or have been canceled. read only. datasource nsirdfdatasource read only. obsolete since gecko 1.8 dbconnection mozistorageconnection the database connection to the downloads database. read only. defaultdownloadsdirectory nsilocalfile returns the plat
form default downloads directory. read only. listener nsidownloadprogresslistener the download manager's progress listener. obsolete since gecko 1.8 userdownloadsdirectory nsilocalfile returns the user configured downloads directory. the path is dependent on two user configurable prefs set in preferences: browser.download.folderlist defines the default download...
... adownloadtype the download type for the transfer. should always be set to nsidownloadmanager.download_type_download (that is, zero). asource the source uri of the transfer. must not be null. atarget the uri indicating where the transferred file should be stored. must not be null. adisplayname a user-readable description of the transfer. may be an empty string. amimeinfo the mime in
formation associated with the target; this may include mime type and helper application when appropriate. this parameter is optional. astarttime the time at which the download began. atempfile the location of a temporary file (a file in which the received data will be stored but is not equal to the target file). the file will be moved to the location indicated by atarget when the download is compl...
...And 2 more matches
nsIEditor
node existingrightnode, in long offset, out nsidomnode newleftnode); void joinnodes(in nsidomnode leftnode, in nsidomnode rightnode, in nsidomnode parent); void deletenode(in nsidomnode child); void marknodedirty(in nsidomnode node); direction controller void switchtextdirection(); output methods astring outputtostring(in astring
formattype, in unsigned long flags); example: // flags are declared in base/public/nsidocumentencoder.idl // outputselectiononly = 1, output
formatted = 2, // outputraw = 4, outputbodyonly = 8, // outputpre
formatted = 16, outputwrap = 32, // output
formatflowed = 64, outputabsolutelinks = 258, // outputencodew3centities = 256, outputcrlinebreak = 512, //...
...// tag name are in lower case with <br>. ...
...utencodehtmlentities=65536, outputpersistnbsp=131072 editorapi.outputtostring('text/html', 2); editorapi.outputtostring('text/plain', 4); // output the body tag, body children and the html end tag (</html>). // tag name are in lower case with <br>. ...
...And 2 more matches
nsIParserUtils
setting this together with sanitizerallowstyle doesn't make sense. at present, sanitizing css syntax in svg presentational attributes is not supported, so this option flattens out svg. sanitizerdropnoncsspresentation (1 << 3) flag for sanitizer: drops non-css presentational html elements and attributes, such as <font>, <center>, and the bgcolor attribute. sanitizerdrop
forms (1 << 4) flag for sanitizer: drops
forms and
form controls (excluding <fieldset> and <legend>. sanitizerdropmedia (1 << 5) flag for sanitizer: drops <img>, <video>, <audio>, and <source>, and flattens out svg. sanitizerlogremovals (1 << 6) flag for sanitizer: log messages to the console for everything that gets sanitized. methods converttoplaintext()...
...ect for the resulting sanitized document fragment. sanitize() parses a string into an html document, sanitizes the document, and returns the result serialized to a string. the sanitizer is designed to protect against xss when sanitized content is inserted into a different-origin context without an iframe-equivalent sandboxing mechanism. by default, the sanitizer doesn't try to avoid leaking in
formation that the content was viewed to third parties. that is, by default, for example <img> with a source pointing to an http server potentially controlled by a third party is not removed. to avoid ambient in
formation leakage upon loading the sanitized content, use the sanitizerinternalembedsonly flag. in that case, <a> links (and similar) to other content are preserved, so an explicit user action ...
... by default, comments and css is removed. ...
...And 2 more matches
nsIPrintingPrompt
ege of a parent window. the parentage is hidden by the getinterface though which it is gotten. inherits from: nsisupports last changed in gecko 1.7 this interface is identical to nsipintingpromptservice but without the parent nsidomwindow parameter. see nsiprintingpromptservice for all documentation. this service enables embedders to implement their own print and progress dialogs. each plat
form has a "base" or "backstop" implementation of the service. the service is automatically registered at start up. historically, plat
form toolkits with native dialogs have implemented them in the gfx layer usually they were displayed when a new devicecontextspec specific to that plat
form was created. windows: the gfx layer no longer supports default toolkit behavior for displaying the native print...
...ws: the gfx layer no longer supports default toolkit behavior for displaying the native print dialog. if an embedder implemented service returns any error code (other than ns_error_abort) printing will terminate. returning ns_ok assumes that the printsettings object was correctly filled in and if it does not have valid fields for printer name, and so on. it may also terminate. defaults for plat
form service: showprintdialog - displays a native dialog showpagesetup() - displays a xul dialog showprogress() - displays a xul dialog summary for windows embedders: stated once again: there is no "fallback" native plat
form support in gfx for the displaying of the native print dialog. the current default implementation for windows display a native print dialog but a xul-based progress dialo...
...f you stub out this service you must set "printsilent" to true, if you do not, printing will terminate and an error dialog will be displayed. mac: the gfx layer still supports default toolkit behavior for displaying the print dialog. if an embedder implemented service returns ns_error_not_implemented for "showprintdialog" the toolkit will display the native print dialog. ...
...And 2 more matches
nsIScriptError
es attribute type description category string a string indicating the category of error that occurred see categories for a list. read only. columnnumber pruint32 the column number where the error occurred. this is used to draw the arrow pointing to the problem character. read only. errormessage astring the error message in a string
format without any context/line number in
formation. note: nsiconsolemessage.message will return the error
formatted with file/line in
formation. read only. flags pruint32 flags; see flag constants for a list. read only. innerwindowid unsigned long long the inner window id with which the error is associated. this is zero if the error was initialized by c...
...y pass null if you are lazy; that will prevent showing the source line in javascript console. read only. sourcename astring the url of the file in which the error occurred. this will be a hyperlink in the javascript console, so you should use a real url. you may pass null if it's not applicable. read only. timestamp long long elapsed time, in milliseconds, from a plat
form-specific zero time to the time the message was created. read only. flag constants constant value description errorflag 0x0 error messages. a pseudo-flag for the default, error case. warningflag 0x1 warning messages. exceptionflag 0x2 an exception was thrown for this case - exception-aware hosts can ignore this. strictfl...
... error messages. a pseudo-flag for the default, error case. warningflag 0x1 warning messages. exceptionflag 0x2 an exception was thrown for this case - exception-aware hosts can ignore this. strictflag 0x4 one of the flags declared in nsiscripterror. infoflag 0x8 just a log message methods init() initializes the object with in
formation describing the error which occurred. void init( in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category ); parameters message the text of the message to add to the log. sourcename the url of the file in which the error occurred. this will be a hyperlink in the javascript c...
...And 2 more matches
nsITextInputProcessor
r level. nsidomwindowutils has provided the methods which dispatched keyboard events and composition events almost directly. therefore they sometimes caused impossible scenarios in automated tests (what's tested with such events?) and js-ime and/or js-keyboard on firefox os or add-ons may dispatch events with wrong rules. for solving that issue, methods of this interface have been designed for per
forming a key operation or representing a change of composition state. for example, the implementation of this interface manages modifier state and composition state, initializes dom events from minimum in
formation, and doesn't dispatch some events if they are not necessary. this means that even when gecko changes the dom event behavior, it may not be necessary that the users of this interface need t...
...event = new keyboardevent("", { key: "convert", code: "convert" }); tip.flushpendingcomposition(convertkeyevent); // this means that the composition is committed by a keypress of "enter" key. var enterkeyevent = new keyboardevent("", { key: "enter", code: "enter" }); tip.commitcomposition(enterkeyevent); note that specifying keyboard event may not be dispatched during composition due to con
forming to the specification of dom level 3 events. however, it's the best for every textinputprocessor user to specify keyboardevent every time because when gecko will change the behavior of keyboard events during composition, textinputprocessor must not need to change for the new behavior in most cases. method overview void appendclausetopendingcomposition(in unsigned long alength, in uns...
...ingcomposition(), and setcaretinpendingcomposition() on the focused editor. if appendclausetopendingcomposition() and/or setcaretinpendingcomposition() are not called properly, e.g., sum of alength of calls of appendclausetopendingcomposition() is not same as composition string set by setpendingcompositionstring(), this throws an exception. after a call of this, the pending composition string in
formation is cleared. therefore, you can set new composition string continuously. boolean flushpendingcomposition(in nsidomkeyevent adomkeyevent optional, in unsigned long akeyflags optional); parameters adomkeyevent optional when the modifying composition is caused by a key operation, this should be specified. if this is specified, keyboard events may be dispatch...
...And 2 more matches
nsIXULTemplateBuilder
ed by the query processor to indicate that the set of valid results has changed, such that a different query may match. if a different match would become active, the content for the existing match is removed and the content for the new match is generated. a query processor is not required to provide any support for updating results after they have been generated. see the template guide for more in
formation about templates. /xul/templates/public/nsixultemplatebuilder.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void rebuild(); void refresh(); void addresult(in nsixultemplateresult aresult, in nsidomnode aquerynode); void removeresult(in nsixultemplateresult aresult); void replaceresult(in...
...followed by its initializeforbuilding() method when the content is to be regenerated. void rebuild(); parameters none. refresh() reloads any rdf datasources that support nsirdfremotedatasource. note: this is a temporary hack so that remote-xul authors can reload remote datasources. when rdf becomes remote-scriptable, this will no longer be necessary. void refresh(); parameters none. addresult() in
forms the template builder that a new result is available. the builder will add this result to the set of results. the query node that the new result applies to must be specified using the aquerynode parameter. the builder will apply the rules associated with the query to the new result, unless a result with the same id from an earlier query supersedes it, and the result's rulematched() method will be...
... unless a result with the same id from an earlier query supersedes it, and the result's rulematched() method will be called if it matches. void addresult( in nsixultemplateresult aresult, in nsidomnode aquerynode ); parameters aresult the result to add. aquerynode the query to which the result applies. errors throws ns_error_null_pointer if aresult or aquerynode is null. removeresult() in
forms the template builder that a result no longer applies. the builder will call the remove content generated for the result, if any. if a different query would then match instead, it will become the active match. this method will have no effect if the result isn't known to the builder. void removeresult( in nsixultemplateresult aresult ); parameters aresult the result to remove errors throws ns...
...And 2 more matches
Xptcall Porting Status
what is this? ...
... what is this? ...
...this is a status page for the multiplat
form porting of xptcall. xptcall has a faq and a porting guide. this is being maintained by john bandhauer <jband@netscape.com>. feel free to email me with questions or to volunteer to contribute xptcall code for any plat
form. mike shaver <shaver@mozilla.org> is the best contact regarding 'nix (unix, linux, finux, etc.) ports of xptcall. ...
...And 2 more matches
XUL Overlays
ate or enhancement of some kind, they can be used in many different ways. overlays provide a general mechanism for: adding ui for additional components, as described in the example above overriding small pieces of a xul file without having to resupply the whole ui reusing particular pieces of the ui xul files and overlays work together to describe a single master document. though there is no
formal restriction on what kind of xul content is located in "base" xul files and what kind should be put in overlays, xul overlays generally define items that are not present in the basic versions of the ui, such as additional components. when plug-ins, browser extensions, or other applications provide new ui elements to the browser, these elements should be defined in overlay files. the installation...
...he 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). the layout engine loads any overlay files and then flows the resulting xul document, so problems associated with incremental insertion in menus, boxes, tables, and
forms are avoided. any number of overlays can be loaded into a master document, and an overlay can also load other overlays. because an overlay is superimposed on the master document, there are no ambiguities relating to scoping of style sheets or scripts. style sheets and scripts loaded by the overlay simply apply to the entire master document. loading overlays dynamically the chrome registry makes i...
...ed on the master document, there are no ambiguities relating to scoping of style sheets or scripts. style sheets and scripts loaded by the overlay simply apply to the entire master document. loading overlays dynamically the chrome registry makes it possible to load xul overlays dynamically -- or only when necessary. the chrome registry, which is a special rdf datasource into which user-specific in
formation is persisted, or stored, contains in
formation about the components or additional packages that have been installed with the browser. when a component such as the "super stream player" from the examples above is registered there, overlays associated with that component are loaded automatically. when the component is not present, only the base files are loaded. loading overlays at runtime fire...
...And 2 more matches
Address Book examples
first match that it finds in the collection, or null. let collection = ... let card = collection.cardforemailaddress("foo@bar.invalid.com"); note: both of these functions may raise an ns_error_not_implemented exception if the collection has not implemented that function. this is currently true in the case of ldap, but may be true in other cases as well. how do i search for multiple contacts?
formulate a boolean search string (see nsiabcard for built-in property names): var searchquery = "(or(primaryemail,bw,@v)(nickname,bw,@v)(and(ismaillist,=,true)(notes,bw,@v)))"; searchquery = searchquery.replace(/@v/g, encodeuricomponent("mystr") the search queries use lisp syntax with operators enumerated in nsabquerystringtoexpression.cpp. assuming you wish to search across multiple directories:...
...ts.interfaces.nsiabcard); card.setproperty("firstname", "john"); card.setproperty("lastname", "smith"); card.primaryemail = "john@invalid.com"; now add the card to an address book via its nsiabdirectory interface: let newcard = addressbook.addcard(card); the addcard function returns a new nsiabcard object that may have had nsiabdirectory specific data added to it, e.g. database specific in
formation, that is used on edits. editing contacts once you have obtained a card from an nsiabdirectory (see above), you can edit it in a two step process, firstly, change the properties that you to edit: card.setproperty("firstname", "jane"); card.setproperty("lastname", "doe"); secondly, call modifycard to save the card in the database. addressbook.modifycard(card); deleting contacts once y...
...maillistdirectory = abmanager.getdirectory(maillistcard.maillisturi); you can then adjust the items in the actual mailing list: maillistdirectory.addresslists.appendelement(newcard, false); then save the updated list to the database: maillistdirectory.editmaillisttodatabase(maillistcard); deleting a mailing list there are two ways to delete a mailing list. ...
...And 2 more matches
Autoconfiguration in Thunderbird
it contains settings for the world's largest isps. most isps with a market share of more than 0.1% are included. this allows to autoconfigure almost 50% of our user's email accounts. it was added because we cannot assume that all big isps (including microsoft) will set up a configuration server for thunderbird. configuration server at isp isps have the option to provide their configuration in
formation themselves directly to users, by setting up a web server at autoconfig.<domain>, which simply returns a static xml file with the configuration, as described below. for more complicated setups, for example when the login name does not appear in the email address, the xml file can also be generated by the isp. in such complicated cases, this is the only way to allow an automatic setup. config...
... configuration file. guessing if all other mechanisms failed, thunderbird tries to guess the configuration, by trying common server names like imap.<domain>, smtp.<domain>, mail.<domain> etc., and, when a mail server answers, checking whether it supports ssl, starttls and encrypted passwords (cram-md5). ...
...nfiguration, by trying common server names like imap.<domain>, smtp.<domain>, mail.<domain> etc., and, when a mail server answers, checking whether it supports ssl, starttls and encrypted passwords (cram-md5). manual configuration if guessing fails, the user must manually enter the configuration in
formation. users may also choose to manually modify the account settings, even if configuration in
formation is successfully obtained by the methods described above. ...
...And 2 more matches
Filelink Providers
ulist. some providers require thunderbird to do very little in order to connect a user to their account. other providers however may require the user to fill in additional details in order to connect to the service. hightail, for example, requires a username and password. other services may require the user to fill in a server string or port number. a provider implementation can choose what in
formation it gets from the user from the setup dialog by pointing the settingsurl attribute of their nsimsgcloudfileprovider implementation to a chrome url for an xhtml page that contains a
form with the extra in
formation. that url is then loaded into an iframe directly beneath the provider menulist. note: the setup dialog window should resize itself automatically in order to fit the content of the i...
...r implementation to a chrome url for an xhtml page that contains a
form with the extra in
formation. that url is then loaded into an iframe directly beneath the provider menulist. note: the setup dialog window should resize itself automatically in order to fit the content of the iframe without scrollbars. custom settings fields to handle custom settings, the settings xhtml page should contain a
form with the id "provider-
form", with its onsubmit attribute set to "return false;". ...
.... that url is then loaded into an iframe directly beneath the provider menulist. note: the setup dialog window should resize itself automatically in order to fit the content of the iframe without scrollbars. custom settings fields to handle custom settings, the settings xhtml page should contain a
form with the id "provider-
form", with its onsubmit attribute set to "return false;". example: <
form id="provider-
form" onsubmit="return false;"> <label for="username">username:</label> <input id="username" type="text" required="true" /> <label for="server">server:</label> <input id="server" type="text" required="true" /> <label for="port">port:</label> <input id="port" pattern="[0-9]+" required="true" /> </
form> the
form is expected to use html5
form validation. for each input eve...
...And 2 more matches
LDAP Support
this document is intended to "fill in the gaps" about how enterprise customers can leverage and customize ldap support in mozilla thunderbird. it is not intended as an introduction to ldap and mozilla products. it assumes you are already familiar with configuring preferences for deployed builds in addition to setting up thunderbird to use an ldap directory. it should be noted that all of this in
formation applies to both thunderbird and the seamonkey application suite. 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. for large companies, there may be a large number of users in the directory with the same name. in such a scenario, it may be hard to tell which person you re...
...ers in the directory with the same name. in such a scenario, it may be hard to tell which person you really want to send the message to. 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.comment
format", "[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. the comment
format preference is set on each directory. it acts as a template, specifying the extra ldap attribute which should be used in the comment field along with how the attribute should ...
...in this example, we are setting the organization unit as the ldap attribute. ...
...And 2 more matches
Theme Packaging
ke 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 in
formation: 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/1...
...7dbc4} official references for toolkit api official references. do not add to this list without contacting benjamin smedberg. note that this page is included from the pages listed below. ...
...ot add to this list without contacting benjamin smedberg. note that this page is included from the pages listed below. ...
...And 2 more matches
Using the Multiple Accounts API
cts. the account manager maintains the main list of accounts. accounts (nsimsgaccount): an account consists of a single incoming server, and one or more identities. an account is merely a container to bind incoming servers and identities together. incoming servers (nsimsgincomingserver): an incoming server represents a remote message store such as a pop, imap, or nntp server. it holds all the in
formation necessary to retrieve mail from the remote server, such as hostname, user login name, and biff settings. identities (nsimsgidentity): an identity contains all the in
formation necessary to compose and outgoing mail message. it includes a user's full name and e-mail address. smtp servers (nsismtpserver): an smtp server is not tied to any of the above and can be retrieved from the smtp servic...
... the keys used here are the account1, server1, id1, etc. these keys are listed in the value of some of these preferences, such as "mail.accountmanager.accounts", and are used to construct the preference names, such as "mail.account.account1.server". this the way accounts know which server and which identities they contain. creating new accounts it is possible to cr...
...unt, identity, and server. it is possible, through some tricks with server and identity keys, to share servers and identities between accounts. you can do this by referring to the same identity or server key in the preferences, or with clever calls to the account manager. (left as an exercise for the reader.)this will work but it is not supported. the ui will act slighty strange when you share in
formation between accounts. the current plans prevent sharing of in
formation between accounts using the ui. relevant api calls: nsimsgaccount nsimsgaccountmanager.createaccount() nsimsgaccount nsimsgaccountmanager.getaccount(in string key) nsimsgincomingserver nsimsgaccountmanager.createincomingserver(in string type) nsimsgincomingserver nsimsgaccountmanager.getincomingserver(in string k...
...And 2 more matches
Zombie compartments
oughly speaking, all memory used by javascript code that is from a particular origin (i.e. website) goes into its own compartment. firefox’s own javascript code also gets one or more compartments and so do add-on scripts. 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 in
formation. 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. in the results, you'll find a js-main-runtime-compartments tree (whcih you may need to expand further) that lists all system (firefox and add-ons) and user (website) compartments, these compartments are also listed in more detail in the explic...
...-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 breaks it down into zones, compartments, dom etc. when are compartments created? any compartments with the following
forms are created by firefox for its own internal use, and can usually be ignored when looking for zombie compartments. js-compartment([system principal], 0x7f10f1250000) compartment(atoms) js-compartment(about:home) js-compartment(about:blank) compartment([system principal], resource://gre/modules/addons/xpiprovider.jsm) when looking at user compartments there are a couple of things to be aw...
...isements, "like" and "+1" buttons, twitter feeds, etc. so it's common for multiple compartments to be created for a single web page. for example, if i open www.techcrunch.com the following compartments are created. compartment(http://techcrunch.com/) compartment(http://www.facebook.com/plugins/like.php?...) compartment(https://plusone.google.com/_/+1/fastbutton?...) compartment(http://plat
form.twitter.com/widgets/...utton.html?...) compartment(http://cdn.at.atwola.com/_media/uac/tcode3.html) compartment(https://s-static.ak.fbcdn.net/connec..._proxy.php?...) compartment(http://ads.tw.adsonar.com/adserving/getads.jsp?...) (some of those compartment urls are long and have been truncated.) another thing to beware is each compartment is created for an origin (e.g. https://www.facebook...
...And 2 more matches
Add to iPhoto
are declared near the top of the code: const osstatus = ctypes.int32_t; const cfindex = ctypes.long; const optionbits = ctypes.uint32_t; osstatus used to represent the status code resulting from an operation. cfindex a core foundation long integer type used to represent indexes into lists. i debated including this in the corefoundation object, and probably would have if i were being more
formal, but opted against it for clarity's sake. optionbits a 32-bit bit field data type. core foundation the majority of the system routines we'll be using come from core foundation. among these are routines for managing cfstring, cfurl, and cfarray objects, among others. these are core system data
formats that are used by other frameworks, and we'll be making use of them. the core foundation a...
... ctypes.voidptr_t); // input: object to retain these methods are used to manage the reference counting for core foundation objects. cfstring a cfstring is an opaque data type that contains a string. the string can be stored in any of a number of encodings, so you use assorted functions that know how to cope with different encodings to set and get values of cfstrings, as well as to per
form typical string operations. the first declaration to be done here is to actually declare the cfstringref data type; this is an opaque pointer to a cfstring object. this.cfstringref = new ctypes.pointertype("cfstringref"); now that we've declared the core type, we can declare the methods we use that work with cfstring objects. let's take a look at one of these. this.cfstringcreatewithchara...
... use the ctypes.voidptr_t type for this), a pointer to the unicode string to copy into the new string object (ctypes.jschar.ptr), and the length of the unicode string in characters. cfurl the cfurl type is used to describe a url. it differs from a string in that it offers url-specific methods for managing the content, and includes methods for converting between urls and file system routine data
formats such as fsref and unix pathnames. we use a few of these routines because the launch services routine we'll be using to launch iphoto and pass it the image to import uses cfurl for the file references. let's take a look at two of the routines declared here: this.cfurlcreatefromfilesystemrepresentation = this.lib.declare("cfurlcreatefromfilesystemrepresentation", ...
...And 2 more matches
CData
integer types, terminated by a null character. readstring() converts a character array to a javascript string. 8-bit strings are assumed to be encoded as utf-8. if the 8-bit string contains invalid encoded character, a typeerror exception is thrown. string readstring(); parameters none. return value a new string object that is a copy of the original string contents. readstringreplacemal
formed() converts a character array to a javascript string. 8-bit strings are assumed to be encoded as utf-8. if the 8-bit string contains invalid encoded character, no exception is thrown. string readstringreplacemal
formed(); parameters none. return value a new string object that is a copy of the original string contents. invalid encoded characters will be replaced by �(u+fffd). here is ...
...acter array to a javascript string. 8-bit strings are assumed to be encoded as utf-8. if the 8-bit string contains invalid encoded character, no exception is thrown. string readstringreplacemal
formed(); parameters none. return value a new string object that is a copy of the original string contents. invalid encoded characters will be replaced by �(u+fffd). ...
...xception is thrown. string readstringreplacemal
formed(); parameters none. return value a new string object that is a copy of the original string contents. invalid encoded characters will be replaced by �(u+fffd). ...
...And 2 more matches
Structures - Plugins
« previousnext » this chapter describes the data structures that are used to represent the various objects in the plug-in api. structure summary npanycallbackstruct contains in
formation required during embedded mode printing. npbyterange represents a particular range of bytes from a stream. npembedprint substructure of npprint that contains plat
form-specific in
formation used during embedded mode printing. npevent represents an event passed by npp_handleevent to a windowless plug-in. ...
...ired during embedded mode printing. npbyterange represents a particular range of bytes from a stream. npembedprint substructure of npprint that contains plat
form-specific in
formation used during embedded mode printing. npevent represents an event passed by npp_handleevent to a windowless plug-in. npfullprint substructure of npprint that contains plat
form-specific in
formation used during full-page mode printing. npp represents a single instance of a plug-in. np_port contains in
formation required by the window field of an npwindow structure. ...
... npevent represents an event passed by npp_handleevent to a windowless plug-in. npfullprint substructure of npprint that contains plat
form-specific in
formation used during full-page mode printing. npp represents a single instance of a plug-in. np_port contains in
formation required by the window field of an npwindow structure. npprint contains in
formation the plug-in needs to print itself in full-page or embedded mode. npprintcallbackstruct contains in
formation required by the plat
formprint field of the npembedprint during embedded mode printing. ...
...And 2 more matches
URLs - Plugins
« previousnext » this chapter describes retrieving urls and displaying them on specified target pages, posting data to an http server, uploading files to an ftp server, and sending mail. uni
form resource locator (url) protocols provide a means for locating and accessing resources that are available on the internet and on intranets. 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 table below summarizes urls supported by gecko. in addition, gecko may support urls not listed on this table. url scheme description about locates browser in
formation or "fun" pages. file (host-specific filenames) locates files on a specific host computer rather ...
...cates usenet news groups or individual usenet articles. nntp (usenet news using nntp access) locates usenet news groups or individual usenet articles; alternate to news. prospero (prospero directory service) locates a resource on a prospero directory server. telnet (reference to interactive sessions) locates an interactive service. wais (wide area in
formation servers) locates wais databases and their documents. wysiwyg placed before another url; displays a page that javascript has updated using document.write. for more in
formation, see rfc 3986, "uni
form resource identifier (uri): generic syntax", and the iana uri scheme registry. getting urls posting urls getting urls to retrieve a url and display it on a specified targ...
...lug-in. for http urls only, the browser resolves this method as the http server method post, which transmits data to the server. you can use npn_posturl to post data to a url from a memory buffer or file. the result from the server can also be sent to a particular browser window or frame for display, or delivered to the plug-in instance in a new stream. plug-ins can use this capability to post
form data to cgi scripts using http or upload files to a remote server using ftp. the browser resolves this method as the http server method post, which transmits data to the server. the data to post can be contained either in a local temporary file or a new memory buffer. to post a file, set the flag file to true, the buffer buf to the path name string for a file, and len to the length of the path s...
...And 2 more matches
Allocations - Firefox Developer Tools
the allocations view in the per
formance tool shows you which functions in your page are allocating the most memory over the course of the profile. for per
formance this is important mostly because allocating a lot of memory, or making a lot of allocations, can trigger garbage collection. this in turn can hurt the responsiveness of a page. the allocations view is new in firefox 46. to enable the allocations view, you must check "record allocations" in the per
formance tool settings, before recording a profile. then record a profile as usual, and you will see a new tab labeled "allocations" in the toolbar: anatomy of the allocations view the allocations view looks something like this: the allocations view periodically samples allocations that are made over the recording. each...
...ount, meaning that no allocations were seen directly in these functions. however, removeinner() has 8901 in total count, while setselectioninner() has just 3 in total count. this is telling us that, of the 8904 allocations seen in signallater(), all but three came through the removeinner() branch. allocations and garbage collection of course, the memory allocated by a site is in itself useful in
formation to know. but the main connection between the allocation profile of a site and its responsiveness is the cost of garbage collection (gc). with a garbage-collected language, like javascript, the runtime periodically needs to walk the heap looking for objects that are no longer reachable, and then freeing the memory they occupy. while gc events like this are executing, the javascript engine mu...
...e, like javascript, the runtime periodically needs to walk the heap looking for objects that are no longer reachable, and then freeing the memory they occupy. while gc events like this are executing, the javascript engine must be paused, so your program is suspended and will be completely unresponsive. ...
...And 2 more matches
Frame rate - Firefox Developer Tools
frame rate is a measure of a website's responsiveness. a low or inconsistent frame rate can make a site appear unresponsive or janky, making for a bad user experience. a frame rate of 60fps is the target for smooth per
formance, giving you a time budget of 16.7ms for all the updates needed in response to some event. the frame rate graph in the per
formance tool shows you the frame rate over the course of a recording. it gives you a quick indication of where your site might be having problems, enabling you to use the other tools for a more in-depth analysis. frame rate and responsiveness frame rate is the rate at which a video device can produce images (or frames). it's most familiar from film and gaming, but is now widely used as a per
formance measure for websites and web apps. in...
...e of a recording. it gives you a quick indication of where your site might be having problems, enabling you to use the other tools for a more in-depth analysis. frame rate and responsiveness frame rate is the rate at which a video device can produce images (or frames). it's most familiar from film and gaming, but is now widely used as a per
formance measure for websites and web apps. in web per
formance, a frame encapsulates the work the browser needs to do in order to update and repaint the screen. frame rate is most obviously applicable to animations: if the frame rate is too low, an animation will have a jerky appearance, while a faster frame rate will be smoother. but frame rate is also useful as a general measure of a site's responsiveness as the user interacts with it. for example, if...
...anky). similarly, if scrolling through a page involves a lot of complex page updates and the browser can't keep up an acceptable frame rate, scrolling the page will appear sluggish or will occasionally freeze. in general, a high and consistent frame rate will make the user's interaction with the site more enjoyable and engaging. a frame rate of 60fps is reckoned to be the target for smooth per
formance, giving you a time budget of 16.7ms for all the updates that need to be made synchronously in response to some event. however, consistency is especially important: if you can't deliver 60fps, it's better to deliver lower frame rates more consistently, and avoid sudden dips in the frame rate which cause the site to freeze. frame rate graph the frame rate graph is found in the recording ove...
...And 2 more matches
Manipulating video using canvas - Web APIs
the document content the html document used to render this content is shown below. ...
...ht="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. canvas c1 is used to display the current frame of the original video, while c2 is used to display the video after per
forming the chroma-keying effect; c2 is preloaded with the still image that will be used to replace the green background in the video. the javascript code is imported from a script named processor.js. the javascript code the javascript code in processor.js consists of three methods. initializing the chroma-key player the doload() method is called when the xhtml document initially loads. this me...
...canvases. these will be used when we're actually doing the chroma-keying effect. then addeventlistener() is called to begin watching the video element so that we obtain notification when the user presses the play button on the video. in response to the user beginning playback, this code fetches the width and height of the video, halving each (we will be halving the size of the video when we per
form the chroma-keying effect), then calls the timercallback() method to start watching the video and computing the visual effect. the timer callback the timer callback is called initially when the video starts playing (when the "play" event occurs), then takes responsibility for establishing itself to be called periodically in order to launch the keying effect for each frame. processor.timercall...
...And 2 more matches
DOMMatrixReadOnly - Web APIs
11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44 double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth. a, b, c, d, e, f double-precision floating-point values representing the components of a 4×4 matrix which are required in order to per
form 2d rotations and translations. these are aliases for specific components of a 4×4 matrix, as shown below. 2d 3d equivalent a m11 b m12 c m21 d m22 e m41 f m42 methods this interface doesn't inherit any methods. none of the following methods alter the original matr...
...caled by 1 and the y axis has no default scaling value. the default origin is (0, 0, 0). the original matrix is not modified. dommatrixreadonly.scale3d() returns a new dommatrix created by scaling the source 3d matrix by the given factor along all its axes, centered on the specified origin point. the default origin is (0, 0, 0). the original matrix is not modified. dommatrixreadonly.scalenonuni
form() returns a new dommatrix created by applying the specified scaling on the x, y, and z axes, centered at the given origin. by default, the y and z axes' scaling factors are both 1, but the scaling factor for x must be specified. the default origin is (0, 0, 0). the original matrix is not changed. dommatrixreadonly.skewx() returns a new dommatrix created by applying the specified skew transfo...
...the original matrix is not modified. ...
...And 2 more matches
DataTransfer - Web APIs
this object is available from the datatransfer property of all drag events. constructor datatransfer() creates and returns a new datatransfer object. properties standard properties datatransfer.dropeffect gets the type of drag-and-drop operation currently selected or sets the operation to a new type. the value must be none, copy, link or move. ...
...move, link, linkmove, move, all or uninitialized. datatransfer.files contains a list of all the local files available on the data transfer. if the drag operation doesn't involve dragging files, this property is an empty list. datatransfer.items read only gives a datatransferitemlist object which is a list of all of the drag data. datatransfer.types read only an array of strings giving the
formats that were set in the dragstart event. gecko properties note: all of the properties in this section are gecko-specific. datatransfer.mozcursor gives the drag cursor's state. this is primarily used to control the cursor during tab drags. datatransfer.mozsourcenode read only the node over which the mouse cursor was located when the button was pressed to initiate the drag operation. t...
...he data transfer contains no data, this method will have no effect. datatransfer.getdata() retrieves the data for a given type, or an empty string if data for that type does not exist or the data transfer contains no data. datatransfer.setdata() set the data for a given type. if data for the type does not exist, it is added at the end, such that the last item in the types list will be the new
format. if data for the type already exists, the existing data is replaced in the same position. datatransfer.setdragimage() set the image to be used for dragging if a custom one is desired. gecko methods note: all of the methods in this section are gecko-specific. datatransfer.addelement() sets the drag source to the given element. deprecated methods datatransfer.mozcleardataat() ...
...And 2 more matches
GlobalEventHandlers.onreset - Web APIs
the onreset property of the globaleventhandlers mixin is an eventhandler that processes reset events. the reset event fires when the user clicks a reset button in a
form (<input type="reset">). syntax target.onreset = functionref; value functionref is a function name or a function expression. the function receives an event object as its sole argument. example this example logs the current event.timestamp whenever you reset the
form. ...
... is an eventhandler that processes reset events. the reset event fires when the user clicks a reset button in a
form (<input type="reset">). syntax target.onreset = functionref; value functionref is a function name or a function expression. the function receives an event object as its sole argument. example this example logs the current event.timestamp whenever you reset the
form. ...
...enthandler that processes reset events. the reset event fires when the user clicks a reset button in a
form (<input type="reset">). syntax target.onreset = functionref; value functionref is a function name or a function expression. the function receives an event object as its sole argument. example this example logs the current event.timestamp whenever you reset the
form. ...
...And 2 more matches
HTMLCanvasElement.getContext() - Web APIs
ntext is only available on browsers that implement webgl version 2 (opengl es 3.0). "bitmaprenderer" which will create an imagebitmaprenderingcontext which only provides functionality to replace the content of the canvas with a given imagebitmap. note: the identifier "experimental-webgl" is used in new implementations of webgl. these implementations have either not reached test suite con
formance, or the graphics drivers on the plat
form are not yet stable. the khronos group certifies webgl implementations under certain con
formance rules. contextattributes you can use several context attributes when creating your rendering context, for example: const gl = canvas.getcontext('webgl', { antialias: false, depth: false }); 2d context attributes: alpha: boolean that indic...
...os). (blink only) storage: string that indicates which storage is used ("persistent" by default). webgl context attributes: alpha: boolean that indicates if the canvas contains an alpha buffer. desynchronized: boolean that hints the user agent to reduce the latency by desynchronizing the canvas paint cycle from the event loop antialias: boolean that indicates whether or not to per
form anti-aliasing. depth: boolean that indicates that the drawing buffer has a depth buffer of at least 16 bits. failifmajorper
formancecaveat: boolean that indicates if a context will be created if the system per
formance is low or if no hardware gpu is available. powerpreference: a hint to the user agent indicating what configuration of gpu is suitable for the webgl context. possible values are...
... premultipliedalpha: boolean that indicates that the page compositor will assume the drawing buffer contains colors with pre-multiplied alpha. ...
...And 2 more matches
HTMLCanvasElement.toBlob() - Web APIs
ge/png. the created image is in a resolution of 96dpi. the third argument is used when creating images using lossy compression (namely, image/jpeg) to specify the quality of the output. syntax canvas.toblob(callback, mimetype, qualityargument); parameters callback a callback function with the resulting blob object as a single argument. mimetype optional a domstring indicating the image
format. the default type is image/png. qualityargument optional a number between 0 and 1 indicating image quality if the requested type is image/jpeg or image/webp. if this argument is anything else, the default values 0.92 and 0.80 are used for image/jpeg and image/webp respectively. other arguments are ignored. return value none. exceptions securityerror the canvas's bitmap is not origin c...
...default values 0.92 and 0.80 are used for image/jpeg and image/webp respectively. other arguments are ignored. return value none. exceptions securityerror the canvas's bitmap is not origin clean; at least some of its contents come from secure examples getting a file representing the canvas once you have drawn content into a canvas, you can convert it into a file of any supported image
format. the code snippet below, for example, takes the image in the <canvas> element whose id is "canvas", obtains a copy of it as a png image, then appends a new <img> element to the document, whose source image is the one created using the canvas. var canvas = document.getelementbyid('canvas'); canvas.toblob(function(blob) { var newimg = document.createelement('img'), url = url.createobjec...
...t('img'), url = url.createobjecturl(blob); newimg.onload = function() { // no longer need to read the blob so it's revoked url.revokeobjecturl(url); }; newimg.src = url; document.body.appendchild(newimg); }); note that here we're creating a png image; if you add a second parameter to the toblob() call, you can specify the image type. for example, to get the image in jpeg
format: canvas.toblob(function(blob){...}, 'image/jpeg', 0.95); // jpeg at 95% quality a way to convert a canvas to an ico (mozilla only) this uses -moz-parse to convert the canvas to ico. windows xp doesn't support converting from png to ico, so it uses bmp instead. a download link is created by setting the download attribute. the value of the download attribute is the name it will use as the fi...
...And 2 more matches
HTMLImageElement.alt - Web APIs
construed as a caption or title. there are separate attributes and elements designed for those purposes. examples beyond that, there are additional guidelines for using alt appropriately which vary depending on what the image is being used for. these are shown in the examples below. decorative images images with no semantic meaning—such as those which are solely decorative—or of limited in
formational value, should have their alt attributes set to the empty string (""). this is shown in the example below. html in the html for this example, shown below, the <img> element includes the alt property, which will prevent the image from having any alternate text, since it's simply a decorational detail. <div class="container"> <div class="left-margin"> <img src="/files/16861/margin-fl...
... for a map, the alt text could be directions to the place indicated by the map, similarly to how you would explain it verbally. for a chart, the text could d...
...="button"><img src="albumicon.svg" alt="albums"</a> <a href="artists.html" aria-role="button"><img src="artisticon.svg" alt="artists"</a> <a href="playlists.html" aria-role="button"><img src="playlisticon.svg" alt="playlists"</a> </li> images containining diagrams or maps when an image contains in
formation presented as a diagram, chart, graph, or map, the alt text should provide the same in
formation, at least in summary
form. this is true whether the /me image is in a bitmapped
format such as png or jpeg or in a vector
format like svg. for a map, the alt text could be directions to the place indicated by the map, similarly to how you would explain it verbally. for a chart, the text could describe the items in the chart and their values. for a diagram, the text could be an explanati...
...And 2 more matches
KeyframeEffect.setKeyframes() - Web APIs
the setkeyframes() method of the keyframeeffect interface replaces the keyframes that make up the affected keyframeeffect with a new set of keyframes. syntax existingkeyframeeffect.setkeyframes(keyframes); parameters keyframes a keyframe object or null. if set to null, the keyframes are replaced with a sequence of empty keyframes. there are two different ways to
format keyframes: an array of objects (keyframes) consisting of properties and values to iterate over. this is the canonical
format returned by the getkeyframes() method. element.animate([ { // from opacity: 0, color: "#fff" }, { // to opacity: 1, color: "#000" } ], 2000); offsets for each keyframe can be specified by providing an offset value. element.animate([ { opacity: 1 }, ...
...any easing value specified on the options argument, however, applies across a single iteration of the animation — for the entire duration. an object containing key-value pairs consisting of the property to animate and an array of values to iterate over. element.animate({ opacity: [ 0, 1 ], // [ from, to ] color: [ "#fff", "#000" ] // [ from, to ] }, 2000); using this
format, the number of elements in each array does not need to be equal. the provided values will be spaced out independently. element.animate({ opacity: [ 0, 1 ], // offset: 0, 1 backgroundcolor: [ "red", "yellow", "green" ], // offset: 0, 0.5, 1 }, 2000); the special keys offset, easing, and composite (described below) may be specified alongside the property values. element.animate({ ...
... 1 ], offset: [ 0, 0.8 ], // shorthand for [ 0, 0.8, 1 ] easing: [ 'ease-in', 'ease-out' ], }, 2000); after generating a suitable set of keyframes from the property value lists, each supplied offset is applied to the corresponding keyframe. if there are insufficient values, or if the list contains null values, the keyframes without specified offsets will be evenly spaced as with the array
format described above. if there are too few easing or composite values, the corresponding list will be repeated as needed. implicit to/from keyframes in newer browser versions, you are able to set a beginning or end state for an animation only (i.e. a single keyframe), and the browser will infer the other end of the animation if it is able to. for example, consider this simple animation — t...
...And 2 more matches
Media Capabilities API - Web APIs
the media capabilities api allows developers to determine decoding and encoding abilities of the device, exposing in
formation such as whether media is supported and whether playback should be smooth and power efficient, with real time feedback about playback to better enable adaptive streaming, and access to display property in
formation. examples detect audio file support and expected per
formance this example defines a audio configuration then checks to see if the user agent supports decoding that media configuration, and whether it will per
form well in terms of smoothness and power efficiency. if ('mediacapabilities' in navigator) { const audiofileconfiguration = { type : 'file', audio : { contenttype: "audio/mp3", channels: 2, bitrate: 132700, ...
...with the media capabilities api, developers can ensure each user is getting the best bitrate and storage savings for their browser, device, and os capabilities. whether a device uses hardware or software decoding impacts how smooth and power efficient the video decoding is and how efficient the playback will be. ...
...coding is and how efficient the playback will be. the media capabilities api enables determining which codecs are supported and how per
formant a media file will be both in terms of smoothness and power efficiency. the media capabilities api provide more powerful features than say mediarecorder.istypesupported() or htmlmediaelement.canplaytype(), which only address general browser support, not per
formance. the api also provides abilities to access display property in
formation such as supported color gamut, dynamic range abilities, and real-time feedback about the playback. to test support, smoothness and power efficiency of a video or audio file, you define the media configuration you want to test, and then pass the audio or video configuration as the parameter of the mediacapabilities inter...
...And 2 more matches
Media Source API - Web APIs
using mse, media streams can be created via javascript, and played using <audio> and <video> elements. media source extensions concepts and usage playing video and audio has been available in web applications without plugins for a few years now, but the basic features offered have really only been useful for playing single whole tracks. we can't, for example, combine/split arraybuffers. streaming media has up until recently been the domain of flash, with technologies like flash media server serving video streams using the rtmp protocol. the mse standard with media source extensions (mse), this is changing. ...
...bine/split arraybuffers. streaming media has up until recently been the domain of flash, with technologies like flash media server serving video streams using the rtmp protocol. the mse standard with media source extensions (mse), this is changing. mse allows us to replace the usual single track src value fed to media elements with a reference to a mediasource object, which is a container for in
formation like the ready state of the media for being played, and references to multiple sourcebuffer objects that represent the different chunks of media that make up the entire stream. mse gives us finer grained control over how much and how often content is fetched, and some control over memory usage details, such as when buffers are evicted. it lays the groundwork for adaptive bitrate streaming cl...
...rol over memory usage details, such as when buffers are evicted. it lays the groundwork for adaptive bitrate streaming clients (such as those using dash or hls) to be built on its extensible api. creating assets that work with mse in modern browsers is a laborious process, taking significant time, computing power, and energy. the usage of external utilities to massage the content into a suitable
format is required. while browser support for the various media containers with mse is spotty, usage of the h.264 video codec, aac audio codec, and mp4 container
format is a common baseline. mse also provides an api for runtime detection of container and codec support. if you do not require explicit control of video quality over time, the rate at which content is fetched, or the rate at which memory ...
...And 2 more matches
Capabilities, constraints, and settings - Web APIs
ts exist, trying to see whether various things work or not and determining what errors occur, and so forth. the result has been a lot of very fragile code, or a reliance on libraries which figure this stuff out for you, then implement polyfills to patch the holes in the implementation on your behalf. the twin concepts of constraints and capabilities let the browser and web site or app exchange in
formation about what constrainable properties the browser's implementation supports and what values it supports for each one. this article discusses capabilities and constraints, as well as media settings, and includes an example we call the constraint exerciser. the constraint exerciser lets you experiment with the results of different constraint sets being applied to the audio and video tracks comin...
...ed by specifying the values or ranges of values it wishes to use for any of the constrainable properties about which it has a preference. the track's getconstraints() method returns the set of constraints passed into the most recent call to applyconstraints(). this may not represent the actual current state of the track, due to properties whose requested values had to be adjusted and because plat
form default values aren't represented. for a complete representation of the track's current configuration, use getsettings(). in the media stream api, both mediastream and mediastreamtrack have constrainable properties. determining if a constraint is supported if you need to know whether or not a given constriant is supported by the user agent, you can find out by calling navigator.mediadevices.g...
...ere is some interest in removing it from the specification, so it will not be discussed here. if you wish to learn more, see section 11 of the media capture and streams specification, past example 2. checking capabilities you can call mediastreamtrack.getcapabilities() to get a list of all of the supported capabilities and the values or ranges of values which each one accepts on the current plat
form and user agent. this function returns a mediatrackcapabilities object which lists each constrainable property supported by the browser and a value or range of values which are supported for each one of those properties. note: getcapabilities() hasn't been implemented yet by all major browsers. for the time being, you'll have to try to get what you need, and if you can't, decide what to do at th...
...And 2 more matches
Page Visibility API - Web APIs
h tabbed browsing, there is a reasonable chance that any given webpage is in the background and thus not visible to the user. the page visibility api provides events you can watch for to know when a document becomes visible or hidden, as well as features to look at the current visibility state of the page. notes: the page visibility api is especially useful for saving resources and improving per
formance by letting a page avoid per
forming unnecessary tasks when the document isn't visible. when the user minimizes the window or switches to another tab, the api sends a visibilitychange event to let listeners know the state of the page has changed. you can detect the event and per
form some actions or behave differently. for example, if your web app is playing a video, it can pause the video whe...
...rent document. hiding an <iframe> using css properties (such as display: none;) doesn't trigger visibility events or change the state of the document contained within the frame. use cases let's consider a few use cases for the page visibility api. a site has an image carousel that shouldn't advance to the next slide unless the user is viewing the page an application showing a dashboard of in
formation doesn't want to poll the server for updates when the page isn't visible a page wants to detect when it is being prerendered so it can keep accurate count of page views a site wants to switch off sounds when a device is in standby mode (user pushes power button to turn screen off) developers have historically used imperfect proxies to detect this. for example, watching for blur and focus ...
...t the active page, but it does not tell you that your page is actually hidden to the user. the page visibility api addresses this. note: while onblur and onfocus will tell you if the user switches windows, it doesn't necessarily mean it's hidden. pages only become hidden when the user switches tabs or minimizes the browser window containing the tab. policies in place to aid background page per
formance separately from the page visibility api, user agents typically have a number of policies in place to mitigate the per
formance impact of background or hidden tabs. these may include: most browsers stop sending requestanimationframe() callbacks to background tabs or hidden <iframe>s in order to improve per
formance and battery life. timers such as settimeout() are throttled in background/in...
...And 2 more matches
Using Pointer Events - Web APIs
cessing in the ongoingtouches for later processing, the start point is drawn as a small circle. we're using a 4-pixel wide line, so a 4 pixel radius circle will show up neatly. drawing as the pointers move each time one or more pointers moves, a pointermove event is delivered, resulting in our handlemove() function being called. its responsibility in this example is to update the cached touch in
formation and to draw a line from the previous position to the current position of each touch. function handlemove(evt) { var el = document.getelementsbytagname("canvas")[0]; var ctx = el.getcontext("2d"); var color = colorfortouch(evt); var idx = ongoingtouchindexbyid(evt.pointerid); log("continuing touch: idx = " + idx); if (idx >= 0) { ctx.beginpath(); log("ctx.moveto(" + ong...
...this is done by looking at each touch's pointerevent.pointerid property. this property is a unique integer for each pointer event, and remains consistent for each event during the duration of each finger's contact with the surface. this lets us get the coordinat...
...this is done by looking at each touch's pointerevent.pointerid property. this property is a unique integer for each pointer event, and remains consistent for each event during the duration of each finger's contact with the surface. this lets us get the coordinates of the previous position of each...
...And 2 more matches
RTCPeerConnection - Web APIs
ntremotedescription or rtcpeerconnection.remotedescription to get the current session description for the remote endpoint. for details on the difference, see pending and current descriptions in webrtc connectivity.remotedescription read only the read-only property rtcpeerconnection.remotedescription returns a rtcsessiondescription describing the session (which includes configuration and media in
formation) for the remote end of the connection. if this hasn't been set yet, this is null.sctp the read-only sctp property on the rtcpeerconnection interface returns an rtcsctptransport describing the sctp transport over which sctp data is being sent and received. if sctp hasn't been negotiated, this value is null.signalingstate read only the read-only signalingstate property on the rtcpeerconnectio...
...ddtrack() adds a new media track to the set of tracks which will be transmitted to the other peer.close() the rtcpeerconnection.close() method closes the current peer connection.createanswer() the createanswer() method on the rtcpeerconnection interface creates an sdp answer to an offer received from a remote peer during the offer/answer negotiation of a webrtc connection. the answer contains in
formation about any media already attached to the session, codecs and options supported by the browser, and any ice candidates already gathered. the answer is delivered to the returned promise, and should then be sent to the source of the offer to continue the negotiation process.createdatachannel() the createdatachannel() method on the rtcpeerconnection interface creates a new channel linked with th...
...iplet given in parameter: its name, the protocol used to communicate with it (optional) and an optional username. the idp will be used only when an assertion is needed.setlocaldescription()the rtcpeerconnection method setlocaldescription() changes the local description associated with the connection. this description specifies the properties of the local end of the connection, including the media
format.setremotedescription()the rtcpeerconnection method setremotedescription() sets the specified session description as the remote peer's current offer or answer. the description specifies the properties of the remote end of the connection, including the media
format. obsolete method the following method was obsoleted long ago and was never implemented in all major browsers. rtcpeerconnection.
...And 2 more matches
Reporting API - Web APIs
feature-policy violations. ...
... feature-policy violations. ...
... feature-policy violations. ...
...And 2 more matches
Screen Wake Lock API - Web APIs
ncepts and usage most devices by default turn off their screen after a specified amount of time to prolong the life of the hardware. modern devices do this to save on battery power. whilst this is a useful feature, some applications need the screen to stay awake to be their most useful. the screen wake lock api prevents the screen from turning off, dimming or locking. it allows for a simple plat
form based solution which up until now could only be achieved via workarounds which were potentially power hungry. only visible (active) documents can acquire the screen wake lock. there are plenty of use cases for keeping a screen on, including reading an ebook, map navigation, following a recipe, presenting to an audience, scanning a qr/barcode or applications that use voice or gesture control, rat...
... of use cases for keeping a screen on, including reading an ebook, map navigation, following a recipe, presenting to an audience, scanning a qr/barcode or applications that use voice or gesture control, rather than tactile input (the default way to keep a screen awake). you acquire a wakelocksentinel object by calling the navigator.wakelock.request() promise based method that resolves if the plat
form allows it. a request may be rejected for a number of reasons, including system settings (such as power save mode or low battery level) or if the document is not active or visible. the sentinel is attached to the underlying system wake lock. it can be released by the system, again if the battery power is too low or the document is not active or visible. it can also be released manually via the wa...
...o keep the screen on to benefit usability. it's a good idea to show some feedback on the interface to show if wake lock is active and a way for the user to disable it if they wish. screen wake lock api interfaces wakelock the wakelock interface prevents device screens from dimming or locking when an application needs to keep running. wakelocksentinel provides a handle to the underlying plat
form wake lock and if referenced can be manually released and reacquired. get an instance of the object by calling wakelock.request. navigator.wakelock returns a wakelock object instance, from which all other functionality can be accessed. examples feature detection this code checks for wake lock support and updates the ui accordingly. if ('wakelock' in navigator) { issupported = true; stat...
...And 2 more matches
Using readable streams - Web APIs
how do you use the streams api’s readable stream functionality? this article explains the basics. note: this article assumes that you understand the use cases of readable streams, and are aware of the high-level concepts. if not, we suggest that you first read the streams concepts and usage overview and dedicated streams api concepts article, then come back. note: if you are looking for in
formation on writable streams try using writable streams instead. browser support you can consume fetch body objects as streams and create your own custom readable streams in firefox 65+ and chrome 42+ (and equivalent chromium-based browsers). pipe chains are only supported in chrome at the moment, and that functionality is subject to change. finding some examples we will look at various examples...
....then(stream => new response(stream)) .then(response => response.blob()) .then(blob => url.createobjecturl(blob)) .then(url => console.log(image.src = url)) .catch(err => console.error(err)); let’s look in detail at how read() is used. 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 }. if the stream becomes closed, the promise will be fulfilled with an object of the
form { value: undefined, done: true }. if the stream becomes errored, t...
...are then read: function teestream() { const teedoff = stream.tee(); readstream(teedoff[0], list2); readstream(teedoff[1], list3); } pipe chains one very experimental feature of streams is the ability to pipe streams into one another (called a pipe chain). this involves two methods — readablestream.pipethrough(), which pipes a readable stream through a writer/reader pair to trans
form one data
format into another, and readablestream.pipeto(), which pipes a readable stream to a writer acting as an end point for the pipe chain. this functionality is at a very experimental stage and is subject to change, so we have no explored it too deeply as of yet. we have created an example called unpack chunks of a png (see it live also) that fetches an image as a stream, then pipes it thr...
...And 2 more matches
SubtleCrypto.sign() - Web APIs
hich will be fulfilled with the signature. you can use the corresponding subtlecrypto.verify() method to verify the signature. syntax const signature = crypto.subtle.sign(algorithm, key, data); parameters algorithm is a string or object that specifies the signature algorithm to use and its parameters: to use rsassa-pkcs1-v1_5, pass the string "rsassa-pkcs1-v1_5" or an object of the
form { "name": "rsassa-pkcs1-v1_5" }. to use rsa-pss, pass an rsapssparams object. to use ecdsa, pass an ecdsaparams object. to use hmac, pass the string "hmac" or an object of the
form { "name": "hmac" }. key is a cryptokey object containing the key to be used for signing. if algorithm identifies a public-key cryptosystem, this is the private key. data is an arraybuffer or arraybuffe...
...ect that you pass into generatekey(), or the hmacimportparams object that you pass into importkey(). examples note: you can try the working examples out on github. rsassa-pkcs1-v1_5 this code fetches the contents of a text box, encodes it for signing, and signs it with a private key. see the complete source code on github. /* fetch the contents of the "message" textbox, and encode it in a
form we can use for the sign operation. */ function getmessageencoding() { const messagebox = document.queryselector(".rsassa-pkcs1 #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } let encoded = getmessageencoding(); let signature = await window.crypto.subtle.sign( "rsassa-pkcs1-v1_5", privatekey, encoded ); rsa-pss this code fetc...
...ncoder(); return enc.encode(message); } let encoded = getmessageencoding(); let signature = await window.crypto.subtle.sign( "rsassa-pkcs1-v1_5", privatekey, encoded ); rsa-pss this code fetches the contents of a text box, encodes it for signing, and signs it with a private key. see the complete source code on github. /* fetch the contents of the "message" textbox, and encode it in a
form we can use for the sign operation. */ function getmessageencoding() { const messagebox = document.queryselector(".rsa-pss #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } let encoded = getmessageencoding(); let signature = await window.crypto.subtle.sign( { name: "rsa-pss", saltlength: 32, }, privatekey, encoded ); e...
...And 2 more matches
SubtleCrypto.verify() - Web APIs
const result = crypto.subtle.verify(algorithm, key, signature, data); parameters algorithm is a domstring or object defining the algorithm to use, and for some algorithm choices, some extra parameters. the values given for the extra parameters must match those passed into the corresponding sign() call. to use rsassa-pkcs1-v1_5, pass the string "rsassa-pkcs1-v1_5" or an object of the
form { "name": "rsassa-pkcs1-v1_5" }. to use rsa-pss, pass an rsapssparams object. to use ecdsa, pass an ecdsaparams object. to use hmac, pass the string "hmac" or an object of the
form { "name": "hmac" }. key is a cryptokey containing the key that will be used to verify the signature. it is the secret key for a symmetric algorithm and the public key for a public-key system. signature...
... that is either unknown or isn't suitable for a verify operation. supported algorithms the verify() method supports the same algorithms as the sign() method. examples note: you can try the working examples out on github. rsassa-pkcs1-v1_5 this code uses a public key to verify a signature. see the complete code on github. /* fetch the contents of the "message" textbox, and encode it in a
form we can use for sign operation. */ function getmessageencoding() { const messagebox = document.queryselector(".rsassa-pkcs1 #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature. * if it checks out, set the "valid" class on the signature. * otherwise set the "in...
..."invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( "rsassa-pkcs1-v1_5", publickey, signature, encoded ); signaturevalue.classlist.add(result ? "valid" : "invalid"); } rsa-pss this code uses a public key to verify a signature. see the complete code on github. /* fetch the contents of the "message" textbox, and encode it in a
form we can use for sign operation. */ function getmessageencoding() { const messagebox = document.queryselector(".rsa-pss #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature. * if it checks out, set the "valid" class on the signature. * otherwise set the "invalid...
...And 2 more matches
SubtleCrypto - Web APIs
that fulfills with a newly generated cryptokey derived from the master key and specific algorithm given as parameters. subtlecrypto.derivebits() returns a promise that fulfills with a newly generated buffer of pseudo-random bits derived from the master key and specific algorithm given as parameters. ...
...nerated buffer of pseudo-random bits derived from the master key and specific algorithm given as parameters. subtlecrypto.importkey() returns a promise that fulfills with a cryptokey corresponding to the
format, the algorithm, raw key data, usages, and extractability given as parameters. subtlecrypto.exportkey() returns a promise that fulfills with a buffer containing the key in the requested
format. subtlecrypto.wrapkey() returns a promise that fulfills with a wrapped symmetric key for usage (transfer and storage) in insecure environments. the wrapped key matches the
format specified in the given parameters, and wrapping is done by the given wrapping key, using the specified algorithm. subtlecrypto.unwrapkey() returns a promise that fulfills with a cryptokey corresponding to the wrapp...
...: * sign() and verify(): create and verify digital signatures. * encrypt() and decrypt(): encrypt and decrypt data. * digest(): create a fixed-length, collision-resistant digest of some data. key management functions except for digest(), all the cryptography functions in the api use cryptographic keys. in the subtlecrypto api a cryptographic key is represented using a cryptokey object. to per
form operations like signing and encrypting, you pass a cryptokey object into the sign() or encrypt() function. generating and deriving keys the generatekey() and derivekey() functions both create a new cryptokey object. the difference is that generatekey() will generate a new distinct key value each time you call it, while derivekey() derives a key from some initial keying material. if you provide...
...And 2 more matches
WebGLRenderingContext.compressedTexSubImage2D() - Web APIs
the webglrenderingcontext.compressedtexsubimage2d() method of the webgl api specifies a two-dimensional sub-rectangle for a texture image in a compressed
format. compressed image
formats must be enabled by webgl extensions before using this method or a webgl2renderingcontext must be used. ...
... the webglrenderingcontext.compressedtexsubimage2d() method of the webgl api specifies a two-dimensional sub-rectangle for a texture image in a compressed
format. compressed image
formats must be enabled by webgl extensions before using this method or a webgl2renderingcontext must be used. ...
...possible values: gl.texture_2d: a two-dimensional texture. ...
...And 2 more matches
WebGLRenderingContext.renderbufferStorage() - Web APIs
possible values: gl.rgba4: 4 red bits, 4 green bits, 4 blue bits 4 alpha bits. gl.rgb565: 5 red bits, 6 green bits, 5 blue bits. ...
...possible values: gl.rgba4: 4 red bits, 4 green bits, 4 blue bits 4 alpha bits. gl.rgb565: 5 red bits, 6 green bits, 5 blue bits. ...
...possible values: gl.rgba4: 4 red bits, 4 green bits, 4 blue bits 4 alpha bits. gl.rgb565: 5 red bits, 6 green bits, 5 blue bits. ...
...And 2 more matches
Web Speech API - Web APIs
n service) and respond appropriately. generally you'll use the interface's constructor to create a new speechrecognition object, which has a number of event handlers available for detecting when speech is input through the device's microphone. the speechgrammar interface represents a container for a particular set of grammar that your app should recognise. grammar is defined using jspeech grammar
format (jsgf.) speech synthesis is accessed via the speechsynthesis interface, a text-to-speech component that allows programs to read out their text content (normally via the device's default speech synthesiser.) different voice types are represented by speechsynthesisvoice objects, and different parts of text that you want to be spoken are represented by speechsynthesisutterance objects. you can ge...
... speechrecognitionresult represents a single recognition match, which may contain multiple speechrecognitionalternative objects. speechrecognitionresultlist represents a list of speechrecognitionresult objects, or a single one if results are being captured in continuous mode. ...
...ltlist represents a list of speechrecognitionresult objects, or a single one if results are being captured in continuous mode. speech synthesis speechsynthesis the controller interface for the speech service; this can be used to retrieve in
formation about the synthesis voices available on the device, start and pause speech, and other commands besides. speechsynthesiserrorevent contains in
formation about any errors that occur while processing speechsynthesisutterance objects in the speech service. ...
...And 2 more matches
Functions and classes available to Web Workers - Web APIs
h a few features are later.) no support 42 41 behind pref 10.1 filereader this api allows asynchronous read of blob and file objects. 46 (46) no support (yes) no support filereadersync this api allows synchronous read of blob and file objects. this is an api that works only in workers. 8 (8) no support no support no support
formdata
formdata objects provide a way to easily construct a set of key/value pairs representing
form fields and their values, which can then be easily sent using the xmlhttprequest send() method. ? (should be in 39 (39)) ? (yes) ? imagedata the underlying pixel data of an area of a canvas element. manipulating such data can be a complex task better suited to be delegated t...
...magedata the underlying pixel data of an area of a canvas element. manipulating such data can be a complex task better suited to be delegated to a web worker. 25 (25) no support no support no support indexeddb database to store records holding simple values and hierarchical objects. 37 (37), 42 (42) for idbcursorwithvalue. ...
...ixel data of an area of a canvas element. manipulating such data can be a complex task better suited to be delegated to a web worker. 25 (25) no support no support no support indexeddb database to store records holding simple values and hierarchical objects. 37 (37), 42 (42) for idbcursorwithvalue. ...
...And 2 more matches
Using Web Workers - Web APIs
once created, a worker can send messages to the javascript code that created it by posting messages to an event handler specified by that code (and vice versa). this article provides a detailed introduction to using web workers. web workers api a worker is an object created using a constructor (e.g. ...
... "querymethodlisteners", "querymethodarguments" can be anything as long as they are consistent in queryableworker and the worker. passing data by transferring ownership (transferable objects) google chrome 17+ and firefox 18+ contain an additional way to pass certain types of objects (transferable objects, that is objects implementing the transferable interface) to or from a worker with high per
formance. transferable objects are transferred from one context to another with a zero-copy operation, which results in a vast per
formance improvement when sending large data sets. think of it as pass-by-reference if you're from the c/c++ world. however, unlike pass-by-reference, the 'version' from the calling context is no longer available once transferred. its ownership is transferred to the new con...
...in app to a worker script, the original arraybuffer is cleared and no longer usable. its content is (quite literally) transferred to the worker context. // create a 32mb "file" and fill it. var uint8array = new uint8array(1024 * 1024 * 32); // 32mb for (var i = 0; i < uint8array.length; ++i) { uint8array[i] = i; } worker.postmessage(uint8array.buffer, [uint8array.buffer]); note: for more in
formation on transferable objects, per
formance, and feature-detection for this method, read transferable objects: lightning fast! on html5 rocks. embedded workers there is not an "official" way to embed the code of a worker within a web page, like <script> elements do for normal scripts. but a <script> element that does not have a src attribute and has a type attribute that does not identify an exe...
...And 2 more matches
Window.open() - Web APIs
blank page is opened into the targeted browsing context. windowname optional a domstring specifying the name of the browsing context (window, <iframe> or tab) into which to load the specified resource; if the name doesn't indicate an existing context, a new window is created and is given the name specified by windowname. this name can be used as the target for the target attribute of <a> or <
form> elements. the name should not contain whitespace. keep in mind that this will not be used as the window's title. windowfeatures optional a domstring containing a comma-separated list of window features given with their corresponding values in the
form "name=value". these features include options such as the window's default size and position, whether or not to include toolbar, and so forth. th...
...ful for preventing untrusted sites opened via window.open() from tampering with the originating window, and vice versa. note that when noopener is used, nonempty target names other than _top, _self, and _parent are all treated like _blank in terms of deciding whether to open a new window/tab. this is supported in modern browsers including chrome, and firefox 52+. see rel="noopener" for more in
formation and for browser compatibility details, including in
formation about ancillary effects. noreferrer if this feature is set, the request to load the content located at the specified url will be loaded with the request's referrer set to noreferrer; this prevents the request from sending the url of the page that initiated the request to the server where the request is sent. in addition, setting ...
...s feature is set, the request to load the content located at the specified url will be loaded with the request's referrer set to noreferrer; this prevents the request from sending the url of the page that initiated the request to the server where the request is sent. in addition, setting this feature also automatically sets noopener. see rel="noreferrer" for additional details and compatibility in
formation. firefox introduced support for noreferrer in firefox 68. 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 */ {...
...And 2 more matches
Window: popstate event - Web APIs
ut(dosomething, 0); when popstate is sent when the transition occurs, either due to the user triggering the browser's "back" button or otherwise, the popstate event is near the end of the process to transition to the new location. it happens after the new location has loaded (if needed), displayed, made visible, and so on, after the pageshow event is sent, but before the persisted user state in
formation is restored and the hashchange event is sent. to better understand when the popstate event is fired, consider this simplified sequence of events that occurs when the current history entry changes due to either the user navigating the site or the history being traversed programmatically. here, the transition is changing the current history entry to one we'll refer to as new-entry. the curren...
... before continuing. this will eventually send events such as domcontentloaded and load to the window containing the document, but the steps below will continue to execute in the meantime. if current-entry's title wasn't set using one of the history api methods (pushstate() or replacestate(), set the entry's title to the string returned by its document.title attribute. if the browser has state in
formation it wishes to store with the current-entry before navigating away from it, it then does so. the entry is now said to have "persisted user state." this in
formation the browser might add to the history session entry may include, for instance, the document's scroll position, the values of
form inputs, and other such data. if new-entry has a different document object than current-entry, the brow...
...see the html autocomplete attribute for more about the autocomplete field names and how autocomplete works. ...
...And 2 more matches
Window.speechSynthesis - Web APIs
nthesis; value a speechsynthesis object. examples in our basic speech synthesiser demo, we first grab a reference to the speechsynthesis controller using window.speechsynthesis. after defining some necessary variables, we retrieve a list of the voices available using speechsynthesis.getvoices() and populate a select menu with them so the user can choose what voice they want. ...
... object. examples in our basic speech synthesiser demo, we first grab a reference to the speechsynthesis controller using window.speechsynthesis. after defining some necessary variables, we retrieve a list of the voices available using speechsynthesis.getvoices() and populate a select menu with them so the user can choose what voice they want. ...
...se what voice they want. inside the input
form.onsubmit handler, we stop the
form submitting with preventdefault(), create a new speechsynthesisutterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method. ...
...And 2 more matches
Window - Web APIs
w is closed or not. window.console read only returns a reference to the console object which provides access to the browser's debugging console. window.controllers read only returns the xul controller objects for the current chrome window. window.customelements read only returns a reference to the customelementregistry object, which can be used to register new custom elements and get in
formation about previously registered custom elements. window.crypto read only returns the browser crypto object. window.devicepixelratio read only returns the ratio between physical pixels and device independent pixels in the current display. window.document read only returns a reference to the document that the window contains. window.dommatrix read only returns a reference to a dommat...
.... window.outerheight read only gets the height of the outside of the browser window. window.outerwidth read only gets the width of the outside of the browser window. window.pagexoffset read only an alias for window.scrollx. window.pageyoffset read only an alias for window.scrolly window.parent read only returns a reference to the parent of the current window or subframe. window.per
formance read only returns a per
formance object, which includes the timing and navigation attributes, each of which is an object providing per
formance-related data. see also using navigation timing for additional in
formation and examples. window.personalbar read only returns the personalbar object, whose visibility can be toggled in the window. window.screen read only returns a reference to th...
... multiple storage objects that were used for storing data across multiple pages. window.mozanimationstarttime the time in milliseconds since epoch at which the current animation cycle began. use animation.starttime instead. window.mozpaintcount returns the number of times the current document has been rendered to the screen in this window. this can be used to compute rendering per
formance. window.orientation read only returns the orientation in degrees (in 90 degree increments) of the viewport relative to the device's natural orientation. window.pkcs11
formerly provided access to install and remove pkcs11 modules. window.returnvalue the return value to be returned to the function that called window.showmodaldialog() to display the window as a modal dialog. metho...
...And 2 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
. etiam sit amet ligula quis urna auctor imperdiet nec faucibus ante. mauris vel consectetur dolor. nunc eget elit eget velit pulvinar fringilla consectetur aliquam purus. curabitur convallis, justo posuere porta egestas, velit erat ornare tortor, non viverra justo diam eget arcu. phasellus adipiscing fermentum nibh ac commodo. nam turpis nunc, suscipit a hendrerit vitae, volutpat non ipsum.</p> <
form> <p>phasellus ac nisl lorem: <input type="text" /><br /> <textarea style="width: 400px; height: 200px;">nullam commodo suscipit lacus non aliquet. phasellus ac nisl lorem, sed facilisis ligula. nam cursus lobortis placerat. sed dui nisi, elementum eu sodales ac, placerat sit amet mauris. pellentesque dapibus tellus ut ipsum aliquam eu auctor dui vehicula. quisque ultrices laoreet erat, at ultrice...
...rnare, erat a porta tempus, velit justo fermentum elit, a fermentum metus nisi eu ipsum. vivamus eget augue vel dui viverra adipiscing congue ut massa. praesent vitae eros erat, pulvinar laoreet magna. maecenas vestibulum mollis nunc in posuere. pellentesque sit amet metus a turpis lobortis tempor eu vel tortor. cras sodales eleifend interdum.</textarea></p> <input type="submit" value="send" /> </
form> <p>duis lobortis sapien quis nisl luctus porttitor. in tempor semper libero, eu tincidunt dolor eleifend sit amet. ut nec velit in dolor tincidunt rhoncus non non diam. morbi auctor ornare orci, non euismod felis gravida nec. curabitur elementum nisi a eros rutrum nec blandit diam placerat. aenean tincidunt risus ut nisi consectetur cursus. ut vitae quam elit. donec dignissim est in quam tempor ...
... the context from which your function was called. also, es2015 supports arrow functions, with lexical this allowing us to write setinterval( () => this.mymethod) if we're inside myarray method. minidaemon - a framework for managing timers in pages requiring many timers, it can often be difficult to keep track of all of the running timer events. one approach to solving this problem is to store in
formation about the state of a timer in an object. following is a minimal example of such an abstraction. the constructor architecture explicitly avoids the use of closures. it also offers an alternative way to pass the this object to the callback function (see the "this" problem for details). the following code is also available on github. for a more complex but still modular version of it (daemon) ...
...And 2 more matches
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
see the usage notes and examples for details. ...
...plying the recommended resolution as identified by the xrsession by this value will result in the actual native resolution of the xr hardware. ...
...in this case, the value returned by xrwebgllayer.getnativeframebufferscalefactor() will be 2.0. this method of dividing the frame buffer between views is shown in the following diagram. ...
...And 2 more matches
Using the aria-required attribute - Accessibility
description the aria-required attribute is used to indicate that user input is required on an element before a
form can be submitted. this attribute can be used with any typical html
form element; it is not limited to elements that have an aria role assigned. html5 now has the required attribute, but aria-required is still useful for user agents that do not yet support html5. value true or false (default: false) possible effects on user agents and assistive technology screen readers should announce the field as required. note that this attribute will not automatically change the presentation of the field. note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. ex...
...ossible effects on user agents and assistive technology screen readers should announce the field as required. note that this attribute will not automatically change the presentation of the field. note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. ...
...fects on user agents and assistive technology screen readers should announce the field as required. note that this attribute will not automatically change the presentation of the field. note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. ...
...And 2 more matches
ARIA annotations - Accessibility
within. ...
...alone. ...
... 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">choose 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" va...
...And 2 more matches
ARIA: application role - Accessibility
ques should be used. this role should only be used to define very dynamic and desktop-like web applications. <div role="application">...</div> this defines this div element and all of its descendants to be treated like they are part of a desktop application. description the application role indicates to assistive technologies that this part of the web content contains elements that do not con
form to any other known html element or wai-aria widget. any sort of special interpretation of html structures and widgets should be suspended, and control should be completely handed over to the browser and web application to handle mouse, keyboard, or touch interaction. in this mode, the web author is completely responsible for handling any and all keyboard input, focus management, and other intera...
...t sense for a blind user to consume the content. this is often referred to as virtual document, browse mode, or similar terms. the document is streamlined to a single-column view. a keyboard interaction model is generated that is very similar to a word processor where users can read line by line, sentence by sentence, or paragraph by paragraph. the at will read any semantics like links, headings,
form controls, tables, lists, or images. in addition, a set of so-called quick navigation keys has been established over the years that allows blind users to skim through a page via a certain element type. such elements usually include headings,
form fields, lists, tables, links, graphics, or landmark regions. for all of this to work, ats intercept almost all keyboard input and consume it themselves...
...ables, links, graphics, or landmark regions. for all of this to work, ats intercept almost all keyboard input and consume it themselves, letting nothing through to the browser or other user agent. to be able to interact with a web page, a standard set of widgets is recognized that, when pressing a certain key (usually the enter key) this mode is switched off. the screen reader mode, often called
forms mode or focus mode, lets all keyboard input go through to the browser again. escape is the most common way of switching back to browse mode. the application role is designed to provide a means for widgets that are not part of the standard set to be accessible for direct interaction in ats that use both browse and focus modes for interacting with web content. associated wai-aria roles, states, ...
...And 2 more matches
ARIA: search role - Accessibility
the search landmark role is used to identify a section of the page used to search the page, site, or collection of sites. <
form role="search"> <!-- search input --> </
form> description the search role is a landmark. landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. the search role is added to the container element that encompasses the items and objects that, as a whole, combine to create search functionality. when a <
form> is a search
form, use the search role instead of
form. if a document includes more than one search, each should have a unique label. ...
... the search role is added to the container element that encompasses the items and objects that, as a whole, combine to create search functionality. when a <
form> is a search
form, use the search role instead of
form. if a document includes more than one search, each should have a unique label. while there is a input of type search, there is html element that defines a search landmark. examples <
form id="search" role="search"> <label for="search-input">search this site</label> <input type="search" id="search-input" name="search" spellcheck="false"> <input value="submit" type="submit"> </
form> accessibility concerns landmark roles are intended to be used sparingly, to identify larger overall sections of the document. using too many landmark roles can create "noise" in screen readers, ...
..."search-input" name="search" spellcheck="false"> <input value="submit" type="submit"> </
form> accessibility concerns landmark roles are intended to be used sparingly, to identify larger overall sections of the document. using too many landmark roles can create "noise" in screen readers, making it difficult to understand the overall layout of the page. best practices prefer html using the <
form> element in conjunction with a declaration of role="search" will provide the largest amount of support. labeling landmarks multiple landmarks if there is more than one search landmark role in a document, provide a label for each landmark. ...
...And 2 more matches
Web applications and ARIA FAQ - Accessibility
aria provides a means to make web applications and widgets more accessible to a diverse range of users, including those who use assistive technologies such as screen readers or magnifiers. aria provides additional semantics to describe the role, state, and functionality of many familiar user interface controls, such as menus, sliders, trees, and dialogs. it also provides additional structural in
formation, helping authors identify landmarks, regions, and grids on their pages. aria enables dynamic, javascript-driven applications and widgets to interoperate with a variety of desktop-based assistive technologies. for more in
formation about how to create accessible widgets with aria, see the overview of accessible web applications and widgets. where is aria supported? aria is a relatively new ...
...ns. for notes on jaws support for aria as of jaws 10, see this article from the paciello group: jaws support for aria. javascript toolkits aria roles, states, and properties have been added to a number of popular javascript user interface toolkits, including: dojo/dijit jquery ui fluid infusion google closure google web toolkit bbc glow yahoo! user interface library (yui) for more in
formation about javascript toolkit accessibility: steve faulkner's wai-aria implementation in javascript ui libraries can you show me an example of aria in action? sure. here's the markup for a progress bar widget: <div id="percent-loaded" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" /> this progress bar is built using a <div>, which is not very descriptive. unfo...
...oaded" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" /> this progress bar is built using a <div>, which is not very descriptive. unfortunately, there isn't a more semantic tag available to developers in html 4, so we need to include aria roles and properties. these are specified by adding attributes to the element. in this example, the role="progressbar" attribute in
forms the browser that this element is actually a javascript-powered progress bar widget. the aria-valuemin and aria-valuemax attributes specify the minimum and maximum values for the progress bar, and the aria-valuenow describes the current state of it. along with placing them directly in the markup, aria attributes can be added to the element and updated dynamically using javascript code like this:...
...And 2 more matches
:focus-within - CSS: Cascading Style Sheets
element that has received focus. in other words, it represents an element that is itself matched by the :focus pseudo-class or has a descendant that is matched by :focus. ...
...s or has a descendant that is matched by :focus. (this includes descendants in shadow trees.) /* selects a <div> when one of its descendants is focused */ div:focus-within { background: cyan; } this selector is useful, to take a common example, for highlighting an entire <
form> container when the user focuses on one of its <input> fields. syntax :focus-within examples in this example, the
form will receive special coloring styles when either text input receives focus. ...
...> when one of its descendants is focused */ div:focus-within { background: cyan; } this selector is useful, to take a common example, for highlighting an entire <
form> container when the user focuses on one of its <input> fields. syntax :focus-within examples in this example, the
form will receive special coloring styles when either text input receives focus. ...
...And 2 more matches
:invalid - CSS: Cascading Style Sheets
the :invalid css pseudo-class represents any <input> or other <
form> element whose contents fail to validate. /* selects any invalid <input> */ input:invalid { background-color: pink; } this pseudo-class is useful for highlighting field errors for the user. syntax :invalid examples this example presents a simple
form that colors elements green when they validate and red when they don't. ...
...nvalid css pseudo-class represents any <input> or other <
form> element whose contents fail to validate. /* selects any invalid <input> */ input:invalid { background-color: pink; } this pseudo-class is useful for highlighting field errors for the user. syntax :invalid examples this example presents a simple
form that colors elements green when they validate and red when they don't. ...
...alid examples this example presents a simple
form that colors elements green when they validate and red when they don't. ...
...And 2 more matches
CSS Containment - CSS: Cascading Style Sheets
the specification defines a single css property contain. this document describes the basic aims of the specification. basic example many webpages contain a number of sections which are independent of each other. for example a listing of article headlines and content, as in the mark-up below. ...
... <h2>another heading of another article</h2> <p>more content here.</p> </article> each article has the contain property with a value of content applied in the css. article { contain: content; } each article is independent of the other articles on the page, and so they have been given contain: content in order to indicate to the browser that this is the case. the browser can then use this in
formation to make decisions about how to render the content. for example, it might not render articles that are outside the viewable area. if we give each <article> the contain property with a value of content, when new elements are inserted the browser understands it does not need to relayout or repaint any area outside of the containing element's subtree, although if the <article> is styled such th...
... may need to account for its size changing). we have told it by way of the contain property that each article is independent. the content value is shorthand for contain: layout paint. it tells the browser that the internal layout of the element is totally separate from the rest of the page, and that everything about the element is painted inside its bounds. nothing can visibly overflow. this in
formation is something that is usually known, and in fact quite obvious, to the web developer creating the page. however browsers cannot guess at your intent and cannot assume that an article will be entirely self-contained. therefore this property gives you a nice way to explain to the browser this fact, and allow it to make per
formance optimizations based on that knowledge. key concepts and termino...
...And 2 more matches
Typical use cases of Flexbox - CSS: Cascading Style Sheets
so in order to get alignment capabilities. this is something that may well change once box alignment is implemented in block layout. in this guide i look at some of the typical things you might use flexbox for today. navigation a common pattern for navigation is to have a list of items displayed as a horizontal bar. this pattern, as basic as it seems, was difficult to achieve before flexbox. it
forms the most simple of flexbox examples, and could be considered the ideal flexbox use case. when we have a set of items that we want to display horizontally, we may well end up with additional space. we need to decide what to do with that space, and have a couple of options. we either display the space outside of the items — therefore spacing them out with white space between or around them — ...
...tern in web design — this pattern has an image or other element to one side and text to the right. ideally a media object should be able to be flipped — moving the image from left to right. we see this pattern everywhere, used for comments, and anywhere we need to display images and descriptions. with flexbox we can allow the part of the media object containing the image to take its sizing in
formation from the image, and then the body of the media object flexes to take up the remaining space. in the live example below you can see our media object. i have used the alignment properties to align the items on the cross axis to flex-start, and then set the .content flex item to flex: 1. as with our column layout card pattern above, using flex: 1 means this part of the card can grow. some t...
... display of the media object so that the image is on the right and the content is on the left we can use the flex-direction property set to row-reverse. the media object now displays the other way around. i have achieved this in the live example by adding a class of flipped alongside the existing .media class. this means you can see how the display changes by removing that class from the html.
form controls flexbox is particularly useful when it comes to styling
form controls.
forms have lots of markup and lots of small elements that we typically want to align with each other. a common pattern is to have an <input> element paired with a <button>, perhaps for a search
form or where you simply want your visitor to enter an email address. flexbox makes this type of layout easy to achieve. i ...
...And 2 more matches
OpenType font features guide - CSS: Cascading Style Sheets
these are all referred to as opentype features, and are made available to use on the web via specific properties and a low-level control property — font-feature-settings. ...
...ing and reading more even and smooth. fractions can make home improvement and recipe sites much easier to read and understand. numerals within paragraphs of text set as 'oldstyle' sit more comfortably between lower-case letters, and likewise setting them as 'tabular numbers' will make them line up better when setting a list of costs in a table say. 'lining' figures on the other hand sit more uni
formly on their own or in front of capitalized words. while none of these features individually will render a site useless due to their absence, each of them in turn can make a site easier to use and more memorable for its attention to detail. opentype features are like secret compartments in fonts. unlock them and you'll find ways to make fonts look and behave differently in subtle and dramatic w...
...to make fonts look and behave differently in subtle and dramatic ways. not all opentype features are appropriate to use all of the time, but some features are critical for great typography. -- tim brown, head of typography at adobe. sometimes it's substance, not just style there are some cases — like with font-variant-east-asian — that opentype features are directly tied to using different
forms of certain glyphs, which can impact meaning and readability. in cases such as these it's more than just a nicety, but rather an integral part of the content itself. the font features there are a number of different features to consider. they are grouped and explained here according to the main attributes and options covered in the w3c specifications. note: the examples below show the propert...
...And 2 more matches
Layout and the containing block - CSS: Cascading Style Sheets
, and offset properties of an absolutely positioned element (i.e., which has its position set to absolute or fixed) are computed from the element's containing block. ...
...ing the containing block the process for identifying the containing block depends entirely on the value of the element's position property: if the position property is static, relative, or sticky, the containing block is
formed by the edge of the content box of the nearest ancestor element that is either a block container (such as an inline-block, block, or list-item element) or establishes a
formatting context (such as a table container, flex container, grid container, or the block container itself). if the position property is absolute, the containing block is
formed by the edge of the padding box of the nearest ancestor element that has a position value other than static (fixed, absolute, relative, or sticky). if the position property is fixed, the containing block is established by t...
...ed by the edge of the padding box of the nearest ancestor element that has a position value other than static (fixed, absolute, relative, or sticky). if the position property is fixed, the containing block is established by the viewport (in the case of continuous media) or the page area (in the case of paged media). if the position property is absolute or fixed, the containing block may also be
formed by the edge of the padding box of the nearest ancestor element that has the following: a trans
form or perspective value other than none a will-change value of trans
form or perspective a filter value other than none or a will-change value of filter (only works on firefox). a contain value of paint (e.g. contain: paint;) note: the containing block in which the root element...
...And 2 more matches
animation - CSS: Cascading Style Sheets
direction | fill-mode | play-state | name */ animation: 3s ease-in 1s 2 reverse both paused slidein; /* @keyframes name | duration | timing-function | delay */ animation: 3s linear 1s slidein; /* @keyframes name | duration */ animation: slidein 3s; <div class="grid"> <div class="col"> <div class="note"> given the following animation: <pre>@keyframes slidein { from { trans
form: scalex(0); } to { trans
form: scalex(1); } }</pre> </div> <div class="row"> <div class="cell"> <button class="play" title="play"></button> </div> <div class="cell flx"> <div class="overlay">animation: 3s ease-in 1s 2 reverse both paused slidein;</div> <div class="animation a1"></div> </div> </div> <div class="row"> <div cla...
...ay: flex; flex: 1 auto; flex-direction: column; } .cell { box-sizing: border-box; margin: .5em; padding: 0; background-color: #fff; overflow: hidden; text-align: left; } .flx { flex: 1 0; } .note { background: #fff3d4; padding: 1em; margin: .5em; font: .8em sans-serif; text-align: left; flex: none; } .overlay { padding: .5em; } @keyframes slidein { from { trans
form: scalex(0); } to { trans
form: scalex(1); } } .a1 { animation: 3s ease-in 1s 2 reverse both paused slidein; } .a2 { animation: 3s linear 1s slidein; } .a3 { animation: 3s slidein; } .animation { background: #3f87a6; width: 100%; height: calc(100% - 1.5em); trans
form-origin: left center; } window.addeventlistener('load', function () { var animation = array.from(document.queryselector...
...limentary experience for users who have expressed a preference for no animated experiences. ...
...And 2 more matches
calc() - CSS: Cascading Style Sheets
it can be used anywhere a <length>, <frequency>, <angle>, <time>, <percentage>, <number>, or <integer> is allowed. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* property: calc(expression) */ width: calc(100% - 80px); the calc() function takes a single expression as its parameter, with the expression's result used as the value. the expression can be any simple expression combining the following operators, using standard operator precedence rules: + addition. - subtraction. ...
...ero results in an error being generated by the html parser. math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been specified. it is permitted to nest calc() functions, in which case the inner ones are treated as simple parentheses. ...
...stretches across the window, with a 40-pixel gap between both sides of the banner and the edges of the window: .banner { position: absolute; left: 40px; width: calc(100% - 80px); border: solid black 1px; box-shadow: 1px 2px; background-color: yellow; padding: 6px; text-align: center; box-sizing: border-box; } <div class="banner">this is a banner!</div> automatically sizing
form fields to fit their container another use case for calc() is to help ensure that
form fields fit in the available space, without extruding past the edge of their container, while maintaining an appropriate margin. let's look at some css: input { padding: 2px; display: block; width: calc(100% - 1em); } #
formbox { width: calc(100% / 6); border: 1px solid black; padding: 4px; } her...
...And 2 more matches
<display-inside> - CSS: Cascading Style Sheets
otherwise it generates a block container box. ...
...the display property, and can be used for legacy purposes as a single keyword, or as defined in the level 3 specification alongside a value from the <display-outside> keywords. syntax valid <display-inside> values: flow the element lays out its contents using flow layout (block-and-inline layout). if its outer display type is inline or run-in, and it is participating in a block or inline
formatting context, then it generates an inline box. otherwise it generates a block container box. depending on the value of other properties (such as position, float, or overflow) and whether it is itself participating in a block or inline
formatting context, it either establishes a new block
formatting context (bfc) for its contents or integrates its contents into its parent
formatting context. ...
... table these elements behave like html <table> elements. it defines a block-level box. ...
...And 2 more matches
font-size-adjust - CSS: Cascading Style Sheets
etermined by the x-height of the font) are the specified number times the font-size. the number specified should generally be the aspect ratio (ratio of x-height to font size) of the first choice font-family. this means that the first-choice font, when available, will appear the same size in browsers, whether or not they support font-size-adjust. 0 yields text of zero height (hidden text). ...
...ize) of the first choice font-family. this means that the first-choice font, when available, will appear the same size in browsers, whether or not they support font-size-adjust. 0 yields text of zero height (hidden text).
formal definition initial valuenoneapplies toall elements. ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfont-size-adjustchrome full support 43disabled full support 43disabled disabled from version 43: this feature is behind the enable experimental web plat
form features preference. to change preferences in chrome, visit chrome://flags.edge full support 79disabled full support 79disabled disabled from version 79: this feature is behind the enable experimental web plat
form features preference.firefox full support 40 ...
...And 2 more matches
font-variant-alternates - CSS: Cascading Style Sheets
the font-variant-alternates css property controls the usage of alternate glyphs. these alternate glyphs may be referenced by alternative names defined in @font-feature-values. ...
...lternates: inherit; font-variant-alternates: unset; the @font-feature-values at-rule can define names for alternative glyph functions (stylistic, styleset, character-variant, swash, ornament or annotation), associating the name with opentype parameters. this property allows those human-readable names (defined in @font-feature-values) in the stylesheet. syntax this property may take one of two
forms: either the keyword normal or one or more of the other keywords and functions listed below, space-separated, in any order. values normal this keyword deactivates alternate glyphs. historical-
forms this keyword enables historical
forms — glyphs that were common in the past but not today. it corresponds to the opentype value hist. stylistic() this function enables stylistic alterna...
...s should include ornaments that don't match unicode dingbat characters as ornamental variants of the bullet character (u+2022). be aware that some existing fonts don't follow this advice. annotation() this function enables annotations, like circled digits or inverted characters. the parameter is a font-specific name mapped to a number. it corresponds to the opentype value nalt, like nalt 2. ...
...And 2 more matches
font-variant-ligatures - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...-values> */ font-variant-ligatures: no-contextual; /* <contextual-alt-values> */ /* global values */ font-variant-ligatures: inherit; font-variant-ligatures: initial; font-variant-ligatures: unset; the font-variant-ligatures property is specified as one of the keyword values listed below. values normal this keyword leads to the activation of the usual ligatures and contextual
forms needed for correct rendering. the ligatures and
forms activated depend on the font, language and kind of script. this is the default value. none this keyword specifies that all ligatures and contextual
forms are disabled, even common ones. <common-lig-values> these values control the most common ligatures, like for fi, ffi, th or similar. they correspond to the opentype values liga and clig.
...ntextual-alt-values> these values control whether letters adapt to their context—that is, whether they adapt to the surrounding letters. these values correspond to the opentype values calt. two values are possible: contextual specifies that the contextual alternates are to be used. note that the keyword normal usually activates these ligatures too. no-contextual prevents their use. ...
...And 2 more matches
font-variant-numeric - CSS: Cascading Style Sheets
values normal this keyword leads to the deactivation of the use of such alternate glyphs. ordinal this keyword forces the use of special glyphs for the ordinal markers, like 1st, 2nd, 3rd, 4th in english or a 1a in italian. it corresponds to the opentype values ordn. slas...
.... two values are possible: diagonal-fractions activating the set of figures where the numerator and denominator are made smaller and separated by a slash. it corresponds to the opentype values frac. stacked-fractions activating the set of figures where the numerator and denominator are made smaller, stacked and separated by a horizontal line. it corresponds to the opentype values afrc. ...
...o the opentype values frac. stacked-fractions activating the set of figures where the numerator and denominator are made smaller, stacked and separated by a horizontal line. it corresponds to the opentype values afrc.
formal definition initial valuenormalapplies toall elements. ...
...And 2 more matches
font-weight - CSS: Cascading Style Sheets
atorsans) and is used here under the terms of its license: https://github.com/letterror/mutatorsans/blob/master/license */ @font-face { src: url('https://mdn.mozillademos.org/files/16011/mutatorsans.ttf'); font-family:'mutatorsans'; font-style: normal; } label { font: 1rem monospace; white-space: nowrap; } .container { max-height: 150px; overflow-y: auto; } .sample { text-trans
form: uppercase; font: 1.5rem 'mutatorsans', sans-serif; } html, body { max-height: 100vh; max-width: 100vw; overflow: hidden; } body { display: flex; flex-direction: column; } header { margin-bottom: 1.5rem; } .container { flex-grow: 1; } .container > p { margin-top: 0; margin-bottom: 0; } javascript let weightlabel = document.queryselector('label[for="weight"]'); let w...
...ddeventlistener('input', update); update(); accessibility concerns people experiencing low vision conditions may have difficulty reading text set with a font-weight value of 100 (thin/hairline) or 200 (extra light), especially if the font has a low contrast color ratio. ...
...t), especially if the font has a low contrast color ratio. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.8 | w3c understanding wcag 2.0
formal definition initial valuenormalapplies toall elements. ...
...And 2 more matches
mask-border-slice - CSS: Cascading Style Sheets
the mask-border-slice css property divides the image set by mask-border-source into regions. these regions are used to
form the components of an element's mask border. syntax /* all sides */ mask-border-slice: 30%; /* vertical | horizontal */ mask-border-slice: 10% 30%; /* top | horizontal | bottom */ mask-border-slice: 30 30% 45; /* top | right | bottom | left */ mask-border-slice: 7 12 14 5; /* using the `fill` keyword */ mask-border-slice: 10% fill 7 12; /* global values */ mask-border-slice: inherit; mask-border-slice: initial; mask-border-slice: unset; the mask-border-slice property may be specified using one to four <number-percentage> values to represent the position of each image slice. negative values are invalid; values greater than their corresponding dimension are clamped...
...d to match the top and left image regions, respectively. description the slicing process creates nine regions in total: four corners, four edges, and a middle region. four slice lines, set a given distance from their respective sides, control the size of the regions. the above diagram illustrates the location of each region. zones 1-4 are corner regions. each one is used a single time to
form the corners of the final border image. zones 5-8 are edge regions. these are repeated, scaled, or otherwise modified in the final border image to match the dimensions of the element. zone 9 is the middle region. it is discarded by default, but is used like a background image if the keyword fill is set. the mask-border-repeat, mask-border-width, and mask-border-outset properties determine how ...
...border image. zones 5-8 are edge regions. these are repeated, scaled, or otherwise modified in the final border image to match the dimensions of the element. zone 9 is the middle region. it is discarded by default, but is used like a background image if the keyword fill is set. ...
...And 2 more matches
perspective - CSS: Cascading Style Sheets
. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword value */ perspective: none; /* <length> values */ perspective: 20px; perspective: 3.5em; /* global values */ perspective: inherit; perspective: initial; perspective: unset; values none indicates that no perspective trans
form is to be applied. <length> a <length> giving the distance from the user to the z=0 plane. it is used to apply a perspective trans
form to the element and its content. if the value is 0 or a negative number, no perspective trans
form is applied. description each 3d element with z>0 becomes larger; each 3d-element with z<0 becomes smaller. the strength of the effect is determined by the value of...
...lue of the perspective css property — are not drawn. the vanishing point is by default placed at the center of the element, but its position can be changed using the perspective-origin property. using this property with a value different than 0 and none creates a new stacking context. also, in that case, the object will act as a containing block for position: fixed elements that it contains.
formal definition initial valuenoneapplies totrans
formable elementsinheritednocomputed valuethe absolute length or noneanimation typea lengthcreates stacking contextyes
formal syntax none | <length> examples setting perspective this example shows a cube with the perspective set at different positions. how quick the cube shrinks is defined by the perspective property. the smaller its value is, th...
... perspective: 250px; } .pers350 { perspective: 350px; } .pers500 { perspective: 500px; } .pers650 { perspective: 650px; } /* define the container div, the cube div, and a generic face */ .container { width: 200px; height: 200px; margin: 75px 0 0 75px; border: none; } .cube { width: 100%; height: 100%; backface-visibility: visible; perspective-origin: 150% 150%; trans
form-style: preserve-3d; } .face { display: block; position: absolute; width: 100px; height: 100px; border: none; line-height: 100px; font-family: sans-serif; font-size: 60px; color: white; text-align: center; } /* define each face based on direction */ .front { background: rgba(0, 0, 0, 0.3); trans
form: translatez(50px); } .back { background: rgba(0, 255, 0, 1); color: ...
...And 2 more matches
text-underline-position - CSS: Cascading Style Sheets
ne-position: right; /* multiple keywords */ text-underline-position: under left; text-underline-position: right under; /* global values */ text-underline-position: inherit; text-underline-position: initial; text-underline-position: unset; syntax values auto the user agent uses its own algorithm to place the line at or under the alphabetic baseline. ...
...ne-position: right under; /* global values */ text-underline-position: inherit; text-underline-position: initial; text-underline-position: unset; syntax values auto the user agent uses its own algorithm to place the line at or under the alphabetic baseline. from-font if the font file includes in
formation about a preferred position, use that value. if the font file doesn't include this in
formation, behave as if auto was set, with the browser choosing an appropriate position. under forces the line to be set below the alphabetic baseline, at a position where it won't cross any descenders. this is useful for ensuring legibility with chemical and mathematical
formulas, which make a large use of subscripts. left in vertical writing-modes, this keyword forces the line to be placed on th...
...of the text. in horizontal writing-modes, it is a synonym of under. auto-pos a synonym of auto, which should be used instead. above forces the line to be above the text. when used with east-asian text, using the auto keyword will lead to a similar effect. below forces the line to be below the text. when used with alphabetic text, using the auto keyword will lead to a similar effect.
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax auto | from-font | [ under | [ left | right ] ] examples a simple example let's take a couple of simple example paragraphs: <p class="horizontal">lorem ipsum dolor sit amet, consectetur adipiscing elit. nullam consectetur ac turpis vel laoreet. nullam volutpat phar...
...And 2 more matches
matrix() - CSS: Cascading Style Sheets
tx ty are <number>s describing the translation to apply. ...
... tx ty are <number>s describing the translation to apply. ...
...(a, b, 0, 0, c, d, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1). syntax the matrix() function is specified with six values. the constant values are implied and not passed as parameters; the other parameters are described in the column-major order. note: until firefox 16, gecko accepted a <length> value for tx and ty. matrix(a, b, c, d, tx, ty) values a b c d are <number>s describing the linear trans
formation. tx ty are <number>s describing the translation to apply. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 ac bd actxbdty001 actxbdty001 ac0txbd0ty00100001 [a b c d tx ty] the values represent the following functions: matrix( scale...
...And 2 more matches
scaleX() - CSS: Cascading Style Sheets
note: scalex(sx) is equivalent to scale(sx, 1) or scale3d(sx, 1, 1). syntax scalex(s) values s is a <number> representing the scaling factor to apply on the abscissa of each point of the element. ...
... note: scalex(sx) is equivalent to scale(sx, 1) or scale3d(sx, 1, 1). syntax scalex(s) values s is a <number> representing the scaling factor to apply on the abscissa of each point of the element. ...
... note: scalex(sx) is equivalent to scale(sx, 1) or scale3d(sx, 1, 1). syntax scalex(s) values s is a <number> representing the scaling factor to apply on the abscissa of each point of the element. ...
...And 2 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. the pattern attribute, when specified, is a regular expression which the input's value must match in order for the value to pass constraint validation. ...
...art anchored to the start of the string and its end anchored to the end of the string, which is slightly different from javascript regular expressions: in the case of pattern attribute, we are matching against the entire value, not just any subset, as if a ^(?: were implied at the start of the pattern and )$ at the end. ...
...ing true. specifying a pattern you can use the pattern attribute to specify a regular expression that the inputted value must match in order to be considered valid (see validating against a regular expression for a simple crash course on using regular expressions to validate inputs). the example below restricts the value to 4-8 characters and requires that it contain only lower-case letters. ...
...And 2 more matches
<body>: The Document Body element - HTML: Hypertext Markup Language
document permitted aria roles no role permitted dom interface htmlbodyelement the <body> element exposes the htmlbodyelement interface. you can access the <body> element through the document.body property. attributes this element includes the global attributes. alink color of text for hyperlinks when selected. this method is non-con
forming, use css color property in conjunction with the :active pseudo-class instead. background uri of a image to use as a background. this method is non-con
forming, use css background property on the element instead. bgcolor background color for the document. this method is non-con
forming, use css background-color property on the element instead. bottommargin the margin of the bottom of ...
...onjunction with the :active pseudo-class instead. background uri of a image to use as a background. this method is non-con
forming, use css background property on the element instead. bgcolor background color for the document. this method is non-con
forming, use css background-color property on the element instead. bottommargin the margin of the bottom of the body. this method is non-con
forming, use css margin-bottom property on the element instead. leftmargin the margin of the left of the body. this method is non-con
forming, use css margin-left property on the element instead. link color of text for unvisited hypertext links. this method is non-con
forming, use css color property in conjunction with the :link pseudo-class instead. onafterprint function to call after the use...
... has moved forward in undo transaction history. onresize function to call when the document has been resized. onstorage function to call when the storage area has changed. onundo function to call when the user has moved backward in undo transaction history. onunload function to call when the document is going away. rightmargin the margin of the right of the body. ...
...And 2 more matches
<nextid>: The NeXT ID element (Obsolete) - HTML: Hypertext Markup Language
icial public dtd's of the html versions. it is also probably one of the least understood of all of the early html elements. html "0.a" - from the beginning through january 10, 1991 this tag had not been invented as yet, so no examples are found from this period. html "0.c" - from january 23, 1991 though november 23, 1992 this early version of html introduced <nextid> in a non-sgml compliant
form that simply used the numeric value alone as an "attribute." html "0.d" - from november 26, 1992 through may 24, 1993 during this span, next and the oldest surviving dtd's show <nextid> to take only a number for a value of its newly-introduced attribute n. html "1.k" - version 1 (first release) in this first published draft of html, <nextid> is the same as it would take in html 2, finally allo...
... draft of html, <nextid> is the same as it would take in html 2, finally allowing the use of a name instead of only a number for its attribute value. html "1.m" - version 1 (second release) in the next published draft of html, <nextid> <nextid> can be individually deselected for display with a simple sgml command. ...
...> is the same as it would take in html 2, finally allowing the use of a name instead of only a number for its attribute value. html "1.m" - version 1 (second release) in the next published draft of html, <nextid> <nextid> can be individually deselected for display with a simple sgml command. html version 2 level 1 this is like the level 2 default but it excludes all the
forms elements, i. e. ...
...And 2 more matches
<output>: The Output element - HTML: Hypertext Markup Language
permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. ...
...tted parents any element that accepts phrasing content. implicit aria role status permitted aria roles any dom interface htmloutputelement attributes this element includes the global attributes. for a space-separated list of other elements’ ids, indicating that those elements contributed input values to (or otherwise affected) the calculation. ...
...s any element that accepts phrasing content. implicit aria role status permitted aria roles any dom interface htmloutputelement attributes this element includes the global attributes. for a space-separated list of other elements’ ids, indicating that those elements contributed input values to (or otherwise affected) the calculation.
form the <
form> element to associate the output with (its
form owner). the value of this attribute must be the id of a <
form> in the same document. (if this attribute is not set, the <output> is associated with its ancestor <
form> element, if any.) this attribute lets you associate <output> elements to <
form>s anywhere in the document, not just inside a <
form>. it can also override an ancestor <
form> element. ...
...And 2 more matches
<script>: The Script element - HTML: Hypertext Markup Language
aluate scripts before continuing to parse. defer has a similar effect in this case. this is a boolean attribute: the presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value. see browser compatibility for notes on browser support. see also async scripts for asm.js. crossorigin normal script elements pass minimal in
formation to the window.onerror for scripts which do not pass the standard cors checks. to allow error logging for sites which use a separate domain for static media, use this attribute. see cors settings attributes for a more descriptive explanation of its valid arguments. defer this boolean attribute is set to indicate to a browser that the script is meant to be executed after the document has b...
...s). origin: the sent referrer will be limited to the origin of the referring page: its scheme, host, and port. origin-when-cross-origin: the referrer sent to other origins will be limited to the scheme, the host, and the port. navigations on the same origin will still include the path. ...
...https→http). ...
...And 2 more matches
Global attributes - HTML: Hypertext Markup Language
ng if the element should be editable by the user. if so, the browser modifies its widget to allow editing. the attribute must take one of the following values: true or the empty string, which indicates that the element must be editable; false, which indicates that the element must not be editable. contextmenu the id of a <menu> to use as the contextual menu for this element. data-*
forms a class of attributes, called custom data attributes, that allow proprietary in
formation to be exchanged between the html and its dom representation that may be used by scripts. all such custom data are available via the htmlelement interface of the element the attribute is set on. the htmlelement.dataset property gives access to them. dir an enumerated attribute indicating the directionality ...
...ata structure. itemscope is used to set the scope of where in the data structure the vocabulary set by itemtype will be active. lang helps define the language of an element: the language that non-editable elements are in, or the language that editable elements should be written in by the user. the attribute contains one “language tag” (made of hyphen-separated “language subtags”) in the
format defined in tags for identifying languages (bcp47). xml:lang has priority over it. part a space-separated list of the part names of the element. part names allows css to select and style specific elements in a shadow tree via the ::part pseudo-element. slot assigns a slot in a shadow dom shadow tree to an element: an element with a slot attribute is assigned to the slot created by the <slot>...
...focusable), if it should participate to sequential keyboard navigation, and if so, at what position. ...
...And 2 more matches
Using the application cache - HTML: Hypertext Markup Language
as of firefox 44+, when appcache is used to provide offline support for a page, a warning message displays in the console advising developers to use service workers instead (bug 1204581). introduction html5 provides an application caching mechanism that lets web applications run offline. this application cache (appcache) interface lists resources that browsers should cache to be available offline. applications that are cached load and work correctly offline, even if users press the refresh button. ...
... and its associated resources directly from the cache, without accessing the network. this speeds up the document load time. the browser then checks to see if the cache manifest has been updated on the server. if the cache manifest has been updated, the browser downloads a new version of the manifest and the resources listed in the manifest. this is done in the background and does not affect per
formance significantly. the process for loading documents and updating the application cache is specified in greater detail below: when the browser visits a document that includes the manifest attribute, if no application cache exists, the browser loads the document and then fetches all the entries listed in the manifest file, creating the first version of the application cache. subsequent visit...
... the header.png image with new content), you must also change the content of the manifest file in order to let browsers know that they need to refresh the cache. you can make any change you want to the manifest file, but revising a version number is the recommended best practice. important: do not specify the manifest itself in the cache manifest file, otherwise it will be nearly impossible to in
form the browser a new manifest is available. sections in a cache manifest file: cache, network, and fallback a manifest can have three distinct sections: cache, network, and fallback. cache: this is the default section for entries in a cache manifest file. files listed under the cache: section header (or immediately after the cache manifest line) are explicitly cached after they're downloaded f...
...And 2 more matches
Identifying resources on the Web - HTTP
the target of an http request is called a "resource", whose nature isn't defined further; it can be a document, a photo, or anything else. each resource is identified by a uni
form resource identifier (uri) used throughout http for identifying resources. the identity and the location of resources on the web are mostly given by a single url (uni
form resource locator, a kind of uri). there are sometimes reasons identity and location are not given by the same uri: http uses a specific http header, alt-svc when the resource requested wants the client to access it at another location. urls and urns urls the most common
form of uri is the uni
form resource locator (url), which is known as the web address. https://developer.mozilla.org https://developer.mozilla.org/docs/learn/ https://developer.m...
...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). a url is composed of different parts, some mandatory and others are optional. ...
...it indicates which protocol the browser must use. usually it is the http protocol or its secured version, https. ...
...And 2 more matches
Content-Location - HTTP
n is a header associated with the response, while content-location is associated with the data returned. this distinction may seem abstract without examples. header type entity header forbidden header name no syntax content-location: <url> directives <url> a relative (to the request url) or absolute url. examples requesting data from a server in different
formats let's say a site's api can return data in json, xml, or csv
formats. if the url for a particular document is at https://example.com/documents/foo, the site could return different urls for content-location depending on the request's accept header: request header response header accept: application/json, text/json content-location: /documents/foo.json accep...
... then the client could remember that the json version is available at that particular url, skipping content negotation the next time it requests that document. the server could also consider other content negotiation headers, such as accept-language. pointing to a new document (http 201 created) say you're creating a new blog post through a site's ...
...text/json content-location: /documents/foo.json accept: application/xml, text/xml content-location: /documents/foo.xml accept: text/plain, text/* content-location: /documents/foo.txt these urls are examples — the site could serve the different filetypes with any url patterns it wishes, such as a query string parameter: /documents/foo?
format=json, /documents/foo?
format=xml, and so on. then the client could remember that the json version is available at that particular url, skipping content negotation the next time it requests that document. the server could also consider other content negotiation headers, such as accept-language. 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: ex...
...And 2 more matches
Referrer-Policy - HTTP
the referrer-policy http header controls how much referrer in
formation (sent via the referer header) should be included with requests. header type response header forbidden header name no syntax the original header name referer is a misspelling of the word "referrer". the referrer-policy header does not share this misspelling. referrer-policy: no-referrer referrer-policy: no-referrer-when-downgrade referrer-policy: origin referrer-policy: origin-when-cross-origin referrer-policy: same-origin referrer-policy: strict-origin referrer-policy: strict-origin-when-cross-origin referrer-policy: unsafe-url directives no-referrer the referer header will be omitted entirely. no referrer in
formation is sent along with requests. no-referrer-when-downgrade (defaul...
...-cross-origin (see https://github.com/whatwg/fetch/pull/952), consider using this value (or a stricter one), if possible, when changing the referrer-policy. origin only send the origin of the document as the referrer. for example, a document at https://example.com/page.html will send the referrer https://example.com/. origin-when-cross-origin send the origin, path, and query string when per
forming a same-origin request, but only send the origin of the document for other cases. same-origin a referrer will be sent for same-site origins, but cross-origin requests will send no referrer in
formation. strict-origin only send the origin of the document as the referrer when the protocol security level stays the same (https→https), but don't send it to a less secure destination (https→htt...
... same-origin a referrer will be sent for same-site origins, but cross-origin requests will send no referrer in
formation. strict-origin only send the origin of the document as the referrer when the protocol security level stays the same (https→https), but don't send it to a less secure destination (https→http). strict-origin-when-cross-origin send the origin, path, and querystring when per
forming a same-origin request, only send the origin when the protocol security level stays the same while per
forming a cross-origin request (https→https), and send no header to any less-secure destinations (https→http). ...
...And 2 more matches
Strict-Transport-Security - HTTP
may initially communicate with the non-encrypted version of the site before being redirected, if, for example, the visitor types http://www.foo.com/ or even just foo.com. this creates an opportunity for a man-in-the-middle attack. the redirect could be exploited to direct visitors to a malicious site instead of the secure version of the original site. the http strict transport security header in
forms the browser that it should never load a site using http and should automatically convert all attempts to access the site using http to https requests instead. note: the strict-transport-security header is ignored by the browser when your site is accessed using http; this is because an attacker may intercept http connections and inject the header or remove it. when your site is accessed over htt...
...l http request and redirecting you to a clone of your bank's site instead of the real thing. now your private data is exposed to the hacker. strict transport security resolves this problem; as long as you've accessed your bank's web site once using https, and the bank's web site uses strict transport security, your browser will know to automatically use only https, which prevents hackers from per
forming this sort of man-in-the-middle attack. how the browser handles it the first time your site is accessed using https and it returns the strict-transport-security header, the browser records this in
formation, so that future attempts to load the site using http will automatically use https instead. when the expiration time specified by the strict-transport-security header elapses, the next atte...
...he site using http will automatically use https instead. when the expiration time specified by the strict-transport-security header elapses, the next attempt to load the site via http will proceed as normal instead of automatically using https. whenever the strict-transport-security header is delivered to the browser, it will update the expiration time for that site, so sites can refresh this in
formation and prevent the timeout from expiring. should it be necessary to disable strict transport security, setting the max-age to 0 (over a https connection) will immediately expire the strict-transport-security header, allowing access via http. preloading strict transport security google maintains an hsts preload service. by following the guidelines and successfully submitting your domain, brows...
...And 2 more matches
JavaScript data types and data structures - JavaScript
ean and boolean for more details. null type the null type has exactly one value: null. see null and null for more details. undefined type a variable that has not been assigned a value has the value undefined. see undefined and undefined for more details. number type ecmascript has two built-in numeric types: number and bigint (see below). the number type is a double-precision 64-bit binary
format ieee 754 value (numbers between -(253 − 1) and 253 − 1). in addition to representing floating-point numbers, the number type has three symbolic values: +infinity, -infinity, and nan ("not a number"). to check for the largest available value or smallest available value within ±infinity, you can use the constants number.max_value or number.min_value. starting with ecmascript 2015, you are...
... see also get. undefined [[set]] function object or undefined the function is called with an argument that contains the assigned value and is executed whenever a specified property is attempted to be changed. see also set. undefined [[enumerable]] boolean if true, the property will be enumerated in for...in loops. false [[configurable]] ...
...4array 0 to 264-1 8 64-bit unsigned integer bigint uint64_t (unsigned long long) keyed collections: maps, sets, weakmaps, weaksets these data structures, introduced in ecmascript edition 6, take object references as keys. set and weakset represent a set of objects, while map and weakmap associate a value to an object. ...
...And 2 more matches
Expressions and operators - JavaScript
« previousnext » this chapter describes javascript's expressions and operators, including assignment, comparison, arithmetic, bitwise, logical, string, ternary and more. a complete and detailed list of operators and expressions is also available in the reference. operators javascript has the following types of operators. this section describes the operators and contains in
formation about operator precedence. assignment operators comparison operators arithmetic operators bitwise operators logical operators string operators conditional (ternary) operator comma operator unary operators relational operators javascript has both binary and unary operators, and one special ternary operator, the conditional operator. a binary operator requires two operands, one befo...
...strings are compared based on standard lexicographical ordering, using unicode values. 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. this behavior generally results in comparing the operands numerically. the sole exceptions to type conversion within comparisons involve the === and !== operators, which per
form strict equality and inequality comparisons. these operators do not attempt to convert the operands to compatible types before checking equality. the following table describes the comparison operators in terms of this sample code: var var1 = 3; var var2 = 4; comparison operators operator description examples returning true equal (==) returns true if the operands ...
... exponentiation operator (**) calculates the base to the exponent power, that is, baseexponent 2 ** 3 returns 8. 10 ** -1 returns 0.1. bitwise operators a bitwise operator treats their operands as a set of 32 bits (zeros and ones), rather than as decimal, hexadecimal, or octal numbers. for example, the decimal number nine has a binary representation of 1001. bitwise operators per
form their operations on such binary representations, but they return standard javascript numerical values. the following table summarizes javascript's bitwise operators. bitwise operators operator usage description bitwise and a & b returns a one in each bit position for which the corresponding bits of both operands are ones. bitwise or a | b return...
...And 2 more matches
Loops and iteration - JavaScript
ion incrementexpression is executed. control returns to step 2. example in the example below, the function contains a for statement that counts the number of selected options in a scrolling list (a <select> element that allows multiple selections). the for statement declares the variable i and initializes it to 0. ...
...below, the function contains a for statement that counts the number of selected options in a scrolling list (a <select> element that allows multiple selections). the for statement declares the variable i and initializes it to 0. it checks that i is less than the number of options in the <select> element, per
forms the succeeding if statement, and increments i by after each pass through the loop. ...
...on contains a for statement that counts the number of selected options in a scrolling list (a <select> element that allows multiple selections). the for statement declares the variable i and initializes it to 0. it checks that i is less than the number of options in the <select> element, per
forms the succeeding if statement, and increments i by after each pass through the loop. ...
...And 2 more matches
Date.prototype.toLocaleDateString() - JavaScript
the source for this interactive example is stored in a github repository. ...
... the source for this interactive example is stored in a github repository. ...
...is interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.tolocaledatestring([locales [, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose
formatting conventions should be used. in implementations, which ignore the locales and options arguments, the locale used and the
form of the string returned are entirely implementation dependent. see the intl.datetime
format() constructor for details on these parameters and how to use them. the default value for each date-time component property is undefined, but if the weekday, year, month, day pr...
...And 2 more matches
Date.prototype.toLocaleTimeString() - JavaScript
the source for this interactive example is stored in a github repository. ...
... the source for this interactive example is stored in a github repository. ...
...his interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.tolocaletimestring([locales[, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose
formatting conventions should be used. in implementations, which ignore the locales and options arguments, the locale used and the
form of the string returned are entirely implementation dependent. see the intl.datetime
format() constructor for details on these parameters and how to use them. the default value for each date-time component property is undefined, but if the hour, minute, second propert...
...And 2 more matches
JSON.parse() - JavaScript
the json.parse() method parses a json string, constructing the javascript value or object described by the string. an optional reviver function can be provided to per
form a trans
formation on the resulting object before it is returned. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax json.parse(text[, reviver]) parameters text the string to parse as json. see the json object for a description of json syntax. reviver optional if a function, this prescribes how the value originally produced by parsing is trans
formed, before being returned. return value the object, array, string, number, boolean, or nul...
...arcodeat(0).tostring(16)).slice(-4) ); }); } // in the second stage, we run the text against regular expressions that look // for non-json patterns. we are especially concerned with "()" and "new" // because they can cause invocation, and "=" because it can cause mutation. // but just to be safe, we want to reject all unexpected
forms. // we split the second stage into 4 regexp operations in order to work around // crippling inefficiencies in ie's and safari's regexp engines. first we // replace the json backslash pairs with "@" (a non-json character). second, we // replace all simple value tokens with "]" characters. third, we delete all // open brackets that follow a colon or comma o...
..." operator is subject to a syntactic ambiguity // in javascript: it can begin a block or an object literal. we wrap the text // in parens to eliminate the ambiguity. j = eval("(" + text + ")"); // in the optional fourth stage, we recursively walk the new structure, passing // each name/value pair to a reviver function for possible trans
formation. return (typeof reviver === "function") ? walk({ "": j }, "") : j; } // if the text is not json parseable, then a syntaxerror is thrown. throw new syntaxerror("json.parse"); }; } examples using json.parse() json.parse('{}'); // {} json.parse('true'); // tr...
...And 2 more matches
encodeURI() - JavaScript
does not encode characters that have special meaning (reserved characters) for a uri. the following example shows all the parts that a uri "scheme" can possibly contain. note how certain characters are used to signify special meaning: http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor hence encodeuri() does not encode characters that are necessary to
formulate a complete uri. also, encodeuri() does not encode a few additional characters, known as "unreserved marks", which do not have a reserved purpose but are allowed in a uri "as is". (see rfc2396) encodeuri() escapes all characters except: not escaped: a-z a-z 0-9 ; , / ? : @ & = + $ - _ . ! ~ * ' ( ) # examples encodeuri vs encodeuricomponent encodeuri() differs from encodeuricompon...
...encodeuricomponent(), however, does encode these characters. encoding a lone high surrogate throws an urierror will be thrown if one attempts to encode a surrogate which is not part of a high-low pair, e.g., // high-low pair...
... are not encoded, which are treated as special characters in get and post requests. encodeuricomponent(), however, does encode these characters. ...
...And 2 more matches
encodeURIComponent() - JavaScript
this will encode "&" symbols that may inadvertently be generated during data entry for special html entities or other characters that require encodin...
...this will encode "&" symbols that may inadvertently be generated during data entry for special html entities or other characters that require encoding/decoding. for example, if a user writes "jack & jill", the text may get encoded as "jack & jill". wit...
...this will encode "&" symbols that may inadvertently be generated during data entry for special html entities or other characters that require encoding/decoding. ...
...And 2 more matches
Standard built-in objects - JavaScript
bal object itself can be accessed using the this operator in the global scope. in fact, the global scope consists of the properties of the global object, including inherited properties, if any. other objects in the global scope are either created by the user script or provided by the host application. the host objects available in browser contexts are documented in the api reference. for more in
formation about the distinction between the dom and core javascript, see javascript technologies overview. standard objects by category value properties these global properties return a simple value. they have no properties or methods. infinity nan undefined globalthis function properties these global functions—functions which are called globally, rather than on an object—directly retu...
...mics dataview json control abstraction objects control abstractions can help to structure code, especially async code (without using deeply nested callbacks, for example). ...
...json control abstraction objects control abstractions can help to structure code, especially async code (without using deeply nested callbacks, for example). ...
...And 2 more matches
Strict mode - JavaScript
ode without feature-testing for support for the relevant aspects of strict mode. strict mode code and non-strict mode code can coexist, so scripts can opt into strict mode incrementally. strict mode makes several changes to normal javascript semantics: eliminates some javascript silent errors by changing them to throw errors. fixes mistakes that make it difficult for javascript engines to per
form optimizations: strict mode code can sometimes be made to run faster than identical code that's not strict mode. prohibits some syntax likely to be defined in future versions of ecmascript. see transitioning to strict mode, if you want to change your code to work in the restricted variant of javascript. invoking strict mode strict mode applies to entire scripts or to individual functions. it ...
.../ typeerror })(); simplifying variable uses strict mode simplifies how variable names map to particular variable definitions in the code. many compiler optimizations rely on the ability to say that variable x is stored in that location: this is critical to fully optimizing javascript code. javascript sometimes makes this basic mapping of name to variable definition in the code impossible to per
form until runtime. strict mode removes most cases where this happens, so the compiler can better optimize strict mode code. first, strict mode prohibits with. the problem with with is that any name inside the block might map either to a property of the object passed to it, or to a variable in surrounding (or even global) scope, at runtime: it's impossible to know which beforehand. strict mode makes ...
...ntroduced a new variable that would hide the outer variable). in strict mode eval creates variables only for the code being evaluated, so eval can't affect whether a name refers to an outer variable or some local variable: var x = 17; var evalx = eval("'use strict'; var x = 42; x;"); console.assert(x === 17); console.assert(evalx === 42); if the function eval is invoked by an expression of the
form eval(...) in strict mode code, the code will be evaluated as strict mode code. the code may explicitly invoke strict mode, but it's unnecessary to do so. function strict1(str) { 'use strict'; return eval(str); // str will be treated as strict mode code } function strict2(f, str) { 'use strict'; return f(str); // not eval(...): str is strict if and only // if it invokes s...
...And 2 more matches
Template literals (Template strings) - JavaScript
(alternatively, it can return something complete...
...(alternatively, it can return something completely different, as described in one of the following examples.) the name of the function used for the tag can be whatever you want. ...
...cluding the two characters '\' and 'n' in addition, the string.raw() method exists to create raw strings—just like the default template function and string concatenation would create. ...
...And 2 more matches
Progressive web app structure - Progressive web apps (PWAs)
hey both have their advantages and disadvantages, and you can mix the two approaches to some degree. server-side rendering (ssr) means a website is rendered on the server, so it offers quicker first load, but navigating between pages requires downloading new html content. it works great across browsers, but it suffers in terms of time navigating between pages and therefore general perceived per
formance — loading a page requires a new round trip to the server. client-side rendering (csr) allows the website to be updated in the browser almost instantly when navigating to different pages, but requires more of an initial download hit and extra rendering on the client at the beginning. the website is slower on an initial visit, but can be faster to navigate. mixing ssr with csr can lead to ...
... what is requested from the server and what is retrieved from the cache with a service worker, which will be explained in detail in the next article — for now let's focus on the structure itself. why should i use it? this architecture allows a website to benefit the most from all the pwa features — it caches the app shell and manages the dynamic content in a way that greatly improves the per
formance. in addition to the basic shell, you can add other features such as add to home screen or push notifications, safe in the knowledge that the app will still work ok if they are not supported by the user's browser — this is the beauty of progressive enhancement. the website feels like a native app with instant interaction and solid per
formance while keeping all the benefits of the web. bein...
...able before the website can start rendering. it's different with html, as the browser is actually streaming the data already and you can see when the elements are loaded and rendered on the website. to have the javascript "operational", however, it has to be downloaded in its entirety. the streams api allows developers to have direct access to data streaming from the server — if you want to per
form an operation on the data (for example, adding a filter to a video), you no longer need to wait for all of it to be downloaded and converted to a blob (or whatever) — you can start right away. it provides fine-grained control — the stream can be started, chained with another stream, cancelled, checked for errors, and more. in theory, streaming is a better model, but it's also more complex, an...
...And 2 more matches
Progressive loading - Progressive web apps (PWAs)
previous overview: progressive web apps in previous articles we covered apis that help us make our js13kpwa example a progressive web app: service workers, web manifests, notifications and push. in this article we will go even further and improve the per
formance of the app by progressively loading its resources. first meaningful paint it's important to deliver something meaningful to the user as soon as possible — the longer they wait for the page to load, the bigger the chance they will leave before waiting for everything to finish. we should be able to show them at least the basic view of the page they want to see, with placeholders in the places more content will eventually be loaded. this could be achieved by progressive loading — also known as lazy loading. this i...
...ny visitors won't go through every single page of a website, yet the usual approach is to bundle every feature we have into one big file. a bundle.js file can be many megabytes, and a single style.css bundle can contain everything from basic css structure definitions to all the possible styles of every version of the site: mobile, tablet, desktop, print only, etc. it is faster to load all that in
formation as one file rather than many small ones, but if the user doesn't need everything at the very beginning, we could load only what's crucial and then manage other resources when needed. render-blocking resources bundling is a problem, because the browser has to load the html, css, and javascript before it can paint their rendered results onto the screen. during the few seconds between initial...
...css"> <link rel="stylesheet" href="print.css" media="print"> this will tell the browser to load them only when the condition is met. in our js13kpwa demo app, the css is simple enough to leave it all in a single file with no specific rules as to how to load them. we could go even further and move everything from style.css to the <style> tag in the <head> of index.html — this would improve per
formance even more, but for the readability of the example we will skip that approach too. images besides javascript and css, websites will likely contain a number of images. when you include <img> elements in your html, then every referenced image will be fetched and downloaded during initial website access. it's not unusual to have megabytes of image data to download before announcing the site is ...
...And 2 more matches
Media - Progressive web apps (PWAs)
for example, you are probably reading this on a device with a display. but you might also want to project it to a big screen for a large audience, or you might want to print it. ...
... for example, you are probably reading this on a device with a display. but you might also want to project it to a big screen for a large audience, or you might want to print it. ...
... starts on a new page: h1 {page-break-before: always;} more details for full details of css support for paged media, see paged media in the css specification. like other features of css, printing depends on browser choice and its settings. for example, the mozilla browser supplies default margins, headers, and footers for printing. keep in mind that you can't completely control the printed
format. it is impossible to anticipate every user's browser choice and settings at the time of printing. user interfaces css has some special properties for devices that support a user interface, like computer displays. these properties dynamically change the appearance of content as the user works with the interface. there are five special selectors: selector selects e:hover...
...And 2 more matches
vector-effect - SVG: Scalable Vector Graphics
paint, then stroke the outline with a specified paint. non-scaling-stroke this value modifies the way an object is stroked. normally stroking involves calculating stroke outline of the shapeʼs path in current user coordinate system and filling that outline with the stroke paint (color or gradient). the resulting visual effect of this value is that the stroke width is not dependant on the trans
formations of the element (including non-uni
form scaling and shear trans
formations) and zoom level. non-scaling-size this value specifies a special user coordinate system used by the element and its descendants. the scale of that user coordinate system does not change in spite of any trans
formation changes from a host coordinate space. however, it does not specify the suppression of rotation and ske...
...n and skew. also, it does not specify the origin of the user coordinate system. since this value suppresses scaling of the user coordinate system, it also has the characteristics of non-scaling-stroke. non-rotation this value specifies a special user coordinate system used by the element and its descendants. the rotation and skew of that user coordinate system is suppressed in spite of any trans
formation changes from a host coordinate space. however, it does not specify the suppression of scaling. also, it does not specify the origin of user coordinate system. fixed-position this value specifies a special user coordinate system used by the element and its descendants. the position of user coordinate system is fixed in spite of any trans
formation changes from a host coordinate space. howeve...
...it does not specify the origin of user coordinate system. fixed-position this value specifies a special user coordinate system used by the element and its descendants. the position of user coordinate system is fixed in spite of any trans
formation changes from a host coordinate space. however, it does not specify the suppression of rotation, skew and scaling. when this vector effect and the trans
form property are defined at the same time, that property is consumed for this effect. ...
...And 2 more matches
SVG Attribute reference - SVG: Scalable Vector Graphics
ed using attributes that specify details about exactly how the element should be handled or rendered. below is a list of all of the attributes available in svg along with links to reference documentation to help you learn which elements support them and how they work. ...
...or cx cy d d decelerate descent diffuseconstant direction display divisor dominant-baseline dur dx dy e edgemode elevation enable-background end exponent externalresourcesrequired f fill fill-opacity fill-rule filter filterres filterunits flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight
format from fr fx fy g g1 g2 glyph-name glyph-orientation-horizontal glyph-orientation-vertical glyphref gradienttrans
form gradientunits h hanging height href hreflang horiz-adv-x horiz-origin-x i id ideographic image-rendering in in2 intercept k k k1 k2 k3 k4 kernelmatrix kernelunitlength kerning keypoints keysplines keytimes l lang lengthadjus...
...angle local m marker-end marker-mid marker-start markerheight markerunits markerwidth mask maskcontentunits maskunits mathematical max media method min mode n name numoctaves o offset opacity operator order orient orientation origin overflow overline-position overline-thickness p panose-1 paint-order path pathlength patterncontentunits patterntrans
form patternunits ping pointer-events points pointsatx pointsaty pointsatz preservealpha preserveaspectratio primitiveunits r r radius referrerpolicy refx refy rel rendering-intent repeatcount repeatdur requiredextensions requiredfeatures restart result rotate rx ry s scale seed shape-rendering slope spacing specularconstant specularexponent speed spreadmetho...
...And 2 more matches
Content type - SVG: Scalable Vector Graphics
a types, and (depend on the implementation) in the future css color module level 3. a <color> is either a keyword or a numerical rgb specification. in addition to these color keywords, users may specify keywords that correspond to the colors used by objects in the user's environment. the normative definition of these keywords is found in user preferences for colors (css2, section 18.2). the
format of an rgb value in hexadecimal notation is a "#" immediately followed by either three or six hexadecimal characters. the three-digit rgb notation (#rgb) is converted into six-digit
form (#rrggbb) by replicating digits, not by adding zeros. for example, #fb0 expands to #ffbb00. this ensures that white (#ffffff) can be specified with the short notation (#fff) and removes any dependencies on the c...
...al notation is a "#" immediately followed by either three or six hexadecimal characters. the three-digit rgb notation (#rgb) is converted into six-digit
form (#rrggbb) by replicating digits, not by adding zeros. for example, #fb0 expands to #ffbb00. this ensures that white (#ffffff) can be specified with the short notation (#fff) and removes any dependencies on the color depth of the display. the
format of an rgb value in the functional notation is an rgb start-function, followed by a comma-separated list of three numerical values (either three integer values or three percentage values) followed by ")". an rgb start-function is the case-insensitive string "rgb(", for example "rgb(" or "rgb(". for compatibility, the all-lowercase
form "rgb(" is preferred. the integer value 255 corresponds to 10...
...g.svg#lamppost iris are used in the xlink:href attribute. some attributes allow both iris and text strings as content. to disambiguate a text string from a relative iri, the functional notation <funciri> is used. this is simply an iri delimited with a functional notation. note: for historical reasons, the delimiters are "url(" and ")", for compatibility with the css specifications. the funciri
form is used in presentation attributes . svg makes extensive use of iri references, both absolute and relative, to other objects. for example, to fill a rectangle with a linear gradient, you first define a <lineargradient> element and give it an id, as in: <lineargradient xml:id="mygradient">...</lineargradient> you then reference the linear gradient as the value of the fill attribute for the ...
...And 2 more matches
SVG element reference - SVG: Scalable Vector Graphics
« svg / svg attribute reference » svg drawings and images are created using a wide array of elements which are dedicated to the construction, drawing, and layout of vector images and diagrams. here you'll find reference documentation for each of the svg elements. ...
...ient> <meshpatch> <meshrow> <metadata> <mpath> p <path> <pattern> <polygon> <polyline> r <radialgradient> <rect> s <script> <set> <solidcolor> <stop> <style> <svg> <switch> <symbol> t <text> <textpath> <title> <tspan> u <unknown> <use> v <view> svg elements by category animation elements <animate>, <animatecolor>, <animatemotion>, <animatetrans
form>, <discard>, <mpath>, <set> basic shapes <circle>, <ellipse>, <line>, <polygon>, <polyline>, <rect> container elements <a>, <defs>, <g>, <marker>, <mask>, <missing-glyph>, <pattern>, <svg>, <switch>, <symbol>, <unknown> descriptive elements <desc>, <metadata>, <title> filter primitive elements <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuse...
...lter primitive elements <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>,<fefunca>, <fefuncb>, <fefuncg>, <fefuncr>,<fegaussianblur>, <feimage>, <femerge>, <femergenode>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, <feturbulence> font elements <font>, <font-face>, <font-face-
format>, <font-face-name>, <font-face-src>, <font-face-uri>, <hkern>, <vkern> gradient elements <lineargradient>, <meshgradient>, <radialgradient>, <stop> graphics elements <circle>, <ellipse>, <image>, <line>, <mesh>, <path>, <polygon>, <polyline>, <rect>, <text>, <use> graphics referencing elements <mesh>, <use> light source elements <fedistantlight>, <fepointlight>, <fespotlight> never-ren...
...And 2 more matches
Index - WebAssembly
found 12 pages: # page tags and summary 1 webassembly landing, webassembly, wasm webassembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary
format that runs with near-native per
formance and provides languages such as c/c++ with a compilation target so that they can run on the web. it is also designed to run alongside javascript, allowing both to work together. 2 caching compiled webassembly modules caching, indexeddb, javascript, module, webassembly, compile, wasm caching is useful for improving the per
formance of an app — we can store compiled webassembly modules on the client so they don't have to be downloaded and compiled every time. this article exp...
...ng ecosystem of c libraries and allow developers to use them on the web. 5 compiling from rust to webassembly compiling, webassembly, rust, wasm if you've written some rust code, you can compile it into webassembly! this tutorial takes you through all you need to know to compile a rust project to wasm and use it in an existing web app. 6 converting webassembly text
format to wasm webassembly, assembly, conversion, text
format, wabt, wasm, wast2wasm, wat2wasm webassembly has an s-expression-based textual representation, an intermediate
form designed to be exposed in text editors, browser developer tools, etc. this article explains a little bit about how it works, and how to use available tools to covert text
format files to the .wasm assembly
format. ...
...embly code fetch, javascript, webassembly, xmlhttprequest, bytecode to use webassembly in javascript, you first need to pull your module into memory before compilation/instantiation. this article provides a reference for the different mechanisms that can be used to fetch webassembly bytecode, as well as how to compile/instantiate then run it. 10 understanding webassembly text
format functions, javascript, s-expressions, webassembly, calls, memory, shared address, table, text
format, was, wasm this finishes our high-level tour of the major components of the webassembly text
format and how they get reflected in the webassembly js api. 11 using the webassembly javascript api api, devtools, javascript, webassembly, compile, instantiate, memory, table ...
...And 2 more matches
Loading and running WebAssembly code - WebAssembly
taining your webassembly module binary after fetching the raw bytes, and then compile/instantiate it. this is analogous to new function(string), except that we are substituting a string of characters (javascript source code) with an array buffer of bytes (webassembly source code). the newer webassembly.compilestreaming/webassembly.instantiatestreaming methods are a lot more efficient — they per
form their actions directly on the raw stream of bytes coming from the network, cutting out the need for the arraybuffer step. so how do we get those bytes into an array buffer and compiled? the following sections explain. using fetch fetch is a convenient, modern api for fetching network resources. the quickest, most efficient way to fetch a wasm module is using the newer webassembly.instantiates...
...the object looks like this: { module : module // the newly compiled webassembly.module object, instance : instance // a new webassembly.instance of the module object } note: usually we only ca...
...ct looks like this: { module : module // the newly compiled webassembly.module object, instance : instance // a new webassembly.instance of the module object } note: usually we only care about the instance, but it’s useful to have the module in case we want to cache it, share it with another worker or window via postmessage(), or simply create more instances. note: the second overload
form takes a webassembly.module object as an argument, and returns a promise directly containing the instance object as the result. see second overload example. running your webassembly code once you've got your webassembly instance available in your javascript, you can then start using features of it that have been exported via the webassembly.instance.exports property. your code might look someth...
...And 2 more matches
Modules - Archive of obsolete content
a certain size, it becomes necessary to split it up into multiple files. unfortunately, javascript does not provide any means to load scripts from other locations: we have to rely on the host application to provide us with this functionality. applications such as firefox and thunderbird are based on xulrunner. xulrunner adds a built-in object, known as components, to the global scope. this object
forms the central access point for all functionality provided by the host application. a complete explanation of how to use components is out of scope for this document. however, the following example shows how it can be used to load scripts from other locations: const { classes: cc interfaces: ci } = components; var instance = cc["@mozilla.org/moz/jssubscript-loader;1"]; var loader = instan...
...ctly from another compartment: they need to be accessed through an intermediate object, known as a wrapper. compartments are very useful from a security point of view: each compartment has a set of privileges that determines what a script running in that compartment can and cannot do. compartments with chrome privileges have access to the components object, giving them full access to the host plat
form. in contrast, compartments with content privileges can only use those features available to ordinary websites. the sandbox constructor takes a url parameter, which is used to determine the set of privileges for the compartment in which the sandbox will be created. passing an xul url will result in a compartment with chrome privileges (note, however, that if you ever actually do this in any of yo...
...cript(url, imports) { let global = components.utils.sandbox(url); global.imports = imports; global.exports = {}; loader.loadsubscript(url, global); return global.exports; } note that the object returned by sandbox is a wrapper to the sandbox, not the sandbox itself. a wrapper behaves exactly like the wrapped object, with one difference: for each property access/function it per
forms an access check to make sure that the calling script is actually allowed to access/call that property/function. if the script being loaded is less privileged than the loading script, the access is prevented, as the following example shows: // index.js: let a = loadscript("www.foo.com/a.js", { components: components }); // index.js has chrome privileges components.utils; // => [object nsxpc...
...returns the resolved id as its result. the resolved id is then further resolved using the paths array: const { loader, main } = require('toolkit/loader'); let loader = loader({ paths: ["./": "http://www.foo.com/"], resolve: function (id, requirer) { // your code here return id; } }); main(loader, "./main.js"); cuddlefish uses a custom resolve function to implement a
form of access control: modules can only require modules for which they have been explicitly granted access. a whitelist of modules is generated statically when the add-on is linked. it is possible to pass a list of predefined modules as an option to the loader constructor. this is useful if the api to be exposed does not have a corresponding js file, or is written in an incompatible
format. cuddlefis...
Low-Level APIs - Archive of obsolete content
ming easier. dev/panel enables you to extend the firefox developer tools. event/core the event/core module allows the creation of apis to broadcast and subscribe to events. event/target create objects that broadcast events. frame/hidden-frame creates firefox frames (i.e. xul <iframe> elements) that are not displayed to the user. frame/utils provides helper functions for working with plat
form internals like frames and browsers. fs/path provides access to the local filesystem with the nodejs path module api. io/byte-streams provides streams for reading and writing bytes. io/file provides access to the local filesystem. io/text-streams provides streams for reading and writing text. lang/functional functional helper methods. lang/type functions for working with type detection...
...r/cuddlefish the sdk's module loader. loader/sandbox create javascript sandboxes and execute scripts in them. net/url enables you to read content from a uri. net/xhr provides access to xmlhttprequest functionality. places/bookmarks create, modify, and retrieve bookmarks. places/favicon helper functions for working with favicons. places/history access the user's browsing history. plat
form/xpcom implement xpcom objects, factories, and services. preferences/event-target listen to changes to the preferences system in firefox. preferences/service access the preferences system in firefox. remote/child enables an sdk module loaded into a child process to access web content in the child process and communicate with modules in the main process. remote/parent enables you t...
... into child processes. stylesheet/style modify styles using stylesheet files or css rules. stylesheet/utils helper functions for working with stylesheets. system/child_process an implementation of the node.js child_process api. system/environment access, set and clear environment variables. system/events api for working with the application observer service. system/runtime access to in
formation about firefox's runtime environment. system/unload register callbacks that are called when a module is unloaded. system/xul-app in
formation about the application on which your add-on is running. tabs/utils functions for working with xul tabs and the xul tabbrowser object. test/assert implements the assert interface defined in the commonjs unit testing specification version 1.1. test...
... test/runner sets up unit tests. test/utils helper methods used in the commonjs unit testing suite. ui/button/action add a button to the firefox user interface. ui/button/toggle add a toggle button to the firefox user interface. ...
console - Archive of obsolete content
if you have started firefox for your add-on from the command line with jpm run or jpm test then these messages appear in the command shell you used. if the add-on has been installed in firefox, then the messages appear in the browser console. if you're developing your add-on using the extension auto-installer, then the add-on is installed in firefox, meaning that messages will appear in the browser console. but see the discussion of logging levels: by default, messages logged using log(), info(), trace(), or warn() won't be logged in these situations. ...
...objects that are logged. console.debug(...) deprecated, you should use console.log() instead. console.error(object[, object, ...]) logs the arguments to the console, preceded by "error:" and the name of your add-on: console.error("this is an error message"); error: my-addon: this is an error message console.exception(exception) logs the given exception instance as an error, outputting in
formation about the exception's stack traceback if one is available. try { dothing(); } catch (e) { console.exception(e); } function userexception(message) { this.message = message; this.name = "userexception"; } function dothing() { throw new userexception("thing could not be done!"); } error: my-addon: an exception occurred. userexception: thing could not be done! console.info(ob...
...me = "userexception"; } function dothing() { throw new userexception("thing could not be done!"); } error: my-addon: an exception occurred. userexception: thing could not be done! console.info(object[, object, ...]) a synonym for console.log(). console.log(object[, object, ...]) logs the arguments to the console, preceded by "info:" and the name of your add-on: console.log("this is an in
formational message"); info: my-addon: this is an in
formational message console.time(name) starts a timer with a name specified as an input parameter. up to 10,000 simultaneous timers can run on a given page. console.timeend(name) stops the specified timer and logs the elapsed time in seconds since its start. see timers. console.trace() logs a stack trace at the point the function is called. ...
...pecially when debug logging shows up in a production environment, the noise can make it harder, not easier, to debug issues. this is the problem that logging levels are designed to fix. the console defines a number of logging levels, from "more verbose" to "less verbose", and a number of different logging functions that correspond to these levels, which are arranged in order of "severity" from in
formational messages, through warnings, to errors. at a given logging level, only calls to the corresponding functions and functions with a higher severity will have any effect. for example, if the logging level is set to "info", then calls to info(), log(), warn(), and error() will all result in output being written. but if the logging level is "warn" then only calls to warn() and error() have any ...
Code snippets - Archive of obsolete content
amples can also be used in xulrunner applications, as well as in actual mozilla code itself. these examples demonstrate how to accomplish basic tasks that might not be immediately obvious. general examples and demos from mdn articles a collection of examples and demos from articles. window code opening and manipulating windows toolbar toolbar related code sidebar sidebar related code
forms
forms related code xml code used to parse, write, manipulate, etc. xml file i/o code used to read, write and process files drag & drop code used to setup and handle drag and drop events dialogs code used to display and process dialog boxes alerts and notifications modal and non-modal ways to notify users preferences code used to read, write, and modify preferences js xpcom code u...
... miscellaneous miscellaneous useful code fragments html to dom using a hidden browser element to parse html to a window's dom javascript libraries here are some javascript libraries that may come in handy. 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. ...
...nicate from extensions to websites and vice-versa. ...
...ance html or xul based markup xul widgets html in xul for rich tooltips dynamically embed html into a xul element to attain markup in a tooltip label and description special uses and line breaking examples tree setup and manipulation of trees using xul and js scrollbar changing style of scrollbars. applies to scrollbars in browser and iframe as well. autocomplete code used to enable
form autocomplete in a browser boxes tips and tricks when using boxes as containers tabbox removing and manipulating tabs in a tabbox windows-specific finding window handles (hwnd) (firefox) how to use windows api calls to find various kinds of mozilla window handles. window handles can be used for ipc and accessibility purposes. using the windows registry with xpcom how to read, write, mo...
Deploying a Plugin as an Extension - Archive of obsolete content
r the rhapsody player engine. normally, this plugin is installed in a local directory, and a registry item is used to let firefox know about the plugin. first, let's take a look at the structure of the xpi file used for a browser plugin. rhapsodyplayerengine_inst_win.xpi install.rdf plugins/ license.rtf nprhapengine.dll the important file here is the install.rdf file. this contains in
formation about our extension; all extensions have one. here's what a basic install.rdf file looks like: <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>rhapsodyplayerengine@rhapsody.com</em:id> <em:name>rhapsody player engine</em:name> <em:version>1.0.0.487</em:version...
...if you have written extensions for firefox in the past, you'll notice that we no longer require the use of guids as extension ids. the name specifies the name of the extension that appears in the extension manager. the version is used for version checking w...
...on> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>1.5</em:minversion> <em:maxversion>1.5.0.*</em:maxversion> </description> </em:targetapplication> </description> </rdf> you can get more detailed in
formation about this file at install.rdf. we'll cover the basics. the id specifies a unique id that uniquely identifes this extension of the
form. if you have written extensions for firefox in the past, you'll notice that we no longer require the use of guids as extension ids. the name specifies the name of the extension that appears in the extension manager. the version is used for version checking when we are updating extensions. the targetapplication section specifies that plat
form we want to work on (that id is for firefox). it also sp...
...e placed in the install.rdf is called an updateurl. for example: <em:updateurl><http://www.rhapsody.com/update.rdf></em:updateurl> this url specifies an rdf file that can be used to tell firefox that there are updates available for your extension. this rdf file can be updated to indicate that an update to our extension/plugin is available. finally, if you want to package plugins for multiple plat
forms into a single extension, you can do that as well. there are two ways to do this. first, you can simply put all the files in the plugins directory. firefox will load the correct plugins based on the plat
form, simply because the plugins for other plat
forms won't load. if your plugin is for windows, don't forget add to version resources to your plugin's dll. also, supply mimetype and fileextents, w...
Listening to events in Firefox extensions - Archive of obsolete content
there are several different categories of events; this article will help you learn about them and direct you to more specific documentation covering each of them. it also provides some use cases that may be of specific interest. types of events there are multiple types of events that application and extension authors can use to receive notifications from <xul:browser> and <xul:tabbrowser> elements to hear about changes relating to loads of the content contained within them. simple dom events registering for a dom event is done using with code such as the following: function callback(evt) { // do your processing here. ...
...then when the cached page is loaded: pageshow events from each frame fire before the pageshow event in the main document fires. when the user navigates away from the cached page, the pagehide event from each frame fires before the pagehide event in the main document. for navigation that occurs inside a single frame, events fire only in the affected frame. web progress listeners for more in
formation about web loads a web progress listener can be used; these provide more details about the progress of loading data from the web. both browser and tabbrowser elements support the following: var progresslistener = { // add nsiwebprogressimplementation here } b.addprogresslistener(progresslistener); where b is the browser or tabbrowser you want to listen to events for. there are code snip...
...the browser that is currently displayed at the time the event occurs. in order to listen to events from all browsers, including those not currently being displayed, the following example can be used: var tabsprogresslistener = { // add tabs progress listener implementation here } gbrowser.addtabsprogresslistener(tabsprogresslistener); this lets you receive events related to all tabs. more in
formation about listening to events from all tabs is available. how events are used by firefox the firefox frontend already listens for a number of these progress events from web pages. most of this goes on in browser.js. domlinkhandler the domlinkhandler object is called by the domlinkadded event in order to detect any rss feeds, site icons, or opensearch plugins for the web site. pageshoweventh...
...istening for each browser. first it creates a browser-status-filter and adds it as a web progress listener for the browser. next it creates an internal object to receive all web progress events from the browser. this is created by the method mtabprogresslistener(). this receives events from the browser-status-filter. the filter acts to reduce the number of status and progress events to improve per
formance. the filters are held in the array mfilters, the internal listeners in the array mtablisteners. the internal listeners are used to send out progress events to listeners registered with addprogresslistener() (which receives events from the browser that is currently visible) and addtabsprogresslistener() (which receives events from all browsers). ...
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
o the firefox ui. these issues are discussed in chapter 5. the minimum knowledge required in the interest of brevity, i will omit explanations of widely understood technologies, and focus instead on introducing new technologies you will need to understand in order to develop for firefox. i will assume that you have experience developing with dynamic html, as well as the topics below. for more in
formation on these technologies, please refer to other sources. xml coding css coding basic javascript syntax xml: a text-based structural language extensible markup language (xml) is a meta-language for expressing various kinds of data. it was specified in 1998 by w3c, the organization that sets standards for web-related technologies. it has a number of useful qualities: it is generic, extens...
... refer to other sources. xml coding css coding basic javascript syntax xml: a text-based structural language extensible markup language (xml) is a meta-language for expressing various kinds of data. it was specified in 1998 by w3c, the organization that sets standards for web-related technologies. it has a number of useful qualities: it is generic, extensible, and easy to validate as well-
formed. some examples of xml-based markup languages include xhtml, which is html redefined on an xml base; svg, for expressing vector images; and mathml, for expressing mathematical
formulas. xul, which is used in firefox, is also based on xml. listing 1: xml syntax <elementname someattribute="somevalue"> content </elementname> as shown in listing 1, xml uses elements, which consist of an openin...
...as in all trees, elements can have children (elements contained within them) and parents (elements that contain them). attributes can also be added to opening tags, each with a value. ...
...ed in firefox, is also based on xml. listing 1: xml syntax <elementname someattribute="somevalue"> content </elementname> as shown in listing 1, xml uses elements, which consist of an opening tag, a closing tag, and content. note: elements that take no content can be expressed in compact
form as <elementname/>. an element can include other elements as well as text in its content, and all in
formation is structured as a tree. as in all trees, elements can have children (elements contained within them) and parents (elements that contain them). attributes can also be added to opening tags, each with a value. as the "extensible" part of xml implies, elements from various xml-based languages such as xhtml and svg can be interspersed in one another as a means to extend the language. all eleme...
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
a version comparison to decide which code to run. the current version number can be hard-coded in the first run function, or you can use the add-on manager to dynamically get it. this can get tricky with the firefox 4 addonmanager, so it's probably best to keep it simple. uninstall scripts there are two common cases for needing these: cleaning up local data and presenting an uninstall feedback
form. regarding local data, it is debatable if it is good practice to remove it or not. if an add-on is uninstalled and later installed again, it might be desirable for preferences and other settings to be kept. another argument in favor of keeping that data is that firefox doesn't delete its profile folders after it is uninstalled, so it would be consistent to keep it. on the other hand, local data t...
...not. if an add-on is uninstalled and later installed again, it might be desirable for preferences and other settings to be kept. another argument in favor of keeping that data is that firefox doesn't delete its profile folders after it is uninstalled, so it would be consistent to keep it. on the other hand, local data that is no longer needed takes unnecessary disk space and can contain private in
formation that users forget is there. it's up to the developer's discretion. uninstalling an add-on happens in 2 stages: first the add-on is flagged to be uninstalled, and then the add-on is actually removed. in the case of bootstrapped extensions, both steps happen at the same time. in the case of "traditional" extensions, like those explained in the tutorial, both steps happen at different times. i...
...ension to be completely removed. then the user has the option to restart right away, wait to restart whenever is convenient, or even cancel the uninstall operation. the add-on will not be completely removed until the browser is restarted. so, in order to detect the first stage, you'll need to add an event listener using the addaddonlistener method. the data parameter explains the action being per
formed. if you detect your add-on is going to be uninstalled at this stage, it's a good time to show the uninstall feedback
form. it is not a good time to clean up your files, at least not without prior user consent. remember that the user can revert this decision. so, you should listen to other events, like canceling the operation, to make sure that you know what is going on. set a boolean flag that...
...cision. so, you should listen to other events, like canceling the operation, to make sure that you know what is going on. set a boolean flag that indicates if your add-on is set to be uninstalled or not, and reset it when necessary. the second stage is knowing when the application is actually going to be closed. then you'll have reasonable certainty that the add-on will be removed and you can per
form any cleanup operations safely. for this, you need to add an observer for the quit-application topic. this is when you'll know the application will close. then you can check the flag you set up on the first stage and per
form any necessary deletions. you shouldn't per
form very time-consuming operations here, at least not without telling users what is going on. ...
Appendix F: Monitoring DOM changes - Archive of obsolete content
dom mutation events were introduced to html several years ago in order to allow web applications to monitor changes to the dom by other scripts. unfortunately, adding listeners for any of these events to a document has a highly deleterious effect on per
formance, an effect which is not mitigated in the slightest by later removing those listeners. for this reason, it is best to avoid using mutation listeners at all costs, especially from extensions. this document lays out some alternatives which do not have such severe per
formance impacts. mutation observers mutation observers are the more efficient, w3c speced replacement for the highly inefficient mutation events. their major advantage is in their per
formance and their ease of use, especially when combined with simple libraries. their main ...
... non-mutation triggers it is usually possible to tell when a mutation has occurred or is about to occur without resorting to mutation events or observers. most of these methods are specific to a particular site or codebase. ...
...tell when a mutation has occurred or is about to occur without resorting to mutation events or observers. most of these methods are specific to a particular site or codebase. hashchange and popstate events most ajax-heavy sites update the url when they significantly change their content, either via a change to the fragment identifier (hash) or more recently via the history.pushstate method. the
former triggers a hashchange event while the latter triggers a popstate event. event listeners for those events are the preferred method for detecting dom modifications when feasible. often times, this must be used in combination with a slight delay, or even polling, via settimeout, for cases where the url change happens before the page is fully loaded. this method works particularly well with servi...
...or instance, rather than watching for the creation of <a> elements and adding event listeners to them as they are created, an event listener can be added to the root <html> element, and when the event fires, the event.target and its parents can be searched for a matching element. you can read more about event delegation here. it is important to note, however, that this method can have severe per
formance implications for certain events, namely mouseover, mouseout, and friends, which are fired very often while the mouse is moving. monkey patching in many instances, especially when dealing with chrome code, the best way to modify actions which result in dom mutations is by wrapping the functions that trigger those changes. for instance, when you want to modify the result of dom mutations that...
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
nt = jsontodom(jsontemplatebtn, document, capturednodes); palette.appendchild(domfragment); alert("capturednodes contains any created nodes that have optionally been captured (for later convenient javascript access) by giving them a 'key' attribute; for example: " + capturednodes.mytestbutton123); another example this here is another example of using jsontodom but in the html scope, a complex
form is created with ease. the demo of this is seen at jsfiddle :: jsontodom example var json = ['html:div', {style:'background-color:springgreen'}, ['html:
form', {id:'myfirst
form'}, ['html:input', {type:'text', value:'my field'}], ['html:button', {id:'mybtn'}, 'button text content'] ], ['html:
form', {id:'mysecond
form'}, ['html:input', {type:'text', val...
...he demo of this is seen at jsfiddle :: jsontodom example var json = ['html:div', {style:'background-color:springgreen'}, ['html:
form', {id:'myfirst
form'}, ['html:input', {type:'text', value:'my field'}], ['html:button', {id:'mybtn'}, 'button text content'] ], ['html:
form', {id:'mysecond
form'}, ['html:input', {type:'text', value:'my field for second
form'}], ['html:div', {}, 'sub div with textcontent and siblings', ['html:br', {}], ['html:input', {type:'checkbox', id:'mycheck'}], ['html:label', {for:'mycheck'}, 'here is text of label, click this text will check the box' ] ] ] ]; document.body.appendchild(jsontodom(json,...
... dostuffwith(href); dootherstuff(); for (var somestuff in otherstuff) dosomemorestuffwith(somestuff); } return script.tosource() + "(" + [string.quote(href), uneval(otherstuff)] + ")"; } safely using remote html in the above cases, we're working with text content that needs to appear in generated dom. there are cases, however, where we need to safely display
formatted html sent by a remote server. fortunately, there is a safe and simple way to do this. for webextensions the most simple way is sanitize the output about javascript inline declaration and other wrong content. for xul addon based the nsiparserutils.parsefragment() method will convert a string to a document fragment while removing any scripts or other unsafe content in the process. let { cc,...
...urned fragment may be appended to any element in the given document. ...
Handling Preferences - Archive of obsolete content
« previousnext » preferences in firefox mozilla applications are highly customizable. preferences are used to store settings and in
formation to change their default behavior. to open the preferences window in firefox, select the following from the main menu: on windows, tools > options on mac, firefox > preferences on linux, edit > preferences note: keep in mind the usage of the terms "preferences" and "options" in different plat
forms. if you need to refer to the term "preference" in any of your locale files, you must change the string depending on the operating system. tip: you can use window.navigator.plat
form in your chrome code to figure out the operating system firefox is running on. you can use the hidden dom window in non-chrome code. firefox loads user preferences ...
...ument what they do. the preferences file you need to create should be defaults/preferences/yourextensionname.js, under your extension root. the naming of the js file is not compulsory, but it is the standard most extensions use. note: the purpose of the defaults directory is to hold non-code files your extension needs. in the past we have used this directory to store xslt files for xml trans
formations and local storage template files (more on this later). it's the best place to put miscellaneous files your extension needs. download this sample hello world using preferences. there are a couple of additions in the makefiles, to include the preference file xulschoolhello.js. the contents of the file are fairly simple: // amount of messages shown to the user. pref("extensions.xulschool...
...s can switch, so checking for the operating system is not good enough. the general philosophy in non-windows systems is that a change in a preference applies immediately. preference windows don't have any buttons, or just an ok or close button. on windows, changing preferences don't apply until the user click on the ok button. the user can click on the cancel button and none of the changes per
formed in the window will apply. this is why it makes sense to have preference windows be modal on windows. this way the user is urged to apply or discard any changes instead of being able to ignore the preferences window. for preferences windows you should always use the prefwindow element instead of window in your xul file. firefox will know if it needs to add ok and cancel buttons or not. in mo...
...those. the element and its children are completely invisible, and their purpose is to list the preferences to be used in the window/pane. <preferences> <preference id="xulschoolhello-message-count-pref" name="extensions.xulschoolhello.message.count" type="int" /> <!-- more preference elements. --> </preferences> after you define the preferences you need, you associate them with the
form elements in your window or pane using the preference attribute: <textbox preference="xulschoolhello-message-count-pref" type="number" min="0" max="100" /> in this case we use a numeric field to set the message count preference. changing the value in the control will change the preference (depending on the instant apply rule), and vice versa. you may be able to create a preferences window ...
Intercepting Page Loads - Archive of obsolete content
chniques presented here apply only to content loaded in the main browser area, while others detect content being loaded in other xul windows, or even detect xul content being loaded. also, the different techniques tap into different steps of the load process. which one you should use solely depends on your needs. we will start with the simplest one, which is also the most common to use. note: per
formance is very important when it comes to add-ons and page loads. read the recommendations in appendix a regarding per
formance if you're planning on implementing any of these. the easy way: load events this comes from the tabbrowser code snippets page. in a nutshell, from the chrome code in the overlay we add an event listener for the load event. this._loadhandler = function() {that._onpageload()...
...url)) { // re_url_to_modify is a regular expression. asubject.setrequestheader("referer", "http://example.com", false); } else if (re_url_to_cancel.test(url)) { // re_url_to_cancel is a regular expression. asubject.cancel(components.results.ns_binding_aborted); } } } this example shows how you can obtain the url for the request, analyze it using regular expressions, and per
form actions on it such as modifying http headers, or even canceling the request. http observers are great for load detection, and filtering by url. you can also use these in conjunction with nsitraceablechannel to get and modify the response text before it gets to the original requester. you won't be able to make dom modifications like with the load events, since these notifications are triggered b...
...perating. . you have to take into account that a page load may involve several http requests, specially when redirects are involved. if you enter gmail.com in your browser, you will probably be redirected a few times before reaching the page that actually displays any content. all of these "hops" will involve a call to your observer. . the aforementioned observer notifications page has more in
formation about these notifications and links to other useful documentation. webprogresslisteners when used in the chrome, this is a more sophisticated way of intercepting and modifying the various stages in page loads. but of course, there's always a price to pay: web progress listeners in the chrome are attached to specific instances of the browser element. what does this mean? it means you have t...
..., we recommend that you first read the documentation on nsiwebprogresslistener and the nsiwebprogress.constants (webprogress notify constants). in a nutshell, there are a lot of state and status changes going on when a page loads, and the notify constants allow you to filter out the events you don't need to listen to. picking the right filter not only simplifies your code, but also reduces the per
formance impact your extension will have in regular navigation. here are a couple of common use cases and the ways to implement them with web progress listeners: if you want simple detection and filtering like in the page load events, you can use onlocationchange. you can use alocation.spec to get the url and match it against a regular expression. the request object arequest holds the request bein...
XPCOM Objects - Archive of obsolete content
« previousnext » xpcom xpcom is a cross plat
form component object model, similar to microsoft com. taken from the xpcom page. firefox can be seen as composed of two layers. the largest of the two is a compiled plat
form, mostly written in c++. on top of it lies the chrome, mostly written in xml, javascript and css. in fact, you can separate the two. we often mention other "mozilla based applications". well, those are applications that, simply put, take the underlying plat
form with perhaps a few changes and additions, and then write their own chrome layer. this lower layer is called xulrunner, and it is a very powerful plat
form, providing a very robust development base for web-enabled, cross-plat
form applications. the fact that it allows to easily create os-independent applications ...
...ck, because after that we only need to get and set preferences, and those methods are in nsiprefbranch. trying to access methods or attributes without having the right interface set will result in an exception being thrown. passing parameters passing parameters to xpcom methods is no different from other js objects, with some exceptions. in general, you can rely on javascript's ability to trans
form values to the correct type, but it's usually best to pass the right type in the first place. this section is a quick guide on how to read xpcom documentation, which basically amounts to understanding the syntax of xpidl, the language used to specify xpcom interfaces. at mdc, you'll see stuff like this: void setcharpref(in string aprefname, in string avalue); one of the most important detai...
... documentation, which basically amounts to understanding the syntax of xpidl, the language used to specify xpcom interfaces. at mdc, you'll see stuff like this: void setcharpref(in string aprefname, in string avalue); one of the most important details to notice is that both paratemers have the in keyword. this specifies that these are input parameters, values that the method will use to per
form its actions. when is a parameter not an in parameter? in some methods the out keyword is used for parameters that are return values in reality. this is done for certain value types that are not valid as return values in idl, such as typed arrays. void getchildlist(in string astartingat, out unsigned long acount,[array, size_is(acount), retval] out string achildarray); this method returns an...
.... this can also be specified on a per-method basis, which is something you'll see in some of the interfaces in firefox, but it's not likely you'll have to do it in your own components. the second part defines a uuid for the interface. you must generate a new one for each interface, and you should change it every time the interface changes. in this case you're forced to use uuid, the email address
format used for extension ids won't work. we included a constant, an attribute and a method to display examples of the 3, but this is clearly an overly elaborate way to keep a simple counter. you can define numeric and boolean constants in idl files, but not string constants. this is a known limitation of xpidl, and a simple workaround is to define a readonly attribute instead. this means you have t...
Tabbed browser - Archive of obsolete content
owser only after the browser window is fully loaded. if you need to do something with gbrowser right after the window is opened, listen for the load event and use gbrowser in the event listener. if your code does not have access to the main window because it is run in a sidebar or dialog, you first need to get access to the browser window you need before you can use gbrowser. you can find more in
formation on getting access to the browser window in working with windows in chrome code. from a sidebar basically, if your extension code is a sidebar you can use: var mainwindow = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltre...
...data, referrerurl ) the following code will open a url in a new tab, an existing tab, or an existing window based on which mouse button was pressed and which hotkeys (ex: ctrl) are being held. the code given is for a menuitem, but will work equally well for other xul elements. this will only work in an overlay of browser.xul. ...
... and every time one is needed, it is good practice to try to re-use an existing tab which already displays the desired url--if one is already open. following this practice minimizes the proliferation of tabs and browsers created by your extension. reusing by url/uri a common feature found in many extensions is to point the user to chrome:// uris in a browser window (for example, help or about in
formation) or external (on-line http(s)://) html documents when the user clicks an extension's button or link. the following code demonstrates how to re-use an existing tab that already displays the desired url/uri. if no such tab exists, a new one is opened with the specified url/uri. function openandreuseonetabperurl(url) { var wm = components.classes["@mozilla.org/appshell/window-mediator;1"] ...
...le } catch(e) { components.utils.reporterror(e); } } to learn what methods are available for <browser/> and <tabbrowser/> elements, use dom inspector or look in browser.xml for corresponding xbl bindings (or just look at the current reference pages on browser and tabbrowser. getting the browser that fires the http-on-modify-request notification see the observer notifications page for in
formation on http-on-* notifications. note that some http requests aren't associated with a tab; for example, rss feed updates, extension manager requests, xhr requests from xpcom components, etc. in those cases, the following code returns null. warning: this code should be updated to use nsiloadcontext instead of getinterface(components.interfaces.nsidomwindow). updated example is in section below ...
Firefox addons developer guide - Archive of obsolete content
ad of written as ("xpi"). method and function names should have parentheses after them. for example, here: https://developer.mozilla.org/en/firefox_addons_developer_guide/let's_build_a_firefox_extension#init_method the text of the paragraph should begin "the <code>init()</code> method is as shown...". if you use the interface template when mentioning interfaces by name, mdc will automatically
format them and generate links to their documentation, like this: nsiconsoleservice. if you prefer, you can just link to the articles directly. either way, these links should be added. these articles are all tagged as covering firefox 3.1 using the fx_minversion_header template, but i don't think that's the case. certainly appendix 2 doesn't care what version of firefox you're using, since it's jus...
...emplate, but i don't think that's the case. certainly appendix 2 doesn't care what version of firefox you're using, since it's just about open source software licenses. ...
... opinions: i think ...
... opinions: i think we should be careful about adding new contents to this guide. the original version of this guide was written as a first step guide for beginners. ...
Search Extension Tutorial (Draft) - Archive of obsolete content
ch(""); // get the root default preference branch. var defaultprefs = services.prefs.getdefaultbranch(""); // save the original values. var savedprefs = {} // change the default value of the preference *name* to *value*. // a default for this preference must exist, and it must be a // character preference. function setpref(name, value, localized) { // if this is a localized preference, trans
form the value into an // appropriate data: url. if (localized) value = "data:text/plain," + encodeuricomponent(name + "=" + value.replace(/ /g, "\\u0020")); // save the original and new values. savedprefs[name] = [defaultprefs.getcharpref(name), value]; // change the default defaultprefs.setcharpref(name, value); // clear the user value if this is the first run,...
...} changing the default search engine this change comes in two parts: 1) installing a new search engine (and removing it when your extension is disabled), and 2) setting it as a default (and restoring the previous default when your extension is uninstalled). adding a new search engine search engines may be added either directly via an api call, or indirectly via an xml description file. while the
former is the simpler method, it does not support complex descriptions containing suggestion urls or separate keyword search urls. note: example uninstall code is only provided for restartless extensions. a separate tutorial exists for running code at uninstall in non-restartless extensions. an example bootstrap.js file illustrating the simple method follows: const { classes: cc, interfaces: ci, utils...
...cu.import("resource://gre/modules/services.jsm"); // these must be the same details as in your search.xml file. const engine_details = { name: "example engine", url: "https://www.example.com/search?q=_searcht...
...cu.import("resource://gre/modules/services.jsm"); // these must be the same details as in your search.xml file. const engine_details = { name: "example engine", url: "https://www.example.com/search?q=_searchterms_&source=search-box" }; // get the eng...
Underscores in class and ID Names - Archive of obsolete content
ight be voted_republican. given this fact, authors who write css often attempt to employ the underscore in a similar fashion when creating class and id names. this should not be done. although underscores are, as of this writing, technically permitted in class and id names, there are many historical and practical reasons why they should be avoided. the css1 specification, published in its final
form in 1996, did not allow for the use of underscores in class and id names unless they were "escaped." an escaped underscore would look something like this: p.urgent\_note {color: maroon;} this was not well supported by browsers at the time, however, and the practice has never caught on. css2, published in 1998, also forbade the use of underscores in class and id names. however, errata to the spec...
... convoluted. netscape 6.x permits underscores and escaped underscores. navigator 4.x honored the restriction against underscores, and so any class or id name with an underscore will be ignored by navigator 4.x, so the associated styles will never be applied. it also ignored escaped underscores. internet explorer 4.x and 5.x for windows erroneously allowed underscores, and so were both non-con
formant on this point until the errata was published. the same is true of ie4.x and 5.x for macintosh. internet explorer 6 for windows, published after the errata, permits underscores and escaped underscores. opera 3.x through 5.x does not recognize underscores or escaped underscores, and so acts the same as navigator 4.x in this regard. recommendation because support is so inconsistent between c...
...all rights reserved. note: this reprinted article was originally part of the devedge site. ...
... camel case names such as this: p.urgentnote {color: maroon;} if the initial-cap approach is used, however, remember that class and id names are also supposed to be case-sensitive. see the tech note "case sensitivity in class and id names" for more details. original document in
formation author(s): eric a. meyer, netscape communications last updated date: published 05 mar 2001 copyright in
formation: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Localizing an extension - Archive of obsolete content
« previousnext » this article expands upon the previous samples on extension writing by adding localization support to our stock watcher extension. per
forming a few simple steps makes your extension much easier to localize into various languages without having to edit the xul or javascript files themselves. if you haven't already created an extension, or would like to refresh your memory, take a look at the previous articles in this series: creating a status bar extension creating a dynamic status bar extension adding preferences to an extension download the sample you can download this article's sample code so you can look at it side-by-side with the article, or to use it as a basis for your own extension. download the sample localizing strings in xul files create the ne...
... don't actually include the name of the localization to use. the chrome registry resolves the uris based on the user's current locale setting and the data you provide in your chrome manifest. then we simply replace each text string in our xul files with the corresponding entity. for example, in stockwatcher2.xul, we change this line: <menuitem label="refresh now" oncommand="stockwatcher.refreshin
formation()"/> to <menuitem label="&menu_refresh_now.label;" oncommand="stockwatcher.refreshin
formation()"/> do this for every string used in each xul file. update the chrome manifest to let firefox know about the locale files, we need to make a revision to our chrome.manifest file, adding one line for each localization: locale stockwatcher2 en-us chrome/locale/ this instructs firefox that the en...
...oaded from the stockwatcher2.properties file we've already created. note: you should use a unique id for each string bundle element for each file you use to avoid conflicts. (e.g. id="myextensionname-filename") update the javascript code now we're ready to revise the javascript code to load the strings from the string bundle instead of using literal strings. ...
...flicts. (e.g. id="myextensionname-filename") update the javascript code now we're ready to revise the javascript code to load the strings from the string bundle instead of using literal strings. this involves rewriting the refreshin
formation() function to load the strings, and its enclosed inforeceived() function to use the loaded, localized, strings instead of string literals. ...
Defining Cross-Browser Tooltips - Archive of obsolete content
age, the contents of the alt attribute are displayed as a "tooltip." gecko-based browsers such as mozilla, netscape 6+, and compuserve 7 do not support this behavior. see bug 25537 for a lengthy, sometimes passionate discussion of gecko's behavior in this regard. the problem according to the html 4.01 definition of the alt attribute: alt = text cs for user agents that cannot display images,
forms, or applets, this attribute specifies alternate text. the language of the alternate text is specified by the lang attribute. in other words, alt text should only be displayed when a user agent cannot display the primary content of the element (e.g., a text-mode browser that cannot display images). in a visual browser, the image should be displayed and the alt text should not. this assumes that...
...guage of the alternate text is specified by the lang attribute. in other words, alt text should only be displayed when a user agent cannot display the primary content of the element (e.g., a text-mode browser that cannot display images). in a visual browser, the image should be displayed and the alt text should not. ...
...be displayed and the alt text should not. this assumes that the browser can find the image and that it supports the image
format used; if either of these is not true, and the image cannot be displayed, then the alt text should be displayed in place of the missing image. on the other hand, the html 4.01 definition of the title attribute states: title = text cs this attribute offers advisory in
formation about the element for which it is set. unlike the title element, which provides in
formation about an entire document and may only appear once, the title attribute may annotate any number of elements. please consult an element's definition to verify that it supports this attribute... values of the title attribute may be rendered by user agents in a variety of ways. for instance, visual brows...
...(instead of alt) to ensure desired tooltip behavior in multiple browsers. authors able to run content-rewriting proxy servers can use them to dynamically alter outgoing content to ensure both the title and alt attributes are present. related links html 4.01 specification: 13.8 how to specify alternate text html 4.01 specification: 7.4.3 the title attribute bug 25537 original document in
formation author(s): eric a. meyer, netscape communications last updated date: published 16 aug 2002 copyright in
formation: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Making a Mozilla installation modifiable - Archive of obsolete content
mozilla's user interface is made up of xul (described below), xbl (a topic for another tutorial), javascript, css, and image files. xul, xbl, javascript, and css files are all in text
format and can be edited in a standard text editor, while image files are in binary gif, jpg, or png
format and must be edited with an image editing program. the files are then collected into a series of jar archives, which are just zip files that contain a specially
formatted "manifest" file which describes the contents of the archive so mozilla knows what to do with them. although jar archives are binary files, mozilla's ui is not compiled into machine code; mozilla instead builds its ui from the non-compiled files in the archive each time it starts up. because of this, we can modify the files in the ar...
...nstead builds its ui from the non-compiled files in the archive each time it starts up. because of this, we can modify the files in the archive and see our changes to the ui merely by restarting the application. this makes modifying mozilla's ui much easier than for many other applications. although mozilla stores the ui files in jar archives, it can also access them in their original, unarchived
form, which is useful for the extensions developer because it makes it unnecessary to extract the files from the archive before changing the code and then re-add them to the archive afterwards. instead, you only have to extract them once and can then make as many modifications as you like. to make mozilla modifiable, we will first extract the ui files from the archives using an unzip utility, then edi...
...extract them into the same (chrome) directory in which they are located. on unix-like operating systems with bash-like shells, you can run the following command within that directory to accomplish this task: for file in *.jar; do unzip $file; done on operating systems with dos-like shells, the following command accomplishes this task: for %file in (*.jar); do unzip %file note that there are plat
form-specific files — en-mac.jar, en-unix.jar, and en-win.jar — in that directory. extract only the one appropriate for your plat
form. after extracting the files we will modify the mozilla chrome registry to use the extracted files instead of the original jar archives. the chrome registry is a file that lists each major mozilla component and where in the chrome directory its ui files are located. ...
...es instead of the original jar archives. the chrome registry is a file that lists each major mozilla component and where in the chrome directory its ui files are located. it is located in the chrome directory itself and is called either chrome.rdf or installed-chrome.txt (or both). the registry contains a bunch of complicated configuration statements in which you will find a number of urls of the
form jar:resource:/chrome/something.jar!/something-else... which point to directories within the jar archives. change them so they point to the extracted files by removing the leading jar: and the part in the middle that says something.jar!. if you have perl on your system, you can do this with the following command: perl -pi.orig -e 's/(jar:)|(\/[^.\/]+\.jar!)//g' chrome.rdf installed-chrome.txt for...
Creating a hybrid CD - Archive of obsolete content
the cd should support hfs (macintosh), joliet (win32), and rock ridge (unix). many mozilla files have long file names which makes creating the cd on a macintosh difficult because the hfs filesystem limits the length of file names to 32 characters. the utility mkhybrid lets you create hybrid cds that work with all three filesystems. mkhybrid was written by james pearson and is is a component of the latest versions of cdrecord. ...
... ...
... ...
... 'tvod' 'mpg3' "mpeg file" .mpg raw 'tvod' 'mpeg' "mpeg file" .mpeg raw 'tvod' 'mpeg' "mpeg file" .au raw 'tvod' 'ulaw' "audio file" * ascii 'ttxt' 'text' "text file" for more in
formation about recording cds, see the cd-recordable faq. original document in
formation author(s): dawn endico last updated date: may 1, 2001 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
In-Depth - Archive of obsolete content
de of this box will be displayed bottom to top and right to left. this is useful for, say, putting the navigation controls (back button) on the right hand side of the toolbar. values: normal, reverse -moz-image-region this is useful for dividing up an image into multiple smaller images. it uses a rect() object to determine the clipping region. check out the section on organizing images for more in
formation. example: -moz-image-region: rect(168px 69px 189px 46px); -moz-opacity makes boxes semi-transparent. it takes a decimal value, 0.00 is invisible and 1.00 is totally visible. how do i know what to modify? now that you've got everything extracted and you know how to modify items, you might be wondering, how do i know where everything is? well there is an easy way to find out - using the dom i...
...nd display it in the dom inspector. selected in the tree view will be xul:toolbarbutton. this is the portion of the icon with only the image. but the back button is made up of two parts (the back portion and the history portion), so if we move one level up in the tree we'll see toolbarbutton. this is what we want. on the right hand side of the dom inspector, what will be listed is the dom node in
formation. but what we're interested in is the css style rules. click the icon located above the dom in
formation and choose css style rules. the side bar will now be split into two parts. at the top, there is a list of all the groups of styles that are applied to this object. when you select an item in the list the bottom portion will display the actual styles that are applied. go through this list on...
...ifferent states of #back-button. change those to match your new image as well. just continue this process for everything that you wish to change and you'll have a new skin in no time. organizing images to organize all of your icons you can store them all in one image and then tell mozilla which portions to use. this is done using the -moz-image-region style. a bunch of 20px x 20px icons in a grid
format above is the source image of some icons setup to use the -moz-image-region style. each row is a different icon in one of its 4 different states (normal, hover, mouse down, and disabled). to cut the pieces out you need to define rectangles in the css file like this: #button-send { -moz-image-region: rect(294px 23px 315px 0px); } #button-send:hover { -moz-image-region: rect(294px 46px 315px...
...: 100px; background-repeat: no-repeat; background-position: top; } open up \classic\skin\classic\navigator\navigator.css and scroll down to the bottom. to style that image, we first need to get a handle to the toolbar, then the box inside of it, and then to the image that we added with the xml. by hunting around with the dom inspector and looking at the navigation toolbar you can find this in
formation. the id is "navigation-toolbar". then it contains a xul:hbox with the class .toolbar-holder. this .toolbar-holder class is also defined in the toolbarbindings.xml. this is where mozilla takes the code out of our xml file and puts the two together. inside of the xml file there is an image which has its class set to toolbar-primary-icon. note: in versions of firefox prior to firefox 3 beta 3, ...
Drag and Drop JavaScript Wrapper - Archive of obsolete content
most suitable. for example, a file may come in two flavors, the file itself and the text name of the file. if the file is dragged and dropped onto a directory, the file flavor will be used. if the file is dropped onto a textbox, the text name flavor will be used. the text is therefore used to insert the name of the file when files can't be dropped directly. a flavor object has a name, which is a
formatted like a mime type, such as 'text/unicode'. within the ondragstart function, you specify what flavours are available for the item being dragged. to do this, add data and flavours to the transferdata object, which is the second argument to ondragstart. an example should help here. the ondragstart function adds data to the transferdata object. var textobserver = { ondragstart: function (event,...
...ds the flavour of the data. once you have the data, you can add it to the element is some way. for example, you might set the value of a textbox. ...
...gged at once and also allows alternative
forms of the data to be dragged. the following table describes some of the flavours you might use. you can also make up your own flavours if necessary. text/unicode text data text/html html data text/x-moz-url a url application/x-moz-file a local file see here for an overview of more data flavours. ...
...flavours you might use. you can also make up your own flavours if necessary. ...
Repackaging Firefox - Archive of obsolete content
erties partner-bookmarks.xml one by one, the files listed above are: chrome.manifest contains a specialized listing of the contents of the xpi. components/partnerbookmarks.js from the cck extension, and it allows us to drop in default bookmarks at profile creation. you should not need to edit this file. defaults/preferences/partner.js default preferences for this dex. install.rdf meta-in
formation about your extension, such as the creator (your organization), a unique id, and which versions of firefox are supported. locale/*/partner.properties for preferences which need to be localized, there needs to be an entry in each of the properties files with the desired value for that locale. if the value is the same for *all* locales, it can be set in the partner.js file itself, see the se...
...h as the creator (your organization), a unique id, and which versions of firefox are supported. locale/*/partner.properties for preferences which need to be localized, there needs to be an entry in each of the properties files with the desired value for that locale. if the value is the same for *all* locales, it can be set in the partner.js file itself, see the section "preferences" for more in
formation. partner-bookmarks.xml default bookmarks are set here. and that's all you need! take a moment and browse through the files, and don't forget to check mdc for reference material. locales there is a difference between the locales you plan to distribute installers for (and will therefore need to repack), and the locales supported by your dex. if possible, we recommend you have your dex sup...
...ble.preference.name", "data:text/plain,localizable.preference.name=some value."); then, a properties file is not used (or needed at all) for that preference. therefore, if *all* of your preferences can use the same values, you do not need to include any properties files at all. note that you must know which preferences are localizable and which ones aren't. see the mdc documentation for more in
formation on them. important extension preferences there is a small set of preferences which will be given to you by mozilla. they help mozilla track your distribution, and plan upgrades accordingly. they allow for upgrades to be delivered by mozilla specifically for your distribution, if need be, and because of that they are the most important preferences you need to set. mozilla will provide you ...
... actual repackaging job itself. first, set the source directory by clicking its "choose" button. the source directory is a directory that contains the windows installer, mac disk image (.dmg), and/or linux tarball of the standard firefox that you wish to customize. second, set the destination directory to the directory into which you wish to save the customized installers. the "plat
forms" section lets you select the plat
forms for which you wish to generate customized installers. check the boxes next to each one you want to generate. make sure you have the standard firefox install package in the source directory for each of these. the names of the source installer packages for each plat
form that are included in your source directory will appear next to each checkbox. the repack...
Style System Overview - Archive of obsolete content
{ display: block; } [class="emph"] { font-style: italic; } css style rule representation each declaration block is represented by an nscssdeclaration an cssstyleruleimpl contains each selector associated with that declaration, and the declaration, and is the most important implementation of nsistylerule. the declarations (properties & values) are stored in data structs (nscss*). the data
format of the structs and selectors is mostly clear from the code and not worth going into (although the implementation of :not() is confusing). css style rule representation h1, h2 { color: green; text-align: right; text-indent: 0; } cssstyleruleimpl cssstyleruleimpl ↓ ↓ ↓ ↓ h1 nscssdeclaration h2 ...
...estruct.h). a struct for a style context can be obtained through nsistylecontext::getstyledata. nsiframe::getstyledata does the same thing for the frame's mstylecontext member, and the global ::getstyledata is a typesafe helper that doesn't require the style struct id. this style struct is always const, and should always be declared as such (evil old-style casts often used with the non-typesafe
forms sometimes hide this error), since the struct may be shared with other elements. the rule tree as we call nsrulewalker::forward on all the rules that are matched, we build or walk along the rule tree. the rule tree is a lexicographic tree of matched rules, where each node in the tree is represented by a nsrulenode. some style data is cached on nsrulenode objects to speed up computation and...
...e attributes that have an effect on which rules match and only doing a reresolvestylecontext if the attribute has an effect. nsistylesheet::attributeaffectsstyle (should be on nsistyleruleprocessor). we optimize event state changes (:hover, :active, etc.) using nsistyleruleprocessor::hasstatedependentstyle, which is much more accurate. the cssruleprocessor implementation does a slightly modified
form of selector matching to implement it (includes matching on the middle of selectors to catch p:hover a). style attribute changes we handle style attribute (“inline style”) changes in a different way from other changes to style rules. as for other style changes, we have to “walk” the rule tree and clear all the style data coming from the old inline style nsistylerule, since there coul...
...ky)) rule addition and removal just rebuild the entire world. we could at least do what we do for sheet addition/removal, or slightly better, by searching the rule tree (only one rule this time) instead of rebuilding it. lots of room for optimization here. (but beware didsetstylecontext) the style system style sheets & rules ↓ rule tree ↓ style context interface original document in
formation author(s): david baron last updated date: june 6, 2003 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Menu - Archive of obsolete content
jetpack's menu api allows features to access and modify the browser's built-in menus. features can also create new menus and attach them almost anywhere, chrome or content, as popup menus or context menus. two namespaces are associated with this api: jetpack.menu, which provides access to the browser's menus, and jetpack.menu, the constructor for making new menus. ...
...n a function that will be called when the menuitem is clicked. if the menu property is present, command will instead be called when any of the item's descendants is clicked. in that case, the commands of descendants will be invoked first. in either case, it is called as command(clickedmenuitem), where clickedmenuitem is the menuitem that was clicked. due to a plat
form bug in firefox, on os x only, for menus in the menu bar only, command functions defined on menuitems with submenus are not called when descendant menuitems are clicked. see bug 534014 for details and a workaround. data string an arbitrary string that the feature may associate with the menuitem. disabled boolean if true, the menuite...
...ons either by default or at all. label string the label of the menuitem. menu jetpack.menu if defined, the menuitem expands into a submenu. mnemonic string a character that is used as the item's shortcut key while the menu is open. it should be one of the characters that appears in the item's label. on some plat
forms this character is underlined in the label. type string currently only "separator" is supported. if this property is undefined, the item is a normal menuitem. note that when type == "separator", any other properties (such as label) may be specified. fancy separators may behave differently on different plat
forms, however. xulid string the i...
...submenu to the jetpack menu. (assume we've defined a getrecenttweets(), which invokes a callback with an array of strings.) when the menu is shown, it displays a "loading..." item. if the menu remains open when getrecenttweets() receives data from the network and calls done(), the "loading..." item is replaced with the tweets, one item per tweet: this example will not work on os x due to a plat
form bug in firefox. replace jetpack.menu with jetpack.menu.context.page to see the effect on the content context menu. see bug 526382 for more in
formation. jetpack.menu.add({ label: "recent tweets", menu: new jetpack.menu({ beforeshow: function (menu) { menu.set("loading..."); getrecenttweets(function done(tweets) menu.set(tweets)); } }) }); when the user selects some tex...
jspage - Archive of obsolete content
gth=="number"){if(a.callee){return"arguments"; }else{if(a.item){return"collection";}}}}return typeof a;}function $unlink(c){var b;switch($type(c)){case"object":b={};for(var e in c){b[e]=$unlink(c[e]); }break;case"hash":b=new hash(c);break;case"array":b=[];for(var d=0,a=c.length;d<a;d++){b[d]=$unlink(c[d]);}break;default:return c;}return b;}var browser=$merge({engine:{name:"unknown",version:0},plat
form:{name:(window.orientation!=undefined)?"ipod":(navigator.plat
form.match(/mac|win|linux/i)||["other"])[0].tolowercase()},features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.queryselector)},plugins:{},engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getelementsbyclassname)?950:925)); },trident:function(){return(!window.active...
...rident:function(){return(!window.activexobject)?false:((window.xmlhttprequest)?((document.queryselectorall)?6:5):4);},webkit:function(){return(navigator.taintenabled)?false:((browser.features.xpath)?((browser.features.query)?525:420):419); },gecko:function(){return(!document.getboxobjectfor&&window.mozinnerscreenx==null)?false:((document.getelementsbyclassname)?19:18);}}},browser||{});browser.plat
form[browser.plat
form.name]=true; browser.detect=function(){for(var b in this.engines){var a=this.engines[b]();if(a){this.engine={name:b,version:a};this.engine[b]=this.engine[b+a]=true; break;}}return{name:b,version:a};};browser.detect();browser.request=function(){return $try(function(){return new xmlhttprequest();},function(){return new activexobject("msxml2.xmlhttp"); },function(){return new activex...
...urn math.pow(2,10*--b)*math.cos(20*b*math.pi*(a[0]||1)/3);}});["quad","cubic","quart","quint"].each(function(b,a){fx.transitions[b]=new fx.transition(function(c){return math.pow(c,[a+2]); });});var request=new class({implements:[chain,events,options],options:{url:"",data:"",headers:{"x-requested-with":"xmlhttprequest",accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,
format:false,method:"post",link:"ignore",issuccess:null,emulation:true,urlencoded:true,encoding:"utf-8",evalscripts:false,evalresponse:false,nocache:false},initialize:function(a){this.xhr=new browser.request(); this.setoptions(a);this.options.issuccess=this.options.issuccess||this.issuccess;this.headers=new hash(this.options.headers);},onstatechange:function(){if(this.xhr.readystate!=4||!this.running)...
...turn false;},send:function(k){if(!this.check(k)){return this; }this.running=true;var i=$type(k);if(i=="string"||i=="element"){k={data:k};}var d=this.options;k=$extend({data:d.data,url:d.url,method:d.method},k);var g=k.data,b=string(k.url),a=k.method.tolowercase(); switch($type(g)){case"element":g=document.id(g).toquerystring();break;case"object":case"hash":g=hash.toquerystring(g);}if(this.options.
format){var j="
format="+this.options.
format; g=(g)?j+"&"+g:j;}if(this.options.emulation&&!["get","post"].contains(a)){var h="_method="+a;g=(g)?h+"&"+g:h;a="post";}if(this.options.urlencoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:""; this.headers.set("content-type","application/x-www-
form-urlencoded"+c);}if(this.options.nocache){var f="nocache="+new date().gettime(...
Message Summary Database - Archive of obsolete content
nsimsgfolder has a method to get the database for a folder. nsimsgdatabase is an abstraction on top of mdb, which is a set of db interfaces. the mdb interfaces are implemented in mork. mdb is a schema-less db interface, so it's trivial to add new attributes without regenerating the db, and it's trivial for older code to read newer databases, because the code can ignore but maintain the attributes it doesn't know about. ...
... message header object implements the nsimsgdbhdr interface. this includes a set of per-message flags, the more commonly used headers (e.g., subject, sender, from, to, cc, date, etc), and a few other attributes, e.g., keywords. there are a set of generic property methods so that core code and extensions can set attributes on msg headers without changing nsimsghdr.idl.msg threads we store thread in
formation persistently in the database and expose these object through the [nsimsgthread interface. so the db knows which messages are in a thread, which message a message is in reply to, etc. this allows us to store watch/ignore in
formation on a thread object, and avoids having to generate threading in
formation whenever a folder is open. this has arguably been more trouble than it's been worth, espec...
...this also supports generic properties. there is a method on nsimsgdatabase to get the dbfolderinfo. ...
...n nsimsgdatabase to get the dbfolderinfo. mork - the good, the bad, and the ugly mork has a horrible reputation and we're always asked why we don't just replace it with some other db. the bottom line is that we haven't been able to justify the very large cost of doing so because there won't be any benefit to the end-user, at least in the short term. here are some of the trade-offs: the mork file
format is ascii text, but unreadable. if it were binary, there would be less complaints, and it would be smaller. the mdb interfaces are overly complex, and unfamiliar. the mork code uses a lot of terminology of its own invention, as near as i can tell (though i suspect most db code would be that way). it's difficult to fix bugs in mork. but, on the other hand, there are very few bugs in the mork code...
Microsummary topics - Archive of obsolete content
enerator. ...
...ippet installs the microsummary generator from the creating a microsummary tutorial: var generatortext = ' \ <?xml version="1.0" encoding="utf-8"?> \ <generator xmlns="http://www.mozilla.org/microsummaries/0.1" \ name="firefox download count" \ uri="urn:{835daeb3-6760-47fa-8f4f-8e4fdea1fb16}"> \ <template> \ <trans
form xmlns="http://www.w3.org/1999/xsl/trans
form" version="1.0"> \ <output method="text"/> \ <template match="/"> \ <value-of select="id(\'download-count\')"/> \ <text> fx downloads</text> \ </template> \ </trans
form> \ </template> \ <pages> <include>http://(www\.)?spreadfirefox\.com/(index\.php)?</include> </pages> </generator> \ '; var domparser = components.classes["@mo...
...nerator in the uri attribute of the <generator> element. the value of the attribute must be a valid uri, but you can specify an arbitrary identifier using a urn, for example: urn:{835daeb3-6760-47fa-8f4f-8e4fdea1fb16} to guarantee uniqueness, use urns containing uuids generated by the nsuuidgenerator component. see generating a uuid in the nsiuuidgenerator documentation. you may also use another
form appropriate to your extension. note: when web sites install generators via window.sidebar.addmicrosummarygenerator(), firefox sets their uri attribute to urn:source:sourceurl, where sourceurl is the url from which the generator was downloaded. in the future, firefox may access source urls to download updated versions of generators, so unless you are installing generators which are available from ...
.... note: when web sites install generators via window.sidebar.addmicrosummarygenerator(), firefox sets their uri attribute to urn:source:sourceurl, where sourceurl is the url from which the generator was downloaded. in the future, firefox may access source urls to download updated versions of generators, so unless you are installing generators which are available from urls, you should not use this
form for your programmatically-installed generators. differentiating between user-initiated and microsummary-related requests when firefox updates a microsummary generated by a microsummary generator add-on, it automatically downloads the html content of the page being summarized. it does not generally download related content like embedded images and javascript scripts referenced by the page. however...
Monitoring downloads - Archive of obsolete content
oading, the file has begun to download. the adownload object is an nsidownload object. in that case, we create a new row in our database for the new file by opening the database and building a replace into sqlite command. the first three rows are set to the values of the source uri, file size, and start time fields from the download object. the remaining rows are set to zeroes since that's not in
formation we have at the moment. if the download's state indicates that the download is finished, canceled, or failed, we call our logtransfercompleted routine to update the log to indicate that state change. that code looks like this: logtransfercompleted: function(adownload) { var endtime = new date(); // current time is the end time // issue the replace sqlite command t...
...by looking for a record with both the same uri and start time, we properly support the case where the user downloads the same file multiple times. displaying the download log the download log window's code is encapsulated in an object called downloadlogger_dlwindow. since this is a simple example, it's a one-shot log window; it doesn't monitor for further changes to the log. it simply dis...
...k; default: statusstr = "unknown"; break; } cell.setattribute("label", statusstr); cell.setattribute("style", style); row.appendchild(cell); loglist.appendchild(row); } } finally { statement.reset(); dbconn = null; } } this code is fairly simple. it starts by opening the sqlite database containing the log in
formation, then creates a select sql statement to pull all entries from the database. to iterate over the results, we use a while loop that calls the mozistoragestatement object's executestep() method. each time that method is called, one row of the results is fetched. after that, the list row object is created, and each entry in the search result is fetched and inserted into the appropriate list ce...
...o improve this extension. if you're learning to use the download manager or storage apis, they're things you might look into doing for practice: add code to update the download log window on the fly, instead of generating a static list when it's first opened. add additional statistics. what's the average download speed across all downloads? what times of day do you get the best download per
formance? add buttons to delete items from the log, or to delete all items that have finished downloading. add searching. see also storage, nsidownloadmanager, nsidownload, nsidownloadprogresslistener ...
Scripting - Archive of obsolete content
ing false causes the application to terminate. load after the main application windows has finished loading. the window object has been initialized and can be used. error if there is an error loading the main app page (e.g. the server is not accessible). shutdown just before the application terminates. prism exposes desktop integration features through an property of the window object called plat
form. ...
...es the application to terminate. load after the main application windows has finished loading. the window object has been initialized and can be used. error if there is an error loading the main app page (e.g. the server is not accessible). shutdown just before the application terminates. prism exposes desktop integration features through an property of the window object called plat
form. ...
...d after the main application windows has finished loading. the window object has been initialized and can be used. error if there is an error loading the main app page (e.g. the server is not accessible). shutdown just before the application terminates. prism exposes desktop integration features through an property of the window object called plat
form. ...
...d can be used. error if there is an error loading the main app page (e.g. the server is not accessible). shutdown just before the application terminates. prism exposes desktop integration features through an property of the window object called plat
form. the plat
form property implements the nsiplat
formglue interface, whose methods are described in the following section. methods of the window.plat
form object can be called from webapp.js or from web content. the following code can be used by web content to determine whether it is running in prism: if ("plat
form" in window) { // prism-specific code goes here } see the nsiplat
formglue idl definition file for details of the methods available to prism apps. currently, the webapp script also has access to full xpcom functionality, just like a fire...
Table Cellmap - Archive of obsolete content
further it contains info whether this entry is a row- or colspan. 79 // this union relies on the assumption that an object (not primitive type) does 80 // not start on an odd bit boundary. if mspan is 0 then morigcell is in effect 81 // and the data does not represent a span. if mspan is 1, then mbits is in 8...
...these cells can cover more than a grid cell if the row- or colspan attribute is different from 1. a colspan lets add a cell to the second row in the 2x2 table and let the second cell in the first row span over two cells. <table> <tr><td>cell 1</td><td colspan="2">cell 2</td></tr> <t...
...map::getdataat with a special argument aupdatezerospan to repair the cellmap if it encounters a empty cell (nsnull), by looking for a origin of a zero row- or colspan that spans the queried place in the cellmap. this can produce enormous costs once the cellmap contains large holes that are not caused by zero spans, this is at least a o2(n) algorithm. ...
...o be hot spots per
formance wise: nscellmap::colhasspanningcells nscellmap::rowhasspanningcells nscellmap::rowisspannedinto users of nscellmap::getdataat outside nscellmap.cpp the border collapse code relies on the cellmap. the collapsing of rows and columns uses the cellmap. and finally the line iterator methods which are used for arrow navigation through a table. original document in
formation author(s): bernd mielke last updated date: september 27, 2003 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Table Layout Strategy - Archive of obsolete content
e used percent width - pct the cell width specified in percent, fixed width - fix the cell width specified as px, mm etc., proportional width - prop the cell width specified via 1*, 2* etc. and the desired width - des the width the content could fill without any linebreaks. cells can be members of colspans. these colspans have to distribute their space to the columns they include. this in
formation is hold in the adjusted width's. due to this there are 10 width in
formations for every column. min_con des_con fix min_adj des_adj fix_adj pct pct_adj min_pro final the width parameter have the following meaning: #define width_not_set -1 #define num_widths 10 #define num_major_widths 3 // min, des, fix #define min_con 0 // minimum width required of the content...
...for instance one cell could have a large min width,the next could have a specified fixed width and another a specified pct width. for a given width type the maximum wins. special cases note: the following examples are not shown correctly due to technical con...
...cations for columns is as follows: max(min_con, min_adj) max (pct, pct_adj) fix fix_adj max(des_con, des_adj), but use min_pro if present for a fixed width table, the column may get more space if the sum of the col allocations is insufficient column width info columns get their width in
formation from style info <col width="200px"> and from the cells that belong into this column. these in
formations are very often conflicting. for instance one cell could have a large min width,the next could have a specified fixed width and another a specified pct width. for a given width type the maximum wins. special cases note: the following examples are not shown correctly due to technical constraints on wiki content. you can help by editing this page and adding screenshots or links to example ...
...dy></tbody>foobar <col width="40%"><col><tbody></tbody>foobar <table border width="200px"> <col width="40%"><col width="80%"> <tbody> <tr><td>foo</td><td>bar</td></tr> </tbody> </table> the algorithm tries to satisfy the requirements on a first come first serve base. the second table has <col width="40%"><col>. ie and opera handle this pretty much the same as mozilla. original document in
formation author(s): bernd mielke last updated date: september 27, 2003 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Running Tamarin acceptance tests - Archive of obsolete content
y : run a verify pass instead of running abcs --verifyonly : run a -dverifyonly pass: only checks test exitcode (only works with debugger vms) testing the android shell the instructions above apply to running tests on an android device as well, but with a few differences. you should set environment variables as described above except for avm, which should be: $ export avm=$tamarin_build_top/plat
form/android/android_shell.py where $tamarin_build_top is your main tamarin repo folder. note that avm needs to point to android_shell.py which is a proxy for running the tests on the phone. the /android-public/android-vars.sh script has commented-out examples of the environment settings for running tests on the android avm shell. to recap the other environment settings: - set the builtinabc environm...
...ll_toplevel.abc. adb 'adb' stands for android debug bridge. adb is used to access your android device and can run both direct and shell-type commands. if you've correctly edited and run the android-vars.sh script mentioned on the tamarin build documentation page you should already be pathed to the adb executable in the public sdk/ndk, but if not it exists at /android-public/android-sdk-mac_86/plat
form-tools. adb supports ssh-like commands to an android device. adb automatically connects to a phone if connected by usb. adb shell "ls /" is a good test to see if connected. the command: $ adb devices lists the device id of each phone. if you have more than 1 phone connected to usb, use "adb -s " for each phone. if this fails, do you have a dev os installed? under settings->applications->developm...
...: copy avmshell to /data/local/tamarin. ...
...vmshell $ adb shell 'chmod 777 /data/local/tamarin/avmshell' copy android_runner.sh, if it doesn't already exist on the phone in /data/local/tamarin $ adb push tamarin-redux/plat
form/android/android_runner.sh /data/local/tamarin/android_runner.sh $ adb shell 'chmod 777 /data/loca/android_runner.sh' test it out with a simple .abc or no args for usage (should return exitcode=0) $ tamarin-redux/plat
form/android/android_shell.py hello.abc hello exitcode=0 test it out by retrieving the version in
formation of the shell on the android device $ $avm -dversion shell 1.4 debug build 6299:455bca954565 features avmsystem_32bit;avmsystem_unaligned_int_access;avmsystem_little_endian;avmsystem_arm;avmsystem_unix; avmfeature_jit;avmfeature_abc_interp;avmfeature_selftest;avmfeature_eval;avmfeature_protect_jit...
Using Breakpoints in Venkman - Archive of obsolete content
ts list.) venkman also indicates that one or more breakpoints have been set in the loaded scripts view, where red dots appear next to the files in which breakpoints have been set, along with the line number where the function begins whose code is being stopped. using breakpoints to debug when you set a breakpoint, you give venkman (or whatever debugger you're using) the opportunity to display in
formation about the execution environment. one of the most important aspects of debugging a script or software program is the ability to examine variables—function return values, errors, counters, variable scopes—as they change over the course of the script execution. the onflipx function in figure 1, for example, uses the variable newsign to figure out what image to use for the fish. when you set...
...venkman stop execution as it enters the onflipx function. stopped there, venkman displays the value of the newsign variable as "1" in the local variables view. using breakpoints and the interactive view, you can change the values of the variables that venkman displays (only in the context of the debugging environment itself) and see how these changes affect the execution of the code. for more in
formation about the sorts of actions you can take in venkman when you're at a breakpoint, see the debugging basics section of the introductory venkman article. clearing breakpoints to clear the breakpoint, click on the margin twice. the first click will clear the hard breakpoint and leave you with only a future breakpoint, which is represented by a yellow letter "f". a second click will remove the fut...
...n, the breakpoint can be used as a simple log message. the number of times the breakpoint has been hit is passed in as a parameter to the breakpoint script. to reset the count, enter a 0 in the "trigger count" field. meta comments you can also embed scripted breakpoints directly into the source code you are debugging by using a venkman facility called meta comments. meta comments are specially
formatted comments that pull in the script named after the comment and specify how to treat the output of that script. 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. the result of the evaluation will be logged to the interactive session. the //@jsd_break comment will insert a breakpo...
... enable meta comments in a script, select "scan for meta comments" from the context menu of the file in the loaded scripts view. when you add a meta comment, a normal breakpoint is created. you can change or delete this breakpoint just as you would a breakpoint created by hand. resources venkman introduction—previous article on venkman. venkman's home page on devmo. original document in
formation authors: robert ginda, ian oeschger published 02 may 2003 ...
Elements - Archive of obsolete content
hould reside in the same directory which contains helloworld.html. next: bindings > binding element. notes in the current stable releases of mozilla products (e.g. firefox 2) it is impossible to attach bindings to table sub-elements (rows, cells etc.) you can attach binding only to the table element itself. this has been fixed for future versions of mozilla products. see bug 83830 for more in
formation and for workarounds. default encoding in xml documents (including xbl files) is utf-8. an explicit encoding declarations may be present to override the default, for example <?xml version="1.0" encoding="iso-8859-1"?> uri in namespace declarations is an opaque string used to uniquely identify the namespace. it doesn't have to (and often it doesn't) point to some actual schema or a namespace...
...has just been attached to an element. so full access to anonymous nodes generated by the binding is already possible. the constructor tag must be placed inside the implementation tag. id - the id attribute is a document-unique identifier. note: prior to firefox 3, the constructor could be called at a time when reflow of the document layout was locked down, so that attempting to get layout in
formation from within the constructor could return out of date in
formation. in firefox 3 and later, the constructor is called when reflow can take place, which results in up-to-date in
formation being returned. see bug 398404 for details. note: all properties of the binding are "imported" as local variables in a constructor's scope. see bug 407314 for more details. destructor the code inside the de...
...f modifier keys. if present in the list, then the modifier key must be set in the dom event object in order for the handler to be matched. if the modifiers is not empty and the modifier is not present in the list, then the modifier key must not be set in the dom event object in order for the handler to be matched. supported modifiers are: shift alt control meta accel - the plat
form's primary accelerator key. it is left up to the user agent to decide which modifier key represents the primary key. (it's the control key on windows and meta on mac.) accesskey - the plat
form's primary shortcut mnemonic key should be used (the alt key on windows and linux, has no effect on mac). any - this causes the filter to ignore the state of any modifiers that occur before the any kewo...
...ecify how many times a button has been clicked. the event handler will only be matched if the value of the clickcount field in the dom mouse event object matches the value of the attribute. command - the id of a command to invoke when the event occurs. if used in a non-chrome document, the entire handler will be ignored. preventdefault - if set to true, the default action of the event is not per
formed. see also preventdefault method of the event object. resources <!entity % resources-content "(image?,stylesheet?)"> <!element resources %resources-content;> <!attlist property id id #implied > used for inclusion of image elements, to cache them for later use, and for inclusion of stylesheet elements. the resources tag must be used directly inside the bindi...
addFile - Archive of obsolete content
or components that come from another vendor, such as /microsoft/shared/msvcrt40.dll.typically, relative pathnames are relative to the main pathname specified in the initinstall method. this parameter can also be null, in which case the xpisourcepath parameter is used as a relative pathname.note that the registry pathname is not the location of the software on the machine; it is the location of in
formation about the software inside the client version registry. version an installversion object or a string of up to four integer values delimited by periods, such as "1.17.1999.1517". for variants or this method without a version argument the value from initinstall will be used. xpisourcepath a string specifying the location of the file within the xpi file. loca...
...rlying operating system. if this parameter is blank or null, xpisourcepath is used. flags an optional field; reserved for future use. pass 0 as the default value. returns an integer error code. for a list of possible values, see return codes. description the addfile method puts the file in a temporary location. ...
...se. pass 0 as the default value. returns an integer error code. for a list of possible values, see return codes. description the addfile method puts the file in a temporary location. to move this and all other files to their final location, call the per
forminstall method after you've successfully added all files. note: if you are installing binary files on a macintosh, be aware that the binary
format for those files must be applesingle if the resource in
formation is to be installed properly. some file transfer programs will convert apple binaries to this
format on transfer if you transfer them from a macintosh to a unix/windows machine before zipping up those files on that target system. example var xpisrc = "file.txt"; initinstall("adding a file", "addfile", "1.0.1.7", 1); f = get...
...operly. some file transfer programs will convert apple binaries to this
format on transfer if you transfer them from a macintosh to a unix/windows machine before zipping up those files on that target system. ...
initInstall - Archive of obsolete content
-ins portion of that namespace or java/download/, to be relative to the java portion. all other parts of the netscape 6 area of the registry are reserved for use by netscape. the client version registry is a hierarchical description of the software registered for use with netscape 6. the registry name provided here is not the location of the software on the machine, it is the location of in
formation about the software inside the registry. this distinction is important when you add components with the addfile method. version an installversion object or a string representing the version of the package being installed. when version is a string it should be up to four integer values delimited by periods, such as "1.17.1999.1517". flags an optional field; reserve...
...e use. pass 0 as the default value. returns an integer error code. for a list of possible values, see return codes. description the initinstall method initializes the installation of the specified software. you must call this method immediately after the constructor. it is an error to call any other install methods before calling initinstall. ...
...possible values, see return codes. description the initinstall method initializes the installation of the specified software. you must call this method immediately after the constructor. it is an error to call any other install methods before calling initinstall. after calling initinstall, your script must call per
forminstall or cancelinstall before it finishes. ...
...er
forminstall or cancelinstall before it finishes. if your script does not call per
forminstall or cancelinstall, netscape 6 will not be able to clean up properly after your script finishes. example to start installation for the royal airways plug-in, you could use this code: initinstall("royal airways tripplanner","/royalairways/ tripplanner","1.0.0.0"); ... ...
Accessing Files - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file in
formation | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the plat
form (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. accessing files this section describes how to cre...
...reference to be valid. that is, nsiscriptableio.getfile() will still return a valid file reference even if the file 'sample.txt' does not yet exist. you can check if the file exists by using nsifile.exists(). var file = io.getfile("profile", "sample.txt"); if (file.exists()) alert("the file is there!"); else alert("file not found!"); here, the same file is retrieved and a further check is per
formed to see whether the file is present or not. the exists method returns true if the file is present and false if it is not. if the file does not exist, you may wish to create it. the file object has a nsifile.create() method which may be used to create an empty file, or you can open a writing stream and write to the file. nsiscriptableio.getfile() may only be used to retrieve files that are direct...
...which may be used to create an empty file, or you can open a writing stream and write to the file. nsiscriptableio.getfile() may only be used to retrieve files that are directly within one of the starting directories. to retrieve other files, you will need to use nsiscriptableio.getfile() to access a directory and iterate through subdirectories until you come to the file that you want. for more in
formation about this, see working with directories. starting directories the examples above use the profile directory 'profile' as the starting directory for locating a file. there are several other values which may be used as the first argument to nsiscriptableio.getfile(), listed in the following table. application the directory of the executing application. for firefox, for ins...
... desktop the desktop directory. usually, you would use this as the default directory for saving files. components the components directory where xpcom components are installed. temp the temporary directory. you would store any temporary or cache files here. there are a number of other values that may be used, most of which are plat
form specific. for instance, on windows, the value 'strt' returns the start directory, where applications which run when the system starts up are placed. on other plat
forms, using this value will just result in an error. ...
How to implement a custom XUL query processor component - Archive of obsolete content
xul provides template query processors for rdf, xml and sql (mozstorage). the templating system also supports building custom query processors. custom query processors are xpcom components, must implement the nsixultemplatequeryprocessor interface and follow some conventions for when registering the component. in this example, we will create a simple javascript xpcom component. the component will hold a small array of javascript objects as its datasource. ...
... <label value="?eye"/> </row> </template> </rows> </grid> </window> a few things to note. we are not really using the datasources in our sample component, so we set it to a dummy value. an empty string would be ok too. the querytype is important. it is used to create an instance of our xpcom object. the contract id of our xpcom component should be of the
form "@mozilla.org/xul/xul-query-processor;1?name=xxx", where the xxx is the querytype used in the xul template block. here is our sample javascript xpcom query processor: components.utils.import("resource://gre/modules/xpcomutils.jsm"); // basic wrapper for nsixultemplateresult function templateresult(adata) { this._data = adata; // just make a random number for the id this._id = math.rando...
... // eventually we should read the <query> to create filters return this._data; }, genera...
...uilder // is ready for us to start }, done: function() { // called when the builder is destroyed to clean up state }, compilequery: function(abuilder, aquery, arefvariable, amembervariable) { // outputs a query object. ...
OpenClose - Archive of obsolete content
unprivileged content window (such as a web page) can only open a popup while its window is focused, and it is in the currently active tab. that means that a document in a background tab cannot open a menu or popup. closing menus menus will close automatically once the user has made a selection from the menu. when an menu item is selected, it fires a command event so that code may be used to per
form an action. the user may cancel selecting a command from a menu by pressing the escape key. this will close a single menu, but if this menu has a parent menu, the parent menu will remain open. a user may also cancel selecting from a menu by clicking outside the menu. in this case, not only will that menu close, but all parent menus will close as well. a menu may be closed by a script by setting t...
...be used to remove any commands that were adding during the popupshowing event. menus and popups are also closed when the document or window they are contained within is closed, or if the menupopup element is removed from the document. these are situations when the popuphiding or popuphidden events may not fire as the element the events would be fired on are no longer available. if you need to per
form uninitialization that would be done during these events, this could be done during an unload event. testing menu open state to check if a menu is open, check the state of the menu's open property. if the open property is set to true, then the menu is open, otherwise the menu is closed. var open = somemenu.open; opening a popup for opening menupopups that use the menu tag, the button tag and...
...board, so you should always provide an alternate means of accessing the functionality of the menu. this can be done by either placing alternate commands elsewhere in the user interface, or by providing a keyboard shortcut to open the menu. once the menu is open, the keyboard can be used to navigate and select items as usual. popups attached using the context attribute are opened when the user per
forms an action that attempts to open a context menu. this action will vary on each plat
form, but it general it involves clicking on the element with the right mouse button. on macintosh systems with only one mouse button, a context menu may be opened by either holding down the mouse button or by pressing the control key and clicking the mouse button. on windows, the context menu can also be opened by...
... value for the state property of open. this property is readonly and applies to the menupopup, panel or tooltip element. the state property can also have two other values, used while a popup is transitioning from being closed to open and vice versa. when a popup is about to be shown, the state property has a value of showing while it has the value hiding when the popup is about to be hidden. the
former will occur during the popupshowing event, while the latter will occur during the popuphiding event. for example, you could use the state property to determine if a panel is already open. if the panel is open, you might want to avoid manipulating the user interface within the main window, as the user won't be directly interacting with it. ...
Printing from a XUL App - Archive of obsolete content
this document will talk about printutils, and the ways that xul applications can trigger print-related behaviors. ...
... this document will talk about printutils, and the ways that xul applications can trigger print-related behaviors. ...
...cations can trigger print-related behaviors. ...
...e: describes the common structure of installable bundles, including extensions, themes, and xulrunner applications extension packaging: specific in
formation about how to package extensions theme packaging: specific in
formation about how to package themes multiple-item extension packaging: specific in
formation about multiple-item extension xpis xul application packaging: specific in
formation about how to package xulrunner applications chrome registration printing in xul apps ...
RDF Modifications - Archive of obsolete content
tically. this involves a third type of observer involved in a template builder, an nsirdfobserver, used to listen for modifications to the rdf datasource. naturally, this only applies to rdf queries. when the datasource is modified, the datasource will notify any observers of the change. the template builder uses these notifcations to update the template as necessary based on the new or removed in
formation. you don't need to implement this observer yourself, although you may add an observer to the datasource if you want to be notified when the data changes. note that this automatic updating of the template does not occur for xml and sqlite sources, only for rdf datasources. however, as it is possible to use and/or implement other query types with templates, these additional types may support a...
...st in the new data but were there before are removed. this means that the observer will be called only for the triples that differ between the new and old version of the data. if the reloaded datasource hasn't changed, the builder won't receive any notifications. this saves a lot of extra work. the rdf observer also has two methods onbeginupdatebatch and onendupdatebatch. these are called when per
forming a lot of operations on a datasource. when changing the datasource, the changes are surrounded by begin and end batch calls. then, rather than notify on every change, the datasource will send one notification when the changes are finished. the template builder then rebuilds the template completely when done. this is useful when making a large amount of changes to avoid having to keep recalculat...
...is a container 'http://www.xulplanet.com/rdf/myphotos', so the ?start variable will be filled in with this value. now, the potential result so far is: (?photo = http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg, ?description = 'one of the thirty or so egyptian obelisks', ?start = http://www.xulplanet.com/rdf/myphotos, ?title = 'obelisk') as you can see, the result looks to have all the in
formation necessary to create a new item in the output. if a statement hadn't generated a result, for instance if the photo did not have a title, or it wasn't contained in a parent container, there would be no match and the builder could stop processing the new triple. for instance, we might have added a description for a new photo, but haven't added the photo to the container resource. once we do add...
...t is an upcoming section. however, this does show that the template builder can update the output upon changes without rebuilding the entire template. when an unassertion occurs, or data is removed from the datasource, a different process is used. in this case, the builder looks at the results and determines which ones to remove. when it had first generated the results, the builder stored extra in
formation to specify what parts of the graph were navigated over. it uses this in
formation to help determine what results are no longer needed. rdf changes that affect a binding often, a new rdf triple is created in the datasource which would only affect a template rule's bindings. since the bindings section of a rule specifies predicates that may optionally have values, the addition or removal or ...
Result Generation - Archive of obsolete content
/sample.rdf" ref="http://www.xulplanet.com/rdf/a" flex="1"> this is an indicator that we want to construct a xul template using the reference point with the uri 'http://www.xulplanet.com/rdf/a'. query processing a query for an rdf datasource consists of a number of statements, placed as children of the query element. during query processing, the template builder builds up a network of in
formation such as: possible results that are available where content should be generated in
formation that indicates what to do when the rdf datasource changes this network of in
formation remains for the lifetime of the template, or until it is rebuilt. the template builder uses a method based on the rete algorithm to match data. this allows for a fairly efficient means of updating results when...
...the builder begins with a single possible result, called the seed. ...
...template builder uses a method based on the rete algorithm to match data. this allows for a fairly efficient means of updating results when, for instance, a new statement is added to the rdf graph. rather than rebuild the entire template, the algorithm allows only specific parts of the network of in
formation to be re-examined. a similar method can be used when removing rdf statements. while the in
formation network created by the template builder contains a number of different pieces of necessary in
formation, for the purposes of this discussion, we will only be interested in the list of possible results. the builder begins with a single possible result, called the seed. the builder processes each of a query's statements in sequence. to do this for a particular statement, the builder iterates ov...
... a single possible result, called the seed. the builder processes each of a query's statements in sequence. to do this for a particular statement, the builder iterates over the possible results found so far and either accepts each result or rejects each result. for the first statement, only the seed will be available as a possible result. at each step, new possible results may be added, or more in
formation pertaining to an existing result may be added to the network. naturally, a rejected result will be removed. once all results have been examined, the builder moves on to the next statement in the query. once all statements have been analyzed, any results which still remain go on to become matches. the matches are the endpoints and will cause content to be generated. so, to summarize: start...
Adding Event Handlers - Archive of obsolete content
elements. <script src="findfile.js"/> we'll create the script file later when we know what we want to put in it. we'll define some functions in the file and we can call them in event handlers. you can include multiple scripts in a xul file by using multiple script tags, each pointing to a different script. you may use relative or absolute urls. for example, you may use urls of the following
form: <script src="findfile.js"/> <script src="chrome://findfiles/content/help.js"/> <script src="http://www.example.com/js/items.js"/> this tutorial does not attempt to describe how to use javascript (except as related to event handling) as this is a fairly large topic and there are plenty of other resources that are available for this. by default the javascript console only shows errors from web...
...useful event since it automatically handles different ways of activating the element. for example, the command event will occur regardless of whether the user uses the mouse to click a button, or presses the enter key. there are two ways to attach an event listener to an element. first, by using an attribute with a script as its value. second, by calling an element's addeventlistener method. ...
... key. there are two ways to attach an event listener to an element. first, by using an attribute with a script as its value. second, by calling an element's addeventlistener method. the
former may only handle bubbling events but tends to be simpler to write. the latter can handle events at any phase and may also be used to attach multiple listeners for an event to an element. using the attribute
form is more common for most events. attribute event listeners to use the attribute
form, place an attribute on the element where you want the event listener to be, the name of which should be the event name preceded by the word 'on'. for example, the corresponding attribute for the 'command' event is 'oncommand'. the value of the attribute should be some script that should be executed when the even...
... label="show images"/> </vbox> in this example, the command event will bubble up from the button or checkbox to the vbox, where it is handled. if a second listener (the oncommand attribute) were placed on the button, its code will be called first, followed by the handler on the vbox. event handlers are passed the event object as an implied argument called 'event'. this is used to get specific in
formation about the event. one commonly used property is the 'target' property of the event, which holds the element where the event actually occured. in the example we display an alert containing the target's tag name. the target is useful when using a bubbling event so that you could have a set of buttons which are all handled by a single script. you might notice that the attribute syntax is simila...
Box Objects - Archive of obsolete content
about mozilla layout mozilla divides things into two sets of trees, the content tree and the layout tree. the content tree stores the nodes as they are found in the source code. the layout tree holds a different tree of nodes for each individual component that can be displayed. the layout tree holds the structure as the nodes are expected to be displayed there is not necessarily a one to one relationship between content and layout nodes. ...
...odes may have several layout objects, for example, each line of a paragraph has a separate layout object. conversely, some content nodes have no layout objects at all. for instance, the key element doesn't have any layout objects since it isn't displayed in any way. similarly, any element that has been hidden will not have a layout object either. ...
...unless you change the style for an element, most xul elements will usually use the box layout object or one of its subtypes. ...
... objects are constructed but it is quite useful to at least have at least the knowledge of what is described above of xul layout for more advanced xul development. box objects the layout objects are not accessible to the developer for manipulating. they are internal to the xul layout components. however, xul provides some helper objects, called box objects, which can provide some layout related in
formation. as the name implies, they are available for all box-based elements. there are several subtypes of box object, although only a couple of them are generally used. the others have functions which are more easily accessible by methods mapped directly onto the element, since those types are generally only used with one particular element. the base box object, or the interface nsiboxobject, howev...
XUL Changes for Firefox 1.5 - Archive of obsolete content
x> and <richlistitem> the <richlistbox> and <richlistitem> elements are used for creating lists containing arbitrary content. this element works similarly to the <listbox> which is designed primarily for lists of textual items. the <richlistbox> supports much of the same api as the <listbox> and single items, created with the <richlistitem> element may be selected. see xul:richlistbox for more in
formation. preferences system several elements have been added which may be used for creating preference windows. these windows are special types of dialogs which support several panels, each of which may be contained in the same file or a separate file. a set of icons will appear across the top of the dialog allowing the user to switch panels. along with the new preference elements and some additio...
...ese windows are special types of dialogs which support several panels, each of which may be contained in the same file or a separate file. a set of icons will appear across the top of the dialog allowing the user to switch panels. along with the new preference elements and some additional attributes for existing elements, they make it easy to set preferences without having to use code. for more in
formation, see preferences system. bfcache mozilla now caches the page's dom, so that navigating back and forward does not reload the page, making navigation much more efficient. the pageshow and pagehide events are used when switching from a page in the cache, while the load and unload events are used only when the page is loaded or unloaded. for more in
formation see using firefox 1.5 caching. ta...
...operty the <dialog> binding now supports the defaultbutton property. setting this property changes the default button of the dialog. it can be set either to one of the buttons of the <dialog> binding (using their names); or to none - in which case no button is set to be the default. button: icon property the icon property on a button may be used to set stock icons on a button, used on some plat
forms. for instance <button icon="help"> will create a button with a help icon. this is used typically on gnome systems where possible values are: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. <menulist> items in a <menulist> support the description attribute to allow for extra d...
...eve an enumeration of all of the strings in the bundle. ...
XUL Coding Style Guidelines - Archive of obsolete content
it could contain xul specific element types for ui controls, html4 markups for content data, and even javascript for user event handling. to make xul files easy to read and maintain, localization friendly, and portable across user agents, we need to have a set of coding style guidelines to ensure our objectives are achievable. the author has collected a set of guidelines from various sources listed in the references section. while some of the guidelines are recommended practices, the others are mandatory. ...
... several guidelines are to be adopted to make the translation work easier and less error-prone. the issues are discussed in details here: what is localizable? widget resources content data style info layout geometry how to make them localizable? localization notes localization notes are the xul writers' notes to the localizers/translators. they are placed above the actual entity string in the
format: <!-- localization note (entity.name): content --> where the <var>entity.name</var> is the entity name (id) for the string (entity value) to be localized, and the content provides helpful hints to the localizers. for example: <!-- localization note homebtn.label : do not translate the entity value "home". --> <!-- entity homebtn.label "home" --> properties files are very similar, but use ...
...references xul is discussed in depth in xul language spec and xul window language. ...
...xul localizability issues xhtml 1.1 recommendation namespaces in xml extensible markup language (xml) 1.0 euro sign the unicode standard®, version 2.1 "xml applications" by frank boumphrey. published by wrox press inc. isbn 1-861001-52-5. author: tao cheng newsgroup discussion mailing list original document in
formation author(s): tao cheng last updated date: december 10, 2004 copyright in
formation: copyright (c) tao cheng ...
checkbox - Archive of obsolete content
rence home [ examples | attributes | properties | methods | related ] an element that can be turned on and off. this is most commonly rendered as a box when the element is off and a box with a check when the element is on. the user can switch the state of the check box by selecting it with the mouse. a label, specified with the label attribute, may be added beside the check box. more in
formation is available in the xul tutorial. attributes accesskey, checked, command, crop, disabled, src, label, preference, tabindex properties accesskey, accessibletype, checked, command, crop, disabled, src, label, tabindex examples <checkbox label="enable javascript" checked="true"/> <checkbox label="enable java" checked="false"/> attributes accesskey type: character thi...
...he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
... menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
... label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more in
formation is available in the preferences system article. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. properties accesskey type: character gets and sets the value of the accesskey attribute. a...
colorpicker - Archive of obsolete content
bled, open, tabindex, value examples <colorpicker/> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
...spond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. color type: color string the currently selected color. this is modified when the user selects a color. you can assign a string of the
form #rrggbb to this property to change the selected color. overview an onchange attribute is an event listener to the object for the event change. 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 w...
... <script type="text/javascript"> function myfunction(e){ /* do something cool here or just say the below */ alert(e.target.nodename); } </script> <textbox id="find-text" onchange="return myfunction(event);"/> </window> preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more in
formation is available in the preferences system article. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. type type: string if this attribute is not present, the colorpicker is displayed inside the window. if this is set to th...
...displayed as a button. when the user clicks the button, a popup appears for the user to select a color. properties accessibletype type: integer a value indicating the type of accessibility object for the element. color type: color string the currently selected color. this is modified when the user selects a color. you can assign a string of the
form #rrggbb to this property to change the selected color. disabled type: boolean gets and sets the value of the disabled attribute. open type: boolean returns true if the popup for a button-type colorpicker is open. set this property to true to open the popup or false to close the popup. tabindex type: integer gets and sets the value of the tab...
datepicker - Archive of obsolete content
pecified using the type attribute. normal - a datepicker with three fields for entering the year, month and date. grid - a datepicker with a calendar grid for selecting a date. popup - a normal datepicker with three fields, but with an additional dropdown button to display a popup grid. there are several ways to set the selected day. in xul, the value attribute may be set to a value of the
form yyyy-mm-dd to initialize the datepicker to a certain date. if not specified, the datepicker defaults to the current day. to change the selected date, the value property may be used to set a new value in the
form yyyy-mm-dd. the datevalue property may be used to retrieve and set the date using a date object. in addition, the date, month and year properties may be used to retrieve and modify each ...
...examples <datepicker type="grid" value="2007-03-26"/> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
...f this kind is desired. grid a datepicker that displays a calendar grid where one month is shown at a time. popup a datepicker with three entry fields but an additional dropdown button, which, when pressed, will display a popup calendar grid. value type: string the initial value of the datepicker in the
form yyyy-mm-dd. properties date type: integer the currently selected date of the month from 1 to 31. set this property to change the selected date. dateleadingzero type: boolean a read only value indicating whether a leading zero should be displayed before the date when it is less than 10. datevalue type: date the date that i...
...n. set this property to open or close the popup. for non-popup datepickers, this property is always false. readonly type: boolean if set to true, then the user cannot modify the value of the element. tabindex type: integer gets and sets the value of the tabindex attribute. value type: string the currently selected date in the
form yyyy-mm-dd. unlike the month property, months in this value range from 01 to 12. set this property to change the selected date. year type: integer the currently selected year from 1 to 9999. set this property to change the selected year. yearleadingzero type: boolean a read only value indicating whether a leading zero should be displayed before the ...
key - Archive of obsolete content
ed. for the shortcut defined using the key element to work, you must specify a command attribute (or an oncommand handler) on the key element. to display the shortcut defined with the key element in the ui, you can use <menuitem key="key element's id" command="command id" .../>. in order to use (non-default) key commands within specific elements, you will need to listen for key events. more in
formation is available in the xul tutorial. 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. if this attribute is set, the element is disabled.
... the id of a command element that is being observed by the element. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
... string a label for the keyboard shortcut. this text would appear next to a menuitem label if that menuitem is associated with the key element via its key attribute. modifiers type: space-separated list of the values below a list of modifier keys that should be pressed to invoke the keyboard shortcut. multiple keys may be separated by spaces or commas. keys will map to other keys on plat
forms that do not have them. shift: the shift key. alt: the alt key. on the macintosh, this is the option key. on macintosh this can only be used in conjunction with another modifier, since alt+letter combinations are reserved for entering special characters in text. meta: the meta key. on the macintosh, this is the command key. control: the control key. os: windows logo key on windows, super ...
...ifier, since alt+letter combinations are reserved for entering special characters in text. meta: the meta key. on the macintosh, this is the command key. control: the control key. os: windows logo key on windows, super or hyper key on linux. this shouldn't be specified directly because it may conflict with system wide shortcut key. accel: the key used for keyboard shortcuts on the user's plat
form, which is control on windows and linux, and command on mac. usually, this would be the value you would use. access: the access key for activating menus and other elements. on windows, this is the alt key, used in conjuction with an element's accesskey. any: indicates that all modifiers preceding it are optional. oncommand type: script code this event handler is called when the command ...
listbox - Archive of obsolete content
the list using the rows attribute. additional rows can be viewed using a scroll bar. a listbox is expected to contain listitem elements. all the rows in the listbox are the same height, which is the height of the tallest item in the list. if you wish to create a list with variable height rows, or with non-text content, you should instead use the richlistbox element. see list controls for more in
formation. attributes disabled, disablekeynavigation, preference, rows, seltype, suppressonselect, tabindex, value properties accessibletype, currentindex, currentitem, disabled, disablekeynavigation, itemcount, listboxobject, selectedcount, selectedindex, selecteditem, selecteditems, seltype, suppressonselect, tabindex, value methods additemtoselection, appenditem, clearselection, ensur...
... row.appendchild(cell); thelist.appendchild(row); } attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
...o specific items within the element by pressing keys corresponding to letters in the item's label. this is done incrementally, so typing more letters with select more specific items. this feature may be disabled by setting this attribute to true. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more in
formation is available in the preferences system article. rows type: integer the number of rows to display in the element. if the element contains more than this number of rows, a scrollbar will appear which the user can use to scroll to the other rows. to get the actual number of rows in the element, use the getrowcount method. seltype type: one of the values below us...
..."value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. currentindex type: integer set to the index of the currently focused item in the list. if no item is focused, the value will be -1. (or, on some plat
forms, typeof(listboxcurrentindex) will be undefined) in a single selection list, the current index will always be the same as the selected index. in a multiple selection list, the currently focused row may be modified by the user without changing the selection by pressing the control key and pressing the cursor keys to navigate. currentitem type: listitem element returns the currently focused i...
listitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single row in a listbox. the text of the listitem is specified either using listcell elements, or by placing a label attribute directly on the listitem element. by default it contains a single listcell element of type and class appropriate to that of the listitem. more in
formation is available in the xul tutorial. attributes accesskey, checked, command, crop, current, disabled, image, label, preference, selected, tabindex, type, value properties accesskey, accessible, checked, control, crop, current, disabled, image, label, selected, tabindex, value style classes listitem-iconic examples <listbox id="thelist"> <listitem label="ruby"/> <listitem label="emerald"/> <lis...
...he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
...tly selected item in a listbox, use the listbox property selecteditem. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
... label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more in
formation is available in the preferences system article. selected type: boolean indicates whether the element is selected or not. this value is read-only. to change the selection, set either the selectedindex or selecteditem property of the containing element. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user pr...
menuitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single choice in a menupopup element. it acts much like a button but it is rendered on a menu. more in
formation is available in the xul tutorial. attributes acceltext, accesskey, allowevents, autocheck, checked, closemenu, command, crop, description, disabled, image, key, label, name, selected, tabindex, type, validate, value properties accessibletype, accesskey, command, control, crop, disabled, image, label, labelelement, parentcontainer, selected, tabindex, value style classes menuitem-iconic, menuitem-non-iconic examples <menulist> <menupopup> <menuitem label="option 1" value="1"/> <menuitem label="option 2" value="2"/> <menuitem label="option 3" value="3...
...he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
...e: string descriptive text to appear in addition to the dialog title. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
...checkable menuitems or for radio button menuitems. checkbox the menuitem is checked. the checked attribute determines whether the menuitem is checked or not. radio the menuitem becomes part of a radio group. other menuitems that have the same value for their name attributes are part of the same radio group. only one menuitem in the same radio group can be checked at once. more in
formation on adding checkmarks to menus in the xul tutorial validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the images are stored remotely or you plan on swapping the image frequently. the following values are accepted, or leave out the attribute entirely for default handling: always the image is al...
menulist - Archive of obsolete content
related ] an element that can be used for drop-down choice lists. the user may select one of the elements displayed in the menulist. the currently selected choice is displayed on the menulist element. to create the drop-down, put a menupopup inside the menulist containing the choices as menuitem elements. the command event may be used to execute code when the menulist selection changes. more in
formation is available in the xul tutorial. attributes accesskey, crop, disableautoselect, disabled, editable, focused, image, label, oncommand, open, preference, readonly, sizetopopup, tabindex, value properties accessibletype, crop, description, disableautoselect, disabled, editable, editor, image, inputfield, itemcount, label, menuboxobject, menupopup, open, selectedindex, selecteditem, ta...
...he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
...match the text box. this attribute applies only to editable menulists. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
... selects a menu item or presses a keyboard shortcut attached to the command. open type: boolean for the menu type buttons, the open attribute is set to true when the menu is open. the open attribute is not present if the menu is closed. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more in
formation is available in the preferences system article. readonly type: boolean if set to true, then the user cannot change the value of the element. however, the value may still be modified by a script. sizetopopup type: one of the values below indicates how the menu width and the menupopup width are determined. if the sizetopopup attribute is left out or set to none, the menu will b...
textbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an input field where the user can enter text. it is similar to the html input element. only one line of text is displayed by default. the multiline attribute can be specified to display a field with multiple rows. more in
formation is available in the xul tutorial. attributes cols, decimalplaces, disabled, emptytext, hidespinbuttons, increment, label, max, maxlength, min, multiline, newlines, onblur, onchange, onfocus, oninput, placeholder, preference, readonly, rows, searchbutton, size, spellcheck, tabindex, timeout, type, value, wrap, wraparound properties accessibletype, clickselectsall, decimalplaces, decimalsymbol, defaultvalue, disabled, editor, emptytext, increment, inputfield, ...
...ber of decimal places. note that decimal numbers are stored as floats. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
...rs text in a textbox. this event is only called when the text displayed would change, thus it is not called when the user presses non-displayable keys. placeholder type: string a string that appears in the textbox when it has no value. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more in
formation is available in the preferences system article. readonly type: boolean if set to true, then the user cannot change the value of the element. however, the value may still be modified by a script. rows type: integer the number of rows to display in the element. if the element contains more than this number of rows, a scrollbar will appear which the user can use...
...ent. there is no default. the timer starts after the user types a character. if the user types another character, the timer resets. 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. autocomplete a textbox that supports autocomplete. for more in
formation about autocomplete textboxes, see the autocomplete documentation (xpfe [thunderbird/seamonkey]) (firefox) number a textbox that only allows the user to enter numbers. in addition, arrow buttons appear next to the textbox to let the user step through values. there are several attributes that allow the number textbox to be configured, including decimalplaces, min, max, increment, wraparou...
timepicker - Archive of obsolete content
properties | methods | related ] the timepicker is used to allow the user to enter a time. it contains three fields to enter the hour, minute and second. arrow buttons next to the fields allow the values to be adjusted with the mouse. a fourth textbox appears for 12 hour clocks which allows selection of am or pm. to specify the initial, use the value attribute set to a value of either the
form hh:mm:ss or hh:mm. the value may be retrieved and changed using the value property or the datevalue property. the
former specifies the time as a string of the
form hh:mm:ss whereas the latter specifies the time as a date object. in addition, the hour, minute and second properties may be used to retrieve and modify each component of the time separately. the change event is fired whenever the time...
...bindex, value examples <timepicker value="12:05"/> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
...rrows are pressed. this should be used in combination with setting hideseconds to true. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. value type: string the initial value of the timepicker in either the
form hh:mm:ss or hh:mm. properties amindicator type: string the string value displayed for hours between midnight and noon, defaulting to am. this value is determined from the user's locale. datevalue type: date the date that is currently entered or selected in the datepicker as a date object. disabled type: boolean gets and s...
... 59. set this property to change the selected second. secondleadingzero type: boolean a read only value indicating whether a leading zero should be displayed before the second when it is less than 10. tabindex type: integer gets and sets the value of the tabindex attribute. value type: string the currently entered time of the
form hh:mm:ss. set this property to change the time. methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), ge...
toolbarbutton - Archive of obsolete content
relevant accessbility guidelines all toolbar functionality should be duplicated elsewhere in the application where possible, provide keyboard alternatives. ...
...he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
...is is reverse of the order in which they appear in the xul code. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
...tton, which is usually labeled ok. using this attribute on a button that is not in a dialog box has no effect. the following values can be used as the dialog type: accept the ok button, which will accept the changes when pressed. cancel the cancel button which will cancel the operation. help a help button for displaying help about the dialog. disclosure a button to show more in
formation. this might be a button or a disclosure triangle. extra1 an optional additional button. extra2 a second optional additional button. group type: string group name buttons with type="radio" and the same value for their group attribute are put into the same group. only one button from each group can be checked at a time. if the user selects one the buttons, the others in th...
tree - Archive of obsolete content
ou can access the data using rdf functions or dom functions. this type is suitable for rdf generated trees with a fairly small number of rows. custom tree view nsitreeview no for this tree you implement the nsitreeview interface yourself. the tree's data is retrieved from this custom view. the custom view should be attached to the tree by setting its view property. more in
formation is available in the xul tutorial. also tree widget changes. relevant accessbility guidelines provide alternative access (for example, via menus) to column picker and for header behaviors like sorting (these have no default keyboard access). attributes disablekeynavigation, disabled, editable, enablecolumndrag, flags, hidecolumnpicker, onselect, rows...
...</treechildren> </treeitem> </treechildren> </tree> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
...pe: space-separated list of the values below a set of flags used for miscellaneous purposes. two flags are defined, which may be the value of this attribute. dont-test-empty: for template generated content, the builder will not check that a container is empty. dont-build-content: this flag may be used on a tree to indicate that content elements should not be generated. this results in a per
formance enhancement, but you will not be able to use the dom functions to retrieve the tree rows. hidecolumnpicker type: boolean when set to false, a drop-down will appear in the upper right corner of the tree, which the user may use to show and hide columns. when set to true, the column picker will be hidden. the default value is false. onselect type: script code this event is se...
...ed at once. (default in tree.) for trees, you can also use the following values: cell individual cells can be selected text rows are selected; however, the selection highlight appears only over the text of the primary column. for richlistbox, this is new in firefox 3.5. statedatasource type: uri chrome xul may specify an rdf datasource to use to store tree state in
formation. this is used to hold which tree items are open and which items are collapsed. this in
formation will be remembered for the next time the xul file is opened. if you do not specify this attribute, state in
formation will be stored in the local store (rdf:local-store). tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the use...
NPEvent - Archive of obsolete content
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. eventrecord npevent on mac os npevent is defined as an eventrecord data structure, which has the following fields: what integer repr...
...as an eventrecord data structure, which has the following fields: what integer representing an event type. both windowed and windowless plug-ins receive the same events. values: 0 nullevent 1 mousedown 2 mouseup 3 keydown 4 keyup 5 autokey 6 updateevt 7 diskevt 8 activateevt 15 osevt 23 khighlevelevent getfocusevent 0, 1 (true, false) losefocusevent adjustcursorevent 0, 1 (true, false) for in
formation about these events, see the mac os developer documentation. message longint. additional in
formation about the event. type of in
formation depends on the event type. undefined for null, mouseup, and mousedown events. when longint. ticks since start-up. where point. cursor location. modifiers integer. flags. xevent npevent on unix/x11 npevent is defined as an xevent data structure, which is...
...pe member is an int representing an event type, and indicating which structure is relevant. the event type may be any of the ollowing: graphicsexpose focusin focusout enternotify leavenotify motionnotify buttonpress buttonrelease keypress keyrelease description microsoft windows description the type npevent represents an event passed by npp_handleevent() to a windowless plug-in. for in
formation about these events, see your microsoft windows documentation. mac os description the npevent object represents an event passed by npp_handleevent() to a windowless plug-in. this structure is defined as eventrecord, the event type used by mac os. on mac os, plug-ins receive the same events for both windowed and windowless plug-ins, as follows. mouse events: sent if the mouse is within the ...
...the cursor when the mouse is within the instance, set the cursor and return true. if you don't want a special cursor, return false and the browser will use the standard arrow cursor. xwindows description the npevent object represents an event passed by npp_handleevent() to a windowless plug-in. the npevent structure is defined as xevent, the definition of the event type used by the xwindows plat
form. for in
formation about the xevent structure and xwindows events, see the xwindows documentation. as the xevents sent to the plug-in are synthesized and there is not a native window corresponding to the plug-in rectangle, some of the members of the xevent structures are not set to their normal xserver values. e.g. key events don't have a position. mouse events have x and y coordinates relative to ...
NPN_GetValue - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary allows the plug-in to query the browser for in
formation. syntax #include <npapi.h> nperror npn_getvalue(npp instance, npnvariable variable, void *value); parameters this function has the following parameters: instance pointer to the current plug-in instance. variable in
formation the call gets. values for npnvariable: npnvxdisplay =1: unix only: returns the current display npnvxtappcontext: unix only: returns the application's xtappcontext npnvnetscapewindow: ms windows and unix/x11 only: ms windows: gets the native window on which plug-in drawing occurs; returns hwnd unix/x11: gets the browser toplevel window in which...
...capewindow: ms windows and unix/x11 only: ms windows: gets the native window on which plug-in drawing occurs; returns hwnd unix/x11: gets the browser toplevel window in which the plug-in is displayed; returns window npnvjavascriptenabledbool: tells whether javascript is enabled; true=javascript enabled, false=not enabled npnvasdenabledbool: tells whether smartupdate (
former name: asd) is enabled; true=smartupdate enabled, false=not enabled npnvisofflinebool: tells whether offline mode is enabled; true=offline mode enabled, false=not enabled npnvtoolkit: npnvsupportsxembedbool: npnvwindownpobject: returns the npobject * pointer for the dom window object; see getting the page url in npapi plugin for a rough example npnvpluginelementnpobject: npnvs...
...or not the browser is currently in private browsing mode. the value parameter should point to an npbool, which will be set appropriately if the function returns nperr_no_error. npnvdocumentorigin: the value for this variable is the unicode serialization of the origin converted to nfkc-encoded (normalized) utf-8. memory for this string must be freed by the plugin via npn_memfree(). for more in
formation, see the document origin specification. npnvplugindrawingmodel: (mac only) npnvsupportsquickdrawbool : (mac only) npnvsupportscoregraphicsbool : (mac only) value function returns the name of the plug-in in the value parameter. gecko 1.9.2 note starting with gecko 1.9.2 (firefox 3.6), the variables npnvservicemanager, npnvdomelement, and npnvdomwindow are no lo...
...arameter. gecko 1.9.2 note starting with gecko 1.9.2 (firefox 3.6), the variables npnvservicemanager, npnvdomelement, and npnvdomwindow are no longer supported. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description npn_getvalue returns the browser in
formation set with npn_setvalue. the queried in
formation is returned in the value parameter. unix the plat
form-specific values for this parameter are npnvxdisplay (the current display), npnvxtappcontext (the browser's xtappcontext), and npnvnetscapewindow (the browser toplevel window in which the plugin is displayed). you can use npnvnetscapewindow to obtain the appropriate window for the wm_transient...
NPP_Destroy - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary deletes a specific instance of a plug-in. syntax #include <npapi.h> nperror npp_destroy(npp instance, npsaveddata **save); parameters the function has the following parameters: instance pointer to the plug-in instance to delete. **save state or other in
formation to save for reuse by a new instance of this plug-in at the same url. passed to npp_new. returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description npp_destroy releases the instance data and resources associated with a plug-in. the browser calls this function when a plug-in instance is dele...
...nd the function returns an error code. for possible values, see error codes. description npp_destroy releases the instance data and resources associated with a plug-in. the browser calls this function when a plug-in instance is deleted, typically because the user has left the page containing the instance, closed the window, or quit the browser. you should delete any private instance-specific in
formation stored in the plug-in's instance->pdata at this time. if this function is deleting the last instance of a plug-in, np_shutdown is subsequently called. use np_shutdown to delete any data allocated in np_initialize and intended to be shared by all instances of a plug-in. use the optional save parameter if you want to save and reuse some state or other in
formation. upon the user's return to t...
...the plug-in's instance->pdata at this time. if this function is deleting the last instance of a plug-in, np_shutdown is subsequently called. use np_shutdown to delete any data allocated in np_initialize and intended to be shared by all instances of a plug-in. use the optional save parameter if you want to save and reuse some state or other in
formation. upon the user's return to the page, this in
formation is passed to the new plug-in instance when it is created with npp_new. avoid trying to save critical data with this function. ownership of the buf field of the npsaveddata structure passes from the plug-in to the browser when npp_destroy returns. the browser can and will discard this data based on arbitrary criteria such as its size and the user's page history. to ensure that the browser d...
..._destroy returns. the browser can and will discard this data based on arbitrary criteria such as its size and the user's page history. to ensure that the browser does not crash or leak memory when the saved data is discarded, npsaveddata's buf field should be a flat structure (a simple structure with no allocated substructures) allocated with npn_memalloc. mac os if you want to restore state in
formation if this plug-in is later recreated, use np_memalloc to create an npsaveddata structure. note: you should not per
form any graphics operations in npp_destroy as the instance's window is no longer guaranteed to be valid. see also npp_new, np_shutdown, npp, npn_memalloc, npsaveddata ...
NPP_HandleEvent - Archive of obsolete content
values: ms windows: pointer to npevent structure mac os: pointer to a standard mac os eventrecord unix/x11: pointer to a standard xlib xevent for a list of possible events, see npevent. ...
...values: ms windows: pointer to npevent structure mac os: pointer to a standard mac os eventrecord unix/x11: pointer to a standard xlib xevent for a list of possible events, see npevent. ...
...values: ms windows: pointer to npevent structure mac os: pointer to a standard mac os eventrecord unix/x11: pointer to a standard xlib xevent for a list of possible events, see npevent. returns if the plug-in handles the event, the function should return true. ...
...e application is responsible for delivering to the plug-in, see the npevent structure. ms windows the browser gives each windowed plug-in its own native window, often a child window of the browser window, to draw into. the plug-in has complete control over drawing and event handling within that window. mac os the browser does not give a windowed plug-in a native window, because the mac os plat
form does not support child windows. instead, the windowed plug-in draws into the graphics port associated with the the browser window, at the offset that the browser specifies. for this reason, npp_handleevent is only way the plug-in can receive events from its host application on mac os. when npp_handleevent is called, the current port is set up so that its origin matches the top-left corner of the ...
Supporting private browsing in plugins - Archive of obsolete content
for example, if private browsing mode is in effect, video player plugins should not record the urls of watched videos in their histories. ...
... for example, if private browsing mode is in effect, video player plugins should not record the urls of watched videos in their histories. ...
... for example, if private browsing mode is in effect, video player plugins should not record the urls of watched videos in their histories. ...
... for example, if private browsing mode is in effect, video player plugins should not record the urls of watched videos in their histories. detecting private browsing mode plug-ins can detect whether or not private browsing mode is in effect by using the npn_getvalue() function to check the current value of the npnvprivatemodebool variable. ...
Plugins - Archive of obsolete content
plug-in support has been dropped other than flash for more details). flash usage is also set to be phased out in the future. note: plugins are now a legacy technology. they are not available on most mobile devices. mozilla encourages website developers to avoid using plugins wherever possible and use standard web apis instead. if there are plugin features which are not available in the web plat
form, we encourage developers to post their use cases to mozilla.dev.plat
form project list, so that mozilla can prioritize web plat
form work to make those use cases possible. for more in
formation about plugin roadmap, see non-archived plugin in
formation. plugins are shared libraries that users can install to display content that the browser can't display natively. for example, the adobe reader plug...
... plugins are written using npapi, the cross-browser api for plugins. the main source of documentation for npapi is the gecko plugin api reference. to make your plugin scriptable from web pages, use npruntime. ...
... api for plugins. the main source of documentation for npapi is the gecko plugin api reference. to make your plugin scriptable from web pages, use npruntime. plugins can be written completely from scratch using c apis (usually in c or c++) or they may be built on a plugin framework such as firebreath, juce, or qtbrowserplugin. there are also some code generation tools that may be helpful. more in
formation about these tools can be found on the external resources page. plugins are different from extensions, which modify or enhance the functionality of the browser itself. plugins are also different from search plugins, which plug additional search engines in the search bar. gecko plugin api reference (npapi) this reference describes the application programming interfaces for npapi plugin...
... tools can be found on the external resources page. plugins are different from extensions, which modify or enhance the functionality of the browser itself. plugins are also different from search plugins, which plug additional search engines in the search bar. gecko plugin api reference (npapi) this reference describes the application programming interfaces for npapi plugins and provides in
formation about how to use these interfaces. site author guide for click-to-activate plugins these guidelines will help website authors use plugins when they are blocked by default with the firefox click-to-activate feature. scripting plugins (npruntime) this reference describes the new cross-browser npapi extensions that let plugins be scriptable and also let them access the script objects in ...
Getting Started - Archive of obsolete content
g examples in action. this tutorial follows the mantra thatthe best way to learn is to do . because of this, you will be creating your own rss files by hand. who should use this tutorial? this tutorial is mostly meant for beginners to rss (i.e., those with no or very little prior rss experience). however, those experienced with rss may also find this useful as an aid in filling in any missing in
formation about rss that they were not aware of, or as a refresher guide. this tutorial assumes that you have some experience with html (or xml) and that you are comfortable with the basics ofmarkup . in other words, code like this doesn't bother you: this is some markup with <b>bold</b> tags. if you are comfortable with that, you should have no problem learning rss. note: if you are not a web d...
...u need to be comfortable with creatingmarkup to be able to effectively use this tutorial. what do you need before you start? to get the most from this tutorial, you will need a text editor and a rss reader. you must also know how to use each of these. note: a word processor is not a text editor. if a word processor is used, you must make sure to save your rss files in a (pure and plain) text
format. it is not mandatory to create rss files in this tutorial (you can just read on), but this would be a less effective way for you to learn. you'll retain the in
formation more and absorb it better if you create the rss files yourself. how to use this tutorial although each page in this tutorial has been written so that it can act as a "standalone" tutorial, it does assume you already possess ...
...ry to create rss files in this tutorial (you can just read on), but this would be a less effective way for you to learn. you'll retain the in
formation more and absorb it better if you create the rss files yourself. how to use this tutorial although each page in this tutorial has been written so that it can act as a "standalone" tutorial, it does assume you already possess the knowledge of the in
formation taught in previous pages of this tutorial. although you may jump to any point in the tutorial that you wish, we suggest that rss beginners read this tutorial in order. ...
...orial has been written so that it can act as a "standalone" tutorial, it does assume you already possess the knowledge of the in
formation taught in previous pages of this tutorial. although you may jump to any point in the tutorial that you wish, we suggest that rss beginners read this tutorial in order. ...
RSS - Archive of obsolete content
getting started a guided tutorial that will help you get started with rss. really simple syndication (rss) is a popular html-like xml-based data
format used for syndication. rss has a sordid history and a multitude of different incompatible rss versions. (some being based on rdf, but most only being based on xml.) nonetheless, rss is an extremely popular
format that is used for syndicating news, blog posts, ipradio, and iptv, with an amazing amount of momentum. ...
...onetheless, rss is an extremely popular
format that is used for syndicating news, blog posts, ipradio, and iptv, with an amazing amount of momentum. documentation why rss slash is popular - counting your comments charles iliya krempeaux talks about the rss slash module, why it is popular among some, and how it is used to give a count for your comments. why well-
formed web rss module is popular - syndicating your comments charles iliya krempeaux talks about the rss well-
formed web module, why it is popular among some, and how it is used to link to your comments. ...
... view all... community view mozilla xml forums... ...
... view all... community view mozilla xml forums... ...
Security Controls - Archive of obsolete content
one can use functions that are not necessary. this principle is known as least privilege. limiting functionality and resolving security weaknesses have a common goal: give attackers as few opportunities as possible to breach a system. there are three types of security controls, as follows: management controls: the security controls that focus on the management of risk and the management of in
formation system security. operational controls: the security controls that are primarily implemented and executed by people (as opposed to systems). technical controls: the security controls that are primarily implemented and executed by the system through the system's hardware, software, or firmware. all three types of controls are necessary for robust security. for example, a security policy is...
...work-based firewall, a host-based firewall, and os patching. the motivation for having multiple layers is that if one layer fails or otherwise cannot counteract a certain threat, other layers might prevent the threat from successfully breaching the system. a combination of network-based and host-based controls is generally most effective at providing consistent protection. ...
...vation for having multiple layers is that if one layer fails or otherwise cannot counteract a certain threat, other layers might prevent the threat from successfully breaching the system. a combination of network-based and host-based controls is generally most effective at providing consistent protection. original document in
formation author(s): u.s. ...
... a certain threat, other layers might prevent the threat from successfully breaching the system. a combination of network-based and host-based controls is generally most effective at providing consistent protection. original document in
formation author(s): u.s. department of commerce title: federal in
formation processing standard publication 200, minimum security requirements for federal in
formation and in
formation systems last updated date: march 2006 copyright in
formation: this document is not subject to copyright. original document in
formation author(s): karen scarfone, wayne jansen, and miles tracy title: nist special publication 800-123, guide to general server security last updated date: july 2008 copyright in
formation: this document is not subject to copyright. ...
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. /* keyword values */ display-outside: block-level; display-outside: inline-level; display-outside: run-in; display-outside: contents; display-outside: none; display-outside: table-row-group; display-outside: table-header-group; display-outside: table-footer-group; display-outside: table-row; display-outside: table-cell; display-outside: table-column-group; display-outside: table-column; display-outside: table-caption; display-outside: ruby-base; display-outside: ruby-text; display-outside: ruby-base-container; display-outside: ruby-text-container; /* global values */ display-outside: inherit; display-outside:...
...on; display-outside: ruby-base; display-outside: ruby-text; display-outside: ruby-base-container; display-outside: ruby-text-container; /* global values */ display-outside: inherit; display-outside: initial; display-outside: unset; value not found in db! syntax one of the keyword values listed below. values block-level the element generates a block-level box, and participates in a block
formatting context. other
formatting contexts, such as flex
formatting contexts, may also work with block-level elements. inline-level the element generates an inline-level box, and participates in an inline
formatting context. run-in the element generates a run-in box. run-in elements act like inlines or blocks, depending on the surrounding elements. contents the element lays out its contents u...
... table-row-group, table-header-group, table-footer-group, table-row, table-cell, table-column-group, table-column, table-caption the element is an internal table element, and participates in a table layout context. ...
...d children to be of particular display types. for example, a table-row box requires its parent to be a table row group box and its children to be table-cell boxes. layout-specific leaf types these display types require their parent to be of a particular display type, but can accept any display-inside value. for example, a table-caption box must have a table parent, but can establish any kind of
formatting context for its children.
formal syntax syntax not found in db! specifications specification status comment css display module level 3the definition of 'display-outside' in that specification. candidate recommendation initial definition ...
Reference - Archive of obsolete content
.2. so how should this be documented? in fx 1.0, js 1.2 is available, but not in the upcoming fx 1.5. there are 5 cases where "javascript1.2" is mentioned in this reference: special:search?search=javascript1.2&go=go. how should they be revised? --maian 23:43, 21 september 2005 (pdt) i think we need a new section in the reference that specifies the differences between versions, collecting this in
formation into a single location rather than leaving it scattered haphazardly throughout the reference as it currently is. once that is done, the various code samples should be updated to reflect current practices and code if they cannot be written in a "version-neutral" manner. do you think this makes sense? -- dria 04:27, 22 september 2005 (pdt) those examples are not "bad examples" per se. they a...
...st tense. i also support the use of a deprecated pre box with these examples. since it's been 9 months since the last comment on this, i think i'll go ahead and change all of the examples. if anyone disagrees, you can always revert. sevenspade 13:19, 2 july 2006 (pdt) after some thought, i removed the references to using language="javascript1.2", and all references are merely presented as in
formation detailing past behavior. the "backwards compatibility" sections have been renamed to "behavior in older versions." however, i think this is only appropriate if we are going to document the evolution of everything, or at least note the most significant changes introduced in the various versions. otherwise, i think we should just remove the "behavior in other versions" sections, and rename th...
...infinitely do function.constructor; //function function.constructor.constructor; //function . . . function.constructor.constructor.constructor.constructor.constructor . . . ; //function note that math is not a constructor function, but merely a global object with methods and properties useful to per
form various mathematical operations. this is why math instanceof object evaluates to true, but math instanceof function does not. compare this to the date object. like math, date is a global object that contains useful methods (date.parse() and date.utc()). in addition to this, however, date is also a constructor function: it constructs objects of the class date, and thus is an instance of both objec...
...1.6 reference. having 1.6 features defined in the 1.5 reference might be confusing. cstevens 10:23, 20 december 2006 (pst) we do plan to move the pages around, see core javascript 1.5 reference/reorg, but it's not clear when that will happen. in the meantime, newer features from js 1.6 (and hopefully someone will add js 1.7 features too) are being added to the reference with appropriate version in
formation on the page itself. yes, it can be slightly confusing, but it's better than no documentation for newer features at all. --nickolay 01:53, 22 december 2006 (pst) yes, seeing stuff that doesn't apply to 1.5 on a page titled "... javascript 1.5" might be a little confusing. but there is no other place to put javascript 1.6 features at the moment. (there is no "core javascript 1.6 reference" y...
RDF in Fifty Words or Less - Archive of obsolete content
e resources relate to one another. but what does that mean,really? to a mozilla developer, it means that the rdf data model (the "graph") can be used as a mechanism for integrating and organizing internet resources. let's look at an example:bookmarks. right now, most web browsers let you organize your bookmarks hierarchically intofolders. each bookmark is apointer to a web page called a uri (uni
form resource identifier). but a web page is just one kind of internet resource. there are tons of others, including email messages, usenet news articles (or entire usenet news groups), and search results from your favorite web crawler, just to name a few. and fundamentally, there's no reason that you shouldn't be able to treat these as "bookmarks" as well, grouping them together into folders as you ...
...an group them in just about any way that you can imagine. but wait, there's more... second, rdf is a serialization syntax. this syntax allows the graph-like model to be communicated between "agents". okay, what the heck doesthat mean? fundamentally, it means that parts of the rdf data model can be communicated across network boundaries, and the contents of the graph can dynamically change as in
formation arrives from a remote service. let's go back to our bookmark example. say that one of my bookmark "folders" is really a pointer to my email inbox: when i open that folder, voilà! all the messages that i've received over night appear. but how did that happen? the inbox "folder" was really just a pointer to an internet resource that contains more rdf that extends the graph. that "internet r...
...e received over night appear. but how did that happen? the inbox "folder" was really just a pointer to an internet resource that contains more rdf that extends the graph. that "internet resource" was a uri that pointed to a cgi script (say, http://www.mozilla.org/smart-mail/get-mail.cgi?user=waterson&folder=inbox). ...
...df> upon receipt of the above monstrosity, the rdf engine folds the rdf into the graph at the appropriate place, and the tree control that actually implements the ui to the bookmarks is notified that it should begin drawing some icons for the latest message about yam soup from aunt helga. this isexactly how smartmail works. contact: chris waterson (waterson@netscape.com) original document in
formation author(s): chris waterson last updated date: november 19, 1998 copyright in
formation: copyright (c) chris waterson interwiki language link ...
Bounding volume collision detection with THREE.js - Game development
ou need to manually call geometry.computeboundingbox beforehand. var knot = new three.mesh( new three.torusknotgeometry(0.5, 0.1), new meshnormalmaterial({})); knot.geometry.computeboundingbox(); var knotbbox = new box3( knot.geometry.boundingbox.min, knot.geometry.boundingbox.max); note: the boundingbox property takes the geometry itself as reference, and not the mesh. so any trans
formations such as scale, position, etc. applied to the mesh will be ignored while computing the calculating box. a more simple alternative that fixes the previous issue is to set those boundaries later on with box3.setfromobject, which will compute the dimensions taking into account a 3d entity's trans
formations and any child meshes as well. var knot = new three.mesh( new three.torusknotgeometry...
...de the sphere's center and radius, which can be added to the boundingsphere property available in geometry. var knot = new three.mesh( new three.torusknotgeometry(0.5, 0.1), new meshnormalmaterial({})); var knotbsphere = new sphere( knot.position, knot.geometry.boundingsphere.radius); unfortunately, there is no equivalent of box3.setfromobject for sphere instances. so if we apply trans
formations or change the position of the mesh, we need to manually update the bounding sphere. for instance: knot.scale.set(2, 2, 2); knotbsphere.radius = knot.geometry.radius * 2; intersection tests point vs. box3 / sphere both box3 and sphere have a containspoint method to do this test. var point = new three.vector3(2, 4, 7); knotbbox.containspoint(point); box3 vs. box3 the box3.intersectsbo...
... of the mesh, we need to manually update the bounding sphere. for instance: knot.scale.set(2, 2, 2); knotbsphere.radius = knot.geometry.radius * 2; intersection tests point vs. box3 / sphere both box3 and sphere have a containspoint method to do this test. var point = new three.vector3(2, 4, 7); knotbbox.containspoint(point); box3 vs. box3 the box3.intersectsbox method is available for per
forming this test. knotbbox.intersectsbox(otherbox); note: this is different from the box3.containsbox method, which checks whether the box3 fully wraps another one. sphere vs. sphere in a similar fashion as before, there is a sphere.intersectssphere method to per
form this test. knotbsphere.intersectssphere(othersphere); sphere vs. box3 unfortunately this test is not implemented in three.js, ...
... change the mesh position, rotation, scale, etc. we need to call the update() method so the boxhelper instance matches its linked mesh. we also need to call setfromobject again in order to make the box3 follow the mesh. knot.position.set(-3, 2, 1); knot.rotation.x = -math.pi / 4; // update the bounding box so it stills wraps the knot knotboxhelper.update(); box3.setfromobject(knotboxhelper); per
forming collision tests is done in the same way as explained in the above section — we use our box3 object in the same way as described above. // box vs box box3.intersectsbox(otherbox3); // box vs point box3.containspoint(point.position); demos there are two demos you can take a look at on our live demos page. the first one showcases point vs. box collisions using boxhelper. the second one perfo...
3D collision detection - Game development
s as with 2d collision detection, axis-aligned bounding boxes (aabb) are the quickest algorithm to determine whether the two game entities are overlapping or not. this consists of wrapping game entities in a non-rotated (thus axis-aligned) box and checking the positions of these boxes in the 3d coordinate space to see if they are overlapping. the axis-aligned constraint is there because of per
formance reasons. the overlapping area between two non-rotated boxes can be checked with logical comparisons alone, whereas rotated boxes require additional trigonometric operations, which are slower to calculate. if you have entities that will be rotating, you can either modify the dimensions of the bounding box so it still wraps the object, or opt to use another bounding geometry type, such as spher...
...if a point is inside an aabb is pretty simple — we just need to check whether the point's coordinates fall inside the aabb; considering each axis separately. ...
...tinsideaabb(point, box) { return (point.x >= box.minx && point.x <= box.maxx) && (point.y >= box.miny && point.y <= box.maxy) && (point.z >= box.minz && point.z <= box.maxz); } aabb vs. aabb checking whether an aabb intersects another aabb is similar to the point test. we just need to do one test per axis, using the boxes' boundaries. ...
.... sphere to check whether a sphere contains a point we need to calculate the distance between the point and the sphere's center. if this distance is smaller than or equal to the radius of the sphere, the point is inside the sphere. taking into account that the euclidean distance between two points a and b is (ax-bx)2)+(ay-by)2+(az-bz)\sqrt{(a_x - b_x) ^ 2) + (a_y - b_y)^2 + (a_z - b_z)} , our
formula for point vs. sphere collision detection would work out like so: f(p,s)=sradius>=(px-sx)2+(py-sy)2+(pz-sz)2f(p,s) = s_{radius} >= \sqrt{(p_x - s_x)^2 + (p_y - s_y)^2 + (p_z - s_z)^2} or in javascript: function ispointinsidesphere(point, sphere) { // we are using multiplications because is faster than calling math.pow var distance = math.sqrt((point.x - sphere.x) * (point.x - sphere.x) +...
GLSL Shaders - Game development
fragment shaders compute the renderings of a shape's colors and other attributes. glsl is not as intuitive as javascript. glsl is strongly typed and there is a lot of math involving vectors and matrices. ...
...in 3d space onto a 2d screen. fragment shaders fragment (or texture) shaders define rgba (red, blue, green, alpha) colors for each pixel being processed — a single fragment shader is called once per pixel. the purpose of the fragment shader is to set up the gl_fragcolor variable. gl_fragcolor is a built-in glsl variable like gl_position. the calculations result in a variable containing the in
formation about the rgba color. demo let's build a simple demo to explain those shaders in action. be sure to read three.js tutorial first to grasp the concept of the scene, its objects, and materials. note: remember that you don't have to use three.js or any other library to write your shaders — pure webgl (web graphics library) is more than enough. we've used three.js here to make the backgrou...
...the <script> element in the <head> includes the three.js library in the page; we will write our code into three script tags in the <body> tag: the first one will contain the vertex shader. the second one will contain the fr...
...e below inside the body's first <script> tag: void main() { gl_position = projectionmatrix * modelviewmatrix * vec4(position.x+10.0, position.y, position.z+5.0, 1.0); } the resulting gl_position is calculated by multiplying the model-view and the projection matrices by each vector to get the final vertex position, in each case. note: you can learn more about model, view, and projection trans
formations from the vertex processing paragraph, and you can also check out the links at the end of this article to learn more about it. both projectionmatrix and modelviewmatrix are provided by three.js and the vector is passed with the new 3d position, which results in the original cube moving 10 units along the x axis and 5 units along the z axis, translated via a shader. we can ignore the fourth...
asm.js - Game development
en a clear definition of what kind of code to generate. we will show what asm.js code looks like and explain how it helps and how you can use it. this subset of javascript is already highly optimized in many javascript engines using fancy just-in-time (jit) compiling techniques. ...
... additionally, if an engine chooses to specially recognize asm.js code, there even more optimizations that can be made. ...
... additionally, if an engine chooses to specially recognize asm.js code, there even more optimizations that can be made. firefox is the only browser to do this right now. ...
...de, there even more optimizations that can be made. firefox is the only browser to do this right now. asm.js language summary asm.js is an intermediate programming language. asm.js has a very predictable perfomance rate because it is limited to an extremely restricted subset of javascript that provides only strictly-typed integers, floats, arithmetic, function calls, and heap accesses. the per
formance characteristics are closer to native code than that of standard javascript. using a subset of javascript asm.js is already supported by major web browsers. since asm.js runs in a browser it depends heavily on the browser and the hardware. ...
Paddle and keyboard controls - Game development
ctx.beginpath(); ctx.rect(paddlex, canvas.height-paddleheight, paddlewidth, paddleheight); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); } allowing the user to control the paddle we can draw the paddle wherever we want, but it should respond to the user's actions. it's time to implement some keyboard controls. we will need the following: two variables for storing in
formation on whether the left or right control button is pressed. two event listeners for keydown and keyup events. we want to run some code to handle the paddle movement when the buttons are pressed. two functions handling the keydown and keyup events the code that will be run when the buttons are pressed. the ability to move the paddle left and right pressed buttons can be defined and initiali...
... most browsers use arrowright and arrowleft for the left/right cursor keys, ...
... most browsers use arrowright and arrowleft for the left/right cursor keys, but we need to also include right and left checks to support ie/edge browsers. ...
... most browsers use arrowright and arrowleft for the left/right cursor keys, but we need to also include right and left checks to support ie/edge browsers. ...
2D maze game with device orientation - Game development
g up the anchor point on the button for which all the calculations of the position are applied. in our case it's anchored half the way from the left edge and at the start of the top edge, so it can be easily horizontally centered on the screen without the need to know its width. when the start button is pressed, instead of jumping directly into the action the game will show the screen with the in
formation on how to play the game. howto.js ball.howto = function(game) { }; ball.howto.prototype = { create: function() { this.buttoncontinue = this.add.button(0, 0, 'screen-howtoplay', this.startgame, this); }, startgame: function() { this.game.state.start('game'); } }; the howto state shows the gameplay instructions on the screen before starting the game. after cl...
...dy will not move when we hit it with the ball and will have the collision detection calculated (which will be discussed later on in this article). building the block labyrinth to make the game harder and more interesting we will add some obstacles between the ball and the exit. we could use a level editor, but for the sake of this tutorial let's create something on our own. to hold the block in
formation we'll use a level data array: for each block we'll store the top and left absolute positions in pixels (x and y) and the type of the block — horizontal or vertical (t with the 'w' value meaning width and 'h' meaning height). then, to load the level we'll parse the data and show the blocks specific for that level. in the initlevels function we have: this.leveldata = [ [ { x: 96...
...ide(this.ball, this.levels[this.level-1], this.wallcollision, null, this); this will tell the framework to execute the wallcollision function when the ball hits any of the walls. we can use the wallcollision function to add any functionality we want like playing the bounce sound and implementing the vibration api. adding the sound among the preloaded assets there was an audio track (in various
formats for browser compatibility), which we can use now. it has to be defined in the create() function first: this.bouncesound = this.game.add.audio('audio-bounce'); if the status of the audio is true (so the sounds in the game are enabled), we can play it in the wallcollision function: if(this.audiostatus) { this.bouncesound.play(); } that's all — loading and playing the sounds is easy wit...
...ve to create a variable for storing the actual number of seconds elapsed from the start of the game, and to show it for the player in the game. let’s define the variables in the create function first: this.timer = 0; // time elapsed in the current level this.totaltimer = 0; // time elapsed in the whole game then, right after that, we can initialize the necessary text objects to display this in
formation to the user: this.timertext = this.game.add.text(15, 15, "time: "+this.timer, this.fontbig); this.totaltimetext = this.game.add.text(120, 30, "total time: "+this.totaltimer, this.fontsmall); we’re defining the top and left positions of the text, the content that will be shown and the styling applied to the text. we have this printed out on the screen, but it would be good to update the v...
Compile - MDN Web Docs Glossary: Definitions of Web-related terms
some compilers which translate between similar level languages are called transpilers or cross-compilers, for instance to compile from typescript to javascript. those are considered productivity tools. ...
...some compilers which translate between similar level languages are called transpilers or cross-compilers, for instance to compile from typescript to javascript. those are considered productivity tools. ...
...some compilers which translate between similar level languages are called transpilers or cross-compilers, for instance to compile from typescript to javascript. those are considered productivity tools. ...
...anguages are called transpilers or cross-compilers, for instance to compile from typescript to javascript. those are considered productivity tools. most compilers work either ahead-of-time (aot) or just-in-time (jit). as a programmer, you usually invoke aot compilers from a command line or your ide. the most famous, "gcc" is one example. jit compilers are usually transparent to you, used for per
formance. for instance in the browser: firefox' spidermonkey javascript engine has a jit built-in that will compile javascript in a website to machine code while you're viewing it so it runs faster. projects like webassembly work on making this even better. learn more general knowledge compiler on wikipedia the gnu compiler collection (gcc) learning resources base cs introduction on compile...
Search engine - MDN Web Docs Glossary: Definitions of Web-related terms
this enables users to find relevant pages as quickly as possible. ...
...this enables users to find relevant pages as quickly as possible. ...
...this enables users to find relevant pages as quickly as possible. searching: looking for relevant web pages based on queries consisting of key words and other commands to the search engine. ...
...earch engine conducts the following processes: web crawling: searching web sites by navigating hyperlinks on web pages, both within a site, and from one site to another. a web site owner can exclude areas of the site from being accessed by a search engine's web crawler (or spider), by defining "robot exclusion" in
formation in a file named robots.txt. indexing: associating keywords and other in
formation with specific web pages that have been crawled. this enables users to find relevant pages as quickly as possible. searching: looking for relevant web pages based on queries consisting of key words and other commands to the search engine. the search engine finds the urls of pages that match the query, and ranks them based on their relevance. it then presents results to the user in order of t...
Cascade and inheritance - Learn web development
yled with that color and font, unless you've applied different color and font values directly to them. some properties do not inherit — for example if you set a width of 50% on an element, all of its descendants do not get a width of 50% of their parent's width. if this was the case, css would be very frustrating to use! note: on mdn css property reference pages you can find a technical in
formation box, usually at the bottom of the specifications section, which lists a number of data points about that property, including whether it is inherited or not. see the color property specifications section, for example. understanding how the concepts work together these three concepts together control which css applies to what element; in the below sections we'll see how they work together. ...
...y value applied to a selected element to the initial value of that property. unset resets the property to its natural value, which means that if the property is naturally inherited it acts like inherit, otherwise it acts like initial. note: there is also a newer value, revert, which has limited browser support. note: see origin of css declarations in introducing the css cascade for more in
formation on each of these and how they work. we can look at a list of links and explore how the universal values work. the live example below allows you to play with the css and see what happens when you make changes. playing with code really is the best way to get to grips with html and css. for example: the second list item has the class my-class-1 applied. this sets the color of the <a> elem...
...rations in user style sheets it makes sense for web developers' stylesheets to override user stylesheets, so the design can be kept as intended, but sometimes users have good reasons to override web developer styles, as mentioned above — this can be achieved by using !important in their rules. test your skills! we have covered a lot in this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: the cascade. what's next if you understood most of this article, then well done — you've started getting familiar with the fundamental mechanics of css. next up, we'll look at selectors in detail. if you didn't fully understand the cascade, specificity, and inher...
...could be a specificity issue. ...
Organizing your CSS - Learn web development
ften isn't a right or wrong way to do things, but consistency is important. keep it consistent if you get to set the rules for the project or are working alone, then the most important thing to do is to keep things consistent. consistency can be applied in all sorts of ways, such as using the same naming conventions for classes, choosing one method of describing color, or maintaining consistent
formatting (for example will you use tabs or spaces to indent your code? if spaces, how many spaces?) having a set of rules you always follow reduces the amount of mental overhead needed when writing css, as some of the decisions are already made.
formatting readable css there are a couple of ways you will see css
formatted. some developers put all of the rules onto a single line, like so: .box { ...
...ules and then smaller ones that include the specific rules needed for those sections. you can link to multiple stylesheets from one page, and the normal rules of the cascade apply, with rules in stylesheets linked later coming after rules in stylesheets linked earlier. for example, we might have an online store as part of the site, with a lot of css used only for styling the product listings and
forms needed for the store. it would make sense to have those things in a different stylesheet, only linked to on store pages. this can make it easier to keep your css organised, and also means that if multiple people are working on the css you will have fewer situations where two people need to work on the same stylesheet at once, leading to conflicts in source control. other tools that can help c...
..., or logo. an element is something like a list item or a title that is tied to the block it is in. a modifier is a flag on a block or element that changes the styling or behavior. you will be able to recognise code that uses bem due to the extensive use of dashes and underscores in the css classes. 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. bem is widely used in larger web projects and many people write their css in this way. it is like...
... guide to css grid layout. ...
Overflowing content - Learn web development
. you might wonder why css works in such a messy way, displaying content outside of its intended container. why not hide overflowing content? why not scale the size of the container to fit all the content? wherever possible, css does not hide content. this would cause data loss. the problem with data loss is that you might not notice. website visitors may not notice. if the submit button on a
form disappears and no one can complete the
form, this could be a big problem! instead, css overflows in visible ways. you are more likely to see there is a problem. at worst, a site visitor will let you know that content is overlapping. if you restrict a box with a width or a height, css trusts you to know what you are doing. css assumes that you are managing the potential for overflow. in general, ...
...erflow: scroll hidden would set overflow-x to scroll and overflow-y to hidden. if you only want scrollbars to appear when there is more content than can fit in the box, use overflow: auto. this allows the browser to determine if it should display scrollbars. in the example below, remove content until it fits into the box. you should see the scrollbars disappear. overflow establishes a block
formatting context when you use a value of overflow such as scroll or auto, you create a block
formatting context (bfc). the content of the box that you have changed the value of overflow for acquires a self-contained layout. content outside the container cannot poke into the container, and nothing can poke out of that container into the surrounding layout. this enables scrolling behavior, as all box...
...ge and small amounts of content. increase the font sizes of text. generally ensure that your css works in a robust way. changing the value of overflow to hide content, or to add scrollbars, is likely to be reserved for a few select use cases. (for example, where you intend to have a scrolling box) test your skills! there is a lot to absorb from this lesson! can you remember the most important in
formation? to check your understanding, see test your skills: overflow. summary this lesson introduced the concept of overflow. you should understand that default css avoids making overflowing content invisible. you have discovered that you can manage potential overflow, and also, that you should test work to make sure it does not accidentally cause problematic overflow. previous overview: bui...
...oblematic overflow. ...
The box model - Learn web development
ou can test this by setting the margin-top of paragraph two to 0. the visible margin between the two paragraphs will not change — it retains the 50 pixels set in the bottom-margin of paragraph one. if you set it to -10px, you'll see that the overall margin becomes 40px — it subtracts from the 50px. there are a number of rules that dictate when margins do and do not collapse. for further in
formation see the detailed page on mastering margin collapsing. the main thing to remember for now is that margin collapsing is a thing that happens. if you are creating space with margins and don't get the space you expect, this is probably what is happening. borders the border is drawn between the margin and the padding of a box. if you are using the standard box model, the size of the border is a...
...t-width border-right-style border-right-color border-bottom-width border-bottom-style border-bottom-color border-left-width border-left-style border-left-color in the example below we have used various shorthands and longhands to create borders. have a play around with the different properties to check that you understand how they work. the mdn pages for the border properties give you in
formation about the different styles of border you can choose from. padding the padding sits between the border and the content area. unlike margins you cannot have negative amounts of padding, so the value must be 0 or a positive value. any background applied to your element will display behind the padding, and it is typically used to push the content away from the border. we can control the pa...
...<a> is hovered. the padding appears to overlap the border on the <ul> element. this is because the <a> is an inline element. add display: inline-block to the rule with the .links-list a selector, and you will see how it fixes this issue by causing the padding to be respected by other elements. test your skills! we have covered a lot in this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: the box model. summary that's most of what you need to understand about the box model. you may want to return to this lesson in the future if you ever find yourself confused about how big boxes are in your layout. in the next lesson, we will take a look at how back...
...k more interesting. ...
Floats - Learn web development
inside a column of text, with the text wrapping around the left or right of it. the kind of thing you might get in a newspaper layout. but web developers quickly realized that you can float anything, not just images, so the use of float broadened, for example to fun layout effects such as drop-caps. floats have commonly been used to create entire web site layouts featuring multiple columns of in
formation floated so they sit alongside one another (the default behavior would be for the columns to sit below one another, in the same order as they appear in the source). there are newer, better layout techniques available and so use of floats in this way should be regarded as a legacy technique. in this article we'll just concentrate on the proper uses of floats. a simple float example let's ex...
...this is like a mini layout inside your page, inside which everything is contained, therefore our floated element is contained inside the bfc and the background runs behind both items. this will usually work, however, in certain cases you might find unwanted scrollbars or clipped shadows due to unintended consequences of using overflow. display: flow-root the modern way of s...
... previous overvie...
...227); padding: 10px; color: #fff; display: flow-root; } .box { float: left; margin: 15px; width: 150px; height: 150px; border-radius: 5px; background-color: rgb(207,232,220); padding: 1em; } test your skills! you've reached the end of this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: floats. summary you now know all there is to know about floats in modern web development. see the article on legacy layout methods for in
formation on how they used to be used, which may be useful if you find yourself working on older projects. previous overview: css layout next in this module introduction to css layout normal flow ...
Positioning - Learn web development
rd elements have closed together like it no longer exists! well, in a way, this is true. an absolutely positioned element no longer exists in the normal document layout flow. instead, it sits on its own layer separate from everything else. this is very useful: it means that we can create isolated ui features that don't interfere with the layout of other elements on the page. for example, popup in
formation boxes and control menus; rollover panels; ui features that can be dragged and dropped anywhere on the page; and so on... second, notice that the position of the element has changed — this is because top, bottom, left, and right behave in a different way with absolute positioning. rather than positioning the element based on its relative position within the normal document layout flow, the...
...position within the normal document layout flow, they specify the distance the element should be from each of the containing element's sides. so in this case, we are saying that the absolutely positioned element should sit 30px from the top of the "containing element", and 30px from the left. (in this case, the "containing element" is the initial containing block. see the section below for more in
formation) note: you can use top, bottom, left, and right to resize elements if you need to. try setting top: 0; bottom: 0; left: 0; right: 0; and margin: 0; on your positioned elements and see what happens! put it back again afterwards... note: yes, margins still affect positioned elements. margin collapsing doesn't, however. note: you can see the example at this point live at 3_absolute-posi...
...this means that you can create useful ui items that are fixed in place, like persisting navigation menus that are always visible no matter how much the page scrolls. let's put together a simple example to show what we mean. first of all, delete the existing p:nth-of-type(1) and .positioned rules from your css. now, update the body rule to remove the position:...
...gg</dd> <dd>elephant</dd> <dd>egret</dd> </dl> sticky elements are "sticky" relative to the nearest ancestor with a "scrolling mechanism", which is determined by its ascendants' position property. note: you can see this example live at 7_sticky-positioning.html (see source code). test your skills! you've reached the end of this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: positioning. summary i'm sure you had fun playing with basic positioning; while it is not a method you would use for entire layouts, as you can see there are many tasks it is suited for. previous overview: css layout next ...
Responsive design - Learn web development
ing like m.example.com, or example.mobi). this meant that two separate versions of the site had to be developed and kept up-to-date. in addition, these mobile sites often offered a very cut down experience. as mobile devices became more powerful and able to display full websites, this was frustrating to mobile users who found themselves trapped in the site's mobile version and unable to access in
formation they knew was on the full-featured desktop version of the site. flexible layout before responsive design a number of approaches were developed to try to solve the downsides of the liquid or fixed-width methods of building websites. in 2004 cameron adams wrote a post entitled resolution dependent layout, describing a method of creating a design that could adapt to different screen resolutio...
... the downsides of the liquid or fixed-width methods of building websites. in 2004 cameron adams wrote a post entitled resolution dependent layout, describing a method of creating a design that could adapt to different screen resolutions. this approach required javascript to detect the screen resolution and load the correct css. zoe mickley gillenwater was instrumental in her work to describe and
formalize the different ways in which flexible sites could be created, attempting to find a happy medium between filling the screen or being completely fixed in size. responsive design the term responsive design was coined by ethan marcotte in 2010 and described the use of three techniques in combination. the first was the idea of fluid grids, something which was already being explored by gillenw...
...practices, used to create a layout that can respond to the device being used to view the content. in marcotte's original exploration this meant flexible grids (using floats) and media queries, however in the almost 10 years since that article was written, working responsively has become the default. modern css layout methods are inherently responsive, and we have new things built into the web plat
form to make designing responsive sites easier. the rest of this article will point you to the various web plat
form features you might want to use when creating a responsive site. media queries responsive design was only able to emerge due to the media query. the media queries level 3 specification became a candidate recommendation in 2009, meaning that it was deemed ready for implementation in bro...
...always have their browser window maximized. by using a flexible grid, you only need to add in a breakpoint and change the design at the point where the content starts to look bad. for example, if the line lengths become unreadably long as the screen size increases, or a box becomes squashed with two words on each line as it narrows. in the early days of responsive design, our only option for per
forming layout was to use floats. flexible floated layouts were achieved by giving each element a percentage width, and ensuring that across the layout the totals were not more than 100%. in his original piece on fluid grids, marcotte detailed a
formula for taking a layout designed using pixels and converting it into percentages. target / context = result for example, if our target column size is ...
What do common web layouts contain? - Learn web development
ake it so many directions. and if you don't have much experience, starting out with a blank page might be a bit scary. we have over 25 years' experience and we'll give you some common rules of thumb to help you design your site. even now with the new focus on mobile web, almost all mainstream webpages are built from these parts: header visible at the top of every page on the site. contains in
formation relevant to all pages (like site name or logo) and an easy-to-use navigation system. main content the biggest region, containing content unique to the current page. stuff on the side 1) in
formation complementing the main content; 2) in
formation shared among a subset of pages; 3) alternative navigation system. in fact, everything not absolutely required by the page's main content. footer...
...here are some examples (1 represents header, 2 footer; a main content; b1, b2 things on the side): 1-column layout. ...
...here are some examples (1 represents header, 2 footer; a main content; b1, b2 things on the side): 1-column layout. especially important for mobile browsers so you don't clutter the small screen up. 2-column layout. often used to target tablets, since they have medium-size screens. 3-column layouts. ...
...ites that change depending on the screen size) and sites whose layouts vary between pages. for now, it's best to keep your layout consistent throughout your site. active learning there is no active learning available yet. deeper dive let's study some more concrete examples taken from well-known websites. one-column layout invision application. a typical one-column layout providing all the in
formation linearly on one page. quite straightforward. just remember, many people will still browse your site from desktops, so make your content usable/readable there as well. two-column layout. abduzeedo, a simple blog layout. blogs usually have two columns, a fat one for the main content and a thin one for stuff on the side (like widgets, secondary navigation levels, and ads). ...
What is a URL? - Learn web development
a url is nothing more than the address of a given unique resource on the web. in theory, each valid url points to a unique resource. such resources can be an html page, a css document, an image, etc. ...
... prerequisites: you need to first know how the internet works, what a web server is and the concepts behind links on the web. objective: you will learn what a url is and how it works on the web. summary with hypertext and http, url is one of the key concepts of the web. it is the mechanism used by browsers to retrieve any published resource on the web. url stands for uni
form resource locator. a url is nothing more than the address of a given unique resource on the web. in theory, each valid url points to a unique resource. such resources can be an html page, a css document, an image, etc. in practice, there are some exceptions, the most common being a url pointing to a resource that no longer exists or that has moved. as the resource represented by the url and the ur...
...evelopers. don't worry about this, you don't need to know them to build and use fully functional urls. you might think of a url like a regular postal mail address: the protocol represents the postal service you want to use, the domain name is the city or town, and the port is like the zip code; the path represents the building where your mail should be delivered; the parameters represent extra in
formation such as the number of the apartment in the building; and, finally, the anchor represents the actual person to whom you've addressed your mail. how to use urls any url can be typed right inside the browser's address bar to get to the resource behind it. but this is only the tip of the iceberg! the html language — which will be discussed later on — makes extensive use of urls: to cre...
... we saw above. you don't need to include the protocol (the browser uses http by default) or the port (which is only required when the targeted web server is using some unusual port), but all the other parts of the url are necessary. when a url is used within a document, such as in an html page, things are a bit different. because the browser already has the document's own url, it can use this in
formation to fill in the missing parts of any url available inside that document. we can differentiate between an absolute url and a relative url by looking only at the path part of the url. if the path part of the url starts with the "/" character, the browser will fetch that resource from the top root of the server, without reference to the context given by the current document. let's look at some ...
What software do I need to build a website? - Learn web development
rly all operating systems by default include a text editor and a browser, which you can use to view websites. as a result, you usually only need to acquire software for transferring files to your web server. active learning there is no active learning available yet. dig deeper creating and editing webpages to create and edit a website, you need a text editor. text editors create and modify un
formatted text files. other
formats, like rtf, let you to add
formatting, like bold or underline. those
formats are not suitable for writing web pages. you should put some thought into which text editor you use, since you'll be working with it extensively while you're building the website. all desktop operating systems come with a basic text editor. these editors are all straightforward, but lack s...
...advanced text editor: here is a screenshot of an online text editor: uploading files on the web when your website is ready for public viewing, you'll have to upload your webpages to your web server. you can buy space on a server from various providers (see how much does it cost to do something on the web?). once you settle on which provider to use, the provider will email you the access in
formation, usually in the
form of an sftp url, username, password, and other in
formation needed to connect to their server. bear in mind that (s)ftp is now somewhat old-fashioned, and other uploading systems are starting to become popular, such as rsync and git/github. note: ftp is inherently insecure. you should make sure your hosting provider allows use of a secure connection, e.g. sftp or rsync o...
...ou already know, you need a web browser to view websites. there are dozens of browser options for your personal use, but when you're developing a website you should test it at least with the following major browsers, to make sure your site works for most people: mozilla firefox google chrome microsoft internet explorer apple safari if you're targeting a specific group (e.g., technical plat
form or country), you may have to test the site with additional browsers, like opera, konqueror, or uc browser. but testing gets complicated because some browsers only run on certain operating systems. apple safari runs on ios and mac os, while internet explorer runs only on windows. it's best to take advantage of services like browsershots or browserstack. browsershots furnishes screenshots of your ...
...ers including a ready-to-use virtual machine at modern.ie.) by all means run some tests on a real device, especially on real mobile devices. mobile device simulation is a new, evolving technology and less reliable than desktop simulation. mobile devices cost money, of course, so we suggest taking a look at the open device lab initiative. you can also share devices if you want to test on many plat
forms without spending too much. next steps some of this software is free, but not all of it. find out how much it costs to do something on the web. if you'd like to learn more about text editors, read our article about how to choose and install a text editor. if you're wondering how to publish your website on the web, look at "how to upload files to a web server". ...
Example 3 - Learn web development
this is the third example that explain how to build custom
form widgets. ...
... this is the third example that explain how to build custom
form widgets. ...
...</option> <option>strawberry</option> <option>apple</option> </select> <div class="select" tabindex="0"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> </
form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top ...
...tor('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.remove('highlight'); }); option.classlist.add('highlight'); }; // ------------- // // event binding // // ------------- // window.addeventlistener("load", function () { var
form = document.queryselector('
form');
form.classlist.remove("no-widget");
form.classlist.add("widget"); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (option) { option.addeventlistener('mouseover', ...
Example 4 - Learn web development
this is the fourth example that explain how to build custom
form widgets. ...
... this is the fourth example that explain how to build custom
form widgets. ...
... <option>banana</option> <option>strawberry</option> <option>apple</option> </select> <div class="select"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> </
form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top ...
...eryselectorall('.option'); nativewidget.selectedindex = index; value.innerhtml = optionlist[index].innerhtml; highlightoption(select, optionlist[index]); }; function getindex(select) { var nativewidget = select.previouselementsibling; return nativewidget.selectedindex; }; // ------------- // // event binding // // ------------- // window.addeventlistener("load", function () { var
form = document.queryselector('
form');
form.classlist.remove("no-widget");
form.classlist.add("widget"); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (option) { option.addeventlistener('mouseover', ...
Example 5 - Learn web development
this is the last example that explain how to build custom
form widgets. ...
... this is the last example that explain how to build custom
form widgets. ...
..."listbox"> <span class="value">cherry</span> <ul class="optlist hidden" role="presentation"> <li class="option" role="option" aria-selected="true">cherry</li> <li class="option" role="option">lemon</li> <li class="option" role="option">banana</li> <li class="option" role="option">strawberry</li> <li class="option" role="option">apple</li> </ul> </div> </
form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top ...
...('aria-selected', 'true'); nativewidget.selectedindex = index; value.innerhtml = optionlist[index].innerhtml; highlightoption(select, optionlist[index]); }; function getindex(select) { var nativewidget = select.previouselementsibling; return nativewidget.selectedindex; }; // ------------- // // event binding // // ------------- // window.addeventlistener("load", function () { var
form = document.queryselector('
form');
form.classlist.remove("no-widget");
form.classlist.add("widget"); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'), selectedindex = getindex(select); select.tabindex = 0; select.previous...
HTML basics - Learn web development
here the paragraph ends. failing to add a closing tag is one of the standard beginner errors and can lead to strange results. the content: this is the content of the element, which in this case, is just text. the element: the opening tag, the closing tag and the content together comprise the element. elements can also have attributes that look like the following: attributes contain extra in
formation about the element that you don't want to appear in the actual content. here, class is the attribute name and editor-note is the attribute value. the class attribute allows you to give the element a non-unique identifier that can be used to target it (and any other elements with the same class value) with style in
formation and other things. an attribute should always have the following: a...
...tains two attributes, but there is no closing </img> tag and no inner content. this is because an image element doesn't wrap content to affect it. its purpose is to embed an image in the html page in the place it appears. anatomy of an html document that wraps up the basics of individual html elements, but they aren't handy on their own. now we'll look at how individual elements are combined to
form an entire html page. let's revisit the code we put into our index.html example (which we first met in the dealing with files article): <!doctype html> <html> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <img src="images/firefox-icon.png" alt="my test image"> </body> </html> here, we have the following: <!doctype html> — the doctype. it is req...
...s to read out the alt text to them. something has gone wrong causing the image not to display. for example, try deliberately changing the path inside your src attribute to make it incorrect. if you save and reload the page, you should see something like this in place of the image: the keywords for alt text are "descriptive text". the alt text you write should provide the reader with enough in
formation to have a good idea of what the image conveys. in this example, our current text of "my test image" is no good at all. a much better alternative for our firefox logo would be "the firefox logo: a flaming fox surrounding the earth." try coming up with some better alt text for your image now. find out more about accessibility in our accessibility learning module. marking up text this sec...
...ld modify the markup to this <p>at mozilla, we’re a global community of</p> <ul> <li>technologists</li> <li>thinkers</li> <li>builders</li> </ul> <p>working together ... </p> try adding an ordered or unordered list to your example page. links links are very important — they are what makes the web a web! to add a link, we need to use a simple element — <a> — "a" being the short
form for "anchor". to make text within your paragraph into a link, follow these steps: choose some text. we chose the text "mozilla manifesto". wrap the text in an <a> element, as shown below: <a>mozilla manifesto</a> give the <a> element an href attribute, as shown below: <a href="">mozilla manifesto</a> fill in the value of this attribute with the web address that you want the link to ...
JavaScript basics - Learn web development
this article helps you get started with javascript and furthers your understanding of what is possible. what is javascript? javascript ("js" for short) is a full-fledged dynamic programming language that can add interactivity to a website. ...
...ers together or combine two strings. + 6 + 9; 'hello ' + 'world!'; subtraction, multiplication, division these do what you'd expect them to do in basic math. -, *, / 9 - 3; 8 * 2; // multiply in js is an asterisk 9 / 3; assignment as you've seen already: this assigns a value to a variable. = let myvariable = 'bob'; equality this per
forms a test to see if two values are equal. it returns a true/false (boolean) result. === let myvariable = 3; myvariable === 4; not, does-not-equal this returns the logically opposite value of what it precedes. it turns a true into a false, etc.. when it is used alongside the equality operator, the negation operator tests whether two values are not equal. !, !== for "...
...sically the same result with different syntax. here we are testing "is myvariable not equal to 3". this returns false because myvariable is equal to 3: let myvariable = 3; myvariable !== 3; there are a lot more operators to explore, but this is enough for now. see expressions and operators for a complete list. note: mixing data types can lead to some strange results when per
forming calculations. be careful that you are referring to your variables correctly, and getting the results you expect. for example, enter '35' + '25' into your console. why don't you get the result you expected? because the quote marks turn the numbers into strings, so you've ended up concatenating strings rather than adding numbers. if you enter, 35 + 25 you'll get the total of the two numbers. c...
...pect. for example, enter '35' + '25' into your console. why don't you get the result you expected? because the quote marks turn the numbers into strings, so you've ended up concatenating strings rather than adding numbers. if you enter, 35 + 25 you'll get the total of the two numbers. conditionals conditionals are code structures used to test if an expression returns true or not. a very common
form of conditionals is the if ... else statement. for example: let icecream = 'chocolate'; if(icecream === 'chocolate') { alert('yay, i love chocolate ice cream!'); } else { alert('awwww, but chocolate is my favorite...'); } the expression inside the if( ... ) is the test. this uses the identity operator (as described above) to compare the variable icecream with the string chocolate to see if t...
HTML Cheatsheet - Learn web development
t inline quotation. ...
... a line break line 1<br>line 2 line 1 line 2 suggesting a line break it is used to suggest the browser to cut the text on this site if </wbr>there is not enough space to display it on the same line it is used to suggest the browser to cut the text on this site if there is not enough space to display it on the same line date in readable
form it is used to
format the date legibly for the user, such as: <time datetime="2020-05-24" pubdate>published on 23-05-2020</time> it is used to
format the date legibly for the user, such as: published on 23-05-2020 text displayed in code
format <p>this text is in normal
format.</p> <code>this text is in code
format.</code> <pre>this text is in predefined
format.</pre> this te...
...bly for the user, such as: <time datetime="2020-05-24" pubdate>published on 23-05-2020</time> it is used to
format the date legibly for the user, such as: published on 23-05-2020 text displayed in code
format <p>this text is in normal
format.</p> <code>this text is in code
format.</code> <pre>this text is in predefined
format.</pre> this text is in normal
format. this text is in code
format. this text is in predefined
format. embedded audio <audio controls="controls" src="https://udn.realityripple.com/samples/b7/193cb038d0.mp3">your browser does not support the html5 audio element.</audio> your browser does not support the html5 audio element. embedded audio with alternative sources <audio controls="con...
... usage code snippet result a simple paragraph <p>i'm a paragraph</p> <p>i'm another paragraph</p> i'm a paragraph i'm another paragraph an extended quotation <blockquote>the blockquote element indicates an extended quotation.</blockquote> the blockquote element indicates an extended quotation. ...
Define terms with HTML - Learn web development
. in this article, we'll cover how to properly mark up keywords when you're defining them. prerequisites: you need to be familiar with how to create a basic html document. objective: learn how to introduce new keywords and how to build description lists. when you need a term defined, you probably go straight to a dictionary or glossary. dictionaries and glossaries
formally associate keywords with one or more descriptions, as in this case: blue (adjective) of a color like the sky in a sunny day. the clear blue sky of a subtle sadness, melancholy. i'm feeling blue but we're constantly defining keywords in
formally, as here: firefox is the web browser created by the mozilla foundation. to deal with these use cases, html provides tags to mark descript...
... we do that in html too, except html is not a visual medium and so we don't use bold. ...
...<p><dfn>firefox</dfn> is the web browser created by the mozilla foundation.</p> another use for bold is to emphasize content. bold itself is a concept foreign to html, but there are tags for indicating emphasis. special case: abbreviations it's best to mark abbreviations specially with <abbr>, so that screen readers read them appropriately and so that you can operate on all abbreviations uni
formly. just as with any new keyword, you should define your abbreviations the first time they occur. <p> <dfn><abbr>html</abbr> (hypertext markup language)</dfn> is a description language used to structure documents on the web. </p> the html spec does indeed set aside the title attribute for expanding the abbreviation. however, this is not an acceptable alternative for providing an inline exp...
... of title are completely hidden from your users, unless they're using a mouse and they happen to hover over the abbreviation. the spec duly acknowledges this as well. improve accessibility <dfn> marks the keyword defined, and indicates that the current paragraph defines the keyword. in other words, there's an implicit relationship between the <dfn> element and its container. if you want a more
formal relationship, or your definition consists of only one sentence rather than the whole paragraph, you can use the aria-describedby attribute to associate a term more
formally with its definition: <p> <span id="ff"> <dfn aria-describedby="ff">firefox</dfn> is the web browser created by the mozilla foundation. </span> you can download it at <a href="http://www.mozilla.org">mozilla.or...
Introduction to HTML - Learn web development
ment into logical sections (does it have a header? three columns of content? a navigation menu?), and embed content such as images and videos into a page. this module will introduce the first two of these and introduce fundamental concepts and syntax you need to know to understand html. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites before starting this module, you don't need any previous html knowledge, but you should have at least basic familiarity with using computers and using the web passively (i.e., just looking at it and consuming content). you should have a basic work environment set up (as detailed in installing basic software), and understand ho...
...here they fit in the language. we also show how a typical html page is structured and how an html element is structured, and explain other important basic language features. along the way, we'll play with some html to get you interested! what’s in the head? metadata in html the head of an html document is the part that is not displayed in the web browser when the page is loaded. it contains in
formation such as the page <title>, links to css (if you want to style your html content with css), links to custom favicons, and metadata (data about the html, such as who wrote it, and important keywords that describe the document). html text fundamentals one of html's main jobs is to give text meaning (also known as semantics), so that the browser knows how to display it correctly. this article l...
...how to display it correctly. this article looks at how to use html to break up a block of text into a structure of headings and paragraphs, add emphasis/importance to words, create lists, and more. creating hyperlinks hyperlinks are really important — they are what makes the web a web. this article shows the syntax required to make a link and discusses best practices for links. advanced text
formatting there are many other elements in html for
formatting text that we didn't get to in the html text fundamentals article. the elements here are less well-known, but still useful to know about. in this article, you'll learn about marking up quotations, description lists, computer code and other related text, subscript and superscript, contact in
formation, and more. document and website struct...
... html is fine, but what if something goes wrong, and you can't work out where the error in the code is? this article will introduce you to some tools that can help. assessments the following assessments will test your understanding of the html basics covered in the guides above. marking up a letter we all learn to write a letter sooner or later; it is also a useful example to test out text
formatting skills. in this assessment, you'll be given a letter to mark up. structuring a page of content this assessment tests your ability to use html to structure a simple page of content, containing a header, a footer, a navigation menu, main content, and a sidebar. ...
Multimedia and Embedding - Learn web development
ing text. let's start looking at how to make the web come alive with more interesting content! this module explores how to use html to include multimedia in your web pages, including the different ways that images can be included, and how to embed video, audio, and even entire webpages. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites before starting this module, you should have a reasonable understanding of the basics of html, as previously covered in introduction to html. if you've not worked through this module (or something similar), work through it first, then come back! note: if you are working on a computer/tablet/other device where you don't have ...
...nt used to embed a simple image in a webpage. in this article we'll look at how to use it in more depth, including basics, annotating it with captions using <figure>, and how it relates to css background images. video and audio content next, we'll look at how to use the html5 <video> and <audio> elements to embed video and audio on our pages, including basics, providing access to different file
formats to different browsers, adding captions and subtitles, and how to add fallbacks for older browsers. from <object> to <iframe> — other embedding technologies at this point we'd like to take somewhat of a sideways step, looking at a couple of elements that allow you to embed a wide variety of content types into your webpages: the <iframe>, <embed> and <object> elements. <iframe>s are for embe...
...to embed a wide variety of content types into your webpages: the <iframe>, <embed> and <object> elements. <iframe>s are for embedding other web pages, and the other two allow you to embed pdfs, svg, and even flash — a technology on its way out, but which you may still see semi-regularly. adding vector graphics to the web vector graphics can be very useful in certain situations. unlike regular
formats like png/jpg, they don't distort/pixelate when zoomed in — they can remain smooth when scaled. this article introduces you to what vector graphics are and how to include the popular svg
format in web pages. responsive images in this article, we'll learn about the concept of responsive images — images that work well on devices with widely differing screen sizes, resolutions, and other suc...
...responsive images are just one part of responsive design, a future css topic for you to learn. ...
Graceful asynchronous programming with Promises - Learn web development
it cannot switch from success to failure or vice versa once the operation has completed. if a promise has succeeded or failed and you later add a success/failure callback, the correct callback will be called, even though the event took place earlier. ...
...this is very similar to the example we looked at in the first article of the series, but we'll do it a bit differently as we get you building your own promise-based code. ...
... to an object using addeventlistener(). it doesn't run until an event occurs (when the promise fulfills). the most notable difference is that a .then() will only run once for each time it is used, whereas an event listener could be invoked multiple times. we immediately run the blob() method on this response to ensure that the response body is fully downloaded, and when it is available trans
form it into a blob object that we can do something with. the result of this is returned like so: response => response.blob() which is shorthand for function(response) { return response.blob(); } unfortunately, we need to do slightly more than this. fetch promises do not fail on 404 or 500 errors — only on something catasrophic like a network failure. instead, they succeed, but with th...
...d when all promises in the array fulfil. it looks something like this: promise.all([a, b, c]).then(values => { ... }); if they all fulfil, the chained .then() block's executor function will be passed an array containing all those results as a parameter. if any of the promises passed to promise.all() reject, the whole block will reject. this can be very useful. imagine that we’re fetching in
formation to dynamically populate a ui feature on our page with content. in many cases, it makes sense to receive all the data and only then show the complete content, rather than displaying partial in
formation. let's build another example to show this in action. download a fresh copy of our page template, and again put a <script> element just before the closing </body> tag. download our ...
Looping code - Learn web development
e "equal to" (===) rather than say "less than or equal to" (<=). if we wanted to run our loop up to i = 5, the exit condition would need to be i <= cats.length. if we set it to i === cats.length, the loop would not run at all because i is not equal to 5 on the first loop iteration, so it would stop immediately. one small problem we are left with is that the final output sentence isn't very well-
formed: my cats are called bill, jeff, pete, biggles, jasmin, ideally, we want to change the concatenation on the final loop iteration so that we haven't got a comma on the end of the sentence. well, no problem — we can quite happily insert a conditional inside our for loop to handle this special case: for (let i = 0; i < cats.length; i++) { if (i === cats.length - 1) { info += 'and ' + c...
... we store the value entered into the text input in a variable called searchname, before then emptying the text input and focusing it again, ready for the next ...
... we store the value entered into the text input in a variable called searchname, before then emptying the text input and focusing it again, ready for the next search. ...
...to see where they are and check that you aren't missing them. note: there are other loop types/features too, which are useful in advanced/specialized situations and beyond the scope of this article. if you want to go further with your loop learning, read our advanced loops and iteration guide. test your skills! you've reached the end of this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: loops. conclusion this article has revealed to you the basic concepts behind, and different options available when looping code in javascript. you should now be clear on why loops are a good mechanism for dealing with repetitive code and are raring to use them in yo...
Basic math in JavaScript — numbers and operators - Learn web development
round your number to a fixed number of decimal places, use the tofixed() method. type the following lines into your browser's console: let lotsofdecimal = 1.766584958675746364; lotsofdecimal; let twodecimalplaces = lotsofdecimal.tofixed(2); twodecimalplaces; converting to number data types sometimes you might end up with a number that is stored as a string type, which makes it difficult to per
form calculations with it. this most commonly happens when data is entered into a
form input, and the input type is text. there is a way to solve this problem — passing the string value into the number() constructor to return a number version of the same value. for example, try typing these lines into your console: let mynumber = '74'; mynumber + 3; you end up with the result 743, not 77, because...
...an or equal to tests whether the left value is smaller than or equal to the right one. 3 <= 2 >= greater than or equal to tests whether the left value is greater than or equal to the right one. 5 >= 4 note: you may see some people using == and != in their tests for equality and non-equality. these are valid operators in javascript, but they differ from ===/!==. the
former versions test whether the values are the same but not whether the values' datatypes are the same. the latter, strict versions test the equality of both the values and their datatypes. the strict versions tend to result in fewer errors, so we recommend you use them. if you try entering some of these values in a console, you'll see that they all return true/false values — those booleans we me...
... update the label as appropriate. if the button is currently saying "stop machine" when it is pressed, we swap the display back again. note: such a control that swaps between two states is generally referred to as a toggle. it toggles between one state and another — light on, light off, etc. test your skills! you've reached the end of this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: math. summary in this article we have covered the fundamental in
formation you need to know about numbers in javascript, for now. you'll see numbers used again and again, all the way through your javascript learning, so it's a good idea to get this out of the way now...
...math and want to read more about how it is implemented in javascript, you can find a lot more detail in mdn's main javascript section. ...
Learning area release notes - Learn web development
s been improved. if you want to give feedback on any of these new additions, please leave comments in our discourse forum. june 2020 our front-end web developer learning pathway is officially launched! check it out for an opinionated pathway to follow for learning front-end development! also see our hacks post — introducing the mdn web docs front-end developer learning pathway — for more in
formation about the rationale behind it. may 2020 our understanding client-side javascript frameworks module is now available. learn why frameworks exist, when you should use one (and when you shouldn't), what kinds of features are common to all frameworks, and how they relate to the vanilla javascript you may already know. once you have a general understanding of frameworks, move on to tutorial ser...
...ent-side javascript frameworks module is now available. learn why frameworks exist, when you should use one (and when you shouldn't), what kinds of features are common to all frameworks, and how they relate to the vanilla javascript you may already know. once you have a general understanding of frameworks, move on to tutorial series covering popular frameworks like react, ember, and vue. our web
forms learning module now has "test your skills" assessments accompanying the articles. april 2020 our new understanding client-side web development tools module has been released! learn the essentials of web development tooling, including what kind of tools exist, the command line, package managers, and how to assemble your own functioning tool chain. march 2020 you'll now find "test your skills"...
...ls of web development tooling, including what kind of tools exist, the command line, package managers, and how to assemble your own functioning tool chain. march 2020 you'll now find "test your skills" assessments accompanying the articles in the following modules: css building blocks javascript first steps javascript building blocks introducing javascript objects january 2020 the html
forms module has been significantly updated: it has been retitled web
forms, and moved out of the html topic area to recognise that it covers more than just html
form elements — it also covers styling, validation, the basics of how to send data and process it on the server, and more besides. it has new examples available and techniques covered. it has a new structure to make for a more effectiv...
... offer several short questions aimed at rapidly testing whether you understood what is going on. ...
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
he "todos left" indicator always says "x todos left", even when there is only one todo left, which is bad grammar! to fix this, we need to update this part of the template to include some conditional rendering. ...
... creating a todo class run the following command in your terminal: ember generate component-class todo now go to the newly-created todomvc/app/components/todo.js file and update the contents ...
... creating a todo class run the following command in your terminal: ember generate component-class todo now go to the newly-created todomvc/app/components/todo.js file and update the contents to look like so, to give the todo component access to t...
... ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo
form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced s...
Getting started with Ember - Learn web development
speed quickly. ember with add-ons emberjs has a plugin architecture, which means that add-ons can be installed and provide additional functionality without much, if any, configuration. examples include: prember: static website rendering for blogs or marketing content. fastboot: server-side rendering, including improving search-engine optimization (seo), or improving initial render per
formance of complex, highly interactive web pages. empress-blog: authoring blog posts in markdown while optimizing for seo with prember. ember-service-worker: configuring a pwa so that the app can be installed on mobile devices, just like apps from the device's respective app-store. native mobile apps ember can also be used with native mobile apps with a native-mobile bridge to javascript, such a...
...script, and interactivity can be added later. this language also enables lighter asset payloads due to compiling the templates into a "byte code" that can be parsed faster than javascript. the glimmer vm enables extremely fast dom change tracking without the need to manage and diff a cached virtual representation (which is a common approach to mitigating the slow i/o of dom changes). for more in
formation on the technical aspects of the glimmer vm, the github repository has some documentation — specifically, references and validators may be of interest. everything else in ember is just javascript. in particular, javascript classes. 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 l...
...tes at build time and therefore be less efficient and more complicated to set up). in ember-cli-build.js, find the following code: let app = new emberapp(defaults, { // add options here }); add the following lines underneath it before saving the file: app.import('node_modules/todomvc-common/base.css'); app.import('node_modules/todomvc-app-css/index.css'); for more in
formation on what ember-cli-build.js does, and for other ways in which you can customize your build / pipeline, the ember guides have a page on addons and dependencies. finally, find app.css, located at app/styles/app.css, and paste in the following: :focus, .view label:focus, .todo-list li .toggle:focus + label, .toggle-all:focus + label { /* !important needed because todomvc styles delibe...
... ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo
form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced s...
Introduction to client-side frameworks - Learn web development
n code, which in turn makes your final piece of software larger and more computationally expensive to operate. some extra code is inevitable, and a framework that supports tree-shaking (removal of any code that isn't actually used in the app during the build process) will allow you to keep your applications small, but this is still a factor you need to keep in mind when considering your app's per
formance, especially on more network/storage-constrained devices, like mobile phones. the abstraction of frameworks affects not only your javascript, but your relationship with the very nature of the web. no matter how you build for the web, the end result, the layer that your users ultimately interact with, is html. writing your whole application in javascript can make you lose sight of html and the...
...depends entirely on javascript and will not function without it. frameworks are not the source of our problems. with the wrong priorities, it's possible for any application to be fragile, bloated, and inaccessible. frameworks do, however, amplify our priorities as developers. if your priority is to make a complex web app, it's easy to do that. however, if your priorities don't carefully guard per
formance and accessibility, frameworks will amplify your fragility, your bloat, and your inaccessibility. modern developer priorities, amplified by frameworks, have inverted the structure of the web in many places. instead of a robust, content-first network of documents, the web now often puts javascript first and user experience last. accessibility on a framework-driven web let's build on what we s...
...static site generators are programs that dynamically generate all the webpages of a multi-page website — including any relevant css or javascript — so that they can be published in any number of places. the publishing host could be a github pages branch, a netlify instance, or any private server of your choosing, for example. there are a number of advantages of this approach, mostly around per
formance (your user's device isn’t building the page with javascript; it's already complete) and security (static pages have fewer attack vectors). these sites can still utilize javascript where they need to, but they are not dependent upon it. static site generators take time to learn, just like any other tool, which can be a barrier to your development process. static sites can have as few or as ...
... ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo
form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced s...
Working with Svelte stores - Learn web development
use svelte stores using stores we will create an alert component that shows notifications on screen, which can receive messages from any component. in this case, the alert component is independent from the rest — it is not a parent or child of any other — so the messages don't fit into the component hierarchy. we will also see how to develop our own custom store to persist the todo in
formation to web storage, allowing our todos to persist over page reloads. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/06-stores or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/06-stores remember ...
...te.dev/repl/d1fa84a5a4494366b179c87395940039?version=3.23.2 dealing with our app state we have already seen how our components can communicate with each other using props, two-way data binding, and events. in all these cases we were dealing with communication between parent and child components. but not all application state belongs inside your application's component hierarchy. for example, in
formation about the logged in user, or whether the dark theme is selected or not. sometimes, your app state will need to be accessed by multiple components that are not hierarchically related, or by a regular javascript module. moreover, when your app becomes complicated and your component hierarchy gets complex, it might become too difficult for components to relay data between each other. in that ...
...reads its content from web storage, and returns an object with three methods: subscribe(), set(), and update(). when we create a new localstore, we'll have to specify the key of the web storage and an initial value. we then check if the value exists in web storage and, if not, we create it. we use the localstorage.getitem(key) and localstorage.setitem(key, value) methods to read and write in
formation to web storage, and the tostring() and toobj() (which uses json.parse()) helper functions to convert the values. next, we convert the string content received from the web storage to an object, and save that object in our store. finally, every time we update the contents of the store, we also update the web storage, with the value converted to a string. notice that we only had to ...
... ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo
form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced s...
Accessibility Features in Firefox
playing with dragon and firefox. we are optimistic that nuance will work to improve access to the user interface in the coming year. firefox on linux currently boasts the best onscreen keyboard support in the industry via gok, the gnome onscreen keyboard. basic screen reader accessibility is available via the fire vox extension. fire vox can also be used on windows or os x. for more detailed in
formation, please check the assistive technology compatibility guide is kept on an editable wiki. keyboard support "mozilla firefox is a web-browser with superior keyboard support." alan cantor, cantor access consulting firefox includes keyboard access to all of its amazing features: browse with caret allows users to select arbitrary content with the keyboard and move through content as if in...
... true greatness of firefox lies in support for third party extensions. extensions are small add-ons which can change your browser experience as you see fit. extensions can easily be installed or removed with the extension manager in the tools menu. here are some examples of accessible extensions, although there are hundreds more to try (thank you to the gw micro knowledge base for some of this in
formation): adblock plus removes ads (and other objects, like banners) from web pages greasemonkey lets you add bits of javascript ("user scripts") to any web page to change its behavior. in much the same way that user css lets you take control of a web page's style, user scripts let you easily control any aspect of a web page's design or interaction. we expect enterprising script writers will eve...
...hare their tricks with everyone! fire vox extension by charles l. chen is a screen reader extension built just for firefox which can read mathml community contributions the real reason behind firefox's success is the great community of volunteers and organizations that realize they have something to benefit from a browser open to utilizing their ideas and hard work. contributions come in many
forms. the mozilla firefox community welcomes bug reports, ideas, documentation, answering questions in the support forums -- and nearly any kind of community involvement resulting in a browser built for a broader audience of users and developers. here are a couple of success stories from businesses who contributed accessibility code because they needed an accessible web browser which supported their...
...screen reader accessible on unix as it is on windows, because the same core accessibility work applies to linux. the two companies anticipate that in 2007, firefox will support topnotch screen reader accessibility on unix and linux. that's the great thing about the open firefox community model and source code license -- anyone can contribute, and everyone benefits. downloads, support and more in
formation firefox in
formation and downloads general online support and community forums accessibility newsgroup for users. can also be accessed as a mailing list. accessibility compliance statement (section 508): http://www.mozilla.com/firefox/vpat.html ...
CSUN Firefox Materials
e true greatness of firefox lies in support for third party extensions. extensions are small add-ons which can change your browser experience as you see fit. extensions can easily be installed or removed with the extension manager in the tools menu. here are some examples of accessible extensions, although there are hundreds more to try (thank you to the gw micro knowledge base for some of this in
formation): adblock plus removes ads (and other objects, like banners) from web pages greasemonkey lets you add bits of javascript ("user scripts") to any web page to change its behavior. in much the same way that user css lets you take control of a web page's style, user scripts let you easily control any aspect of a web page's design or interaction. we expect enterprising script writers will ev...
... the accessibility extension, from the university of illinois, provides new menus and keyboard shortcuts for accessing every feature of a web page community contributions the real reason behind firefox's success is the great community of volunteers and organizations that realize they have something to benefit from a browser open to utilizing their ideas and hard work. contributions come in many
forms. the mozilla firefox community welcomes bug reports, ideas, documentation, answering questions in the support forums -- and nearly any kind of community involvement resulting in a browser built for a broader audience of users and developers. here are a couple of success stories from businesses who contributed accessibility code because they needed an accessible web browser which supported their ...
...t to make firefox as screen reader accessible on unix as it is on windows, because the same core accessibility work applies to linux. the two companies anticipate that in 2007, firefox will support topnotch screen reader accessibility on unix and linux. ...
...reen reader accessible on unix as it is on windows, because the same core accessibility work applies to linux. the two companies anticipate that in 2007, firefox will support topnotch screen reader accessibility on unix and linux. ...
Links and Resources
here are some useful links for those interested in web accessibility as well as open source accessibility. guidelines & standards in
formation and resources on section 508 - legal policy for us government purchases requiring software accessibility. wai - web accessibility initiative web content accessibility guidelines (wcag) 1.0 the first set of official guidelines from the w3c web accessibility initiative (wai). the european union is looking to base their upcoming accessibility regulations on these guidelines. wai interest group - discussion list for standards in web accessibility. web accessibility checklist from ibm. ...
... the first set of official guidelines from the w3c web accessibility initiative (wai). the european union is looking to base their upcoming accessibility regulations on these guidelines. wai interest group - discussion list for standards in web accessibility. web accessibility checklist from ibm. ibm's java accessibility checklist - guidelines to making java accessibility. accessibility in
formation resource center for developers at adobe - flash mx accessibility, pdf document accessibility and actionscript accessibility. online accessibility validators there are now a few available and excellent online accessibility validators which check single webpages according to checkpoints of wcag guidelines and then reports errors or warnings. webxact™ from watchfire® corporation webx...
...to checkpoints of wcag guidelines and then reports errors or warnings. webxact™ from watchfire® corporation webxact™ is a free and complete online accessibility validation service that can test single pages for quality, accessibility and privacy issues. ...
... accessibility valet from webthing description and summary to be written. ...
Multiprocess on Windows
n thread uses com, and com requires threads to declare their threading model, the main thread must initialize itself to live inside its own single threaded apartment (sta). this is true for both chrome and content processes. as you should already know from the prerequisite reading, single threaded apartments receive remote procedure calls (rpcs) from com, via the windows message queue. from a per
formance standpoint, this is less than ideal. the windows message queue carries a lot of baggage for the purposes of maintaining backward compatibility. on the other hand, com's multithreaded apartment (mta) uses a much faster ipc mechanism that does not suffer from the same problems as the message queue. ideally, we would like to receive rpcs via threads in the mta, and then forward them in a thread-...
... the method call to the main thread in order to invoke the method on the wrapped object. the interceptor is also aware that any outparams, which contain interfaces, must also be wrapped with interceptors of their own. this code lives in the mscom library, located in the tree at /ipc/mscom. its headers are exported to mozilla/mscom. ...
...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. ...
...). 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. typelib metadata is limited to supporting the same language features which were supported by vb at that time. given those two options, it may seem that oicf is the preferred
format. however, for various reasons, our com interceptor currently only supports typelib metadata. in order for the interceptor to be able to work with our interfaces, we must do some additional work to compensate for typelib's weaknesses. the required steps are as follows: ensure that you generate typelibs for all of your com interfaces; ensure that those interfaces are registered; register any...
Lightweight themes
it it right now! creating a theme header image the header image is displayed as the background of the top of the browser window, nestling in behind the toolbars, address bar, search bar and the tab strip. it will be anchored to the top-right corner of the browser window. view a sample theme header here. ...
... ultrawide monitors can run to 3440px wide, to look good on these monitors, ensure the left of the image fades to a solid color. ...
...eviewer may reject your theme if your description is not an accurate representation of your theme. select a license for your theme — decide on a copyright license for your work. read more about the types of creative common licenses. important: please be sure you have the rights to use the image in your theme! upload your image — make sure it is under 300 kb in size and jpg or png
format! select text and tab colors — you can choose the tab ("background") color and foreground text color that work best with your header image. submit your theme — if everything looks right, click the submit theme button and you're done! you can see all the themes you've authored on your profile page. tip: to ensure that your theme is approved for the gallery, be sure it complies with th...
...ork best with your header image. submit your theme — if everything looks right, click the submit theme button and you're done! you can see all the themes you've authored on your profile page. tip: to ensure that your theme is approved for the gallery, be sure it complies with the content guidelines and terms of service! submit your theme now frequently asked questions for more in
formation about lightweight themes, including content guidelines, please see these frequently asked questions. more tutorials mozilla themes focal point on sizing - a tutorial on theming with a focus on sizing, by vanillaorchids. ...
Android-specific test suites
the source code and insert junit's @ignore annotation before the existing @test annotation. for example, to disable org.mozilla.gecko.permissions.testsuccessrunnableisexecutedifpermissionsaregranted, add @ignore as follows: ... @runwith(testrunner.class) public class testpermissions { @ignore @test public void testsuccessrunnableisexecutedifpermissionsaregranted() { ... contact in
formation android-test is currently owned by :sebastian and :nalexander. file tickets in the firefox for android product in bugzilla. android-checkstyle verifies that the java coding style is consistent throughout. see http://checkstyle.sourceforge.net/index.html and https://docs.gradle.org/2.14/userguide/checkstyle_plugin.html for more details. running android-checkstyle to run android-checksty...
... to stdout, as well as produce an html report. disabling one failing test in general, it's not sensible to allow java code that doesn't observe the existing coding style; in this respect, this job is equivalent to the eslint jobs that check the javascript coding style throughout the tree. however, the existing configuration can be tweaked and the set of files checked can be modified. contact in
formation android-checkstyle is currently owned by :mcomella and :nalexander. file tickets in the firefox for android product in bugzilla. android-findbugs ensures that the code avoids common java coding errors. using this suite will allow the code to be analyzed to spot any design flaws or potential bugs. if an issue is found within the code, a warning will be identified and put into the correct ...
...firefox for android with your changes; then run ./mach android findbugs this will run the tests and report the results to stdout, as well as produce an html report. disabling one failing test in general, it's not sensible to allow new java code to land that findbugs detects issues with. however, the existing configuration can be tweaked and the set of files checked can be modified. contact in
formation android-checkstyle is currently owned by :mcomella and :nalexander. file tickets in the firefox for android product in bugzilla. android-lint ensure that the code avoids common android coding errors. lint is a code scanning tool that identifies problems in the code regarding quality. it is a fast process that can be run on unexecuted code, and test cases are not needed for the process to...
...nt the code and report the results to stdout, as well as produce an html report. while developing, lint warnings should appear within android studio, although this is not infallible. disabling one failing test in general, it's not sensible to allow new java code to land that lint detects issues with. however, the existing configuration can be tweaked and some options can be modified. contact in
formation android-lint is currently owned by :sebastian and :nalexander. file tickets in the firefox for android product in bugzilla. ...
Debugging Frame Reflow
general overview the frame reflow can be logged with the debug capabilities implemented in nsframe.cpp. it provides the following in
formation for each frame at the start of its reflow reflow reason available width, available height computed width, computed height the previous and the next frame in flow and a count number. when the frame's reflow is finished the following in
formation is displayed : reflow metric (desired) width, height max. element width maximum width frame status overflow area getting the log make sure that your build is a debug build (in short you need ac_add_options --enable-debug in your .mozconfig file). create a text file (for instance reflow_rules.txt). enter this line in the text file * 1 this should look like: point t...
...ariable to the path of the reflow_rules.txt file. run the debug build, saving stdout to a file. on mac this is accomplished with: $ env dyld_library_path="`pwd`/obj-ff-dbg/dist/nightlydebug.app/contents/macos" \ ./obj-ff-dbg/dist/nightlydebug.app/contents/macos/firefox-bin > logfile.txt after loading your testcase, the log file will contain the promised in
formation. log file analysis the log file for a simple table like <!doctype html public "-//w3c//dtd html 4.01 transitional//en"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="100"> <tbody> <tr> <td>foo</td> </tr> </tbody> </table> </body> </html> will create the following log: vp 00b97c30 r=0 a=9180,4470 ...
...0,uc c=0,0 cnt=870 here the uc shows that on initial reflow the available height for the outer table frame is unconstrained. the table cell requires its children to compute the mes. it is reported back from the block as: block 02d7bcf8 d=300,300 me=300 the block max. element size is 300 twips. the second table reflow is started at rowg 00b984a4 r=2 a=1500,uc c=1500,uc cnt=879 where the previous in
formation is used. the block has been required to compute the max. element size only once and it reports now: block 02d7bcf8 d=1410,300 the block shows the same address as the previous one. frames with children that overflow the parent have the ns_frame_outside_children flag set. for these frames the overflow area is displayed as block 025ed8f0 d=8940,1020 o=(0,0) 9180 x 1020. the overflow area is spe...
... exit of a routine this can cause display errors like stray lines. os2 is very vulnerable to pixel alignment errors as text is drawn on pixel boundaries. gecko_display_reflow_indent_undisplayed_frames setting this option via set gecko_display_reflow_indent_undisplayed_frames = 1 will cause an advance of the indent even for frames which are blocked via the reflow rules file. original document in
formation author(s): bernd mielke last updated date: december 4, 2004 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Makefile - variables
undant?] inhibit makefile generation within subdirectories. no_ variable description no_profile_guided_optimize inhibit pgo builds no_dist_install note: values will be appended to the export variable when present. os_ variable description os_arch plat
form type os_target target binary type if building on an intermediate plat
form(building mobile binaries on gnu/linux). host_ variable description host_cmsrcs a list of .m sources to compile host_cmmsrcs a list of .mm sources to compile host_objs host_os_arch ...
... distribution/release variables variable description dist top level distribution directory for install/packaging/repacking. ...
... distribution/release variables variable description dist top level distribution directory for install/packaging/repacking. dist_files a list of files copied into the distribution archive(~application.ini). ...
..._target will be $(dist)/bin/$(dist_subdir) [ metro build ] l10n.mk and localization variable description en_us_binary_url server url from which wget will ftp binaries. l10nbasedir moz_chrome_multilocale a list of locale names to process moz_chrome_file_
format both, file, jar, omni, symlink packager_no_libs hack to allow one makefile to include another without pulling in libs:: target definitions. stagedist local staging directory for localization and packaging. todo: xpcom/xpinstall variables: https://developer.mozilla.org/en/adding_xpcom_components_to_mozilla_build_system ...
Cross Process Object Wrappers
cess content in multiprocess firefox. note that from firefox 47 onwards, unsafe cpow usage is no longer permitted in browser code. if browser code tries an unsafe cpow operation, the browser will throw an exception and you'll see an "unsafe cpow usage forbidden” error in the browser console. add-on code is still allowed to use cpows "unsafely". however, if an add-on passes a cpow into a plat
form api, and that plat
form api then attempts an unsafe operation on it, this will throw an exception. so as a general rule, add-ons should avoid passing cpows into non-addon code. in multiprocess firefox, chrome code runs in a different process from web content. so chrome code can't directly interact with web content: instead, it must factor out the code that interacts with web content into separat...
...ser.getbrowserfordocument and gbrowser.getbrowserforcontentwindow can be passed a cpow for the content document and content window, respectively, and return the xul <browser> that these documents / windows belong to. both return null if no such browser can be found. limitations of cpows although cpows can be convenient they have several major limitations, which are listed below. cpows and plat
form apis you can't pass cpows into plat
form apis that expect to receive dom objects. for example, you can't pass a cpow into nsifocusmanager.setfocus(). also, from firefox 47 onwards, browser code can no longer per
form unsafe cpow operations. this means that as an add-on developer, you should not pass cpows into browser apis. chrome responsiveness the lack of a synchronous api on the chrome side ...
...me responsiveness the lack of a synchronous api on the chrome side is intentional: because the chrome process runs the firefox ui, any responsiveness problems affect the whole browser. by making the chrome process block on the content process, cpows break this principle and allow unresponsive content process to make the whole browser unresponsive. see safe and unsafe cpows for more on this. per
formance although the wrapper looks just like an object completely contained in the chrome script scope, it's really just a reference to an object in the content process. when you access a property of the wrapper, it sends a synchronous message to the content process and returns the result. this means it is many times slower to use than an object. message ordering cpows can violate assumptions you ...
... not a problem: when the content process is already blocking on a synchronous message it sent to the chrome process. the content process is blocked anyway waiting for the chrome process, so there's no chance, in this situation, that the cpow call will block on some long-running activity in the content process. the content process can respond immediately to the cpow call: there is still a per
formance cost to the cpow in this situation, because the cpow call is an ipc call instead of a simple property access in the same process. however, the potential impact on responsiveness is much smaller. also, in this situation, the content process is in a known state. we know it's blocked waiting for the synchronous message to return, and we know that won't change during the cpow call. this makes th...
Roll your own browser: An embedding how-to
bits do i need? one of the requirements of building a sdk is the ability to identify and package up required files. like that isn't totally obvious, nonetheless it has to be done. here is that effort. i have created a directory under embedding called config. contained within this directory are a couple of makefiles: basebrowser-unix basebrowser-win the xpinstall packager follows the same
format. however in our case, we only have one named xpi package. after the build is done, you can change directory into mozilla/embedding/config, and do a make. this will produce a directory in dist named embed. it should include all of the base support that you need to get a web browser started up. included is the sample test application (gtkembed or winembed). what initializations do i have to do...
...ications that illustrate how to use it. versions for windows and mac with linux to follow. mozilla examples mfcembed: standard mozilla embedding example application for win32. basic browser, menus, toolbar, urlbar, html area. winembed: obsoleted by mfcembed. a bare-bones browser with urlbar and html area. activex control: an activex control for mozilla using the gecko layout engine. more in
formation at 1 and 2. mac external projects activestate's komodo: development environment, based on mozilla's xul. (screenshot) marbrow : mac port of x2web (ja, ko) embedding mozilla. mozilla examples ppembed: standard mozilla sample application implemented with metroworks' powerplant. camino: a project aimed at delivering a best-of-breed browser on the mac os x plat
form. camino uses c...
...camino uses cocoazilla, a variant of fizzilla that consists of a unix back end wed to a cocoa front end. ...
...xamples java webclient: provides a browser-neutral java api that enables generic web browsing capability. ...
Gecko Keypress Event
me as they were in gecko1.8.1. that is, when the currently selected keyboard layout produces a unicode character (according to the current state of capslock and numlock), the charcode property contains that character. when the keypress event includes modifier keys, sometimes the charcode value is replaced with an ascii character according to the following rules. the accel key depends on the plat
form. ctrl is the accel key on windows and linux, while meta (i.e. command) is the accel key on mac. when the accel key is down, the charcode of a keypress event may be replaced with a character from a latin keyboard layout only when the original character is not an ascii character. this behavior helps the internationalization of web applications that have custom shortcut keys. if gecko doesn't repl...
...hortcut keys. if gecko doesn't replace the charcode with an ascii character, the web application developers would need to consider all non-latin keyboard layouts (arabic, greek, hebrew, russian, etc.). the charcode value depends on the state of capslock and numlock (except they are currently ignored if alt (option) is down on mac - see bug 432953). there are also some differences between the plat
forms, as described in the following sections. windows the charcode is replaced only when ctrl is down but alt is not down. if the os-provided character cannot be entered without using the ctrl key, then, gecko does not replace the character. e.g., ctrl+shift+'2' on persian keyboard layout inputs a zwnj, though shift+'2' inputs '@', and so, if gecko were to replace the charcode in this case, users ...
...characters on the same key (when the shift modifier is usually used to select one of the characters). the pairs of characters that might be on the same key depend on the keyboard layout. (bug 359638 partially addressed this issue by trying both characters on the key, but bug 303192 would provide a complete solution.) solution the following rules apply: key handlers should be provided with in
formation about all the possible meanings of the event. a handler on the innermost element should handle a key event even when the event does not match exactly and there is an outer element with a handler that does match exactly (bug 433192). when handling web content accesskeys, the handlers should consider both characters that are available on the key (without and with shift). the character that i...
...ncluding menu accesskey, handling is currently similar, but this should not be relied on. there should be no chrome access keys with punctuation characters or other characters that would normally require depressing the shift key.) during accel key handling, if the event includes the shift modifier, but an alternative charcode is not a bicameral letter (i.e., it does not have upper and lower case
forms), then the shift modifier state should be ignored if there is no exactly matching handler (requiring shift to be down). (when option (alt) on mac is down, the alt modifier should be ignored in the same way, but this is not implemented in gecko 1.9. see bug 306585). during accel key handling, if the character is a bicameral letter, the shift key should never be ignored. i.e., ctrl+shift+'c' shou...
How Mozilla determines MIME Types
he value is the mime type. the extension must be lowercase. if no ext-to-type-mapping category is found, the externalhelperappservice returns application/x-extension-ext, where ext is the extension of the file. helper applications a somewhat related issue are the helper applications. when loading an uri with a type that mozilla can not handle, a helper app dialog shows up, and the displayed in
formation comes from these sources: ask the os for a handler of the given <extension, mime type> pair. note that the extension here comes from the content-disposition header if present, and from the url itself otherwise. this is where the listed "default application" comes from. the "data source" (that is, the list of helper applications) is searched for an entry with the mime type of the uri. the...
...file directory. if this fails, the data source is searched via the extension (content-disposition as above). ...
...position as above). if one of these lookups succeed, this is where the application in the "open with" field comes from, and also where the description of the type comes from. ...
...open with" field comes from, and also where the description of the type comes from. if this also failed, the extras are searched again, and will supply the extension-list and a description of the mime type. ...
AsyncShutdown.jsm
hases that take place sequentially. typically, each shutdown phase removes some capabilities from the application. for instance, at the end of phase profilebeforechange, no service is permitted to write to the profile directory (with the exception of telemetry). consequently, if any service has requested i/o to the profile directory before or during phase profilebeforechange, the system must be in
formed that these requests need to be completed before the end of phase profilebeforechange. failing to in
form the system of this requirement can (and has been known to) cause data loss. example at some point during shutdown, the add-on manager needs to ensure that all add-ons have safely written their data to disk, before writing its own data. since the data is saved to the profile, this must be co...
...ting its own data. since the data is saved to the profile, this must be completed during phase profilebeforechange. asyncshutdown.profilebeforechange.addblocker( "add-on manager: shutting down", function condition() { let promise = ... // do whatever must be done before the end of phase profilebeforechange return promise; }, function info() { let status = ... // collect any in
formation that may be useful for debugging shutdown issues with this blocker return status; } }); in this example, at some point during phase profilebeforechange, function condition will be called. phase profilebeforechange is guaranteed to not terminate until promise is either resolved or rejected. if, for some reason, promise is never resolved/rejected, firefox will crash during shutdown ...
...forechange, function condition will be called. phase profilebeforechange is guaranteed to not terminate until promise is either resolved or rejected. if, for some reason, promise is never resolved/rejected, firefox will crash during shutdown to avoid blocking system shutdown, preventing the user from restarting firefox or burning through a battery. in this case, a crash report is produced, with in
formation on all the shutdown blockers that have not been resolved, and all the additional debug in
formation returned by calls to info(). instances of phase note that you cannot create an instance of phase yourself. see attributes for the instances of phase. if you need a new phase added to asyncshutdown, please file a bug. methods overview void addblocker(string name, function|promise...
...ition a condition blocking the completion of the phase. generally, this is a function returning a promise. this function is evaluated during the phase and the phase is guaranteed to not terminate until the resulting promise is either resolved or rejected. if condition is not a function but another value v, it behaves as if it were a function returning v. info optionally, a function returning in
formation about the current state of the blocker as an object. used for providing more details when logging errors or crashing. removeblocker () remove the blocker for a condition. if several blockers have been registered for the same condition, remove all these blockers. if no blocker has been registered for this condition, this is a noop. boolean removeblocker( in function|promise|* condition ...
Following the Android Toasts Tutorial from a JNI Perspective
for example, if the class is blah.foo.bar then the signature of this will be this in slash notation with an l and ; around it. so this would be lblah/foo/bar;. if there is a sub class such as blah.foo.bar.subclass then a dollar sign is used in the slash notation, so this w...
.../context;', charsequence; 'ljava/lang/charsequence;', int: 'i', toast: 'landroid/widget/toast;', void: 'v', }; get java environment before we go on to declare the other important features, we need to load our environment variable. we want to wrap this in a try-catch statement so if any errors occur we make sure to unload the classes and the java environment, this is good for per
formance. this is the template that will follow our object of signatures: var my_jenv = null; try { my_jenv = jni.getforthread(); // do the jni work here } finally { if (my_jenv) { jni.unloadclasses(my_jenv); } } the reason we choose my_jenv for a variable name, and not jenv, is because the global privileged window scope of firefox for android has a variable jenv already, ...
... these methods in the third argument of loadclass we add a key-value pair, with the key being static_methods and methods and the value being an array. var toast = jni.loadclass(my_jenv, sig.toast.substr(1, sig.toast.length - 2), { static_methods: [ { name: 'maketext', sig: '()' } ], methods: [ { name: 'show', sig: '()' } ] }); the sig of methods is always in the
format of "method
format" from our types table above. the reason is that methods accept arguments and return something. we need to declare now the arguments and return type for each of the methods. the documentation says maketext takes three arguments, the types are context, int, and int and returns a toast. for example, let's declare this with strings: { name: 'maketext', sig: '(landroid/content/co...
...arguments sig.void // return } ] determine static-ness of fields declare them just like methods, fields have two types, static and not. we look up the documentation for our field, which is length_short, and we see it is static. so we will not need a group in the third argument of loadclass for fields, we will only need static_fields. fields do not accept arguments, so the "method
format" is not used, we simply tell the sig the type of the field, which we find out from the android documentation website. this is what our fields array will look like: static_fields: [ { name: 'length_short', sig: sig.int } ] wrap it all up here is the code for our completed toast class: var toast = jni.loadclass(my_jenv, sig.toast.substr(1, sig.toast.length - 2), { static_methods: [ ...
JavaScript OS.Constants
rome workers. os.constants.sys constants related to system configuration. name the name of the operating system (e.g. "darwin"). debug set to true on debug build configurations, non-existent otherwise. os.constants.path paths of well-known files and directories. libxul the path to the file containing libxul. useful, for instance, to access the plat
form code from javascript in conjunction with js-ctypes. profiledir the path to the current profile. homedir the path to the user's home directory. winappdatadir the path to the user's roaming application data directory. winlocalappdatadir the path to the user's local application data directory. winstartmenuprogsdir the path to the programs s...
...tion data directory. winstartmenuprogsdir the path to the programs subdirectory in the user's start menu. macuserlibdir the path to the user's library directory. maclocalapplicationsdir the path to the local applications directory. os.constants.libc constants for interacting with libc. useful mostly for using js-ctypes to interact with the following plat
forms: macos x; android; linux; other variants of unix. os.constants.libc is available on all plat
forms, although some constants are not defined everywhere. before using a constant, you should check that it is defined. error values eacces permission denied eagain resource temporarily unavailable ebadf bad file descriptor eexist file exists ...
... under windows) value too large to be stored in datatype. eperm operation not permitted erange result too large etimedout (not always available under windows) operation timed out. ewouldblock (not always available under windows) operation would block. exdev cross-device link opening files unix access rights defined on all plat
forms but meaningful only on unix. s_irwxu current user can read, write, execute the file. equivalent to s_irusr | s_iwusr | s_ixusr. s_irusr current user can read the file. s_iwusr current user can write (modify) the file. s_ixusr current user can execute the file. s_irwxg current group of the current user can read, write, execute the file.
...rsync o_shlock atomically obtain a shared lock. o_symlink allow opening of symbolic links. o_sync (linux only) open for purely synchronous access. o_trunc truncate the file. o_wronly open the file for write only. os.constants.win constants for interacting with the windows api. os.constants.win is undefined on non-windows plat
forms. useful mostly in conjunction with js-ctypes. (tbd) ...
OSFile.jsm
several seconds to execute operations that look trivial, such as closing a file, or checking when it was last modified. if the operation is called on the main thread, this means that the whole user experience is stuck for several seconds, which is quite bad. why is i/o efficiency important? i/o efficiency is all about minimizing the number of actual i/o calls. this is critical because some plat
forms have extremely slow storage (e.g. smartphones, tablets) and because, regardless of the plat
forms, doing too much i/o penalizes not just your application but potentially all the applications running on the system, which is quite bad for the user experience. finally, i/o is often expensive in terms of energy, so wasting i/o is wasting battery. consequently, one of the key design choices of os.fil...
...r application but potentially all the applications running on the system, which is quite bad for the user experience. finally, i/o is often expensive in terms of energy, so wasting i/o is wasting battery. consequently, one of the key design choices of os.file is to provide operations that are low-level enough that they do not hide any i/o from the developer (which could cause the developer to per
form more i/o than they think) and, since not all plat
forms have the same features, offer system-specific in
formation that the developer can use to optimize his algorithms for a plat
form. using os.file ... from the main thread most uses of os.file are from the main thread. in this mode, main thread clients use the api to request off main thread file i/o. calling os.file from the main thread ...
...rker threads and make use of os.file directly from these threads. ...
...r workers synchronous file i/o for worker threads os.file.directoryiterator for workers visiting directories synchronously from a worker thread ... ...
SourceMap.jsm
new sourcemapconsumer(rawsourcemap) the only parameter is the raw source map (either as a string which can be json.parse'd, or an object). ...
...ntifiers that can be referenced by individual mappings. sourceroot: optional. the url root from which all sources are relative. mappings: a string of base64 vlqs which contain the actual mappings. file: the generated filename this source map is associated with. sourcemapconsumer.prototype.originalpositionfor(generatedposition) returns the original source, line, and column in
formation for the generated source's line and column positions provided. the only argument is an object with the following properties: line: the line number in the generated source. column: the column number in the generated source. and an object is returned with the following properties: source: the original source file, or null if this in
formation is not available. line: ...
... provided. the only argument is an object with the following properties: line: the line number in the generated source. column: the column number in the generated source. and an object is returned with the following properties: source: the original source file, or null if this in
formation is not available. line: the line number in the original source, or null if this in
formation is not available. column: the column number in the original source, or null if this in
formation is not available. name: the original identifier, or null if this in
formation is not available. sourcemapgenerator an instance of the sourcemapgenerator represents a source map which is being built incrementally. new sourcemapgenerator(startofsourcemap) to create a new one, you m...
... source: the original source file (relative to the sourceroot). name: an optional original token name for this mapping. sourcemapgenerator.prototype.tostring() renders the source map being generated to a string. sourcenode sourcenodes provide a way to abstract over interpolating and/or concatenating snippets of generated javascript source code, while maintaining the line and column in
formation associated between those snippets and the original source code. this is useful as the final intermediate representation a compiler might use before outputting the generated js and source map. new sourcenode(line, column, source[, chunk]) line: the original line number associated with this source node, or null if it isn't associated with an original line. column: the original col...
source-editor.jsm
the source-editor.jsm javascript code module implements an editor specifically tailored for editing source code; its primary purpose is to provide support for web developer tools to display and edit web site code. the editor provided is eclipse orion. to use it, you first need to import the code module into your javascript scope: components.utils.import("resource:///modules/source-editor.jsm"); warning: much of the functionality of the source editor is implemented by a secondary code module (by default, source-editor-orion.jsm). you must not directly import that code module; it is essentially an implementation detail. ...
... when the contents of the text are different from your most recent save. in addition, when this value changes, the "dirtychanged" event is sent. editorelement element the element containing the editor. when using the default orion editor, this is a xul <xul:iframe> element. read only. lastfind object an object describing the result of the last find operation per
formed using the find(), findnext(), or findprevious() method. read only. this object has the following properties: property type description str string the last string that was searched for. index number an integer value indicating the result of the most recent find operation; this is th...
...es such as breakpoints is up to you. the editor simply tracks their existence and marks them with annotations in the editor. void addbreakpoint( number alineindex, [optional] string acondition ); parameters alineindex the 0-based line number at which to place the breakpoint. acondition optional a string describing the condition under which the breakpoint should be triggered. this in
formation is simply recorded as part of the breakpoint annotation. need link to text about handling breakpoint conditions here. addeventlistener() adds a new event listener to the editor. you can listen for any of the events listed in event name constants. to stop listening for the event, call removeeventlistener(). void addeventlistener( string aeventtype, function acallback ); parameters ...
...mize the search operation. it may have the following properties: property type description backwards boolean if true, the search begins at start (or the end of the text, if start is not specified) and progresses toward the beginning of the text. otherwise the search progresses forward. the default is false. ignorecase boolean if true, the search is per
formed in a case-insensitive manner; otherwise case is considered. the default is false. start number an integer value indicating the offset into the text at which to begin the find operation. the default is 0 if backwards is false, or text.length if backwards is true. findnext() finds the next occurrence of the search operation started by the last call to find(). note: this ig...
Translation phase
eatures that will change the way you use the web. see the list of the most critical strings for localizing in firefox, as well as a guide to understanding how they're organized. thunderbird enjoy safe, fast and easy email, mozilla-style. the thunderbird® email client includes intelligent spam filters, powerful search and customizable views. seamonkey seamonkey® is the all-in-one application
formerly known as the "mozilla application suite", containing a web browser, a mail and newsgroups client, an html editor, web development tools, and an irc chat client. firefox mobile by adding firefox® to your mobile phone, you can access rich web content and enjoy your favorite firefox features wherever you go. lightning lightning is a popular calendaring, scheduling and task management extens...
...rt for their mozilla applications. help localize the sumo user interface for everyone in your region. mozilla engagement campaigns individual campaigns created by mozilla to attract new contributors. hacks.mozilla.org for everyone interested in the leading-edge stuff that people are doing with mozilla firefox and the open web. in-product pages a set of pages used to interact with and give in
formation to the end-user as part of their first experience with their mozilla applications. if you are creating your own localization, there are a number of mozilla websites that need to be localized before your efforts become an officially released localization. see the list of localized mozilla websites. you should also read more in
formation on localizing mozilla web projects. add-ons l...
...translation) tool, like omegat? then you may not be interested in using any of the tools listed above for your localizations. if that is the case, then this section is for you! for localizers who prefer localizing without a specialized tool the workflows for localizing mozilla applications and mozilla websites are essentially the same. this tutorial should provide you with all of the technical in
formation you need to secure and maintain your tool independence. productization productization is an essential part of localizing mozilla products. this is where you research and select the search plugins, content and protocol handlers, bookmarks, and links to recommended sites on the in-product pages that your locale's users will find in their mozilla products. this tutorial will walk you through...
...n you need to secure and maintain your tool independence. productization productization is an essential part of localizing mozilla products. this is where you research and select the search plugins, content and protocol handlers, bookmarks, and links to recommended sites on the in-product pages that your locale's users will find in their mozilla products. this tutorial will walk you through per
forming these productization tasks, creating productization patches, and submitting them for review. « previousnext » ...
SVN for Localizers
welcome to the svn tutorial for localizers! here you'll learn the process of using svn to obtain mozilla website source files from the mozilla servers and pushing your localizations right back to them. first things first, we need to give you a brief introduction to what svn is and where you can find the necessary tools to get started. if you're already familiar with this in
formation, skip ahead to mozilla's svn repositories. brief intro to svn svn (abbreviation for subversion) is a free and open source repository tool we use to manage the localized mozilla web pages. it's a handy tool that allows us to grab, change, and store versions of source files in one location. you should know that when we say svn we are referring to either the svn server and the svn client. this may seem confu...
...ost insterested in. trunk refers to a set of files and directories that are in the testing stage (i.e., staging). all file modifications belong in trunk because they are seen most frequently. inside mozilla.com/trunk/locales, there are separate directories for each locale that is localizing mozilla.com. in each of those locale directories are other directories with files to be localized in .lang
format. note: we use the terms stage and prod (abbreviations of the terms staging and production) to refer to testing and publicly visible websites, respectively. working with svn now that you understand the mozilla svn repository layout (in particular the layout for mozilla.com), let's get some files into your hands to start localizing! the first thing you need to do is copy the mozilla reposito...
...e been updating frequently. it's a nightmare if you haven't because it throws away all of your recent hard work. keep this in mind because if you did a lot of work and you made some errors in just one file, maybe it would be wiser to simply correct those errors instead of reverting your working directory and losing all your work. note: sometimes you'll find references to commands in abbreviated
form (svn ci = svn commit, svn up = svn update, svn co = svn checkout, etc.) commit doesn't work, what's wrong? make you sure you're checking out the repository with https:// make sure you're adding a commit message when running svn commit. commits with an empty message will be rejected. svn accounts are disabled after 6 months of inactivity. to be used again, they need to be reenabled. if yo...
... if you have any doubts, ping l10n-drivers on irc in the #l10n channel. off to the races! congratulations! you should now be able to use svn from the command-line to copy directories from the mozilla repositories, make modifications to those repositories by using svn commands like svn up and svn revert, and finally push your localized work to the mozilla repositories. if you forget any of the in
formation on this page, don't worry, you can always come back and review. it won't go anywhere any time soon! back to the localization home page. ...
Localization sign-off reviews
this article presents an overview of why we do sign-off reviews of localizations, the details on the criteria used for the sign-off reviews, and the process for requesting a review and for following its progress. the sign-off review process has been notoriously shrouded in mystery. we use this review process to per
form quality assurance (qa) testing on your l10n efforts. this ensures that every user who downloads your localized mozilla application receives all of your hard work in a functional product. each qa review helps us in these ways: ensures that your l10n work is visible and functional within the mozilla application. allows us to understand how each l10n team is per
forming their localization work. allows us to discover potential bugs within l10n tools. overview you've done...
...ls. overview you've done some localization work and are ready for it to be released. the merge date for migrating from one product release channel to the next is rapidly approaching. you need to make sure that your work can effectively be compiled into a build for the next release channel. here is a detailed overview of what a sign-off review is and who it's meant for: a sign-off review: is per
formed as a qa measure for maintaining a localization from release-to-release. only evaluates new l10n work. this is done by generating a diff between the new release revision being considered and the previously approved release revision. focuses on technical accuracy and completion of l10n work, not translation quality. evaluates new release revisions, not entire l10n repos. does not need to be a...
...off reviews are only for evaluating the changes between your latest approved revision and the new revision you've submitted for release approval. hence, unless a localizer makes a change within the new revision that nullifies the approved work in the previous revision, the sign-off criteria will be significantly less comprehensive than a technical review. here is some of the criteria we use to per
form sign-off reviews: increased amount of untranslated strings we look for previously translated strings changing to untranslated strings in the new revision. this is a common problem with some tools. encoding some tools add bom to utf-8 encoded files, and some change the encoding altogether. mistakenly localized code we look for changes in localized code that should not have...
...ess to follow in bugzilla for requesting these reviews: file a bug requesting the review. attach your files to the bug. once attached, open the attachment details. in the attachment details, select the ? from the dropdown menu next to the appropriate approval flags (see image). this will display a text box to assign the review to someone. enter :pike as the requestee. once you have made the
formal request in bugzilla and you have pushed your work into your l10n repo, refer to the dashboards to follow your review's progress. sign-off dashboards to the right, you'll see the current sign-offs page for a german localization. sign-offs are approved using the buttons in the farthest column to the right. you can work with the l10n-drivers to track the progress of your review and correlate your...
Basics
gain a third time, the fragment will revert to its initial state. this tri-state mode is aimed at limiting conflicts with other agents that compete for the mouse. with mathml, one can build sets such as (go on, right-click any of these equations to experiment the zoom) { 0 , 1 , 2 , 3 , 4 } or { ⌊ a b ⌋ | a 2 + b 2 ≤ 3 } , write calculus d y d x = 1 y 2 ,
form rather complicated expressions lim n → n ( 1 + 1 n ) n − e n , k = ∂ 2 z ∂ x 2 ∂ 2 z ∂ y 2 - ( ∂ 2 z ∂ x ∂ y ) 2 ( 1 + ( ∂ z ∂ x ) 2 + ( ∂ z ∂ y ) 2 ) 2 , write vector equations y = a x + b , etc. notice how the mathematics appear in the main flow of text and respond as you res...
...cript:incrementinput('input12',-1);" title="decrease input">-</a> <br/> (click these control buttons to see their effects.) </div> <p> each entry of the following matrix represents <math> <msup><mrow><mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi><mo>)</mo></mrow><mi>n</mi></msup> </math> for some <i>n</i>. when you left-click any individual entry, it should toggle between its expanded and unexpanded
forms. you can also <a href="javascript:unexpand();">unexpand all</a> or <a href="javascript:expand();">expand all</a>. </p> <div> <math display="block"> <mtable> <mtr> <mtd> <mtable align="axis" columnalign="left left left"> <mtr> <mtd> <maction id="a11" actiontype="toggle" selection="2"> <msup> <mrow> <mo>(</mo> <mrow> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mrow> <mo>)</mo> </mrow> <mn>0</mn> </msup> <...
...these fonts are required to view other examples beyond the basic constructions illustrated here. mathml background image html content <div class="background"></div> <math display="block"> <mrow> <msub> <mi>z</mi> <mi>&alpha...
...these fonts are required to view other examples beyond the basic constructions illustrated here. ...
Fonts for Mozilla 2.0's MathML engine
u need to install additional fonts and to follow the instructions below. you may also want to check out the mozilla mathml torture test to test your installation against concrete examples. on windows: use this mathml fonts installer. on mac os x lion (10.7) and higher versions, stix fonts are already installed and can be used for mathml. ...
...ainst concrete examples. on windows: use this mathml fonts installer. on mac os x lion (10.7) and higher versions, stix fonts are already installed and can be used for mathml. on most linux distributions and similar open source plat
forms, you can install math fonts (stix, asana or mathjax fonts) from your package manager or get them from this zip archive. on android, firefox os and other plat
forms where the instructions above do not work: install the mathml-fonts add-on. this requires gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) or higher. overview mathematical
formulas make use of various symbols represented by specific unicode characters. mozilla can display any of these symbols provided suitable unicode fonts are installed. furthermore, in accordance with the w3c css2...
...phs do not in general have unicode assignments, and so font-specific support is required for some characters. mozilla has general support for the common delimiters and arrows that have the necessary unicode assignments. for other characters, mozilla has font-specific support. in general, if the necessary glyphs are not available on the system then mozilla tries to stretch symbols using scale trans
forms, but that may result in a less pleasant rendering. to see mathml as intended, you need sufficient font support, which may mean installing some fonts. note that some web sites may provide the required mathematical fonts as web fonts. in that case, you will see the correct rendering on these pages if you use gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) or greater. recommended font...
...rary/fonts folder on mac os x, or to a ~/.fonts/ directory (which may need to be created) on unix/linux systems. alternatively, follow dafont's "how to install a font". these fonts are opentype postscript fonts, which are supported by most modern operating systems. however some operating systems may not support these fonts. on such systems, it will be necessary to convert the fonts to a supported
format. for example asana math is available in truetype
format and there is an unofficial truetype conversion for stix fonts. the following fonts are not necessary when the above fonts are installed, but are worth noting because of their unicode support for many mathematical characters. dejavu serif and dejavu sans are freely available and installed with many linux distributions. they contain sup...
McCoy
mccoy uses xulrunner which is bound to break, for details see this post. mozilla calls mccoy a "simple system" which is a clear sign that something probably is not working, and indeed, is not. mccoy is an application that allows add-on authors to provide secure updates to their users. applications periodically look for and install updates to their add-ons. it's important that the update in
formation retrieved has not been tampered with since being written by the add-on author. specifically, it focuses on the process of digitally signing update manifests so the applications can verify the integrity of a manifest retrieved over normally insecure channels. if you want to learn about the technical details of mccoy then visit the project wiki. installing mccoy to use mccoy you need to dow...
... the first step is to create a cryptographic key. simply click the "create" toolbar button or select "create key" from the "keys" menu. you should give the key a name that will remind you what you are using it for. it is up to you how you use your keys, ei...
...mccoy! https://fireclipse.svn.sourceforge.net/svnroot/fireclipse/trunk/fireclipseextensions/chromebug/mccoy/signontheline/ bug 396525 - patch to mccoy https://bugzilla.mozilla.org/show_bug.cgi?id=396525 signing update manifests before you release your add-on in order to verify the update manifests applications need to already have in
formation from you for how to verify it. this is in the
form of the public part of a cryptographic key included in the original add-on you release. the first step is to create a cryptographic key. simply click the "create" toolbar button or select "create key" from the "keys" menu. you should give the key a name that will remind you what you are using it for. it is up to you how you use your keys, either using one key for all add-ons or one key per add-on...
...dated version of your add-on you must create yourself an update.rdf file. you need to use mccoy to sign this file so that the application can verify that it really came from you. simply select the key you originally added to the add-on's install.rdf, then click the "sign" toolbar button, select your update.rdf file and the data in it will be signed. it's important to note that if you change any in
formation in the update file then it must be signed again. the signing is rdf aware, which means that if you reorganized the xml in the file into a more human readable
form but the rdf data remained the same then the signature would still be valid. ...
Midas
ems with bug 198155. in addition to the built-in commands, advanced editing can be done by manipulating the selection and range objects. it is beneficial to be familiar with these objects when working with an editable document. examples this example shows the basic structure described in the notes section : <html> <head> <title>simple edit box</title> </head> <body> <iframe id="midas
form" src="about:blank" onload="this.contentdocument.designmode='on';" ></iframe> </body> </html> methods document.execcommand executes the given command. document.querycommandenabled determines whether the given command can be executed on the document in its current state. document.querycommandindeterm determines whether the current selection is in an indetermined state. document.
...., a comma-separated list of font names. fontsize a number this command will set the fontsize for a selection or at the insertion point if there is no selection. the given number is such as would be used in the "size" attribute of the font tag. forecolor a color code this command will set the text color of the selection or at the insertion point.
formatblock h1, h2, h3, h4, h5, h6, p, div, address, blockquote (more?) the selection surrounded by the given block element. heading h1, h2, h3, h4, h5, h6 selected block will be
formatted as the given type of heading. hilitecolor a color code this command will set the hilite color of the selection or at the insertion point. it only works with stylewithcss enabled. ...
...hortcut key will automatically trigger this command (typically accel-v) with or without the signed js or any code on the page to handle it. redo this command will redo the previous undo action. if undo was not the most recent action, this command will have no effect. note: the shortcut key will automatically trigger this command (typically accel-shift-z) remove
format removes inline
formatting from the current selection. selectall this command will select all of the contents within the editable area. note: the shortcut key will automatically trigger this command (typically accel-a) strikethrough if there is no selection, the insertion point will set strikethrough for subsequently typed characters. if there i...
...accel-a) strikethrough if there is no selection, the insertion point will set strikethrough for subsequently typed characters. if there is a selection and all of the characters are already striked, the strikethrough will be removed. otherwise, all selected characters will have a line drawn through them. stylewithcss this command is used for toggling the
format of generated content. by default (at least today), this is true. an example of the differences is that the "bold" command will generate <b> if the stylewithcss command is false and generate css style attribute if the stylewithcss command is true. subscript if there is no selection, the insertion point will set subscript for subsequently typed characters. if there is a select...
Dynamic Library Linking
= pr_findsymbolandlibrary("functionname", &lib); when pr_findsymbolandlibrary returns, funcptr is the value of the function pointer you want to look up, and the variable lib references the main executable program. you can then call pr_findsymbol on lib to look up other symbols defined in the main program. remember to call pr_unloadlibrary(lib) to close the library handle when you are done. ...
...andlibrary returns, funcptr is the value of the function pointer you want to look up, and the variable lib references the main executable program. you can then call pr_findsymbol on lib to look up other symbols defined in the main program. remember to call pr_unloadlibrary(lib) to close the library handle when you are done. plat
form notes to use the dynamic library loading functions on some plat
forms, certain environment variables must be set at run time, and you may need to link your executable programs using special linker options. this section summarizes these plat
form idiosyncrasies. for more in
formation, consult the man pages for ld and dlopen (or shl_load on hp-ux) for unix, and the loadlibrary documentation for win32. dynamic library search path exporting symbols from the main ex...
... on most unix systems, this environment variable is ld_library_path. these systems typically use dlopen to load a dynamic library. ...
...me search path is used to search for executable programs and dlls. exporting symbols from the main executable program on some systems, symbols defined in the main executable program are not exported by default. on hp-ux, you must link the executable program with the -e linker option in order to export all symbols in the main program to shared libraries. if you use the gnu compilers (on any plat
form), you must also link the executable program with the -e option. ...
Interval Timing
nspr defines a plat
form-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. such parameters are common in nspr functions such as those used for i/o operations and operations on condition variables. nspr 2.0 provides interval times that are efficient in terms of per
formance and storage requirements. conceptually, they are based on free-running counters that increment at a fixed rate ...
...on must declare a point in time, the epoch, and an amount of time elapsed since that epoch, the interval. in almost all cases the epoch is defined as the value of the interval timer at the time it was sampled. ...
...h, and an amount of time elapsed since that epoch, the interval. in almost all cases the epoch is defined as the value of the interval timer at the time it was sampled. ...
...valtime interval functions interval timing functions are divided into three groups: getting the current interval and ticks per second converting standard clock units to plat
form-dependent intervals converting plat
form-dependent intervals to standard clock units getting the current interval and ticks per second pr_intervalnow pr_tickspersecond converting standard clock units to plat
form-dependent intervals pr_secondstointerval pr_millisecondstointerval pr_microsecondstointerval converting plat
form-dependent intervals to standard clock units pr_intervaltoseconds pr_intervaltomilliseconds pr_intervaltomicroseconds ...
NSPR Types
pter 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. algebraic types of various lengths are used for integer algebra. miscellaneous types are used for representing size, pointer difference, boolean values, and return values. for in
formation on naming conventions for nspr types, functions, and macros, see nspr naming conventions. calling convention types these types are used to support cross-plat
form declarations of prototypes and implementations: pr_extern is used for declarations of external functions or variables. pr_implement is used for definitions of external functions or variables. pr_callback is used for definitio...
...some systems require emulation of 64-bit fields by using two 32-bit numeric fields bound in a structure. since the types (long ...
...some systems require emulation of 64-bit fields by using two 32-bit numeric fields bound in a structure. ...
...treat 64-bit numeric fields in different ways. some systems require emulation of 64-bit fields by using two 32-bit numeric fields bound in a structure. since the types (long long versus struct longlong) are not type compatible, nspr defines macros to manipulate 64-bit numeric fields. these macros are defined in prlong.h. conscientious use of these macros ensures portability of code to all the plat
forms supported by nspr and still provides optimal behavior on those systems that treat long long values directly. print64 pruint64 floating-point number type the nspr floating-point type is always 64 bits. prfloat64 native os integer types these types are most appropriate for automatic variables. they are guaranteed to be at least 16 bits, though various architectures may define them to ...
NSPR
netscape portable runtime (nspr) provides a plat
form-neutral api for system level and libc-like functions. the api is used in the mozilla clients, many of red hat's and oracle's server applications, and other software offerings. documentation about nspr this topic describes, in general terms, the goals of nspr and a bit about how it does it. nspr api reference the reference describes each api public macro, structure and function in the nspr api. nspr build instructions how to checkout and build from source. nspr release process how to prepare an nspr release. ...
...ference describes each api public macro, structure and function in the nspr api. nspr build instructions how to checkout and build from source. nspr release process how to prepare an nspr release. ...
...g on your plat
form: windows: build the source package, using the nspr build instructions. mac: install the macports nspr package, or the homebrew nspr package. ubuntu: install the libnspr4-dev package via apt-get. debian: install the libnspr4-dev package via apt-get. ...
...all the libnspr4-dev package via apt-get. opensuse linux: install one or more of the following via yast or zypper : mozilla-nspr : binary libraries for your plat
form mozilla-nspr-32bit : binary libraries needed to run 32-bit programs on a 64-bit os mozilla-nspr-devel : files needed (in addition to the above libraries) to compile programs using nspr mozilla-nspr-debuginfo : debug in
formation (including build symbols) for package mozilla-nspr mozilla-nspr-debuginfo-32bit : debug in
formation (including build symbols) for package mozilla-nspr-32bit mozilla-nspr-debugsource : debug sources for all of the above community view mozilla forums... mailing list newsgroup rss feed related topics necko, nss ...
JSS Provider Notes
specifying an external source of randomness. dsaprivatekey getx() is not supported because nss does not support extracting data from private keys. ...
... pkcs8encodedkeyspec rsaprivatekey dsaprivatekey getkeyspec() is not supported. this method exports key material in plaintext and is therefore insecure. note that a public key's data can be accessed directly from the key. translatekey() simply gets the encoded
form of the given key and then tries to import it by calling generatepublic() or generateprivate(). only x509encodedkeyspec is supported for public keys, and only pkcs8encodedkeyspec is supported for private keys. keygenerator supported algorithms notes aes des desede (des3 ) ...
... secretkeyfactory supported algorithms notes aes des desede (des3 ) pbahmacsha1 pbewithmd5anddes pbewithsha1anddes pbewithsha1anddesede (pbewithsha1anddes3 ) pbewithsha1and128rc4 rc4 generatesecret supports the following trans
formations: keyspec class key algorithm pbekeyspec org.mozilla.jss.crypto.pbekeygenparams using the appropriate pbe algorithm: des desede rc4 desedekeyspec desede ...
... desede rc4 desedekeyspec desede deskeyspec des secretkeyspec aes des desede rc4 getkeyspec supports the following trans
formations: key algorithm keyspec class desede desedekeyspec des deskeyspec desede des aes rc4 secretkeyspec ...
Mozilla-JSS JCA Provider notes
nopadding pkcs5padding the securerandom argument passed to initsign() and initverify() is ignored, because nss does not support specifying an external source of randomness. dsaprivatekey getx() is not supported because nss does not support extracting data from private keys. ...
... rsaprivatecrtkeyspec rsaprivatekey dsaprivatekeyspec dsaprivatekey pkcs8encodedkeyspec rsaprivatekey dsaprivatekey getkeyspec() is not supported. this method exports key material in plaintext and is therefore insecure. note that a public key's data can be accessed directly from the key. translatekey() simply gets the encoded
form of the given key and then tries to import it by calling generatepublic() or generateprivate(). only x509encodedkeyspec is supported for public keys, and only pkcs8encodedkeyspec is supported for private keys. keygenerator supported algorithms notes aes des desede (des3) rc4 the securerandom argument passed to init() is ignored, because nss does not support specifying an external source of ...
...use nss does not support extracting data from private keys. getprivateexponent() is not supported because nss does not support extracting data from private keys. ...
...in this case, the key should be wrapped (encrypted with another key), and then the encrypt...
JSS
git clone git@github.com:dogtagpki/jss.git -- or -- git clone https://github.com/dogtagpki/jss.git all future upstream enquiries to jss should now use the pagure issue tracker system: https://pagure.io/jss/issues documentation regarding the jss project should now be viewed at: http://www.dogtagpki.org/wiki/jss note: as much of the jss documentation is sorely out-of-date, updated in
formation will be a work in progress, and many portions of any legacy documentation will be re-written over the course of time. stay tuned! legacy jss in
formation can still be found at: source: https://hg.mozilla.org/projects/jss issues: https://bugzilla.mozilla.org/buglist.cgi?product=jss wiki: /docs/mozilla/projects/nss/jss network security services for java (jss) is a java inter...
...re java interface for asn.1 types and ber/der encoding. jss offers a implementation of java ssl sockets that uses nss's ssl/tls implementation rather than sun's jsse implementation. you might want to use jss's own ssl classes if you want to use some of the capabilities found in nss's ssl/tls library but not found in jsse. nss is the cryptographic module where all cryptographic operations are per
formed. jss essentially provides a java jni bridge to nss c shared libraries. when nss is put in fips mode, jss ensures fips compliance by ensuring that all cryptographic operations are per
formed by the nss cryptographic module. jss offers a jce provider, "mozilla-jss" jca provider notes. jss, jss4.jar, is still built with jdk 1.4.2. while jdk 1.4.2 is eol'd and all new product development should be...
...db and freely access all of it. documentation before you use jss, you should have a good understanding of the crypto technologies it uses. you might want to read these documents: introduction to public-key cryptography. explains the basic concepts of public-key cryptography that underlie nss and jss. introduction to ssl. introduces the ssl protocol, including in
formation about cryptographic ciphers supported by ssl and the steps involved in the ssl handshake. for in
formation on downloading nss releases, see nss sources building testing. read using jss to get you started with development after you've built and downloaded it. release notes 4.3.1 release notes 4.3 release notes older release notes build instruc...
... mailing list newsgroup rss feed related topics security ...
NSS_3.12.2_release_notes.html
nss 3.12.2 requires nspr 4.7.1. see the documentation section for the build instructions. ...
... nss 3.12.2 requires nspr 4.7.1. see the documentation section for the build instructions. ...
... nss 3.12.2 source and binary distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_2_rtm/src/. binary distributions: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_2_rtm/. both debug and optimized builds are provided. go to the subdirectory for your plat
form, dbg (debug) or opt (optimized), to get the tar.gz or zip file. the tar.gz or zip file expands to an nss-3.12.2 directory containing three subdirectories: include - nss header files lib - nss shared libraries bin< - nss tools and test programs you also need to download the nspr 4.7.1 binary distributions to get the nspr 4.7.1 header files and shared libraries, which nss 3.12...
... bug 432260: [[@ pkix_pl_httpdefaultclient_hdrcheckcomplete - pkix_pl_memcpy] crashes when there is no content-length header in the http response bug 436599: pkix: aia extension is not...
NSS Sample Code Sample1
r's public key (wrapping key) to // send to another server. this becomes the input to // the exportkeys method on the remote server. int exportpublickey(secitem **pubkeydata); // export the encryption and key using the key // provided. the key should come from another server // in the cluster. (the admin should verify this.) // // in this example, the server must be started to per
form // this function (see start()) int exportkeys(secitem *pubkey, secitem **wrappedenckey, secitem **wrappedmackey); // import the keys received from another server in the // cluster. the admin should make sure the keys actually // came from the correct source. int importkeys(secitem *wrappedenckey, secitem *wrappedmackey); // start the server, loading the encryption a...
...if (prvkey) seckey_destroyprivatekey(prvkey); return rv; } int server::shutdown() { if (menckey) pk11_freesymkey(menckey); if (mmackey) pk11_freesymkey(mmackey); menckey = 0; mmackey = 0; return 0; } int server::comparekeys(server *peer) { int rv; secitem *mackey1 = 0; secitem *mackey2 = 0; secitem *enckey1 = 0; secitem *enckey2 = 0; // export each of the keys in raw
form rv = rawexportkey(mmackey, &mackey1); if (rv) goto done; rv = rawexportkey(peer->mmackey, &mackey2); if (rv) goto done; rv = rawexportkey(menckey, &enckey1); if (rv) goto done; rv = rawexportkey(peer->menckey, &enckey2); if (rv) goto done; if (!secitem_itemsareequal(mackey1, mackey2)) { rv = 1; goto done; } if (!secitem_itemsareequal(enckey1, enckey2)) { rv = 1; goto done;...
... // be sent to server 1 rv = server2->exportpublickey(&pubkeydata); if (rv) { cout << "exportpublickey failed" << endl; goto trans_done; } // send the public key to server 1 and get back the // wrapped key values rv = server1->exportkeys(pubkeydata, &wrappedenckey, &wrappedmackey); if (rv) { cout << "exportkeys failed" << endl; goto trans_done; } // print - for in
formation cout << "wrapped encryption key" << endl; printbuffer(wrappedenckey->data, wrappedenckey->len); cout << "wrapped mac key" << endl; printbuffer(wrappedmackey->data, wrappedmackey->len); // import the keys into server 2 - this just puts the wrapped // values into the "files" rv = server2->importkeys(wrappedenckey, wrappedmackey); if (rv) { cout << "importkeys f...
...reeitem(wrappedenckey, pr_true); if (wrappedmackey) secitem_freeitem(wrappedmackey, pr_true); if (pubkeydata) secitem_freeitem(pubkeydata, pr_true); } if (rv) goto done; // start server 2 - this unwraps the encryption and mac keys // so that they can be used rv = server2->start(); if (rv) { cout << "cannot start server 2" << endl; goto done; } // list keys in the token - in
formational { pk11slotinfo *slot = 0; seckeyprivatekeylist *list = 0; seckeyprivatekeylistnode *n; slot = pk11_getinternalkeyslot(); if (!slot) goto list_done; cout << "list private keys" << endl; list = pk11_listprivkeysinslot(slot, 0, 0); if (!list) goto list_done; for(n = privkey_list_head(list); !privkey_list_end(n, list); n = privkey_list_...
Utilities for nss samples
utilities. these utility functions are adapted from those found in the sectool library used by the nss security tools and other nss test applications. it shows the following: read der from a file. compile file size. get seed from a noise gile. generate random numbers. get a module password. extract the password from a text file. print data as hexadecimal. util.h /* this source code
form is subject to the terms of the mozilla public * license, v. 2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. */ #ifndef _util_h #define _util_h #include <prlog.h> #include <termios.h> #include <base64.h> #include <unistd.h> #include <sys/stat.h> #include "util.h" #include <prprf.h> #include <prerror.h> #include <nss.h> #includ...
...rds is often used with server environments * where prompting the user for a password or requiring it * to be entered in the commnd line is not a feasible option. * * this function supports password extraction from files with * multipe passwords, one for each token. ...
...2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. */ #include "util.h" /* * these utility functions are adapted from those found in * the sectool library used by the nss security tools and * other nss test applications. */ /* * newline */ static void newline(prfi...
...rds is often used with server environments * where prompting the user for a password or requiring it * to be entered in the commnd line is not a feasible option. * * this function supports password extraction from files with * multipe passwords, one for each token. ...
nss tech note2
use: set nss_debug_pkcs11_module=nss internal pkcs #11 module the logger is available by default in debug builds. for optimized builds, nss must be built with the variable debug_pkcs11 set. modes of operation the logger has several modes of operation: 1. only display the sequence of pkcs #11 calls. to enable this mode, set: nspr_log_modules=nss_mod_log:1 nspr_log_file=<logfile> the output
format is: osthreadid[nsprthreadid]: c_xxx osthreadid[nsprthreadid]: rv = 0xyyyyyyyy for example, 1024[805ef10]: c_initialize 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getinfo 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getslotlist 1024[805ef10]: rv = 0x0 2. display the sequence of pkcs #11 calls, and the parameters given to them. to enable this mode, set: nspr_log_modules=nss_mod_log:3 nspr_log...
...id]: c_xxx osthreadid[nsprthreadid]: rv = 0xyyyyyyyy for example, 1024[805ef10]: c_initialize 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getinfo 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getslotlist 1024[805ef10]: rv = 0x0 2. display the sequence of pkcs #11 calls, and the parameters given to them. to enable this mode, set: nspr_log_modules=nss_mod_log:3 nspr_log_file=<logfile> the output
format is: osthreadid[nsprthreadid]: c_xxx osthreadid[nsprthreadid]: arg1 = 0xaaaaaaaa ... osthreadid[nsprthreadid]: argn = 0xaaaaaaaa osthreadid[nsprthreadid]: rv = 0xyyyyyyyy for example, 1024[805ef10]: c_initialize 1024[805ef10]: pinitargs = 0x4010c938 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getinfo 1024[805ef10]: pinfo = 0xbffff340 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getslotli...
...4[805ef10]: rv = 0x0 1024[805ef10]: c_getslotlist 1024[805ef10]: tokenpresent = 0x0 1024[805ef10]: pslotlist = 0x0 1024[805ef10]: pulcount = 0xbffff33c 1024[805ef10]: *pulcount = 0x2 1024[805ef10]: rv = 0x0 note that when a pkcs #11 function takes a pointer argument for which it will set a value (c_getslotlist above), this mode will display the value upon return. 3. display verbose in
formation, including template values, array values, etc. to enable this mode, set: nspr_log_modules=nss_mod_log:4 nspr_log_file=<logfile> the output
format is the same as above, but with more in
formation. for example, 1024[805ef10]: c_findobjectsinit 1024[805ef10]: hsession = 0x1000001 1024[805ef10]: ptemplate = 0xbffff410 1024[805ef10]: ulcount = 3 1024[805ef10]: cka_label = localhost.nyc.
..._token = 0 [1] 1024[805ef10]: cka_label = 0 [20] 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getattributevalue 1024[805ef10]: hsession = 0x1000001 1024[805ef10]: hobject = 0xf6457d04 1024[805ef10]: ptemplate = 0xbffff2d0 1024[805ef10]: ulcount = 2 1024[805ef10]: cka_token = ck_true [1] 1024[805ef10]: cka_label = localhost.nyc.rr.com [20] 1024[805ef10]: rv = 0x0 4. collect per
formance data. this mode is most useful in optimized builds. the number of calls to each pkcs #11 function will be counted, and the time spent in each function as well. a summary of per
formance data is dumped during nss shutdown. no additional environment variables are required for this mode. if the environment variable nss_output_file is set, its value will be used as the path name of the file to whi...
PKCS #11 Module Specs
each name/value pair is separated by a blank value. a single line, terminated by a '\n', '\r\n', or '\r' represents a single pkcs #11 library. names can be any alpha/numeric combination, and are parsed case-insensitive. values can contain any printable ascii value, including utf8 characters. ...
... and are parsed case-insensitive. values can contain any printable ascii value, including utf8 characters. values can contain embedded blanks either through quoting the entire value, or by escaping the embedded blanks with '\'. the value is considered quoted if the first character after the '=' is ', ", {, [, or <. if the value is quoted, then the value is terminated with and ending quote of the
form ', ", ), ], }, or > matching the respective starting quote. ending quotes can be escaped. embedded '\' charaters are considered escape characters for the next character in the stream. note that case must be preserved in the values. these modules specs can be passed by the application directly to nss via the secmod_loadusermodule() call. to initialize a pkcs #11 module 'on-the-fly'. recognized n...
...y is the netscape internal fips library. critical - if this library cannot be loaded, completely fail initialization. moduledb - this library includes nss specific functions to supply additional module specs for loading. moduledbonly - this library has no pkcs #11 functions and is only used for loading additional modules. trustorder - integer value specifying the order in which the trust in
formation for certificates specified by tokens on this pkcs #11 library should be rolled up. '0' means that tokens on this library should not supply trust in
formation (default). the relative order of two pkcs#11 libraries which have the same trustorder value is undefined. cipherorder - integer value specifiying the order in which tokens are searched when looking for a token to do a generic operation ...
...ation wishes to load the softoken, that application must supply a non-null libraryparameters value in the ck_c_initialize_args structure passed at c_initialize time. the parameter passed to softoken is a space separated list of name/value pairs exactly like those specified in the pkcs #11 module spec. valid values are: configdir configuration directory where nss can store persistant state in
formation (typically databases). secmod name of the secmod database (default = secmod.db). certprefix prefix for the cert database. keyprefix prefix for the key database. minpwlen minimum password length in bytes. manufacturerid override the default manufactureid value for the module returned in the ck_info, ck_slot_info, and ck_token_info structures with an internationalize string (utf...
NSS reference
if you are inclined to help with this migration, your help would be very much appreciated. the proposed chapters below are based on the chapters of the ssl reference and the categories of functions in nss public functions. should a particular page require the use of an underscore, please see the documentation for the title override extension. building and installing nss overview of an nss application based on "overview of an ssl application" in the ssl reference. getting started with nss based on "getting started with ssl" in the ssl reference. ...
...ctions in the ssl reference and "certificate functions" in nss public functions. ...
... encryption/decryption hashing key generation generate keys, key pairs, and domain parameters. ...
... encryption/decryption hashing key generation generate keys, key pairs, and domain parameters. random number generation this api consists of the two routines used for pseudorandom number generation -- pk11_generaterandomonslot and pk11_generaterandom -- and the two routines used for seeding pseudorandom number generation -- pk11_seedrandom and pk11_randomupdate. ...
TLS Cipher Suite Discovery
or use by applications, those applications may wish to immediately use the newly supported cipher suites found in the new version, without the application needing to be modified and re-released to know about these new cipher suites. to that end, nss's libssl offers a way for applications to discover at run time the set of cipher suites supported by that version of libssl. libssl provides enough in
formation about each of the supported cipher suites that the application can construct a display of that in
formation from which the user can choose which cipher suites his application will attempt to use. here are the details of how an nss-based application learns what cipher suites are supported and obtains the in
formation to display to the user. libssl offers a public table of well defined cipher ...
...table enumerating all implemented ssl 2 and 3 cipher suites. */ ssl_import const pruint16 ssl_implementedciphers[]; /* number of entries in the above table. ...
...sers, so libssl provides a function by which the application can obtain a wealth of in
formation about any supported cipher suite, by its number. this function is declared in "ssl.h" as follows: ssl_import secstatus ssl_getciphersuiteinfo( pruint16 ciphersuite, sslciphersuiteinfo *info, pruintn len); the application provides the cipher suite number for which it wants in
formation, the address of a block of memory allocated to receive that in
formation, and the size in bytes of that block of memory. ssl_getciphersuiteinfo fills that caller-supplied memory with in
formation from the sslciphersuiteinfo structure for that cipher suite. ...
... len); the application provides the cipher suite number for which it wants in
formation, the address of a block of memory allocated to receive that in
formation, and the size in bytes of that block of memory. ssl_getciphersuiteinfo fills that caller-supplied memory with in
formation from the sslciphersuiteinfo structure for that cipher suite. ...
Rhino documentation
javascript tools rhino shell interactive or batch execution of scripts. javascript debugger debugging scripts running in rhino. ...
... javascript tools rhino shell interactive or batch execution of scripts. javascript debugger debugging scripts running in rhino. ...
... javascript tools rhino shell interactive or batch execution of scripts. javascript debugger debugging scripts running in rhino. javascript compiler compiling scripts into java class files. running the rhino tests running the javascript test suite with rhino. ...
... class files. running the rhino tests running the javascript test suite with rhino. embedding rhino embedding tutorial a short tutorial on how to embed rhino into your application. api javadoc reference (link broken? try this at jarvana.) an annotated outline of the programming interface to rhino (tip only). scopes and contexts describes how to use scopes and contexts for the best per
formance and flexibility, with an eye toward multithreaded environments. serialization how to serialize javascript objects and functions in rhino. runtime a brief description of the javascript runtime. small footprint hints for those interested in small-footprint embeddings. examples a set of examples showing how to control the javascript engine and build javascript host objects. using rhino ...
Rhino optimization
optimization settings the currently supported optimization settings are: -1 interpretive mode is always used. the compilation time is minimized at the expense of runtime per
formance. no class files are generated, which may improve memory usage depending on your system. another benefit of the interpreted mode is that the interpreter per
forms tail-call elimination of recursive functions. also, you must use this optimization level if your code uses continuation objects. if the optimization package is not available, then optimization acts as if it is always -1. 0 no optimizations are per
formed. ...
...local common sub-expressions are collapsed (currently this only happens for property lookup, but in the future more expressions may be optimized). ...
... functions. also, you must use this optimization level if your code uses continuation objects. if the optimization package is not available, then optimization acts as if it is always -1. 0 no optimizations are per
formed. the bytecode compiler runs fastest in this mode, but the generated byte code is less efficient. 1-9 all optimizations are per
formed. simple data and type flow analysis is per
formed to determine which javascript variables can be allocated to java vm registers, and which variables are used only as numbers. local common sub-expressions are collapsed (currently this only happens for property lookup, but in the future more expressions may be optimized). all local variables and parameters are allocated to java vm registers. function call targets are speculatively pre-cached (ba...
...ct, pending runtime confirmation of the actual target. arguments are passed as object/number pairs to reduce conversion overhead. note some language features (indirect calls to eval, use of the arguments property of function objects) were previously not supported in higher optimization levels. these features have been removed from the language in ecma, so higher optimization levels are now con
formant. future versions may allocate more aggressive optimizations to higher optimization levels. for compatibility with future versions, use level 1. for maximal optimization, use level 9, but retest your application when upgrading to new versions. scripts are optimized at compile time, not at execution time. so if a script is compiled with the context's optimizationlevel set to 1, it will be exec...
Invariants
never become non-native. (one reason for this is that the object may have watchpoints set; the watchpoint machinery assumes that all objects with watched properties are native. there may be other reasons that cover more cases, but nobody can remember one.) all jsobjects and heap-allocated jsstrings must be 8-byte-aligned. (the jsval encoding depends on this.) the jsstackframe::down chain never
forms a cycle. (it's a stack. but note that a stack frame is not necessarily newer than the next stack frame down, thanks to generators!) an object's scope chain (found by chasing jsobject::fslots[jsslot_parent]) never
forms a cycle. (we can probably loop forever if that happens. js_setparent can violate this, if the application is really that dumb, but generally every object is newer than its __p...
...fferent global object. (if it is a script function, global names accessed in that function would refer to a different global object. even if the function is native, there is serious trouble: js_newobject with null parent argument calculates the parent from cx->fp->scopechain, which can be stale if we're on trace.) the chain of properties starting at any jsshape and chasing jsshape::parent never
forms a cycle and does not contain any duplicate jsscopeproperty::slot values other than -1. (a cycle would be very silly and could cause infloops. the same slot being allocated to more than one property would be a problem for obvious reasons.) all jsshapes in dictionary-mode objects have the in_dictionary flag set. all jsshapes in property trees have it cleared. if an object is inextensible, its ds...
...l, such that there may be either one writer (in gc) or many readers (in requests). no jsnative or other object-related callback ever runs at the same time as a finalizer for that object. property locks each thread may have a lock on at most one property at a time. (nesting them would risk deadlock. js_setwatchpoint violates this rule.) whether a property is locked, and which one, is static in
formation for almost every line of code. the locking scheme is described under jsobjectops.dropproperty. (note that the locking scheme applies to all objects and talks about properties being locked. as implemented for native objects, the locking is not really that fine-grained, but that is a transparent optimization as long as we follow the rules.) a thread holding a property lock never leaves or sus...
...rbkap), we never call a jsapi callback with a property locked. (that would risk deadlock too.) name instructions the first operand to a jsop_setname instruction is always produced by a preceding jsop_bindname instruction. (taken together, ecma 262-3 §11.13.1 and ecma 262-3 §10.1.4 specify that in an assignment such as x = f(), the name lookup for x occurs before f is called. jsop_bindname per
forms this lookup.) the rules below (not exactly invariants) govern the bytecode emitted for nameexpressions. background: the fastest instructions for nameexpressions are fat opcodes that combine a load with additional operations, as in jsop_inclocal or jsop_getlocalprop. failing that, jsop_{get,call,set}local and jsop_{get,call,set}arg are the fastest, followed by jsop_{get,call}upvar, jsop_{get,ca...
Tracing JIT
f lir is called a lins, short for "lir instruction". lins values are depicted in blue in the schematic diagram. in contrast, a single native instruction is called a nins, and is depicted in red in the schematic diagram. the recorder in jstracer inserts lins values into a lir buffer held in a page, itself contained within a logical fragment, and the nanojit compilation pipeline and assembler trans
form the lins values into nins values. nanojit/fragmento.* the nanojit/fragment.cpp and nanojit/fragmento.cpp files define the fragment and fragmento classes. a fragmento is a resource-management object that allocates and stores a set of fragments and pages, and manages their lifecycle. a fragmento owns its associated fragments. a fragment represents a single linear code sequence, typically termina...
...ons (lins values) into the fragment, it allocates pages to store the lir code. later, when the fragment is assembled, it will allocate pages for the native code (nins values) produced by the assembler. when the fragment is destroyed, it returns its pages to the fragmento for reuse. nanojit/assembler.* the nanojit/assembler.cpp and nanojit/assembler.h files define the class assembler, which trans
forms lins values into nins values. in other words, an assembler trans
forms lir code into native code. an assembler is also able to modify existing fragments of native code, by rewriting native jump instructions to jump to new locations. in this way the assembler can "patch together" multiple fragments, so that program control can flow from one fragment into another, or back out of generated code and ...
... so that program control can flow from one fragment into another, or back out of generated code and into the interpreter. an assembler is the only component of the tracing jit that reads or writes native code. therefore an assembler contains several machine-specific methods which are implemented in the accompanying nanojit/native*.* files. an assembler runs in a single pass over its input, trans
forming one lins value to zero or more nins values. it is important to keep in mind that this pass runs backwards from the last lins in the input lir code to the first, generating native code in reverse. running backwards sometimes makes the logic difficult to follow, but it is an essential factor in maintaining the assembler's high speed and small size. in the spidermonkey tracing jit there is only ...
... only functions within nanojit or tracemonkey that emit raw bytes of machine-code into memory. spidermonkey-specific high level component: jstracer.* the files jstracer.cpp and jstracer.h contain a the mechanisms of monitoring and recording the activity of the interpreter. each spidermonkey jscontext holds a trace monitor of type jstracemonitor. the trace monitor maintains some book-keeping in
formation, as well as the collection of recorded fragments, held in a hashtable keyed by the interpreter's program counter and global object shape at the time of recording. at any moment, the trace monitor is in one of three major states: monitoring, recording, or executing. the transitions between these states are somewhat complex and delicate, but the overall picture is simple: monitoring the t...
JIT Optimization Outcomes
. this page documents the meaning of different optimization outcomes. general outcomes general outcomes shared between various optimization strategies. genericfailure the optimization attempt failed, and the reason was not recorded. genericsuccess optimization succeeded. disabled the optimization has been explicitly disallowed. notypeinfo optimization failed because there was no type in
formation associated with an object containing the property. this failure mode is unlikely and occurs if the target object is obtained in some roundabout way. noanalysisinfo todo noshapeinfo the baseline compiler recorded no usable shape in
formation for this operation. unknownobject the type of the object is not known. this can happen if the operation sees many different types of objects, and so...
...t types contain the property at a different slot than the others. notobject optimization failed because the stored in the property could potentially be a non-object value. since only objects can be uniquely typed, the optimization strategy fails in this case. notstruct the object holding the property is not a typed struct object. notunboxed the object whose property is being accessed is not
formatted as an unboxed object. unboxedconvertedtonative the object whose property is being accessed was previously unboxed but was deoptimized and converted to a native object. structnofield the unboxed property being accessed does not correspond to a field on the typed object. inconsistentfieldtype the type of an unboxed field is not consistent across all the different types of objects it coul...
...nlinedebuggee unable to inline function call. the interpreted callee function is being debugged by the debugger api. cantinlineunknownprops unable to inline function call. the engine knows nothing definite about the type of the callee function object. cantinlineunreachable unable to inline function call. the call site has not been observed to have ever been executed. it lacks observed type in
formation for its arguments, its return value, or both. cantinlinebound unable to inline function call. the interpreted callee is a bound function generated from function.prototype.bind that failed some sub-checks. (expand) cantinlinenativenospecialization unable to inline function call. ion does not have built-in specialization for the native (implemented in c++) callee function. cantinlinenativ...
...n for its arguments, its return value, or both. cantinlinebound unable to inline function call. the interpreted callee is a bound function generated from function.prototype.bind that failed some sub-checks. (expand) cantinlinenativenospecialization unable to inline function call. ion does not have built-in specialization for the native (implemented in c++) callee function. cantinlinenativebad
form unable to inline function call. the native callee function was called with an unsupported number of arguments, or calling non-constructing functions with new. cantinlinebadtype unable to inline function call. the native callee function was called with arguments with types that the built-in specialization does not support. for example, calling math functions on objects. cantinlinenativenotempl...
JS_GC
garbage collection frees memory so that it can be reused by the system. ...
...garbage collection frees memory so that it can be reused by the system. ...
... memory pool. syntax void js_gc(jscontext *cx); // added in spidermonkey 52 void js_gc(jsruntime *rt); // obsolete since jsapi 50 void js_gc(jscontext *cx); // obsolete since jsapi 14 name type description cx jscontext * the context to for which to per
form garbage collection. added in spidermonkey 52 rt jsruntime * the runtime to for which to per
form garbage collection. obsolete since jsapi 50 description js_gc per
forms garbage collection of js objects, strings and other internal data structures that are no longer reachable in the specified context or runtime. garbage collection frees memory so that it can be reused by the system. when your scripts create many objects, you may want to call js_gc directly in your code, particularly wh...
... use js_setgccallback to add hooks that are called during garbage collection. ...
SpiderMonkey 38
it also contains new language and api features described in detail below. ...
...ase let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. — sep 17, 2015 the download url is outdated and spidermonkey not release alone! get it here mozilla-esr38 you will find it in "firefox extended support release 38" package on hg release plat
form support spidermonkey 38 is supported on all the plat
forms where firefox 38 runs. compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010. spidermonkey 38 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed ...
... compiling it requires a c++ compiler, and the jsapi can only be used from c++ code. if you are compiling with microsoft's visual studio, note that the minimum supported version is msvc10/2010. spidermonkey 38 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on some other plat
forms (sparc, mips), the jit is provided but not supported. on all other plat
forms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 38 .... xxx will need updating for actual new gc stuff at time! a major change to spidermonkey in 38 is that its apis support a moving garbage collector. ...
...d a new property will fail, yet also itself may throw in some cases. javascript shell changes detail added/removed methods here... known issues detail any known issues here... future direction ...insert details on future plans... spidermonkey embedders should be aware that mozilla has no plans to keep the jsapi, nor the jsdbgapi, stable for embedders. we have chosen to concentrate on per
formance and correctness as primary concerns instead. js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd. release notes errata this is a list of changes which need to be made to the release notes asap. feel free to fix any problems you spot -- this is a wiki! don't add anything here -- this is for after the rele...
A Web PKI x509 certificate primer
ots create intermediates for each other it is called cross-signing). extensions while rfc 5280 defines 16 extensions for webpki in this document we will be describing the six extensions we considered critical for understanding. certificates can have other extensions not described on rfc 5280, but that is out of the scope of this document. extensions can be marked as critical or non-critical, con
forming certificate verification libraries should stop processing verification when encountering a critical extension that they do not understand ( and should continue processing if the extension is marked as non-critical) mozila::pkix has this behavior. subject alternate name this extension defines what other names (such as dns names) are valid for this certificate. this allows for a certificate to...
...rauth, clientauth, and ocspsigning. for end-entity certificates for pki this extension is required to exist with the serverauth bit asserted. name constraints this is an extension exclusive for ca and indicates limits on the name space for its children. this is one of the most powerful extensions for businesses to have to help limit risk imposed by losing the private key of the ca. authority in
formation access this extension is primarily used to to describe the ocsp location for revocation checking. it is mandatory for certificates that chain up to a root in the mozilla ca program. self-signed certificates these are the steps to generate a certificate for www.example.com. replace this value with the actual server name in the steps below. 1. generate the key using the following command: ...
... the major browsers. firefox uses a default set of x.509v3 root certificates for various certification authorities (cas). the root certificates included by default have their "trust bits" set to indicate if the ca's root certificates may be used to verify certificates for ssl servers, s/mime email users, and/or digitally-signed code objects without having to ask users for further permission or in
formation. cas apply to have their root certificates included by default in mozilla products by following the mozilla ca certificate policy and applying for inclusion as per ca:how_to_apply. users may override the default root certificate settings using the certificate manager. some organizations make use of the set of cas included in mozilla's products. if you wish to do this, you should read the r...
...ot properly encoded according to asn.1 (der) encoding re-generate the improperly-encoded certificate sec_error_ca_cert_invalid an end-entity certificate is being used to issue another certificate ensure that any certificate intended to issue certificates has a basic constraints extension with ca: true sec_error_bad_signature a signature on a certificate is improperly
formatted or the certificate has been tampered with re-issue the certificate with the bad signature sec_error_cert_bad_access_location the ocsp uri in the authorityin
formationaccess extension is improperly
formed re-generate the certificate with a well-
formed ocsp uri sec_error_cert_not_in_name_space a certificate has a common name or subject alternative name that is not ...
Setting up an update server
r building a mar locally is more complicated. part of the problem is that mars are signed by mozilla and so you cannot really build an "official" mar yourself. this is a security measure designed to prevent anyone from serving malicious updates. if you want to use a locally-built mar, the copy of firefox being updated will need to be built to allow un-signed mars. see building firefox for more in
formation on building firefox locally. these changes will need to be made in order to use the locally built mar: put this line in the mozconfig file in root of the build directory (create it if it does not exist): ac_add_options --disable-verify-mar several files contain a line that must be uncommented. open them and find this line: #defines['disable_updater_authenticode_check'] = true. delete the...
... files first, create the directory that updates will be served from and put the mar file in it. then, create a file within called update.xml with these contents, replacing <mar name>, <hash> and <size> with the mar's filename, its sha512 hash, and its file size in bytes. ...
...'re using, you'll find the sha512 value in a file called sha512sums in the root of the release directory on archive.mozilla.org for a release or beta build (you'll have to search it for the file name of your mar, since it includes the sha512 for every file that's part of that release), and for a nightly build you'll find a file with a .checksums extension adjacent to your mar that contains that in
formation (for instance, for the mar file at https://archive.mozilla.org/pub/firefox/nightly/2019/09/2019-09-17-09-36-29-mozilla-central/firefox-71.0a1.en-us.win64.complete.mar, the file https://archive.mozilla.org/pub/firefox/nightly/2019/09/2019-09-17-09-36-29-mozilla-central/firefox-71.0a1.en-us.win64.checksums contains the sha512 for that file as well as for all the other win64 files that are part...
...cking on it in the file explorer and selecting properties. you'll find the correct size in bytes at the end of the line that begins "size", not the one that begins "size on disk". be sure to remove the commas when you paste this number into the xml file. on macos, you can get the exact size of your mar by running the command: stat -f%z <filename> or on linux, the same command would be: stat --
format "%s" <filename> starting your update server now, start an update server to serve the update files on port 8000. an easy way to do this is with python. remember to navigate to the correct directory before starting the server. this is the python2 command: python -m simplehttpserver 8000 or, this is the python3 command: python3 -m http.server 8000 if you aren't sure that you started the ser...
Embedded Dialog API
cembedapp::initializewindowcreator (lxr link accurate at revision 1.20 of that file; search for the method name in later revisions). gecko uses nsiwindowcreator to create all new windows for which no explicit override (the advanced api) has been given, and for browser windows in general. the precise appearance and contents of the new window are defined by the application, though the app should con
form to the chromeflags parameter of nsiwindowcreator::createchromewindow. this flag requests the presence or absence of particular features in the window surrounding the browser; features such as a toolbar or menubar. the nsiwebbrowserchrome::chrome_openas_chrome flag deserves special mention. a content window (the chrome flag is 0) is a browser window. the application should respond with whatever ki...
...y the embedding application. nsipromptservice is the canonical example. of course this is a relatively simple example. more complex dialogs may themselves require their own interface. (examples to be added as they come online. the print dialogs should be available soon.) dialogs posed by the embedding app ("down calls") some components will not pose dialogs directly, but maintain a database of in
formation an embedding app may wish to display as a dialog. preferences are the canonical example. in this case, we must be sure to have an api which an embedding app can use to populate its own dialog, should it decide to eschew mozilla's xul version. these components need build no dialog posing interface. guidelines a few restrictions on each component's ui interface... most if not all of these dia...
...indow as the dialog's parent, if non-null. to make our embedding api as consistent as possible, we'd like to impose a few coding conventions on these dialog-posing interfaces. ...
...sistent as possible, we'd like to impose a few coding conventions on these dialog-posing interfaces. ...
Using the Places annotation service
id is @mozilla.org/browser/annotation-service;1 var annotationservice = components.classes["@mozilla.org/browser/annotation-service;1"] .getservice(components.interfaces.nsiannotationservice); note that the annotation service is not thread-safe. you should only use it from the main thread. naming your annotations for your annotation name, you should use the
format <namespace>/<name>. for example, "my_extension/page_state". the annotation service does not currently enforce the annotation name
format, but this may change in the future. also, we may add functions to get all of "your" annotations matching a given namespace. you should not use any characters in your annotation names that are not valid as part of an html path. this includes colons, spaces, mo...
... name: this is the name of the annotation. see the section on naming above. ...
...itional database lookup (which has higher overhead). but then again you won't know if the exception meant that the annotation did not exist or something else is broken. the getter functions return only the value of the annotation (with the exception of the c++ getpageannotationbinary and getitemannotationbinary methods which return the mimetype as well). ...
...tion uri for a given favicon, use nsifaviconservice.getfaviconlinkforicon and to get the favicon annotation uri for a given page, use nsifaviconservice.getfaviconlinkforpage. it is important that you use these functions and not make up your own uris, because these functions will efficiently default to the default page favicon when it does not exist. see using the places favicon service for more in
formation. lifetime of annotations annotation expiration can be explicitly stated when the annotation is created. if no expiration is specified, the annotation is expired when the number of visits to the url is set to zero. valid values for expiration are: expire_with_history : default. annotations live as long as the uri is in history (eg: has >0 visits). expire_never : never expire. must be e...
Bundling multiple binary components
approach is to figure out all the methods imported from gecko and dynamically load the methods. create small wrappers for calling the methods, as you may need to thunk parameters depending on how much has changed between gecko versions. this means using something like loadlibrary / getprocaddress / freelibrary on windows. actually, nspr has portable versions of those features that work across plat
forms. this approach uses only one binary for each plat
form (win/mac/linux) but creates complexity in the binaries - loading the methods and creating the wrappers. the costs get higher if you have many methods that need to be loaded. stub loader this approach involves using a stub loader component. the stub component is an xpcom component itself and when registered by xpcom, the code would sniff th...
...te "real" xpcom component for the current configuration. it's pretty simple to do and the concept can be used to load third-party shared libraries (dll, so, dylib) used in xpcom components. in this case, we would use the stub to load the right binary component instead. some key points: the real components have the same iids but have different filenames. one for each version of gecko and os plat
form. ...
... components have the same iids but have different filenames. one for each version of gecko and os plat
form. the real components are not in the "components" folder, but are in a side folder ("libraries" in the sample). the real components are manually loaded and registered using the stub ("krealcomponent" in the sample). this approach uses one binary component for each version of gecko and plat
form, plus the stub loader component therefore, to support 2 gecko versions on three plat
forms, you need seven components (6 real components + 1 stub). on the other hand, this approach is much more simple than the dynamic loading approach. ...
... one binary component for each version of gecko and plat
form, plus the stub loader component therefore, to support 2 gecko versions on three plat
forms, you need seven components (6 real components + 1 stub). on the other hand, this approach is much more simple than the dynamic loading approach. the stub component can be either binary or javascript, but it is far easier in javascript is cross-plat
form and does not have compile- or load- time compatibility problems. the gears project contains an example of a javascript-based stub loader. ...
Preface
on't need to be a c++ expert, however. although basic ideas such as inheritance and encapsulation should be familar to you, wherever possible they are explained in the book as they are used. also many of the examples are in javascript, which is used in mozilla to access xpcom components as scriptable objects, and so familiarity with that language is useful as well. xpcom stands for the cross plat
form component object model. as this name implies, xpcom is similar to microsoft com. if you have any experience with this technology, much of it can be applied to xpcom. however, this book does not assume any prior knowledge of com - all of the basic com ideas will be introduced. this book provides a tutorial about building an xpcom component that controls browsing behavior. although, xpcom can be u...
...ter (xpcom interfaces were not fully frozen in prior releases). this book assumes you are using the sdk rather than compiling in a mozilla source tree, though the difference between these two approaches is minimal. details about downloading the sdk, building, and getting programmatic access to gecko components are provided in the appendix to this book, setting up the gecko sdk. ...
...umes you are using the sdk rather than compiling in a mozilla source tree, though the difference between these two approaches is minimal. details about downloading the sdk, building, and getting programmatic access to gecko components are provided in the appendix to this book, setting up the gecko sdk. conventions the
formatting conventions listed below are used to designate specific types of in
formation in the book and make things easier to scan. the goal is to use as few
formats as possible, but to distinguish the various different types of in
formation clearly.
format description bold component names appear in bold in the text monospace code listings, interface names and members of interfaces (e.g., createinstance()) appear in monospaced font. lines of ...
...opyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book
form is prohibited unless prior permission is obtained from the copyright holder. ...
nsIAbCard
m: nsisupports method overview astring getcardvalue(in string name) void setcardvalue(in string attrname, in astring value) void copy(in nsiabcard srccard) boolean equals(in nsiabcard card) string converttobase64encodedxml() astring converttoxmlprintdata() string converttoescapedvcard() astring generatename(in long agenerate
format,[optional] in nsistringbundle abundle) astring generatephoneticname(in boolean alastnamefirst) attributes attribute type description firstname astring lastname astring phoneticfirstname astring phoneticlastname astring displayname astring nickname astring ...
...th astring birthday astring custom1 astring custom2 astring custom3 astring custom4 astring notes astring lastmodifieddate unsigned long popularityindex unsigned long popularityindex is bumped every time e-mail is sent to this recipient . prefermail
format unsigned long allowed values are stored in nsiabprefermail
format. ismaillist boolean maillisturi string if ismaillist is true then maillisturi will contain the uri of the associated mailing list. allowremotecontent boolean allow remote content to be displayed in html mail received from this contact methods getcardvalue() astring getc...
...ue converttoxmlprintdata() astring converttoxmlprintdata() return value converttoescapedvcard() string converttoescapedvcard() return value generatename() generate a name from the card for display purposes. using the firstname, lastname and the displayname. we allow the caller to cache the pref value, so we don't have to go to prefs every time. astring generatename(in long agenerate
format,[optional] in nsistringbundle abundle) parameters agenerate
format the
format to present the name in: 0 generated name is displayname 1 lastfirst,
formatted following lastfirst
format property in addressbook.properties. 2 firstlast,
formatted following firstlast
format property in addressbook.properties. abundle an optional parameter that is a pointer to a string bundle that holds: a...
... return value a string containing the generated name. generatephoneticname() generate a phonetic name from the card, using the firstname and lastname values. astring generatephoneticname(in boolean alastnamefirst) parameters alastnamefirst set to true to put the last name before the first. ...
nsIAccessibleStates
cessiblerole.constants) with the state property set to state_animated. this state is used to indicate that the object's location is changing. state_invisible 0x00008000 the object is programmatically hidden. for example, menu items are programmatically hidden until a user activates the menu. because objects with this state are not available to users, client applications should not communicate in
formation about the object to users. however, if client applications find an object with this state, they should check to see if state_offscreen is also set. if this second state is defined, then clients can communicate the in
formation about the object to users. for example, a list box can have both state_invisible and state_offscreen set. in this case, the client application can communicate all items...
...he size of a window by clicking the border with a mouse and dragging the mouse. state_moveable 0x00040000 the object can be moved. for example, a user can click on the titlebar for the object and drag the object to a new location. state_selfvoicing 0x00080000 the object or child uses text-to-speech (tts) technology for description purposes. a speech-based accessibility aid does not announce in
formation when an object with this state has the focus because the object automatically announces in
formation. currently unused. state_focusable 0x00100000 the object can be focused. state_selectable 0x00200000 the object can be selected. state_linked 0x00400000 the object is
formatted as a hyperlink. the object role will usually be role_text_leaf. (see nsiaccessiblerole.constants). state_trav...
... state_protected 0x20000000 maps to gnome's role* atk_role_passwd_text, nothing for java? state_haspopup 0x40000000 new in msaa 2.0. ...
...ually be role_text_leaf. (see nsiaccessiblerole.constants). state_traversed 0x00800000 the object is a hyperlink that has been visited (previously clicked) by a user. state_multiselectable 0x01000000 supports multiple selection. state_extselectable 0x02000000 supports extended selection. state_alert_low 0x04000000 this in
formation is of low priority. state_alert_medium 0x08000000 this in
formation is of medium priority. state_alert_high 0x10000000 this in
formation is of high priority. state_protected 0x20000000 maps to gnome's role* atk_role_passwd_text, nothing for java? state_haspopup 0x40000000 new in msaa 2.0. state_required state_alert_low state_important state_alert_medium currently unused. state_invalid state_alert_high indicates a validation failure. state_chec...
nsICommandLine
remotely by another instance of the application. 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) components may implement the nsicommandlinehandler interface to add custom command line handling behavior. definitions arguments any values found on the command line. switches flags. in normalized
form, these are preceded by a single dash. some flags may take parameters; for example: "-url <param>" or "-install-xpi <param>". method overview long findflag(in astring aflag, in boolean acasesensitive); astring getargument(in long aindex); boolean handleflag(in astring aflag, in boolean acasesensitive); astring handleflagwithparam(in astring aflag, in boolean acasesensitive); void remov...
...oolean acasesensitive); void removearguments(in long astart, in long aend); nsifile resolvefile(in astring aargument); nsiuri resolveuri(in astring aargument); attributes attribute type description length long number of arguments in the command line. the application name is not part of the command line. read only. preventdefault boolean there may be a command-line handler which per
forms a default action if there was no explicit action on the command line (open a default browser window, for example). this flag allows the default action to be prevented. state unsigned long the type of command line being processed. see state constants. read only. windowcontext nsidomwindow a window to be targeted by this command line. in most cases, this will be null (xremote will sometimes ...
...oolean acasesensitive ); parameters aflag the flag name to locate. do not include the initial hyphen. acasesensitive whether to do case-sensitive comparisons. return value the position of the flag in the command line, or -1 if the flag is not found.getargument() gets the value an argument from the array of command-line arguments, given the index into the argument list. on windows, flags of the
form /flag are normalized to -flag. /flag:param are normalized to -flag param. on unix/linux and mac os x, flags of the
form --flag are normalized to -flag, and flags of the
form --flag=param are normalized to the
form -flag param. astring getargument( in long aindex ); parameters aindex the argument to retrieve. this index is 0-based, and does not include the application name. return value the v...
...le() resolves a file-path argument into an nsifile object. this method gracefully handles relative or absolute file paths, according to the working directory of this command line. nsifile resolvefile( in astring aargument ); parameters aargument the command-line argument to resolve. return value the file path as an nsifile. resolveuri() resolves a uri argument into a uri. this method has plat
form-specific logic for converting an absolute uri or a relative file-path into the appropriate uri object; it gracefully handles win32 c:\ paths which would confuse the i/o service if passed directly. nsiuri resolveuri( in astring aargument ); parameters aargument the command-line argument to resolve. return value a plat
form-specific uri. see also sample js component that implements a command-l...
nsIMemoryReporterManager
r objects. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by @mozilla.org/memory-reporter-manager;1 as a service: var reportermanager = components.classes["@mozilla.org/memory-reporter-manager;1"] .getservice(components.interfaces.nsimemoryreportermanager); each memory reporter object, which implements nsimemoryreporter interface, provides in
formation for a given code area. each code area is identified by a unique path string, which is displayed in about:memory. method overview nsisimpleenumerator enumeratemultireporters(); nsisimpleenumerator enumeratereporters(); void init(); void registermultireporter(in nsimemorymultireporter reporter); void registerrepo...
...m level ones not covered by memory reporters. this reporter is special-cased because it is interesting, and is moderately difficult to compute in javascript. -1 means unknown. read only. resident print64 gets the resident size (that is rss, physical memory used). this reporter is special-cased because it is interesting, is available on all plat
forms, and returns a meaningful result on all common plat
forms. -1 means unknown. read only. methods enumeratemultireporters() returns an enumerator for looking at the installed memory multi-reporters. nsisimpleenumerator enumeratemultireporters(); parameters none. return value an enumerator of nsimemorymultireporters that are currently registered. enumeratereporters() returns an enumerator...
... memory reporters. init() initializes the memory reporter manager. void init(); parameters none. registermultireporter() requests that memory multi-reporter notifications be sent to the specified objects. void registermultireporter( in nsimemorymultireporter reporter ); parameters reporter an object implementing the nsimemorymultireporter interface which provides memory usage in
formation for a given code area. registerreporter() requests that memory reporter notifications be sent to the specified objects. void registerreporter( in nsimemoryreporter reporter ); parameters reporter an object implementing the nsimemoryreporter interface which provides memory usage in
formation for a given code area. unregistermultireporter() stops sending memory multi-reporte...
...enting the nsimemoryreporter interface which provides memory usage in
formation for a given code area. unregistermultireporter() stops sending memory multi-reporter notifications to the specified object. void unregistermultireporter( in nsimemorymultireporter reporter ); parameters reporter an object implementing the nsimemorymultireporter interface which provides memory usage in
formation for a given code area. unregisterreporter() stops sending memory reporter notifications to the specified object. void unregisterreporter( in nsimemoryreporter reporter ); parameters reporter an object implementing the nsimemoryreporter interface which provides memory usage in
formation for a given code area. see also nsimemorymultireporter nsimemoryreporter ...
nsIMsgDBView
ently loaded messages. void sort(in nsmsgviewsorttypevalue sorttype, in nsmsgviewsortordervalue sortorder); parameters sorttype a nsmsgviewsorttypevalue designating the sort type used. defined in the interface: nsmsgviewsorttype. sortorder an nsmsgviewsortordervalue designating the sort order used for the folder. defined in the interface: nsmsgviewsortorder. docommand() per
form a command on the currently loaded messages. void docommand(in nsmsgviewcommandtypevalue command); parameters command the nsmsgviewcommandtypevalue to per
form. defined in the interface: nsmsgviewcommandtype. docommandwithfolder() per
form a command that requires a folder. typical examples are move or copy commands. void docommandwithfolder(in nsmsgviewcommandtypevalue command, ...
... getcommandstatus() gets the status of a particular command. used by the thunderbird ui to determine if the command is available. ...
...: nsmsgviewcommandtype. docommandwithfolder() per
form a command that requires a folder. typical examples are move or copy commands. void docommandwithfolder(in nsmsgviewcommandtypevalue command, in nsimsgfolder destfolder); parameters command the nsmsgviewcommandtypevalue to per
form. defined in the interface: nsmsgviewcommandtype. destfolder the folder to per
form the command with. getcommandstatus() gets the status of a particular command. used by the thunderbird ui to determine if the command is available. ...
...defined in the interface: nsmsgviewcommandtype. return values selectable_p the state of the command. true if it is enabled. false if it is disabled. selected_p the returned check state of the command. defined in the interface: nsmsgviewcommandcheckstate. this is not used for all commands and will return the notused value most of the time. ...
nsIPlacesView
views do this, and other things, by implementing the nsiplacesview interface. note: nsiplacesview does not exist in idl at the moment. it's currently implemented directly on each of the built-in places views. ...
...views do this, and other things, by implementing the nsiplacesview interface. note: nsiplacesview does not exist in idl at the moment. it's currently implemented directly on each of the built-in places views. ...
...n hasselection boolean whether or not there are selected items. read only. insertionpoint insertionpoint the insertionpoint at which new items will be inserted upon drop, paste, or creation. read only. place string theuri (as a string) of the root place that the view displays. this may be modified dynamically to update the view. see displaying places in
formation using views for examples. selectednode nsinavhistoryresultnode the selected node in the view. if there are multiple selected nodes, this is null. read only. methods getdragableselection() returns an array of selected nsinavhistoryresultnode objects that can be dragged from the view. nsinavhistoryresultnode[] getdragableselection(); parameters none. return value ...
...essarily returned in the same order in which they occur in the model, or in the same container, or from the same provider. nsinavhistoryresultnode[] getselectionnodes(); parameters none. return value an array of nsinavhistoryresultnode objects that are selected. selectall() selects all the nodes displayed in the view. void selectall(); parameters none. see also displaying places in
formation using views ...
nsIPrivateBrowsingService
netwerk/base/public/nsiprivatebrowsingservice.idlscriptable provides access to in
formation about the state of the private browsing service. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface is deprecated since firefox 20, and will probably be completely removed in firefox 21. the nsiprivatebrowsingservice interface provides access to in
formation about the state of the private browsing feature offered in firefox 3.5 and later. when firefox is in private browsing mode, firefox shouldn't save any potentially private in
formation. the browser itself stops caching, and also doesn't record history in
formation. in addition, temporary, databases are created to be u...
... for details on how to do this, see the article supporting private browsing mode. ...
... for details on how to do this, see the article supporting private browsing mode. ...
... attribute type description autostarted boolean indicates whether or not private browsing was started automatically at application launch time. this is only ever true if privatebrowsingenabled is also true. read only. lastchangedbycommandline boolean indicates whether or not the last private browsing mode transition was per
formed on the command line (using either the -private or -private-toggle switches) rather than the user interface. read only. privatebrowsingenabled boolean indicates whether or not private browsing mode is currently enabled. you may also turn private browsing mode on and off by setting the value of this attribute. changing this value while handling one of the notificatio...
nsIStringBundleService
this is typically a locale url, e.g. chrome://global/locale/global.properties return value a string bundle corresponding to the properties file. this string bundle has functions availa...
...nsistringbundle createbundle( in string aurlspec ); parameters aurlspec the url of the properties file to load. this is typically a locale url, e.g. chrome://global/locale/global.properties return value a string bundle corresponding to the properties file. this string bundle has functions available on it. on the return value object on you can call functions like getstringfromname and
formatstringfromname see nsistringbundle. createextensiblebundle() nsistringbundle createextensiblebundle( in string aregistrykey ); parameters aregistrykey the name of the category under which the properties file(s) have been registered. return value an extensible bundle corresponding to the properties file(s). flushbundles() flushes the string bundle cache - useful when the locale...
...der which the properties file(s) have been registered. return value an extensible bundle corresponding to the properties file(s). flushbundles() flushes the string bundle cache - useful when the locale changes or when we need to get some extra memory back. (automatically called for the memory-pressure and chrome-flush-caches global observer topics.) void flushbundles(); parameters none.
formatstatusmessage()
formats a message string from a status code and status arguments. typically used to
format a message received by a nsiprogresseventsink's onstatus method. wstring
formatstatusmessage( in nsresult astatus, in wstring astatusarg ); parameters astatus the status code. this is mapped into a string id and and used in the string lookup process (see nsierrorservice). astatu...
... see also code snippets : miscellaneous : using string bundles from javascript how to localize html pages, xul files, and js/jsm files from bootstrapped add-ons. ...
nsISupports proxies
us or synchronous xpcom calls to a different thread on arbitrary xpcom interfaces. this technology has been removed in firefox 12 because it was very complex and often lead to strange deadlock conditions. it is no longer needed because javascript code can no longer run on arbitrary threads, and compiled code can use compiled runnable to achieve the same effect in a much simpler manner. for more in
formation about alternatives, see making cross-thread calls using runnables. the following interface is now obsolete: nsiproxyobjectmanager. 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. the main reason for nsisupports proxies is that javascript and ui ...
...ied object. most of the time you will want to set this flag. proxy_sync acts just like a function call in that it blocks the calling thread until the the method is invoked on the destination thread. this is the normal and default case. proxy_async, on the other hand, is a "fire and forget" method call. calls on object created with this flag will return immediately and you will lose all return in
formation. ns_ok will be returned to you. warning about proxy_async: you must take very special care when using this flag. as soon as the calling function or method exits, there is no guarantee about the data at the location that used to be part of that stack frame. accessing it might even cause a crash. for example: myfoo->bar(&x) ... stack frame goes away ... bar(print32 *x) { ... ...
... ...
...robject(ns_proxy_to_main_thread, ifoo::getiid(), ptestobj, ns_proxy_sync | ns_proxy_always, getter_addrefs(pproxy)); if(ns_failed(rv)) return rv; // we do not care about the real object anymore. // ie. getproxyobject refcounts it. ns_release(ptestobj); pproxy->bar(); ns_release(pproxy); original document in
formation author: doug turner last updated date: january 27, 2007 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
nsIURI
netwerk/base/public/nsiuri.idlscriptable this is an interface for an uni
form resource identifier with internationalization support, offering attributes that allow setting and querying the basic components of a uri, and methods for per
forming basic operations on uris. inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) see the following rfcs for details: rfc3490: internationalizing domain names in applications (idna) rfc3986: uni
form resource identifier (uri): generic syntax rfc3987: internationalized resource identifiers subclasses of nsiuri, such as nsiurl, impose further structure on the uri. to create an nsiuri object, you should use nsiioservice.newuri(), like this: function makeuri(aurl, aorigincharset, abaseuri) { ...
.... warning: setting this is highly discouraged outside of a protocol handler implementation, since doing so will generally lead to unpredictable results. spec autf8string returns a string representation of the uri. setting the spec causes the new spec to be parsed using the rules for the scheme the uri currently has. ...
... note: some characters may be escaped. ...
... note: some characters may be escaped. ...
nsIURIFixup
keyword); nsiurifixupinfo getfixupuriinfo(in autf8string auritext, in unsigned long afixupflags); constants constant value description fixup_flag_none 0 no fixup flags. fixup_flag_allow_keyword_lookup 1 allow the fixup to use a keyword lookup service to complete the uri. the fixup object implementer should honour this flag and only per
form any lengthy keyword (or search) operation if it is set. fixup_flags_make_alternate_uri 2 tell the fixup to make an alternate uri from the input uri, for example to turn foo into www.foo.com. fixup_flag_use_utf8 4 use utf-8 to encode the uri instead of the plat
form character set. fixup_flag_fix_scheme_typos 8 fix common scheme typos. methods cr...
...s an internal uri (for example a wysiwyg uri) into one which we can expose to the user, for example on the url bar. nsiuri createexposableuri( in nsiuri auri ); parameters auri the uri to be converted. return value the converted, exposable uri, as an nsiuri. exceptions thrown ns_error_unknown_protocol when we can not get a protocol handler service for the uri scheme. ns_error_mal
formed_uri when the exposable portion of auri is mal
formed. createfixupuri() converts the specified string into a uri, first attempting to correct any errors in the syntax or other vagaries. returns a well
formed uri or nsnull if it cannot. nsiuri createfixupuri( in autf8string auritext, in unsigned long afixupflags ); parameters auritext candidate uri. afixupflags flags that govern w...
... keywordtouri() converts the specified keyword string into a uri. note that it is the caller's responsibility to check whether keywords are enabled and whether akeyword is a sensible keyword. nsiuri keywordtouri( in autf8string akeyword ); parameters akeyword the keyword to convert into a uri. return value the converted uri. ...
...ed uri. getfixupuriinfo() same as createfixupuri, but returns in
formation about what it corrected (e.g. whether we could rescue the uri or "just" generated a keyword search uri instead). nsiuri createfixupuri( in autf8string auritext, in unsigned long afixupflags ); parameters auritext candidate uri. afixupflags flags that govern ways the uri may be fixed up. ...
nsIWindowsRegKey
ase, it is the responsibility of the consumer setting the hkey to ensure that it is a valid hkey. warning: setting the key does not close() the old key. native code only! valuecount unsigned long this attribute returns the number of values under this key. read only. constants root key constants the values for these keys correspond to the values from winreg.h in the ms plat
form sdk. the root_key_ prefix corresponds to the hkey_ prefix in the ms plat
form sdk. this interface is not restricted to using only these root keys. constant value description root_key_classes_root 0x80000000 root_key_current_user 0x80000001 root_key_local_machine 0x80000002 access constants values for the mode parameter passed ...
...only these root keys. constant value description root_key_classes_root 0x80000000 root_key_current_user 0x80000001 root_key_local_machine 0x80000002 access constants values for the mode parameter passed to the open() and create() methods. the values defined here correspond to the regsam values defined in winnt.h in the ms plat
form sdk, where access_ is replaced with key_. this interface is not restricted to using only these access types. constant value description access_basic 0x00020000 access_query_value 0x00000001 access_set_value 0x00000002 access_create_sub_key 0x00000004 access_enumerate_sub_keys 0x00000008 ac...
...numerate_sub_keys | access_notify access_write access_basic | access_set_value | access_create_sub_key access_all access_read | access_write wow64_32 0x00000200 wow64_64 0x00000100 type constants values for the type of a registry value. the numeric values of these constants are taken directly from winnt.h in the ms plat
form sdk. the microsoft documentation should be consulted for the exact meaning of these value types. this interface is somewhat restricted to using only these value types. there is no method that is directly equivalent to regqueryvalueex or regsetvalueex. in particular, this interface does not support the reg_multi_sz and reg_expand_sz value types. it is still possible to enumerate values that have o...
... the key does not exist. nsiwindowsregkey openchild( in astring relpath, in unsigned long mode ); parameters relpath mode return value nsiwindowsregkey for the newly opened subkey. readbinaryvalue() this method reads the binary contents of the named value under this key. javascript callers should take care with the result of this method since it will be byte-expanded to
form a js string. (the binary data will be treated as an iso-latin-1 character string, which it is not). acstring readbinaryvalue( in astring name ); parameters name the name of the value to query. return value the binary contents of the named value under this key. readint64value() this method reads the 64-bit integer contents of the named value. unsigned long long readint64value( in as...
Getting Started Guide
eryinterface| into an |nscomptr|... nsresult rv; nscomptr<nsifoo> foo(do_queryinterface(bar, &rv)); // or, if you don't care about the |nsresult| nscomptr<nsifoo> foo(do_queryinterface(bar)); nscomptr happily calls addref and release implicitly. this same favor is not extended to queryinterface. nscomptr does not queryinterface on assignment without your explicit permission in the
form of the do_queryinterface directive. you need never worry about hidden queries. however, be aware that if you should have queried but didn't, e.g., when assigning in a raw pointer where c++ allows the assignment, but xpcom wouldn't, nscomptr will assert at runtime. use do_queryinterface whenever you assign in a pointer to a xpcom interface of a different type, even if that type happens to derive f...
...ee some com ownership guidelines. nscomptr is designed to be used with xpcom interfaces, so don't use it with non-interfaces with specific exceptions described below. don't use nscomptrs in xpcom interfaces. don't use them in plain old c code; nscomptrs are, of course, a c++ only construct. never cast an nscomptr, it's almost guaranteed to leak. nscomptrs for non-interface classes appropriately
formatted answer to come, in the meanwhile, the full details are available in this news posting (via google groups). nscomptrs in function signatures in general, you won't want to use nscomptr in the signature of xpcom (i.e., `scriptable') functions. nscomptr is not currently directly supported by idl. however, you may sometime be tempted to use an nscomptr in a non-scriptable function. nscomptr<t>...
... groups). nscomptrs in function signatures in general, you won't want to use nscomptr in the signature of xpcom (i.e., `scriptable') functions. nscomptr is not currently directly supported by idl. however, you may sometime be tempted to use an nscomptr in a non-scriptable function. nscomptr<t> f() don't return an nscomptr this practice is dangerous. returning an addrefed pointer in almost any
form as a function result leads to several potential errors, some of which are leaks, some of which are dangling pointers. returning an nscomptr may seem like a good idea (since it tells clients you are giving them ownership), however it can be the cause of an dangling pointer. consider: // don't return |nscomptr|s... nscomptr<nsifoo> createfoo(); // ... nsifoo* myfoo = createfoo(); /...
...atefoo| returns an |nscomptr|, which // automatically |release|s right after this // assignment. now |myfoo| refers to a // deleted object. you can tell callers you are giving them ownership in a way that doesn't pose this hazard by returning a already_addrefed<t> (see bug #59212). an nscomptr knows not to addref a value that is already_addrefed. // preferred
form: if you must return a pointer, use |already_addrefed|... already_addrefed<nsifoo> createfoo(); // ... nsifoo* myfoo1 = createfoo(); // doesn't dangle nscomptr<nsifoo> myfoo2( createfoo() ); // doesn't leak nscomptr<nsifoo> myfoo3( dont_addref(createfoo()) ); // redundant, but legal and correct compare this to the most frequent leaks caused by returning a raw pointer you have already ...
Using nsIDirectoryService
this implementation will allow you to get(), set(), define(), and undefine() nsifile. getting a location: most developers need to find where a file or directory is located. with nsdirectoryservice, there are two steps involved. first, you must know what the string key (or property) is that refers to this locations. header files containing known keys are listed in the known locations section of this document. bear in mind that this list is not static. components can add and remove locations at their will. second, you must acquire the implementation and call get() passing the known string key. ...
... string key, and should return an nsifile. the persistant flag allows you to specify if you want the nsdirectoryservice to cache this value. in most cases you would set this to be true. the interfaces for this can be found here. known locations the nsiproperties strings for currently defined locations can be found in: nsdirectoryservicedefs.h nsappdirectoryservicedefs.h nsxulappapi.h content
formerly at http://www.mozilla.org/projects/xpco...locations.html background the way in which mozilla components locate special files and directories has changed. in the past, this was done using nsifilelocator. this component was a problem for embedding applications. since it was a component and was loaded implicitly by many other components, it was difficult to customize. customizing the locations i...
...ed to tell the system of the location of dlls that are linked against. this aspect of file location is not related to nsidirectoryservice, but needs mention here. on the macintosh, these dlls are the shared libs in the "essential files" directory. you need to include an alias in your application that points to this directory and the resource id of this alias goes into your 'cfrg' resource. on plat
forms which use path environment variables, you will need to set one of these paths to the /bin directory. application level nsappdirectoryservicedefs.h the first group listed is for locations that are relative to the application: for instance, the name and location of the chrome folder, or the default location of user profiles. the nsidirectoryserviceprovider which normally provides these locations i...
...ed these locations at a very early point - even before registering components. if you want to use mpfilelocprovider, or something like it, to provide one fixed profile, just construct it and call its initialize method - it will register itself. again, if you do this, do not initialize the profile service - it's either one or the other. related pages code_snippets:file_i/o original document in
formation authors: conrad carlen, doug turner last updated date: september 26, 2000 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Using the Gecko SDK
an xpcom component will be compatible with future versions of mozilla if it only makes use of frozen gecko apis. ...
...an xpcom component will be compatible with future versions of mozilla if it only makes use of frozen gecko apis. ...
...i is one that is included in the gecko and marked frozen with the text <tt>@status frozen</tt> (with nspr as the exception to the rule). the frozen gecko api consists of a set of component interfaces (c++ vtables) and <tt>extern "c"</tt> symbols exported from the xpcom library and the nspr libraries. the abi of the component interfaces depends on the c++ abi of the host compiler (i.e., the vtable
format and calling conventions of the virtual methods may vary from compiler to compiler). the gecko abi is therefore compiler sensitive. (<tt>about:buildconfig</tt> can be loaded in mozilla to reveal details about the compiler that was used.) for the remainder of this guide, we'll assume you are developing components under linux. (ports of this guide are welcome.) a "frozen" interface or function is ...
...piler). the gecko abi is therefore compiler sensitive. (<tt>about:buildconfig</tt> can be loaded in mozilla to reveal details about the compiler that was used.) for the remainder of this guide, we'll assume you are developing components under linux. (ports of this guide are welcome.) a "frozen" interface or function is guaranteed to be supported by future versions of same major version of the plat
form. the sdk contains headers for all of the frozen interfaces and functions, and it also contains headers for classes and functions defined in the glue libraries. when those classes or functions are used, the component must link with the corresponding static library. every frozen interface or function will be labeled as such in the idl or header file with "@status frozen". (note: nspr is the one exc...
Using Mozilla code in other projects
there are also modules that aren't used in firefox but are available for use by other applications; an example of this is rhino, the javascript engine written in java. you can embed gecko, the layout engine used by firefox to process web pages, as a browser within your own application. ...
... there are also modules that aren't used in firefox but are available for use by other applications; an example of this is rhino, the javascript engine written in java. you can embed gecko, the layout engine used by firefox to process web pages, as a browser within your own application. ...
...y firefox to process web pages, as a browser within your own application. building xul applications the joy of xul an introduction to xul; a must read for new developers. xul reference the complete reference to xul. xulrunner a mozilla runtime package that can be used to bootstrap xul and xpcom applications with ease. ...
...a toolkit in
formation about the mozilla toolkit api. signing mozilla apps for mac os x how to code-sign applications based on mozilla code for mac os x's application security model. using mozilla components spidermonkey spidermonkey is the javascript runtime engine used by mozilla projects. nspr the netscape portable runtime provides a plat
form-neutral api for system level and libc-type functions. necko the mozilla networking library provides cross-plat
form networking functionality. embedding mozilla for in
formation on embedding a web browser into your own application see embedding mozilla. ...
Blocking By Domain - Plugins
according to the firefox plugin roadmap, the plugin block list is planned for firefox 55. effects of plugin blocking once a site is included in plugin blocking, it is not possible for that site or any subframes within that site to use plugins. ...
... according to the firefox plugin roadmap, the plugin block list is planned for firefox 55. effects of plugin blocking once a site is included in plugin blocking, it is not possible for that site or any subframes within that site to use plugins. ...
...r.mimetypes and navigator.plugins will also behave as if the plugin were not installed. there are two versions of plugin blocking: first-party plugin blocking list sites on this list may not use plugins. third-party plugin block list sites on this list may not use plugins when they are loaded into a third-party iframe in another site. criteria in order to improve firefox security and per
formance, there are two major categories of sites mozilla may choose to add to plugin domain blocking: sites commonly embedded in a 3rd-party context web sites which are commonly embedded into other sites using iframes can have a large impact on browser security and also cause many sites to show plugin activation prompts. sites in this category may include advertisers, social media sites, and othe...
...ontext web sites which are commonly embedded into other sites using iframes can have a large impact on browser security and also cause many sites to show plugin activation prompts. sites in this category may include advertisers, social media sites, and other utilities. top sites many popular sites work properly without plugins, but still prompt users for activation. in order to improve site per
formance and reduce the number of plugin prompts that users see, popular sites that show unnecessary plugin prompts or slow the browser down with unnecessary plugins will be added to the plugin block list. list contents and updates the plugin block lists are freely-licensed lists maintained by mozilla in github. the initial contents of the third-party plugin block list are based on disconnect's ope...
Browser Side Plug-in API - Plugins
only call these from the main thread; calling them from other threads is not supported and may have unpredictable results. netscape plug-in method summary « previousnext » npn_destroystream closes and deletes a stream. npn_forceredraw forces a paint message for a windowless plug-in. ...
... npn_invalidaterect invalidates specified drawing area prior to repainting or refreshing a windowless plug-in. ...
... npn_invalidaterect invalidates specified drawing area prior to repainting or refreshing a windowless plug-in. npn_invalidateregion invalidates specified drawing region prior to repainting or refreshing a windowless plug-in. ...
...osturlnotify posts data to a url, and receives notification of the result. npn_pushpopupsenabledstate pushes the popups-enabled state. npn_reloadplugins reloads all plug-ins in the plugins directory. npn_requestread requests a range of bytes for a seekable stream. npn_setvalue sets windowless plug-in as transparent or opaque. npn_setvalueforurl allows a plug-in to change the stored in
formation associated with a url, in particular its cookies. npn_status displays a message on the status line of the browser window. npn_useragent returns the browser's user agent field. npn_version returns version in
formation for the plug-in api. npn_write pushes data into a stream produced by the plug-in and consumed by the browser. ...
Plugins
roadmap highlights since firefox 52, plugins other than flash are not loaded by firefox. ...
... roadmap highlights since firefox 52, plugins other than flash are not loaded by firefox. ...
...ash are not loaded by firefox. starting in firefox 55, users will be asked to choose which sites may use flash content. this feature will be rolled out gradually to firefox users. also from firefox 55 onwards, flash and other plugins can no longer be loaded from any url scheme except for http:// and https:// (bug 1335475). see also flash can now be loaded only from http/https for more useful in
formation. starting with firefox 56 in september 2017, firefox for android will remove all support for plugins (bug 1381916). tutorials and references the articles below are developer in
formation about the developing for click-to-play, and plugin blocking. flash activation: browser comparison each browser activates flash slightly differently, which can be confusing for users and web authors...
...droid will remove all support for plugins (bug 1381916). tutorials and references the articles below are developer in
formation about the developing for click-to-play, and plugin blocking. flash activation: browser comparison each browser activates flash slightly differently, which can be confusing for users and web authors. plugin blocking by domain in order to improve security and per
formance for firefox users, firefox maintains a list of sites that are not able to use plugins. archived in
formation legacy documentation about developing npapi plugins. ...
Debugger.Source - Firefox Developer Tools
each debugger instance has a separate collection of debugger.source instances representing the source code that has been presented to the system. ...
...pe object a debugger.source instance inherits the following accessor properties from its prototype: text if the instance refers to javascript source, the javascript source code, as a string. the value satisfies the program, functiondeclaration, or functionexpression productions in the ecmascript standard. if the instance refers to webassembly code, the serialized text representation. the
format is yet to be specified in the webassembly standard. currently, the text is an s-expression based syntax. the text generation is disabled if the debugger has the allowwasmbinarysource property set, the "[wasm]" value will be returned in this case. binary if the instance refers to webassembly code and the debugger has the allowwasmbinarysource property set, a uint8array that contains the weba...
...ance refers to webassembly code and the debugger has the allowwasmbinarysource property set, a uint8array that contains the webassembly bytecode. url if the instance refers to javascript source, the filename or url from which this script’s code was loaded. for scripts created by eval or the function constructor, this may be a synthesized filename, starting with a valid url and followed by in
formation tracking how the code was introduced into the system; the entire string is not a valid url. for function.prototype’s script, this is null. source may be loaded from a url in the following ways: the url may appear as the src attribute of a <script> element in markup text. the url may be passed to the worker web worker constructor, or the web worker importscripts function. ...
...to javascript source, if this source was produced by a minimizer or translated from some other language, and we know the url of a source map document relating the source positions in this source to the corresponding source positions in the original source, then this property’s value is that url. otherwise, this is null. (on the web, the translator may provide the source map url in a specially
formatted comment in the javascript source code, or via a header in the http reply that carried the generated javascript.) this property is writable, so you can change the source map url by setting it. all debugger.source objects referencing the same source will see the change. setting an empty string has no effect and will not change existing value. if the instance refers to webassembly code, nul...
Examine and edit CSS - Firefox Developer Tools
atched elements: next to the selector is a target icon: click this to highlight all nodes in the page that match this selector. overridden declaration: declarations that are overridden by later rules are crossed out. see overridden declarations. inactive rules (not shown): if a rule is inactive (e.g., padding on a :visited pseudo-element), it is colored gray, with an info icon that gives more in
formation when clicked. filter rules containing this property: next to overridden declarations is an icon you can click to filter the rules list to show only those rules that include that property. see overridden declarations. enable/disable: if you hover over a declaration, a checkbox appears next to it: you can use this to toggle the declaration on or off. filename and line number: on the right-h...
...tton to see checkboxes that you can use to enable the :hover, :active and :focus, :focus-within and :visited pseudo-classes for the selected element: this feature can also be accessed from the popup menu in the html view. if you enable one of these pseudo-classes for a node, an orange dot appears in the markup view next to all nodes to which the pseudo-class has been applied. in addition, the in
formation that appears on the page itself show you what pseudo-class you are examining. for example: viewing and changing classes on an element with an element selected in the html pane, you can click the .cls button in the rules pane toolbar, to display the classes defined on that element. you can clear the checkbox for a particular class name, to see how the element would appear without that ...
...ce a similar effect. examine computed css to see the complete computed css for the selected element, select the computed panel in the righthand pane. this panel shows the calculated value that each css property has for the selected element. (this calculated value is exactly the same as what getcomputedstyle would return.) you can tab through the styles to select them, and you can find more in
formation about each property — pressing f1 on a selected property will open up its mdn reference page. clicking the arrow next to the property name (or pressing enter or space while it is selected) shows the rule that set this value, along with a link to the source filename and line number: by default, this view only shows values that have been explicitly set by the page: to see all values, cli...
...ed) shows the rule that set this value, along with a link to the source filename and line number: by default, this view only shows values that have been explicitly set by the page: to see all values, click the "browser styles" box. you can tab through the filenames/line numbers; pressing enter/return will open up the relevant file at that point in the style editor. typing in the search box per
forms a live filtering of the list, so, for example, if you just want to see font-related settings, you can type "font" in the search box, and only properties with "font" in the name will be listed. you can also search for the values of properties: to find the rule responsible for setting the font to "lucida grande", type that in the search box. while in the computed view, you can press ctrl / cmd +...
Examine and edit HTML - Firefox Developer Tools
selected element: hovering over a breadcrumb highlights that element in the page. the breadcrumbs bar has its own keyboard shortcuts. searching the page inspector's search box matches all markup in the current document and in any frames. to start searching the markup, click in the search box to expand it or press ctrl + f , or cmd + f on a mac. there are three types of searches that are per
formed automatically depending on what you enter, a full text search, a css selector search, and an xpath search. full text search the full text search will always be executed, independently of what you enter. that allows you to find css selectors and xpath expressions occurring within the text. css selector search you can search elements by entering a css selector. as you type, an autocomplete p...
...rated. this can happen for different reasons such as using display: none or that the element doesn't have any dimensions. there is an ellipsis shown between the opening and closing tag of an element when the node is collapsed if it has larger contents. now children are indicated in the tree with this icon: at the right side of some nodes there are markers shown indicating different pieces of in
formation related to it: event the element has one or several event listeners attached to it. clicking the marker opens a tooltip listing the event listeners and allows you for each listener to switch to the line of javascript code in the debugger where the listener is defined. scroll the element is a scroll container, i.e. it has overflow: scroll or overflow: auto applied to ...
...hlight the element with the slot attribute as it exists outside the shadow dom this is very useful when you've got a <slot> element and you can't find the source of its content. note: shadow dom inspection was implemented in firefox 61, but was hidden behind the dom.webcomponents.shadowdom.enabled pref until firefox 63. it is now turned on by default. element popup context menu you can per
form certain common tasks on a specific node using a popup context menu. to activate this menu, context-click the element. the menu contains the following items — click on the links to find the description of each command in the context menu reference: edit as html create new node duplicate node delete node attributes add attribute copy attribute value edit attribute remove att...
...ntexts, for example the "open file in style-editor" option only appears when you context-click over the top of a link to a css file. context menu reference edit as html edit the element's html. (copy) inner html copy the inner html for the element. (copy) outer html copy the outer html for the element. pressing ctrl + c (or cmd + c on a mac) also per
forms this action. (copy) unique selector/css selector copy a css selector that uniquely selects the element. (copy) css path copy a css selector that represents the full path to the element. (copy) image data-url copy image as a data:// url, if the selected element is an image. (copy) attribute copy the attribute of the element. show dom pr...
AnalyserNode - Web APIs
it is an audionode that passes the audio stream unchanged from the input to the output, but allows you to take the generated data, process it, and create audio visualizations. an analysernode has exactly one input and one output. the node works even if the output is not connected. ...
...d4e53" text-anchor="middle" alignment-baseline="middle">analysernode</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor analysernode() creates a new instance of an analysernode object. properties inherits properties from its parent, audionode. analysernode.fftsize is an unsigned long value representing the size of the fft (fast fourier trans
form) to be used to determine the frequency domain. analysernode.frequencybincount read only is an unsigned long value half that of the fft size. this generally equates to the number of data values you will have to play with for the visualization. analysernode.mindecibels is a double value representing the minimum power value in the scaling range for the fft analysis data, for conversion to unsig...
...en values over time smoother. methods inherits methods from its parent, audionode. analysernode.getfloatfrequencydata() copies the current frequency data into a float32array array passed into it. analysernode.getbytefrequencydata() copies the current frequency data into a uint8array (unsigned byte array) passed into it. analysernode.getfloattimedomaindata() copies the current wave
form, or time-domain, data into a float32array array passed into it. analysernode.getbytetimedomaindata() copies the current wave
form, or time-domain, data into a uint8array (unsigned byte array) passed into it. examples note: see the guide visualizations with web audio api for more in
formation on creating audio visualizations. basic usage the following example shows basic usage of an audioco...
... var audioctx = new(window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); // ... ...
AudioContext.getOutputTimestamp() - Web APIs
timestamp values relating to the current audio context. the two values are as follows: audiotimestamp.contexttime: the time of the sample frame currently being rendered by the audio output device (i.e., output audio stream position), in the same units and origin as the context's audiocontext.currenttime. basically, this is the time after the audio context was first created. audiotimestamp.per
formancetime: an estimation of the moment when the sample frame corresponding to the stored contexttime value was rendered by the audio output device, in the same units and origin as per
formance.now(). this is the time after the document containing the audio context was first rendered. syntax var timestamp = audiocontext.getoutputtimestamp() parameters none. returns an audiotimestamp object, wh...
...e.now(). this is the time after the document containing the audio context was first rendered. syntax var timestamp = audiocontext.getoutputtimestamp() parameters none. returns an audiotimestamp object, which has the following properties. contexttime: a point in the time coordinate system of the currenttime for the baseaudiocontext; the time after the audio context was first created. per
formancetime: a point in the time coordinate system of a per
formance interface; the time after the document containing the audio context was first rendered examples in the following code we start to play an audio file after a play button is clicked, and start off a requestanimationframe loop running, which constantly outputs the contexttime and per
formancetime. you can see full code of this exampl...
... working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contri...
... working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please ...
Beacon API - Web APIs
in an unload handler. to solve this problem, analytics and diagnostics code will typically make a synchronous xmlhttprequest in an unload or beforeunload handler to submit the data. the synchronous xmlhttprequest forces the browser to delay unloading the document, and makes the next navigation appear to be slower. there is nothing the next page can do to avoid this perception of poor page load per
formance. there are other techniques used to ensure that data is submitted. one such technique is to delay the unload to submit data by creating an image element and setting its src attribute within the unload handler. as most user agents will delay the unload to complete the pending image load, data can be submitted during the unload. another technique is to create a no-op loop for several seconds w...
.... as most user agents will delay the unload to complete the pending image load, data can be submitted during the unload. another technique is to create a no-op loop for several seconds within the unload handler to delay the unload and submit data to a server. not only do these techniques represent poor coding patterns, some of them are unreliable and result in the perception of poor page load per
formance for the next navigation. the beacon api provides a standard way to address these issues. global context the beacon api's navigator.sendbeacon() method is used to send a beacon of data to the server in the global browsing context. the method takes two arguments, the url and the data to send in the request. the data argument is optional and its type may be an arraybufferview, blob, domstring,...
... for the next navigation. the beacon api provides a standard way to address these issues. global context the beacon api's navigator.sendbeacon() method is used to send a beacon of data to the server in the global browsing context. the method takes two arguments, the url and the data to send in the request. the data argument is optional and its type may be an arraybufferview, blob, domstring, or
formdata. if the browser successfully queues the request for delivery, the method returns "true" and returns "false" otherwise. worker context the beacon api's navigator.sendbeacon() method is used to send a beacon of data to the server from the worker global scope. the method takes two arguments, the url and the data to send in the request. the data argument is optional and its type may be an array...
...y queues the request for delivery, the method returns "true" and returns "false" otherwise. worker context the beacon api's navigator.sendbeacon() method is used to send a beacon of data to the server from the worker global scope. the method takes two arguments, the url and the data to send in the request. the data argument is optional and its type may be an arraybufferview, blob, domstring, or
formdata. if the browser successfully queues the request for delivery, the method returns "true" and otherwise returns "false". ...
CSS Typed Object Model API - Web APIs
generally, css values can be read and written in javascript as strings, which can be slow and cumbersome. ...
... parsing and concatenation. this is easier for authors (for example, numeric values are reflected with actual js numbers, and have unit-aware mathematical operations defined for them). it is also generally faster, as values can be directly manipulated and then cheaply translated back into underlying values without having to both build and parse strings of css. css typed om both allows for the per
formant manipulation of values assigned to css properties while enabling maintainable code that is both more understand and easier to write. interfaces cssstylevalue the cssstylevalue interface of the the css typed object model api is the base class of all css values accessible through the typed om api. an instance of this class may be used anywhere a string is expected. cssstylevalue.parse(pro...
...epresenting values for properties that take an image, for example background-image, list-style-image, or border-image-source. csskeywordvalue an interface which creates an object to represent css keywords and other identifiers. when used where a string is expected, it will return the value of csskeyword.value. cssnumericvalue an interface representing operations that all numeric values can per
form, including: cssnumericvalue.add - adds supplied numbers to the cssnumericvalue. cssnumericvalue.sub - subtracts supplied numbers to the cssnumericvalue. cssnumericvalue.mul - multiplies supplied numbers to the cssnumericvalue. cssnumericvalue.div - divides a supplied number by other numbers, throwing an error if 0. cssnumericvalue.min - returns the minimum value passed cssnumericval...
...if all the values are the exact same type and value, in the same order. otherwise, false cssnumericvalue.to - converts value into another one with the specified unit. cssnumericvalue.tosum cssnumericvalue.type cssnumericvalue.parse - returns a number parsed from a css string csspositionvalue represents values for properties that take a position, for example object-position. csstrans
formvalue an interface representing a list of trans
form list values. they "contain" one or more csstrans
formcomponents, which represent individual trans
form function values. cssunparsedvalue represents property values that reference custom properties. it consists of a list of string fragments and variable references. specifications specification status comment css typ...
CanvasRenderingContext2D.scale() - Web APIs
for instance, a scaling factor of 0.5 results in a unit size of 0.5 pixels; shapes are thus drawn at half the normal size. similarly, a scaling factor of 2.0 increases the unit size so that one unit becomes two pixels; shapes are thus drawn at twice the normal size. syntax void ctx.scale(x, y); parameters x scaling factor in the horizontal direction. a negative value flips pixels across the vertical axis. a value of 1 results in no horizontal scaling. ...
...scaling. y scaling factor in the vertical direction. a negative value flips pixels across the horizontal axis. a value of 1 results in no vertical scaling. examples scaling a shape this example draws a scaled rectangle. a non-scaled rectangle is then drawn for comparison. html <canvas id="canvas"></canvas> javascript the rectangle has a specified width of 8 and a height of 20. the trans
formation matrix scales it by 9x horizontally and by 3x vertically. thus, its final size is a width of 72 and a height of 60. notice that its position on the canvas also changes. since its specified corner is (10, 10), its rendered corner becomes (90, 30). const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // scaled rectangle ctx.scale(9, 3); ctx.fillstyle = 'red...
...tically. thus, its final size is a width of 72 and a height of 60. notice that its position on the canvas also changes. since its specified corner is (10, 10), its rendered corner becomes (90, 30). const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // scaled rectangle ctx.scale(9, 3); ctx.fillstyle = 'red'; ctx.fillrect(10, 10, 8, 20); // reset current trans
formation matrix to the identity matrix ctx.settrans
form(1, 0, 0, 1, 0, 0); // non-scaled rectangle ctx.fillstyle = 'gray'; ctx.fillrect(10, 10, 8, 20); result the scaled rectangle is red, and the non-scaled rectangle is gray. flipping things horizontally or vertically you can use scale(-1, 1) to flip the context horizontally and scale(1, -1) to flip it vertically. in this example, the words "...
... filltext() specifies a negative x coordinate. this is to adjust for the negative scaling factor: -280 * -1 becomes 280, and text is drawn leftwards from that point. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.scale(-1, 1); ctx.font = '48px serif'; ctx.filltext('hello world!', -280, 90); ctx.settrans
form(1, 0, 0, 1, 0, 0); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.scale' in that specification. living standard ...
Basic animations - Web APIs
ng javascript to control <canvas> elements, it's also very easy to make (interactive) animations. in this chapter we will take a look at how to do some basic animations. probably the biggest limitation is, that once a shape gets drawn, it stays that way. if we need to move it we have to redraw it and everything that was drawn before it. it takes a lot of time to redraw complex frames and the per
formance depends highly on the speed of the computer it's running on. basic animation steps these are the steps you need to take to draw a frame: clear the canvas unless the shapes you'll be drawing fill the complete canvas (for instance a backdrop image), you need to clear any shapes that have been drawn previously. the easiest way to do this is using the clearrect() method. save the canvas st...
...ing on. basic animation steps these are the steps you need to take to draw a frame: clear the canvas unless the shapes you'll be drawing fill the complete canvas (for instance a backdrop image), you need to clear any shapes that have been drawn previously. the easiest way to do this is using the clearrect() method. save the canvas state if you're changing any setting (such as styles, trans
formations, etc.) which affect the canvas state and you want to make sure the original state is used each time a frame is drawn, you need to save that original state. draw animated shapes the step where you do the actual frame rendering. restore the canvas state if you've saved the state, restore it before drawing a new frame. controlling an animation shapes are drawn to the canvas by using the...
....requestanimationframe() functions, which can be used to call a specific function over a set period of time. setinterval(function, delay) starts repeatedly executing the function specified by function every delay milliseconds. settimeout(function, delay) executes the function specified by function in delay milliseconds. requestanimationframe(callback) tells the browser that you wish to per
form an animation and requests that the browser call a specified function to update an animation before the next repaint. if you don't want any user interaction you can use the setinterval() function which repeatedly executes the supplied code. if we wanted to make a game, we could use keyboard or mouse events to control the animation and use settimeout(). by setting eventlisteners, we catch any use...
...n the examples below, we'll use the window.requestanimationframe() method to control the animation. the requestanimationframe method provides a smoother and more efficient way for animating by calling the animation frame when the system is ready to paint the frame. the number of callbacks is usually 60 times per second and may be reduced to a lower rate when running in background tabs. for more in
formation about the animation loop, especially for games, see the article anatomy of a video game in our game development zone. an animated solar system this example animates a small model of our solar system. var sun = new image(); var moon = new image(); var earth = new image(); function init() { sun.src = 'https://mdn.mozillademos.org/files/1456/canvas_sun.png'; moon.src = 'https://mdn.mozi...
Drawing shapes with canvas - Web APIs
nts of lines that can be of different shapes, curved or not, of different width and of different color. a path, or even a subpath, can be closed. to make shapes using paths, we take some extra steps: first, you create the path. then you use drawing commands to draw into the path. once the path has been created, you can stroke or fill the path to render it. here are the functions used to per
form these steps: beginpath() creates a new path. once created, future drawing commands are directed into the path and used to build the path up. path methods methods to set different paths for objects. closepath() adds a straight line to the path, going to the start of the current sub-path. stroke() draws the shape by stroking its outline. fill() draws a solid shape by filling the path's ...
...ethods to set different paths for objects. closepath() adds a straight line to the path, going to the start of the current sub-path. stroke() draws the shape by stroking its outline. fill() draws a solid shape by filling the path's content area. the first step to create a path is to call the beginpath(). internally, paths are stored as a list of sub-paths (lines, arcs, etc) which together
form a shape. every time this method is called, the list is reset and we can start drawing new shapes. note: when the current path is empty, such as immediately after calling beginpath(), or on a newly created canvas, the first path construction command is always treated as a moveto(), regardless of what it actually is. for that reason, you will almost always want to specifically set your starting po...
...mplexity. we'll take another look at fillstyle, in more detail, later in this tutorial. here, all we're doing is using it to change the fill color for paths from the default color of black to white, and then back again. path2d objects as we have seen in the last example, there can be a series of paths and drawing commands to draw objects onto your canvas. to simplify the code and to improve per
formance, the path2d object, available in recent versions of browsers, lets you cache or record these drawing commands. you are able to play back your paths quickly. let's see how we can construct a path2d object: path2d() the path2d() constructor returns a newly instantiated path2d object, optionally with another path as an argument (creates a copy), or optionally with a string consisting of svg...
...copy from another path2d object new path2d(d); // path from svg path data all path methods like moveto, rect, arc or quadraticcurveto, etc., which we got to know above, are available on path2d objects. the path2d api also adds a way to combine paths using the addpath method. this can be useful when you want to build objects from several components, for example. path2d.addpath(path [, trans
form]) adds a path to the current path with an optional trans
formation matrix. path2d example in this example, we are creating a rectangle and a circle. both are stored as a path2d object, so that they are available for later usage. with the new path2d api, several methods got updated to optionally accept a path2d object to use instead of the current path. here, stroke and fill are used with a pat...
Optimizing canvas - Web APIs
« previousnext » the <canvas> element is one of the most widely used tools for rendering 2d graphics on the web. however, when websites and apps push the canvas api to its limits, per
formance begins to suffer. this article provides suggestions for optimizing your use of the canvas element to ensure that your graphics per
form well. per
formance tips the following is a collection of tips to improve canvas per
formance. pre-render similar primitives or repeating objects on an offscreen canvas if you find yourself repeating some of the same drawing operations on each animation frame, consider offloading them to an offscreen canvas. you can then render the offscreen image to your primary canvas as often as needed, without unnecessarily repeating the steps needed to generate i...
...er { z-index: 3; } #game-layer { z-index: 2; } #background-layer { z-index: 1; } </style> use plain css for large background images if you have a static background image, you can draw it onto a plain <div> element using the css background property and position it under the canvas. this will negate the need to render the background to the canvas on every tick. ...
... } #game-layer { z-index: 2; } #background-layer { z-index: 1; } </style> use plain css for large background images if you have a static background image, you can draw it onto a plain <div> element using the css background property and position it under the canvas. this will negate the need to render the background to the canvas on every tick. ...
...using css trans
forms css trans
forms are faster since they use the gpu. the best case is to not scale the canvas, or have a smaller canvas and scale up rather than a bigger canvas and scale down. var scalex = window.innerwidth / canvas.width; var scaley = window.innerheight / canvas.height; var scaletofit = math.min(scalex, scaley); var scaletocover = math.max(scalex, scaley); stage.style.trans
formorigin = '0 0'; //scale from top left stage.style.trans
form = 'scale(' + scaletofit + ')'; turn off transparency if your application uses canvas and doesn’t need a transparent backdrop, set the alpha option to false when creating a drawing context with htmlcanvaselement.getcontext(). this in
formation can be used internally by the browser to optimize rendering. var ctx = canvas.getcontext('2d...
DOMMatrix - Web APIs
11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44 double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth. a, b, c, d, e, f double-precision floating-point values representing the components of a 4×4 matrix which are required in order to per
form 2d rotations and translations. these are aliases for specific components of a 4×4 matrix, as shown below. 2d 3d equivalent a m11 b m12 c m21 d m22 e m41 f m42 methods this interface includes the following methods, as well as the methods it inherits from dommatrixr...
...atrix.premultiplyself() modifies the matrix by pre-multiplying it with the specified dommatrix. this is equivalent to the dot product b⋅a, where matrix a is the source matrix and b is the matrix given as an input to the method. returns itself. dommatrix.translateself() modifies the matrix by applying the specified vector. the default vector is [0, 0, 0]. returns itself. dommatrix.scalenonuni
formself() modifies the matrix by applying the specified scaling on the x, y, and z axes, centered at the given origin. by default, the y and z axes' scaling factors are both 1, but the scaling factor for x must be specified. the default origin is (0, 0, 0). returns itself. dommatrix.scaleself() modifies the matrix by applying the specified scaling factors, with the center located at the specifie...
...turns itself. dommatrix.rotateaxisangleself() modifies the matrix by rotating it by the specified angle around the given vector. returns itself. dommatrix.rotatefromvectorself() modifies the matrix by rotating it by the angle between the specified vector and (1, 0). returns itself. dommatrix.setmatrixvalue() replaces the contents of the matrix with the matrix described by the specified trans
form or trans
forms. returns itself. dommatrix.skewxself() modifies the matrix by applying the specified skew trans
formation along the x-axis. returns itself. dommatrix.skewyself() modifies the matrix by applying the specified skew trans
formation along the y-axis. returns itself. static methods this interface inherits methods from dommatrixreadonly. fromfloat32array() creates a new mutable d...
... thrown. frommatrix() creates a new mutable dommatrix object given an existing matrix or a dommatrixinit dictionary which provides the values for its properties. usage notes the matrix defined by the dommatrix interface is comprised of four rows of four columns each. while it's beyond the scope of this article to explain the mathematics involved, this 4×4 size is enough to describe any trans
formation you might apply to either 2d or 3d geometries. [m11m21m31m41m12m22m32m42m13m23m33m43m14m24m34m44]\left [ \begin{matrix} m_{11} & m_{21} & m_{31} & m_{41} \\ m_{12} & m_{22} & m_{32} & m_{42} \\ m_{13} & m_{23} & m_{33} & m_{43} \\ m_{14} & m_{24} & m_{34} & m_{44} \end{matrix} \right ] the positions of the 16 elements (m11 through m44) which comprise the 4×4 abstract matrix. the dom...
Detecting device orientation - Web APIs
increasingly, web-enabled devices are capable of determining their orientation; that is, they can report data indicating changes to their orientation with relation to the pull of gravity. in particular, hand-held devices such as mobile phones can use this in
formation to automatically rotate the display to remain upright, presenting a wide-screen view of the web content when the device is rotated so that its width is greater than its height. there are two javascript events that handle orientation in
formation. the first one is the deviceorientationevent, which is sent when the accelerometer detects a change to the orientation of the device. by receiving and processing the data reported by these orientation events, it's possible to interactively respond to rotation and elevation chang...
...ss-origin <iframe> in all browsers. warning: chrome and firefox do not handle the angles the same way, so on some axes the direction are reversed. ...
...the changes are provided along three axis (see orientation and motion data explained for details). ...
...ntation. the changes are provided along three axis (see orientation and motion data explained for details). for acceleration and accelerationincludinggravity, those axes correspond to the following: x: represents the axis from west to east y: represents the axis from south to north z: represents the axis perpendicular to the ground for rotationrate, the situation is a bit different; the in
formation corresponds to the following in each case: alpha: represents a rotation rate along the axis perpendicular to the screen (or keyboard for desktop). beta: represents a rotation rate along the axis going from left to right of the plane of the screen (or keyboard for desktop). gamma: represents a rotation rate along the axis going from bottom to top of the plane of the screen (or keyboard f...
Document.execCommand() - Web APIs
most commands affect the document's selection (bold, italics, etc.), while others insert new elements (adding a link), or affect an entire line (indenting). when using contenteditable, execcommand() affects the currently active editable element. syntax document.execcommand(acommandname, ashowdefaultui, avalueargument) return value a boolean that is false if the command is unsupported or disabled. ...
...y browser support before calling a command. parameters acommandname a domstring specifying the name of the command to execute. see commands for a list of possible commands. ashowdefaultui a boolean indicating whether the default user interface should be shown. this is not implemented in mozilla. avalueargument for commands which require an input argument, is a domstring providing that in
formation. for example, insertimage requires the url of the image to insert. specify null if no argument is needed. commands backcolor changes the document background color. in stylewithcss mode, it affects the background color of the containing block instead. this requires a <color> value string to be passed in as a value argument. note that internet explorer uses this to set the text backgroun...
... name for the selection or at the insertion point. this requires a font name string (like "arial") as a value argument. fontsize changes the font size for the selection or at the insertion point. this requires an integer from 1-7 as a value argument. forecolor changes a font color for the selection or at the insertion point. this requires a hexadecimal color value string as a value argument.
formatblock adds an html block-level element around the line containing the current selection, replacing the block element containing the line if one exists (in firefox, <blockquote> is the exception — it will wrap any containing block element). requires a tag-name string as a value argument. virtually all block-level elements can be used. (internet explorer and edge support only heading tags h1–...
...ertion point. justifyleft justifies the selection or insertion point to the left. justifyright right-justifies the selection or the insertion point. outdent outdents the line containing the selection or insertion point. paste pastes the clipboard contents at the insertion point (replaces current selection). disabled for web content. see [1]. redo redoes the previous undo command. remove
format removes all
formatting from the current selection. selectall selects all of the content of the editable region. strikethrough toggles strikethrough on/off for the selection or at the insertion point. subscript toggles subscript on/off for the selection or at the insertion point. superscript toggles superscript on/off for the selection or at the insertion point. underline toggles unde...
Document - Web APIs
t child of the document. for html documents, this is normally the htmlhtmlelement object representing the document's <html> element. document.documenturiread only returns the document location as a string. document.embedsread only returns a list of the embedded <embed> elements within the current document. document.fonts returns the fontfaceset interface of the current document. document.
formsread only returns a list of the <
form> elements within the current document. document.headread only returns the <head> element of the current document. document.hiddenread only returns a boolean value indicating if the page is considered hidden or not. document.imagesread only returns a list of the images in the current document. document.implementationread only returns the dom impl...
...aised. globaleventhandlers.ondurationchange is an eventhandler representing the code to be called when the durationchange event is raised. globaleventhandlers.onemptied is an eventhandler representing the code to be called when the emptied event is raised. globaleventhandlers.onended is an eventhandler representing the code to be called when the ended event is raised. globaleventhandlers.on
formdata is an eventhandler for processing
formdata events, fired after the entry list representing the
form's data is constructed. globaleventhandlers.ongotpointercapture is an eventhandler representing the code to be called when the gotpointercapture event type is raised. globaleventhandlers.oninput is an eventhandler representing the code to be called when the input event is raised. globaleve...
...uments the document interface for html documents inherit from the htmldocument interface or, since html5, is extended for such documents: document.clear() in majority of modern browsers, including recent versions of firefox and internet explorer, this method does nothing. document.close() closes a document stream for writing. document.execcommand() on an editable document, executes a
formating command. document.getelementsbyname() returns a list of elements with the given name. document.hasfocus() returns true if the focus is currently located anywhere inside the specified document. document.open() opens a document stream for writing. document.querycommandenabled() returns true if the
formating command can be executed on the current range. document.querycommandindeterm() ...
...ent.getelementsbyname() returns a list of elements with the given name. document.hasfocus() returns true if the focus is currently located anywhere inside the specified document. document.open() opens a document stream for writing. document.querycommandenabled() returns true if the
formating command can be executed on the current range. document.querycommandindeterm() returns true if the
formating command is in an indeterminate state on the current range. document.querycommandstate() returns true if the
formating command has been executed on the current range. document.querycommandsupported() returns true if the
formating command is supported on the current range. document.querycommandvalue() returns the current value of the current range for a
formating command. document.write...
Document Object Model (DOM) - Web APIs
ures such as tabs and windows, css styles and stylesheets, browser history, and so forth. these interfaces are discussed further in the html dom api documentation. ...
...ent svgfefuncgelement svgfefuncrelement svgfegaussianblurelement svgfeimageelement svgfemergeelement svgfemergenodeelement svgfemorphologyelement svgfeoffsetelement svgfepointlightelement svgfespecularlightingelement svgfespotlightelement svgfetileelement svgfeturbulenceelement svgfilterelement svgfilterprimitivestandardattributes svgfontelement svgfontfaceelement svgfontface
formatelement svgfontfacenameelement svgfontfacesrcelement svgfontfaceurielement svgforeignobjectelement svggelement svggeometryelement svgglyphelement svgglyphrefelement svggradientelement svggraphicselement svghatchelement svghatchpathelement svghkernelement svgimageelement svglineargradientelement svglineelement svgmarkerelement svgmaskelement svgmeshelement ...
...svgpathsegarcrel svgpathseglinetohorizontalabs svgpathseglinetohorizontalrel svgpathseglinetoverticalabs svgpathseglinetoverticalrel svgpathsegcurvetocubicsmoothabs svgpathsegcurvetocubicsmoothrel svgpathsegcurvetoquadraticsmoothabs svgpathsegcurvetoquadraticsmoothrel svgpathseglist svgpoint svgpointlist svgpreserveaspectratio svgrect svgstringlist svgtrans
form svgtrans
formlist animated type svganimatedangle svganimatedboolean svganimatedenumeration svganimatedinteger svganimatedlength svganimatedlengthlist svganimatednumber svganimatednumberlist svganimatedpathdata svganimatedpoints svganimatedpreserveaspectratio svganimatedrect svganimatedstring svganimatedtrans
formlist smil-related interfaces elementtimecontrol timeeven...
...veaspectratio svganimatedrect svganimatedstring svganimatedtrans
formlist smil-related interfaces elementtimecontrol timeevent other svg interfaces getsvgdocument shadowanimation svgcolorprofilerule svgcssrule svgdocument svgexception svgexternalresourcesrequired svgfittoviewbox svglangspace svglocatable svgrenderingintent svgstylable svgtests svgtrans
formable svgunittypes svguseelementshadowroot svgurireference svgviewspec svgzoomandpan svgzoomevent specifications specification status comment dom living standard ...
EXT_texture_compression_bptc - Web APIs
the ext_texture_compression_bptc extension is part of the webgl api and exposes 4 bptc compressed texture
formats. these compression
formats are called bc7 and bc6h in microsoft's directx api. webgl extensions are available using the webglrenderingcontext.getextension() method. for more in
formation, see also using extensions in the webgl tutorial. availability: support depends on the system's graphics driver. there is no support on windows. this extension is available to both, webgl1 and webgl2 contexts. constants the compressed texture
formats are exposed by 4 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d(). ext.compressed_rgba_bptc_unorm_ext compresses 8-bit fixed-point data. each 4x4 block of texels consists of 128 bits of rgba o...
... ext.compressed_rgb_bptc_signed_float_ext compresses high dynamic range signed floating point values. ...
... two functions: compressedteximage2d() and compressedtexsubimage2d(). ext.compressed_rgba_bptc_unorm_ext compresses 8-bit fixed-point data. each 4x4 block of texels consists of 128 bits of rgba or image data. see also bc7
format. ext.compressed_srgb_alpha_bptc_unorm_ext compresses 8-bit fixed-point data. each 4x4 block of texels consists of 128 bits of srgb_alpha or image data. see also bc7
format. ext.compressed_rgb_bptc_signed_float_ext compresses high dynamic range signed floating point values. each 4x4 block of texels consists of 128 bits of rgb data. it only contains rgb data, so the returned alpha value is 1.0. see also bc6h
format. ext.compressed_rgb_bptc_unsigned_float_ext compresses high dynamic range unsigned floating point values. each 4x4 block of texels consists of 128 b...
...oint values. each 4x4 block of texels consists of 128 bits of rgb data. it only contains rgb data, so the returned alpha value is 1.0. see also bc6h
format. ext.compressed_rgb_bptc_unsigned_float_ext compresses high dynamic range unsigned floating point values. each 4x4 block of texels consists of 128 bits of rgb data. it only contains rgb data, so the returned alpha value is 1.0. see also bc6h
format. examples var ext = gl.getextension('ext_texture_compression_bptc'); var texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); gl.compressedteximage2d(gl.texture_2d, 0, ext.compressed_rgba_bptc_unorm_ext, 128, 128, 0, texturedata); specifications specification status ext_texture_compression_bptc community approved ...
Element.animate() - Web APIs
ted animation object instance. elements can have multiple animations applied to them. you can get a list of the animations that affect an element by calling element.getanimations(). syntax var animation = element.animate(keyframes, options); parameters keyframes either an array of keyframe objects, or a keyframe object whose property are arrays of values to iterate over. see keyframe
formats for more details. options either an integer representing the animation's duration (in milliseconds), or an object containing one or more timing properties: id optional a property unique to animate(): a domstring with which to reference the animation. delay optional the number of milliseconds to delay the start of the animation. defaults to 0. direction optional whether the...
... can also include a composite operation or iteration composite operation in your options list: composite optional determines how values are combined between this animation and other, separate animations that do not specify their own specific composite operation. defaults to replace. add dictates an additive effect, where each successive iteration builds on the last. for instance with trans
form, a translatex(-200px) would not override an earlier rotate(20deg) value but result in translatex(-200px) rotate(20deg). accumulate is similar but a little smarter: blur(2) and blur(5) become blur(7), not blur(2) blur(5). replace overwrites the previous value with the new one. iterationcomposite optional determines how values build from iteration to iteration in this animation. can be s...
...n value returns an animation. examples in the demo down the rabbit hole (with the web animation api), we use the convenient animate() method to immediately create and play an animation on the #tunnel element to make it flow upwards, infinitely. notice the array of objects passed as keyframes and also the timing options block. document.getelementbyid("tunnel").animate([ // keyframes { trans
form: 'translatey(0px)' }, { trans
form: 'translatey(-300px)' } ], { // timing options duration: 1000, iterations: infinity }); implicit to/from keyframes in newer browser versions, you are able to set a beginning or end state for an animation only (i.e. a single keyframe), and the browser will infer the other end of the animation if it is able to. for example, consider this simple animatio...
...// timing options duration: 1000, iterations: infinity }); implicit to/from keyframes in newer browser versions, you are able to set a beginning or end state for an animation only (i.e. a single keyframe), and the browser will infer the other end of the animation if it is able to. for example, consider this simple animation — the keyframe object looks like so: let rotate360 = [ { trans
form: 'rotate(360deg)' } ]; we have only specified the end state of the animation, and the beginning state is implied. specifications specification status comment web animations level 2the definition of 'keyframeanimationoptions.iterationcomposite' in that specification. draft added the iterationcomposite option. web animationsthe definition of 'animate()' in ...
Element.innerHTML - Web APIs
; element.innerhtml = htmlstring; value a domstring containing the html serialization of the element's descendants. setting the value of innerhtml removes all of the element's descendants and replaces them with nodes constructed by parsing the html given in the string htmlstring. exceptions syntaxerror an attempt was made to set the value of innerhtml using a string which is not properly-
formed html. nomodificationallowederror an attempt was made to insert the html into a node whose parent is a document. usage notes the innerhtml property can be used to examine the current html source of the page, including any changes that have been made since the page was initially loaded. reading the html contents of an element reading innerhtml causes the user agent to serialize the html or...
...tents of an element reading innerhtml causes the user agent to serialize the html or xml fragment comprised of the element's descendants. the resulting string is returned. let contents = myelement.innerhtml; this lets you look at the html markup of the element's content nodes. note: the returned html or xml fragment is generated based on the current contents of the element, so the markup and
formatting of the returned fragment is likely not to match the original page markup. replacing the contents of an element setting the value of innerhtml lets you easily replace the existing contents of an element with new content. for example, you can erase the entire contents of a document by clearing the contents of the document's body attribute: document.body.innerhtml = ""; this example fetc...
...s over which you have no control. for example: const name = "<img src='x' onerror='alert(1)'>"; el.innerhtml = name; // shows the alert for that reason, it is recommended that you do not use innerhtml when inserting plain text; instead, use node.textcontent. this doesn't parse the passed content as html, but instead inserts it as raw text. warning: if your project is one that will undergo any
form of security review, using innerhtml most likely will result in your code being rejected. for example, if you use innerhtml in a browser extension and submit the extension to addons.mozilla.org, it will not pass the automated review process. example this example uses innerhtml to create a mechanism for logging messages into a box on a web page. javascript function log(msg) { var logelem = d...
...ring(); logelem.innerhtml += timestr + ": " + msg + "<br/>"; } log("logging mouse events inside this container..."); the log() function creates the log output by getting the current time from a date object using tolocaletimestring(), and building a string with the timestamp and the message text. then the message is appended to the box with the class "log". ...
EventTarget.addEventListener() - Web APIs
t the listener should be invoked at most once after being added. if true, the listener would be automatically removed when invoked. passive a boolean that, if true, indicates that the function specified by listener will never call preventdefault(). if a passive listener does call preventdefault(), the user agent will do nothing other than generate a console warning. see improving scrolling per
formance with passive listeners to learn more. mozsystemgroup a boolean indicating that the listener should be added to the system group. available only in code running in xbl or in the chrome of the firefox browser. usecapture optional a boolean indicating whether events of this type will be dispatched to the registered listener before being dispatched to any eventtarget beneath it in the...
...imary benefit to doing this is that the event listener receives the data in much the same way that it would if you were to actually pass it through its argument list. getting data into an event listener using the outer scope property when an outer scope contains a variable declaration (with const, let), all the inner functions declared in that scope have access to that variable (look here for in
formation on outer/inner functions, and here for in
formation on variable scope). therefore, one of the simplest ways to access data from outside of an event listener is to make it accessible to the scope in which the event listener is declared. const mybutton = document.getelementbyid('my-button-id'); const somestring = 'data'; mybutton.addeventlistener('click', function() { console.log(somestring...
... to prevent this p...
... to prevent this problem, some browsers (specifically, chrome and firefox) have changed the default value of the passive option to true for the touchstart and touchmove events on the document-level nodes window, document, and document.body. ...
FileHandle API - Web APIs
l filename it can be an empty string, for example, and it doesn't even have to be unique. note: the above code only creates a "temporary file" that exists only while you hold the filehandle instance. if you want a file to survive a page refresh/app relaunch, you need to store the handle in a more permanent location, like the database itself. see file storage below to learn more about this. per
form read and write operations to read or write within a handled file, it is required to get a lockedfile. the filehandle.open() method provides such an object which can be readonly or readwrite. any attempt to per
form a write action on a readonly lockedfile object will fail. writing there are three possible writing operations on a locked file: write : it's an arbitrary writing method which star...
...it's possible to directly write the content of a lockedfile object without using an intermediate file object and a filereader object. the lockedfile interface provides a readastext method and a readasarraybuffer method. those two methods expect a size to indicate how many bytes must be read starting at the lockedfile.location byte. to read the whole file, it is required to know its size. this in
formation (as well as the date of its last modification) can be retrieved through the lockedfile.getmetadata() method. // get a lockedfile object from the handle var myfile = myfilehandle.open('readwrite'); // retrieve the size of the file var getmeta = myfile.getmetadata(); getmeta.onsuccess = function () { var size = this.result.size; // the reading operation will start with the byte at inde...
... } } } a file stored that way is physically put on the device. the database itself only stores a pointer to that file. it means that if the filehandle object is stored several times in several dbs or several data stores, all those objects will reference the same unique file. this is not a problem because to access the file, a lockedfile object is required and operations on such object are per
formed in isolation, meaning that once a lockedfile is active, all operations of this lockedfile are guaranteed to happen sequentially on the underlying file without being interleaved with operations from other lockedfile. secured write operation for per
formance reasons, write (and read) operations are done in memory. periodically, the results of those operation are asynchronously flushed to the dev...
...ent api than filewriter? the filewriter specification defines filewriters, objects aiming at representing editable files. discussions on public-webapps led to the conclusion that the api would behave poorly in the case of different entities writing concurrently to the same file. the outcome of this discussion is the filehandle api with its lockedfile and transaction mechanism. specifications a
formal specification draft is being written. as it does not fully match the current implementation, be warned that the implementation and/or the specification will be subject to changes. specification status comment filesystem api editor's draft draft proposal ...
Geolocation API - Web APIs
the geolocation api allows the user to provide their location to web applications if they so desire. for privacy reasons, the user is asked for permission to report location in
formation. webextensions that wish to use the geolocation object must add the "geolocation" permission to their manifest. the user's operating system will prompt the user to allow location access the first time it is requested. concepts and usage you will often want to retrieve a user's location in
formation in your web app, for example to plot their location on a map, or display personalized in
formation relevant to their location. the geolocation api is accessed via a call to navigator.geolocation; this will cause the user's browser to ask them for permission to access their location data. if they accept, ...
...tion in your web app, for example to plot their location on a map, or display personalized in
formation relevant to their location. the geolocation api is accessed via a call to navigator.geolocation; this will cause the user's browser to ask them for permission to access their location data. if they accept, then the browser will use the best available functionality on the device to access this in
formation (for example, gps). the developer can now access this location in
formation in a couple of different ways: geolocation.getcurrentposition(): retrieves the device's current location. geolocation.watchposition(): registers a handler function that will be called automatically each time the position of the device changes, returning the updated location. in both cases, the method call takes...
...all takes up to three arguments: a mandatory success callback: if the location retrieval is successful, the callback executes with a geolocationposition object as its only parameter, providing access to the location data. an optional error callback: if the location retrieval is unsuccessful, the callback executes with a geolocationpositionerror object as its only parameter, providing access in
formation on what went wrong. an optional positionoptions object, which provides options for retrieval of the position data. for further in
formation on geolocation usage, read using the geolocation api. interfaces geolocation the main class of this api — contains methods to retrieve the user's current position, watch for changes in their position, and clear a previously-set watch. geolocati...
...ition of a user. a geolocationposition instance is returned by a successful call to one of the methods contained inside geolocation, inside a success callback, and contains a timestamp plus a geolocationcoordinates object instance. geolocationcoordinates represents the coordinates of a user's position; a geolocationcoordinates instance contains latitude, longitude, and other important related in
formation. geolocationpositionerror a geolocationpositionerror is returned by an unsuccessful call to one of the methods contained inside geolocation, inside an error callback, and contains an error code and message. navigator.geolocation the entry point into the api. returns a geolocation object instance, from which all other functionality can be accessed. dictionaries positionoptions repre...
HTMLCollection - Web APIs
ipt htmlcollection also exposes its members directly as properties by both name and index. html ids may contain : and . as valid characters, which would necessitate using bracket notation for property access. currently htmlcollections does not recognize purely numeric ids, which would cause conflict with the array-style access, though html5 does permit these. ...
...irectly as properties by both name and index. html ids may contain : and . as valid characters, which would necessitate using bracket notation for property access. currently htmlcollections does not recognize purely numeric ids, which would cause conflict with the array-style access, though html5 does permit these. ...
... index. html ids may contain : and . as valid characters, which would necessitate using bracket notation for property access. currently htmlcollections does not recognize purely numeric ids, which would cause conflict with the array-style access, though html5 does permit these. ...
... characters, which would necessitate using bracket notation for property access. currently htmlcollections does not recognize purely numeric ids, which would cause conflict with the array-style access, though html5 does permit these. for example, assuming there is one <
form> element in the document and its id is my
form: var elem1, elem2; // document.
forms is an htmlcollection elem1 = document.
forms[0]; elem2 = document.
forms.item(0); alert(elem1 === elem2); // shows: "true" elem1 = document.
forms.my
form; elem2 = document.
forms.nameditem("my
form"); alert(elem1 === elem2); // shows: "true" elem1 = document.
forms["named.item.with.periods"]; specifications specification status comment domthe definition of 'htmlcollection' in that specification. living stand...
HTMLDialogElement.returnValue - Web APIs
rty of the htmldialogelement interface gets or sets the return value for the <dialog>, usually to indicate which button the user pressed to close it. syntax dialoginstance.returnvalue = 'myreturnvalue'; var myreturnvalue = dialoginstance.returnvalue; value a domstring representing the returnvalue of the dialog. ...
... pressed to close it. syntax dialoginstance.returnvalue = 'myreturnvalue'; var myreturnvalue = dialoginstance.returnvalue; value a domstring representing the returnvalue of the dialog. examples the following example displays a button to open a <dialog> containing a
form via the showmodal() method. from there, either button will close the dialog. ...
...tance.returnvalue = 'myreturnvalue'; var myreturnvalue = dialoginstance.returnvalue; value a domstring representing the returnvalue of the dialog. examples the following example displays a button to open a <dialog> containing a
form via the showmodal() method. from there, either button will close the dialog. ...
...id="favdialog"> <
form method="dialog"> <p><label>favorite animal: <select name="favanimal" required> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select> </label></p> <menu> <button>cancel</button> <button>confirm</button> </menu> </
form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if (dialog.open) { console.log('dialog open'); } else {...
HTMLInputElement: invalid event - Web APIs
the invalid event fires when a submittable element has been checked for validity and doesn't satisfy its constraints. bubbles no cancelable yes interface event event handler property globaleventhandlers.oninvalid this event can be useful for displaying a summary of the problems with a
form on submission. when a
form is submitted, invalid events are fired at each
form control that is invalid. ...
...bbles no cancelable yes interface event event handler property globaleventhandlers.oninvalid this event can be useful for displaying a summary of the problems with a
form on submission. when a
form is submitted, invalid events are fired at each
form control that is invalid. the validity of submittable elements is checked before submitting their owner <
form>, or after the checkvalidity() method of the element or its owner <
form> is called. it is not checked on blur. examples if a
form is submitted with an invalid value, the submittable elements are checked and, if an error is found, the invalid event will fire on the invalid element. in this example, when an invalid event fires because of an invalid value in the input, the invalid value is logged...
...r the checkvalidity() method of the element or its owner <
form> is called. it is not checked on blur. examples if a
form is submitted with an invalid value, the submittable elements are checked and, if an error is found, the invalid event will fire on the invalid element. in this example, when an invalid event fires because of an invalid value in the input, the invalid value is logged. ...
...d and, if an error is found, the invalid event will fire on the invalid element. in this example, when an invalid event fires because of an invalid value in the input, the invalid value is logged. html <
form action="#"> <ul> <li><label>enter an integer between 1 and 10: <input type="number" min="1" max="10" required></label></li> <li><input type="submit" value="submit"></li> </ul> </
form><p id="log"></p> javascript const input = document.queryselector('input') const log = document.getelementbyid('log') input.addeventlistener('invalid', logvalue) function logvalue(e) { log.textcontent += e.target.value } result specifications specification status comment html living standardthe definition of 'invalid event' in that specification. living st...
HTMLOutputElement - Web APIs
onospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmloutputelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, htmlelement. htmloutputelement.defaultvalue a domstring representing the default value of the element, initially the empty string. htmloutputelement.
formread only an html
formelement indicating the
form associated with the control, reflecting the
form html attribute if it is defined. htmloutputelement.htmlforread only a domtokenlist reflecting the for html attribute, containing a list of ids of other elements in the same document that contribute to (or otherwise affect) the calculated value. htmloutputelement.labelsread only a nodelist of <...
...okenlist reflecting the for html attribute, containing a list of ids of other elements in the same document that contribute to (or otherwise affect) the calculated value. htmloutputelement.labelsread only a nodelist of <label> elements associated with the element. htmloutputelement.name a domstring reflecting the name html attribute, containing the name for the control that is submitted with
form data. htmloutputelement.typeread only the domstring "output". htmloutputelement.validationmessageread only a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any). this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. htmloutpute...
...lding the check result. htmloutputelement.reportvalidity() this method reports the problems with the constraints on the element, if any, to the user. if there are problems, fires an invalid event at the element, and returns false; if there are no problems, it returns true. when the problem is reported, the user agent may focus the element and change the scrolling position of the document or per
form some other action that brings the element to the user's attention. user agents may report more than one constraint violation if this element suffers from multiple problems at once. if the element is not rendered, then the user agent may report the error for the running script instead of notifying the user. htmloutputelement.setcustomvalidity() sets a custom validity message for the element. if ...
... behaves in one of two modes: default mode and value mode. default mode initially, the element is in default mode, and so the contents of the element represent both the value of the element and its default value. if the element is in default mode when the descendants of the element are changed in any way, the defaultvalue property is set to the value of the textcontent property. resetting the
form puts the element into default mode, and sets the textcontent property to the value of the defaultvalue property. value mode the element goes into value mode when the contents of the value property are set. the value property otherwise behaves like the textcontent property. when the element is in value mode, the default value is accessible only through the defaultvalue property. specifications ...
Ajax navigation example - Web APIs
this is an example of an ajax website composed only of three pages (first_page.php, second_page.php and third_page.php). to see how it works, please create the following files (or git clone https://github.com/giabao/mdn-ajax-nav-example.git ): note: for fully integrating the <
form> elements within this mechanism, please take a look at the paragraph submitting
forms and uploading files. first_page.php: <?php $page_title = "first page"; $as_json = false; if (isset($_get["view_as"]) && $_get["view_as"] == "json") { $as_json = true; ob_start(); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<title>" . $page_title . "</title>"; ?> </head> <body> <?php include "include/before_content.php"; ?> <p>thi...
...rl) { history.pushstate(opageinfo, opageinfo.title, opageinfo.url); bupdateurl = false; } break; default: vmsg = nstatus + ": " + (ohttpstatus[nstatus] || "unknown"); switch (math.floor(nstatus / 100)) { /* case 1: // in
formational 1xx console.log("in
formation code " + vmsg); break; case 2: // successful 2xx console.log("successful code " + vmsg); break; case 3: // redirection 3xx console.log("redirection code " ...
... opageinfo = { title: null, url: location.href }, ohttpstatus = /* http://www.iana.org/assignments/http-status-codes/http-status-codes.xml */ { 100: "continue", 101: "switching protocols", 102: "processing", 200: "ok", 201: "created", 202: "accepted", 203: "non-authoritative in
formation", 204: "no content", 205: "reset content", 206: "partial content", 207: "multi-status", 208: "already reported", 226: "im used", 300: "multiple choices", 301: "moved permanently", 302: "found", 303: "see other", 304: "not modified", 305: "use proxy",...
... ...
Intersection Observer API - Web APIs
ment with an ancestor element or with a top-level document's viewport. historically, detecting visibility of an element, or the relative visibility of two elements in relation to each other, has been a difficult task for which solutions have been unreliable and prone to causing the browser and the sites the user is accessing to become sluggish. as the web has matured, the need for this kind of in
formation has grown. intersection in
formation is needed for many reasons, such as: lazy-loading of images or other content as a page is scrolled. implementing "infinite scrolling" web sites, where more and more content is loaded and rendered as you scroll, so that the user doesn't have to flip through pages. reporting of visibility of advertisements in order to calculate ad revenues. deciding wh...
...tersection in
formation is needed for many reasons, such as: lazy-loading of images or other content as a page is scrolled. implementing "infinite scrolling" web sites, where more and more content is loaded and rendered as you scroll, so that the user doesn't have to flip through pages. reporting of visibility of advertisements in order to calculate ad revenues. deciding whether or not to per
form tasks or animation processes based on whether or not the user will see the result. implementing intersection detection in the past involved event handlers and loops calling methods like element.getboundingclientrect() to build up the needed in
formation for every element affected. since all this code runs on the main thread, even one of these can cause per
formance problems. when a site is loaded...
...thresholds rather than reporting every infinitesimal change in how much a target element is visible, the intersection observer api uses thresholds. when you create an observer, you can provide one or more numeric values representing percentages of the target element which are visible. then, the api only reports changes to visibility which cross these thresholds. for example, if you want to be in
formed every time a target's visibility passes backward or forward through each 25% mark, you would specify the array [0, 0.25, 0.5, 0.75, 1] as the list of thresholds when creating the observer. when the callback is invoked, it receives a list of intersectionobserverentry objects, one for each observed target which has had the degree to which it intersects the root change such that the amount expose...
..., or by calling intersectionobserver.takerecords(). a simple example this simple example causes a target element to change its color and transparency as it becomes more or less visible. at timing element visibility with the intersection observer api, you can find a more extensive example showing how to time how long a set of elements (such as ads) are visible to the user and to react to that in
formation by recording statistics or by updating elements.. html the html for this example is very short, with a primary element which is the box that we'll be targeting (with the creative id "box") and some contents within the box. <div id="box"> <div class="vertical"> welcome to <strong>the box!</strong> </div> </div> css the css isn't terribly important for the purposes of this example...
Using the MediaStream Recording API - Web APIs
7rem); overflow: scroll; } note: calc() has good support across modern browsers too, even going back to internet explorer 9. checkbox hack for showing/hiding this is fairly well documented already, but we thought we'd give a mention to the checkbox hack, which abuses the fact that you can click on the <label> of a checkbox to toggle it checked/unchecked. in web dictaphone this powers the in
formation screen, which is shown/hidden by clicking the question mark icon in the top right hand corner. first of all, we style the <label> how we want it, making sure that it has enough z-index to always sit above the other elements and therefore be focusable/clickable: label { font-family: 'notocoloremoji'; font-size: 3rem; position: absolute; top: 2px; right: 3px; z-index: ...
...lways 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 in
formation 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, trans
form 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; text-shadow: 1px 1px 1px black; width: 100%; height: 100%; trans
form:...
...we then use the mediarecorder api to record the stream, and output each recorded snippet into the source of a generated <audio> element so it can be played back. we'll declare some variables for the record and stop buttons, and the <article> that will contain the generated audio players: cons...
...ode below is placed inside the getusermedia success callback. capturing the media stream once getusermedia has created a media stream successfully, you create a new media recorder instance with the mediarecorder() constructor and pass it the stream directly. this is your entry point into using the mediarecorder api — the stream is now ready to be captured into a blob, in the default encoding
format of your browser. const mediarecorder = new mediarecorder(stream); there are a series of methods available in the mediarecorder interface that allow you to control recording of the media stream; in web dictaphone we just make use of two, and listen to some events. first of all, mediarecorder.start() is used to start recording the stream once the record button is pressed: record.onclick = func...
Media Session API - Web APIs
the user agent of the media your web app is playing, and allows you to create event handlers, to define your own behaviors for a user-agent playback controls. the aim of this is allowing users to know what's playing, and to control it, without opening the specific page that launched it. media session concepts and usage the mediametadata interface lets a web site provide rich metadata to the plat
form ui for media that is playing. this metadata includes the title, artist (creator) name, album (collection), and artwork. the plat
form can show this metadata in media centers, notifications, device lockscreens, etc. the mediasession interface lets users control playback of media through user-agent defined interface elements. interaction with these elements even trigger handlers in the web page, pl...
...face for the media session api is the mediasession interface. rather than creating your own mediasession instance, you access the api using the navigator.mediasession property. ...
...y. for example, to set the current state of the media session to playing: navigator.mediasession.playbackstate = "playing"; interfaces mediametadata allows a web page to provide rich media metadata, for display in a plat
form ui. mediasession allows a web page to provide custom behaviors, for standard media playback interactions. dictionaries mediaimage a mediaimage object contains in
formation describing an image associated with the media. this might be a cd or dvd cover, a movie poster, a poster frame, or the like. mediapositionstate used to contain in
formation about the current playback position, playback speed, and overall media duration when calling the mediasession method setpositionstate() to establish the media's length, playback position, and playback speed. mediasessio...
...ssociated with the media. this might be a cd or dvd cover, a movie poster, a poster frame, or the like. mediapositionstate used to contain in
formation about the current playback position, playback speed, and overall media duration when calling the mediasession method setpositionstate() to establish the media's length, playback position, and playback speed. mediasessionactiondetails provides in
formation needed in order to per
form the action which has been requested, including the type of action to per
form and any other in
formation needed, such as seek distances or times. examples the following example shows feature detection for the media session api. it then instantiates a metadata object for the session, and adds event handlers for the user control actions: if ('mediasession' in navig...
NavigatorID.userAgent - Web APIs
never assume that the value of this property will stay the same in future versions of the same browser. try not to use it at all, or only for current and past versions of a browser. new browsers may start using the same ua, or part of it, as an older browser: you really have no guarantee that the browser agent is indeed the one advertised by this property. ...
...(ua spoofing). browser identification based on detecting the user agent string is unreliable and is not recommended, as the user agent string is user configurable. for example: in firefox, you can change the preference general.useragent.override in about:config. some firefox extensions do that; however, this only changes the http header that gets sent, and doesn't affect browser detection per
formed by javascript code. opera 6+ allows users to set the browser identification string via a menu. microsoft internet explorer uses the windows registry. safari and icab allow users to change the browser user agent string to predefined internet explorer or netscape strings via a menu. syntax var ua = navigator.useragent; value a domstring specifying the complete user agent string the brows...
...registry. safari and icab allow users to change the browser user agent string to predefined internet explorer or netscape strings via a menu. syntax var ua = navigator.useragent; value a domstring specifying the complete user agent string the browser provides both in http headers and in response to this and other related methods on the navigator object. ...
...and in response to this and other related methods on the navigator object. the user agent string is built on a
formal structure which can be decomposed into several pieces of info. each of these pieces of info comes from other navigator properties which are also settable by the user. ...
Using the Notifications API - Web APIs
note: this feature is available in web workers. the notifications api lets a web page or app send notifications that are displayed outside the page at the system level; this lets web apps send in
formation to a user even if the application is idle or in the background. this article looks at the basics of using this api in your own apps. typically, system notifications refer to the operating system's standard notification mechanism: think for example of how a typical desktop system or mobile device broadcasts notifications. the system notification system will vary of course by plat
form and browser, but this is ok, and the notifications api is written to be general enough for compatibility with most system notification systems. examples one of the most obvious use cases for web no...
...be displayed. granted the user has granted permission to display notifications, after having been asked previously. denied the user has explicitly declined permission to show notifications. getting permission if permission to display notifications hasn't been granted yet, the application needs to use the notification.requestpermission() method to request this from the user. in its simplest
form, we just include the following: notification.requestpermission().then(function(result) { console.log(result); }); this uses the promise-based version of the method. if you want to support older versions, you might have to use the older callback version, which looks like this: notification.requestpermission(); the callback version optionally accepts a callback function that is called once th...
...e notifications" button that, when pressed, requests notification permissions for the app. ...
...sers) since this method will also remove the notification from any notification tray, preventing users from interacting with it after it was initially shown. note: when you receive a "close" event, there is no guarantee that it's the user who closed the notification. this is in line with the specification, which states: "when a notification is closed, either by the underlying notifications plat
form or by the user, the close steps for it must be run." notification events there are four events that are triggered on the notification instance: click triggered when the user clicks on the notification. close triggered once the notification is closed. error triggered if something goes wrong with the notification; this is usually because the notification couldn't be displayed for some re...
PaymentAddress - Web APIs
properties paymentaddress.addressline read only an array of domstring objects providing each line of the address not included among the other properties. the exact size and content varies by country or location and can include, for example, a street name, house number, apartment number, rural delivery route, descriptive instructions, or post office box number. ...
...t size and content varies by country or location and can include, for example, a street name, house number, apartment number, rural delivery route, descriptive instructions, or post office box number. paymentaddress.country read only a domstring specifying the country in which the address is located, using the iso-3166-1 alpha-2 standard. the string is always given in its canonical upper-case
form. some examples of valid country values: "us", "gb", "cn", or "jp". paymentaddress.city read only a domstring which contains the city or town portion of the address. paymentaddress.dependentlocality read only a domstring giving the dependent locality or sublocality within a city, for example, a neighborhood, borough, district, or uk dependent locality. paymentaddress.organization read only ...
...ate a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options. the first of these three (supportedinstruments in the example below) contains a data property that has to con
form to the structure defined by the basiccardrequest dictionary. const supportedinstruments = [ { supportedmethods: "basic-card", }, ]; const details = { total: { label: "donation", amount: { currency: "usd", value: "65.00" } }, displayitems: [ { label: "original donation amount", amount: { currency: "usd", value: "65.00" }, }, ], shippingoptions: [ { i...
...= httpresponse.ok ? "success" : "failure"; await response.complete(result); } dopaymentrequest(); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details. this has to con
form to the structure defined by the basiccardresponse dictionary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'pat straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification s...
PaymentResponse: payerdetailchange event - Web APIs
if any are invalid, appropriate error messages should be configured and the retry() method should be called on the paymentresponse to ask the user to update the invalid entries. ...
...if any are invalid, appropriate error messages should be configured and the retry() method should be called on the paymentresponse to ask the user to update the invalid entries. ...
...if any are invalid, appropriate error messages should be configured and the retry() method should be called on the paymentresponse to ask the user to update the invalid entries. ...
...() method should be called on the paymentresponse to ask the user to update the invalid entries. bubbles no cancelable no interface paymentrequestupdateevent event handler property onpayerdetailchange examples in the example below, onpayerdetailchange is used to set up a listener for the payerdetailchange event in order to validate the in
formation entered by the user, requesting that any mistakes be corrected // options for paymentrequest(), indicating that shipping address, // payer email address, name, and phone number all be collected. const options = { requestshipping: true, requestpayeremail: true, requestpayername: true, requestpayerphone: true, }; const request = new paymentrequest(methods, details, options); const re...
Payment processing concepts - Web APIs
d. for example, when using a credit card to pay, the credit card processing service is the payment method provider. payment handler the implementation of the code needed to interface with a particular payment method provider in order to process payments. some payment handlers use merchant validation, which is the process of validating the identity of a merchant in some way, usually using some
form of cryptographic response such as a public key. validated merchants are allowed to interface with a payment handler. payment method identifiers payment handlers are identified by payment method identifiers, which are strings uniquely identifying the payment handler. these may be either one of the standardized payment handler identifiers, or a url used by the payment processing service to both i...
...ions that make payment possible vary depending on the payment method and the user's payment request; for example, if the user chooses to pay using a credit card that isn't accepted by the payee, the payment can't be made. if merchant validation is supported by the payment handler, respond to merchant validation requests from the user agent. see merchant validation for details. verify that the in
formation provided by the user results in a valid transaction. this results in the creation and returning of a payment method-specific object that contains the in
formation needed to handle the transaction. merchant validation some payment handlers use merchant validation, which is the process of validating the identity of a merchant in some way, usually using some
form of cryptographic challenge. i...
...ional. in the end, the only thing that the web site or app is responsible for is fetching the merchant's validation key and passing it into the event's complete() method. paymentrequest.onmerchantvalidation = function(event) { event.complete(fetchvalidationdata(event.validationurl)); } in this example, fetchvalidationdata() is a function which loads the payment handler specific identifying in
formation from the address given by validationurl. note this function must go through the merchant server, because a client typically does not access the validation url itself. by then delivering this data (or a promise which resolves to the loaded data) to the payment handler by passing it into complete(), the payment handler can use the retrieved data and whatever algorithm and other data to suppor...
... ...
PublicKeyCredentialCreationOptions.authenticatorSelection - Web APIs
icatorselection, an optional property of the publickeycredentialcreationoptions dictionary, is an object giving criteria to filter out the authenticators to be used for the creation operation. syntax authenticatorselection = publickeycredentialcreationoptions.authenticatorselection value an object with the following properties: authenticatorattachmentoptional a string which is either "plat
form" or "cross-plat
form". the
former describes an authenticator which is bound to the client and which is generally not removable. the latter describes a device which may be used across different plat
form (such as a usb or nfc device). requireresidentkeyoptional a boolean which indicated that the credential private key must be stored in the authenticator, the client or in a client device. the defau...
...rt of the authenticatordata property of authenticatorattestationresponse.attestationobject) "discouraged": user verification should not be employed as to minimize the user interaction during the process. the default value is "preferred". the authenticator used for the creation of the public key credential must comply with the requirements. ...
...ationobject) "discouraged": user verification should not be employed as to minimize the user interaction during the process. the default value is "preferred". the authenticator used for the creation of the public key credential must comply with the requirements. note: see publickeycredential.isuserverifyingplat
formauthenticatoravailable() which resolves to true when a user-verifiying plat
form authenticator is available. ...
...the default value is "preferred". the authenticator used for the creation of the public key credential must comply with the requirements. note: see publickeycredential.isuserverifyingplat
formauthenticatoravailable() which resolves to true when a user-verifiying plat
form authenticator is available. ...
RTCIceCandidatePairStats - Web APIs
the webrtc rtcicecandidatepairstats dictionary reports statistics which provide insight into the quality and per
formance of an rtcpeerconnection while connected and configured as described by the specified pair of ice candidates. if a rtcstats-based object's type is candidate-pair, it's an rtcicecandidatepairstats object. properties rtcicecandidatepairstats is based upon rtcstats and inherits its properties. in addition, it adds the following new properties: availableincomingbitrate optional provides an in
formative value representing the available inbound capacity of the network by reporting the total number of bits per second available for all of the candidate pair's incoming rtp streams. this does not take into account the size of the ip overhead, nor any other transport layers such ...
...this does not take into account the size of the ip overhead, nor any other transport layers such as tcp or udp. ...
...r—if any—can be obtained by calling the rtcicetransport method getselectedcandidatepair(), which returns an rtcicecandidatepair object, or null if there isn't a pair selected. the active candidate pair describes the current configuration of the two ends of the rtcpeerconnection. any candidate pair that isn't the active pair of candidates for a transport gets deleted if the rtcicetransport per
forms an ice restart, at which point the state of the ice transport returns to new and negotiation starts once again. for more in
formation, see ice restart in lifetime of a webrtc session. example this example computes the average time elapsed between connectivity checks if the rtcstats object rtcstats is an rtcicecandidatepairstats object. if (rtcstats && rtcstats.type === "candidate-pair") { ...
....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. if it is, then we know that rtcstats is in fact an rtcicecandidatepairstats object. if so, we compute the average time elapsed between stun connectivity checks and log that in
formation. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.createOffer() - Web APIs
the createoffer() method of the rtcpeerconnection interface initiates the creation of an sdp offer for the purpose of starting a new webrtc connection to a remote peer. the sdp offer includes in
formation about any mediastreamtracks already attached to the webrtc session, codec, and options supported by the browser, and any candidates already gathered by the ice agent, for the purpose of being sent over the signaling channel to a potential peer to request a connection or to update the configuration of an existing connection. the return value is a promise which, when the offer has been created, is resolved with a rtcsessiondescription object containing the newly-created offer. syntax apromise = mypeerconnection.createoffer([options]); mypeerconnection.createoffer(successcallback, failurecal...
...hould never cut audio when quiet. this option defaults to true (voice activity detection enabled). deprecated parameters in older code and documentation, you may see a callback-based version of this function. this has been deprecated and its use is strongly discouraged. you should update any existing code to use the promise-based version of createoffer() instead. the parameters for this
form of createoffer() are described below, to aid in updating existing code. successcallback an rtcsessiondescriptioncallback which will be passed a single rtcsessiondescription object describing the newly-created offer. errorcallback an rtcpeerconnectionerrorcallback which will be passed a single domexception object explaining why the request to create an offer failed. options optional a...
...rtcsessiondescription object describing the newly-created offer. errorcallback an rtcpeerconnectionerrorcallback which will be passed a single domexception object explaining why the request to create an offer failed. options optional an optional rtcofferoptions dictionary providing options requested for the offer. return value a promise whose fulfillment handler will receive an object con
forming to the rtcsessiondescriptioninit dictionary which contains the sdp describing the generated offer. that received offer should be delivered through the signaling server to a remote peer. exceptions these exceptions are returned by rejecting the returned promise. your rejection handler should examine the received exception to determine which occurred. invalidstateerror the rtcpeerconnectio...
...once that's done, the offer is sent to the remote system over the signaling channel; in this case, by using a custom function called sendtoserver(). the implementation of the signaling server is independent from the webrtc specification, so it doesn't matter how the offer is sent as long as both the caller and potential receiver are usi...
RTCPeerConnection.setLocalDescription() - Web APIs
the method takes a single parameter—the session description—and it returns a promise which is fulfilled once the description has been changed, asynchronously. if setlocaldescription() is called while a connection is already in place, it means renegotiation is underway (possibly to adapt to changing network conditions). ...
...rtc connectivity for more details on this process. deprecated parameters in older code and documentation, you may see a callback-based version of this function used. this has been deprecated and its use is strongly discouraged, as it will be removed in the future. you should update any existing code to use the promise-based version of setlocaldescription() instead. the parameters for the older
form of setlocaldescription() are described below, to aid in updating existing code. successcallback a javascript function which accepts no input parameters to be be called once the description has been successfully set. at that time, the offer can be sent to a remote peer via the signaling server. errorcallback a function matching the signature rtcpeerconnectionerrorcallback which gets call...
...accepts no input parameters to be be called once the description has been successfully set. at that time, the offer can be sent to a remote peer via the signaling server. errorcallback a function matching the signature rtcpeerconnectionerrorcallback which gets called if the description can't be set. it is passed a single domexception object explaining why the request failed. this deprecated
form of the method returns instantaneously without waiting for the actual setting to be done: in case of success, the successcallback will be called; in case of failure, the errorcallback will be called. deprecated exceptions when using the deprecated callback-based version of setlocaldescription(), the following exceptions may occur: invalidstateerror the connection's signalingstate is "close...
...ption(), the following exceptions may occur: invalidstateerror the connection's signalingstate is "closed", indicating that the connection is not currently open, so negotiation cannot take place. invalidsessiondescriptionerror the rtcsessiondescription specified by the sessiondescription parameter is invalid. examples implicit descriptions one of the advantages of the parameter-free
form of setlocaldescription() is that it lets you simplify your negotiation code substantially. this is all your negotiationneeded event handler needs to look like, for the most part. just add the signaling server code, which here is represented by the call to signalremotepeer(). pc.addeventlistener("negotiationneeded", async (event) => { await pc.setlocaldescription(); signalremotepeer({ descrip...
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. ...
...ach describing the capabilities of one codec) and an array of the supported rtp header extensions for that codec. properties codecs an array of rtcrtpcodeccapability objects, each describing one of the codecs supported by the rtcrtpsender or rtcrtpreceiver. there are some special entries in this array, described below in the section the codecs array. headerextensions an array of objects con
forming to the rtcrtpheaderextensioncapability dictionary. each object contains a single domstring, uri, specifying the uri of the header extension, as described in rfc 5285. description the codecs array the codecs array is an array of objects con
forming to the dictionary rtcrtpcodeccapability. each of these objects describes a single codec and its basic capabilities. its properties are: the br...
...ree special entries that should always be present, representing underlying components of the transport. those components are: red (redundant audio data) the media type of an red entry may vary due to there being several versions of it, but it will end with red, such as video/red or video/fwdred. the base red standard can be found in rfc 2198. there may be multiple entries for red if different
forms are supported; each will have a unique media type in that case. fec (forward error correction) an fec component handles error correction data; its media type may also vary due to there being advanced versions of the standard available, but it will always end with fec. one possible value is video/ulpfec (a generic error connection model). there may also be multiple fec entries if more than one ...
...s are supported; each will have a unique media type in that case. fec (forward error correction) an fec component handles error correction data; its media type may also vary due to there being advanced versions of the standard available, but it will always end with fec. one possible value is video/ulpfec (a generic error connection model). there may also be multiple fec entries if more than one
form is supported. rtx (retransmission) this component is responsible for retransmission of data; it's media type should be video/rtx. there will only be one entry for rtx, and it will not have an sdpfmtpline property. don't be surprised to see these show up ijn the list; be prepared to ignore them if you're only interested in the actual codecs used for the media itself. specifications ...
RTCStatsType - Web APIs
this report isn't available if there are no connected peers. local-candidate an rtcicecandidatestats object giving statistics about an ice local candidate; these candidates are found in the output from rtcicetransport.getlocalcandidates(). outbound-rtp the report is an rtcoutboundrtpstreamstats object providing statistics based on the local peer's outgoing data being sent to its peers. this in
formation considers only the outbound rtp stream, so any data which requires in
formation about the state of the remote peers (such as round-trip time) is unavailable, since those values can't be computed without knowing about the other peers' states. peer-connection a rtcpeerconnectionstats object provides statistics related to the overall peer connection's rtcpeerconnection. receiver provides sta...
...overall peer connection's rtcpeerconnection. receiver provides statistics about a specific rtcrtpreceiver. the statistics object is an rtcaudioreceiverstats object if kind is audio; if kind is video, the object is an rtcvideoreceiverstats object. remote-candidate the report is an rtcicecandidatestats object containing statistics about the remote candidate's rtcicetransport. ...
...tats object containing statistics about the remote candidate's rtcicetransport. this may include in
formation such as the type of network, the protocol, the url, the type of relay being used, and so forth. remote-inbound-rtp the report is an rtcremoteinboundrtpstreamstats object providing statistics about your outbound rtp data stream, but from the perspective of the remote peer. that is, this in
formation is about your outbound-rtp stream, but as seen by the remote device that's handling the stream. you can use this in
formation to do things like determine how well the remote peer is receiving data. remote-outbound-rtp the report is an rtcremoteoutboundrtpstreamstats object that contains statistics about your inbound rtp (inbound-rtp) stream, but from the perspective of the remote peer. sen...
...atistics about your inbound rtp (inbound-rtp) stream, but from the perspective of the remote peer. sender an object containing statistics about the rtcrtpsender for a stream on the rtcpeerconnection. if kind is "audio", this object is of type rtcaudiosenderstats; if kind is "video", this is an rtcvideosenderstats object. stream an object of type rtcmediastreamstats, providing statistics and in
formation about a mediastream which is part of the rtcpeerconnection. track the object is one of the types based on rtcmediahandlerstats: for audio tracks, the type is rtcsenderaudiotrackattachmentstats and for video tracks, the type is rtcsendervideotrackattachmentstats. the data within provides statistics related to a particular mediastreamtrack's attachment to an rtcrtpsender; also included are t...
SVGAnimatedPathData - Web APIs
ion) properties this interface also inherits properties from its parent, svgpathelement. ...
...' attribute in a
form where all path data commands are expressed in terms of the following subset of svgpathseg types: svg_pathseg_moveto_abs (m), svg_pathseg_lineto_abs (l), svg_pathseg_curveto_cubic_abs (c) and svg_pathseg_closepath (z). animatedpathseglist svgpathseglist provides access to the current animated contents of the 'd' attribute in a
form which matches one-for-one with svg's syntax. if the given attribute or property is being animated, contains the current animated value of the attribute or property, and both the object itself and its contents are read only. ...
... in a
form which matches one-for-one with svg's syntax. if the given attribute or property is being animated, contains the current animated value of the attribute or property, and both the object itself and its contents are read only. normalizedpathseglist svgpathseglist provides access to the base (i.e., static) contents of the 'd' attribute in a
form where all path data commands are expressed in terms of the following subset of svgpathseg types: svg_pathseg_moveto_abs (m), svg_pathseg_lineto_abs (l), svg_pathseg_curveto_cubic_abs (c) and svg_pathseg_closepath (z). ...
...thus, if the d attribute has an "absolute moveto (m)" and an "absolute arcto (a)" command, then pathseglist will have two entries: a svg_pathseg_moveto_abs and a svg_pathseg_arc_abs. ...
Sensor APIs - Web APIs
the sensor apis are a set of interfaces built to a common design that expose device sensors in a consistent way to the web plat
form. sensor apis concepts and usage although the generic sensor api specification defines a sensor interface, as a web developer you will never use it. instead you'll use one of its subclasses to retrieve specific kinds of sensor data. for example, the accelerometer interface returns the acceleration of the device along all three axes at the time it is read. sensors may or may not correspond exactly to a physical device sensor. for example, the gyroscope interface corresponds exactly to a physical device interface. alternatively, the absoluteorientationsensor interface provides in
formation that is algorithmically agregated from two or more device sensors. these ...
...re detection sensor interfaces are only proxies for the underlying device sensors. consequently, feature detection is more complicated for sensors than it is for other apis. the presence of a sensor api does not tell you whether that api is connected to a real hardware sensor, whether that sensor works, if it's still connected, or even whether the user has granted access to it. making all this in
formation consistently available is costly to per
formance and battery life. therefore, feature detection for sensor apis must include both detection of the apis themselves and defensive programming strategies (see below). the examples below show three methods for detecting sensor apis. additionally you can put object instantiation inside a try...catch block. notice that detection through the navigat...
...ensorsecure context returns the current light level or illuminance of the ambient light around the hosting device. gyroscopesecure context provides the angular velocity of the device along all three axes. linearaccelerationsensorsecure context provides the acceleration applied to the device along all three axes, but without the contribution of gravity. magnetometersecure context provides in
formation about the magnetic field as detected by the device’s primary magnetometer sensor. orientationsensorsecure context the base class for the absoluteorientationsensor. this interface cannot be used directly, instead it provides properties and methods accessed by interfaces that inherit from it. relativeorientationsensorsecure context describes the device's physical orientation without rega...
...entationsensorsecure context describes the device's physical orientation without regard to the earth's reference coordinate system. sensorsecure context the base class for all the other sensor interfaces. this interface cannot be used directly. instead it provides properties, event handlers, and methods accessed by interfaces that inherit from it. sensorerroreventsecure context provides in
formation about errors thrown by a sensor or related interface. specifications specification status comment generic sensor api candidate recommendation initial definition. accelerometer candidate recommendation defines accelerometer and linearaccerationsensor. ambient light sensor candidate recommendation gyroscope candidate r...
SpeechSynthesisErrorEvent - Web APIs
the speechsynthesiserrorevent interface of the web speech api contains in
formation about any errors that occur while processing speechsynthesisutterance objects in the speech service. properties speechsynthesiserrorevent extends the speechsynthesisevent interface, which inherits properties from its parent interface, event. speechsynthesiserrorevent.error read only returns an error code indicating what has gone wrong with a speech synthesis attempt. methods speechsynthesiserrorevent extends the speechsynthesisevent interface, which inherits methods from its parent interface, event. ...
... interface, which inherits properties from its parent interface, event. speechsynthesiserrorevent.error read only returns an error code indicating what has gone wrong with a speech synthesis attempt. methods speechsynthesiserrorevent extends the speechsynthesisevent interface, which inherits methods from its parent interface, event. ...
...erties from its parent interface, event. speechsynthesiserrorevent.error read only returns an error code indicating what has gone wrong with a speech synthesis attempt. methods speechsynthesiserrorevent extends the speechsynthesisevent interface, which inherits methods from its parent interface, event. ...
... synthesis attempt. methods speechsynthesiserrorevent extends the speechsynthesisevent interface, which inherits methods from its parent interface, event. examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
SpeechSynthesisUtterance.rate - Web APIs
eechsynthesisutterance interface gets and sets the speed at which the utterance will be spoken at. if unset, a default value of 1 will be used. syntax var myrate = speechsynthesisutteranceinstance.rate; speechsynthesisutteranceinstance.rate = 1.5; value a float representing the rate value. it can range between 0.1 (lowest) and 10 (highest), with 1 being the default pitch for the current plat
form or voice, which should correspond to a normal speaking rate. other values act as a percentage relative to this, so for example 2 is twice as fast, 0.5 is half as fast, etc. some speech synthesis engines or voices may constrain the minimum and maximum rates further. if ssml is used, this value will be overridden by prosody tags in the markup. examples var synth = window.speechsynthesis; var in...
... voice, which should correspond to a normal speaking rate. other values act as a percentage relative to this, so for example 2 is twice as fast, 0.5 is half as fast, etc. some speech synthesis engines or voices may constrain the minimum and maximum rates further. if ssml is used, this value will be overridden by prosody tags in the markup. ...
... to a normal speaking rate. other values act as a percentage relative to this, so for example 2 is twice as fast, 0.5 is half as fast, etc. some speech synthesis engines or voices may constrain the minimum and maximum rates further. if ssml is used, this value will be overridden by prosody tags in the markup. ...
...ynthesis engines or voices may constrain the minimum and maximum rates further. if ssml is used, this value will be overridden by prosody tags in the markup. examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
SpeechSynthesisUtterance.text - Web APIs
the text property of the speechsynthesisutterance interface gets and sets the text that will be synthesised when the utterance is spoken. the text may be provided as plain text, or a well-
formed ssml document. the ssml tags will be stripped away by devices that don't support ssml. syntax var mytext = speechsynthesisutteranceinstance.text; speechsynthesisutteranceinstance.text = 'hello i am speaking'; value a domstring representing the text to the synthesised. the maximum length of the text that can be spoken in each utterance is 32,767 characters. ...
...ml tags will be stripped away by devices that don't support ssml. syntax var mytext = speechsynthesisutteranceinstance.text; speechsynthesisutteranceinstance.text = 'hello i am speaking'; value a domstring representing the text to the synthesised. the maximum length of the text that can be spoken in each utterance is 32,767 characters. ...
...y devices that don't support ssml. syntax var mytext = speechsynthesisutteranceinstance.text; speechsynthesisutteranceinstance.text = 'hello i am speaking'; value a domstring representing the text to the synthesised. the maximum length of the text that can be spoken in each utterance is 32,767 characters. ...
...ng'; value a domstring representing the text to the synthesised. the maximum length of the text that can be spoken in each utterance is 32,767 characters. examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
Using writable streams - Web APIs
to a stream is very useful! this article explains the streams api’s writable stream functionality. note: this article assumes that you understand the use cases of writable streams, and are aware of the high-level concepts. if not, we suggest that you first read the streams concepts and usage overview and dedicated streams api concepts article, then come back. note: if you are looking for in
formation about readable streams, try using readable streams instead. browser support the streams api is experimental, and support is at an early stage right now. only chrome currently has basic writable streams implemented. introducing an example in our dom-examples/streams repo you’ll find a simple writer example (see it live also). this takes a given message and writes it into a writable str...
...nk,controller) { }, close(controller) { }, abort(reason) { } }, { highwatermark, size() }); the constructor takes two objects as parameters. the first object is required, and creates a model in javascript of the underlying sink the data is being written to. the second object is optional, and allows you to specify a custom queueing strategy to use for your stream, which takes the
form of an instance of bytelengthqueuingstrategy or countqueuingstrategy. the first object can contain up to four members, all of which are optional: start(controller) — a method that is called once, immediately after the writablestream is constructed. inside this method, you should include code that sets up the stream functionality, e.g. getting access to the underlying sink. write(chunk,contr...
...this is called when each chunk is actually written (see the next section). the close() method is called automatically when writing has finished — it prints the entire decoded result to the ui in one string. the abort() method simply prints an error to the console if the stream is aborted. writing to actually write content to the stream we call the sendmessa...
... to check whether the writer is ready to have another chunk written to it. ready returns a promise that fulfills when this is the case, inside of which we call writablestreamdefaultwriter.write() to actually write the chunk to the stream. this also triggers the write() method specified inside the writablestream() constructor, as discussed above. after the chunks have all been written, we then per
form the ready check once more, to check that the last chunk has finished being written and all the work is done. when this ready check fulfills, we invoke writablestreamdefaultwriter.close() to close the stream. this also triggers the close() method specified inside the writablestream() constructor, as discussed above. controllers as you'll have noticed when studying the writablestream() syntax ske...
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. if the submission was not triggered by a button of some kind, the value of submitter is null. ...
...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. if the submission was not triggered by a button of some kind, the value of submitter is null. ...
... kind, the value of submitter is null. examples in this example, a shopping cart may have an assortment of different submit buttons depending on factors such as the user's settings, the shop's settings, and any minimum or maximum shopping card totals established by the payment processors. each of the submit elements' id is used to identify which payment processor the button corresponds to. 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. please try again.", "ok"); } }); the handler id is obtained by using the submit event's submitter property to get ...
... if (handler) { processorder(
form, handler); } else { showalertmessage("an unknown or unaccepted payment type was selected. please try again.", "ok"); } }); the handler id is obtained by using the submit event's submitter property to get the submit button, from which we then get the id. with that in hand, we can call a processorder() function to handle the order, passing along the
form and the handler id. specifications specification status comment html living standardthe definition of 'submitevent.submitter' in that specification. living standard ...
TextEncoder.prototype.encodeInto() - Web APIs
syntax b1 = encoder.encodeinto(string, uint8array); parameters string is a usvstring containing the text to encode. ...
...ulting utf-8 encoded text into. return value a textencoderencodeintoresult dictionary, which contains two members: read the number of utf-16 units of code from the source that has been converted over to utf-8. this may be less than string.length if uint8array did not have enough space. written the number of bytes modified in the destination uint8array. the bytes written are guaranteed to
form complete utf-8 byte sequences. encode into a specific position encoder.encodeinto always puts its output at the start of the array. however, it is sometimes useful to make the output start at a particular index. the solution is typedarray.prototype.subarray(). observe. var encoder = new textencoder; function encodeintoatposition(string, u8array, position) { return encoder.encodeinto(strin...
...ytes for the output, in which case the first conversion attempt is guaranteed to convert the whole string. note that the s.length * 3 is rare because the string would have to be packed with some of the few characters that expant into 3 bytes. it is unlikely that long text will exceed s.length * 2 bytes in length. thus, a more optimistic approach might be to allocate s.length * 2 + 5 bytes, and per
form reallocation in the rare circumstance that the optimistic prediction was wrong. if the output is expected to be long-lived, it makes sense to compute minimum allocation rounduptobucketsize(s.length), the maximum allocation size s.length * 3, and to have a chosen (as a tradeoff between memory usage and speed) threshold t such that if rounduptobucketsize(s.length) + t >= s.length * 3, you simply ...
... (function(window){ "use strict"; var log = math.log; var ln2 = math.ln2; var clz32 = math.clz32 || function(x) {return 31 - log(x >>> 0) / ln2 | 0}; var fromcharcode = string.fromcharcode; var patchedu8array = window.uint8array || array; var textencoderprototype = textencoder["prototype"]; var globaltextencoder = window["textencoder"]; var globaltextencod...
VRStageParameters - Web APIs
vrstageparameters.sizex read only returns the width of the play-area bounds in meters. ...
... vrstageparameters.sizex read only returns the width of the play-area bounds in meters. ...
... draft initial definition ...
... draft initial definition ...
WebGLRenderingContext.getBufferParameter() - Web APIs
the webglrenderingcontext.getbufferparameter() method of the webgl api returns in
formation about the buffer. syntax any gl.getbufferparameter(target, pname); parameters target a glenum specifying the target buffer object. possible values: gl.array_buffer: buffer containing vertex attributes, such as vertex coordinates, texture coordinate data, or vertex color data. gl.element_array_buffer: buffer used for element indices. when using a webgl 2 context, the following values are available additionally: gl.copy_read_buffer: buffer for copying from one buffer object to another. gl.copy_write_buffer: buffer for copying from one buffer object to another. ...
...ributes, such as vertex coordinates, texture coordinate data, or vertex color data. gl.element_array_buffer: buffer used for element indices. when using a webgl 2 context, the following values are available additionally: gl.copy_read_buffer: buffer for copying from one buffer object to another. gl.copy_write_buffer: buffer for copying from one buffer object to another. gl.trans
form_feedback_buffer: buffer for trans
form feedback operations. gl.uni
form_buffer: buffer used for storing uni
form blocks. gl.pixel_pack_buffer: buffer used for pixel transfer operations. gl.pixel_unpack_buffer: buffer used for pixel transfer operations. pname a glenum specifying in
formation to query. possible values: gl.buffer_size: returns a glint indicating the size of ...
...e usage pattern of the buffer. this is either: gl.static_draw, gl.dynamic_draw, gl.stream_draw. when using a webgl 2 context, the following values are available additionally: gl.static_read, gl.dynamic_read, gl.stream_read, gl.static_copy, gl.dynamic_copy, gl.stream_copy. return value depends on the requested in
formation (as specified with pname). either a glint or a glenum. examples gl.getbufferparameter(gl.array_buffer, gl.buffer_size); specifications specification status comment webgl 1.0the definition of 'getbufferparameter' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetbufferparameteriv' in that specif...
... (similar) opengl es 2 api. webgl 2.0the definition of 'getbufferparameter' in that specification. editor's draft updated definition for webgl. opengl es 3.0the definition of 'glgetbufferparameter' in that specification. standard man page of the (similar) opengl es 3 api. adds new target buffers: gl.copy_read_buffer, gl.copy_write_buffer, gl.trans
form_feedback_buffer, gl.uni
form_buffer, gl.pixel_pack_buffer, gl.pixel_unpack_buffer adds new usage hints: gl.static_read, gl.dynamic_read, gl.stream_read, gl.static_copy, gl.dynamic_copy, gl.stream_copy. ...
WebGLRenderingContext.getFramebufferAttachmentParameter() - Web APIs
syntax any gl.getframebufferattachmentparameter(target, attachment, pname); parameters target a glenum specifying the binding point (target). possible values: gl.framebuffer: collection buffer data storage of color, alpha, depth and stencil buffers used to render an image. when using a webgl 2 context, the following values are available additionally: gl.draw_framebuffer: equivalent to gl.framebuffer. used as a destination for drawing, rendering, clearing, and writing operations. ...
...possible values: gl.framebuffer_attachment_object_type: the type which contains the attached image. gl.framebuffer_attachment_object_name: the texture or renderbuffer of the attached image (webglrenderbuffer or webgltexture). gl.framebuffer_attachment_texture_level: mipmap level. default value: 0. gl.framebuffer_attachment_texture_cube_map_face: the name of cube-map face ...
...ent_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. ext.framebuffer_attachment_texture_base_view_index_ovr: the base view index of the framebuffer object attachment. return value depends on the requested in
formation (as specified with pname). either a glint, a glenum, a webglrenderbuffer, or a webgltexture. pname parameter return value gl.framebuffer_attachment_object_type a glenum indicating the type of the texture. either gl.renderbuffer, gl.texture, or if no image is attached, gl.none. gl.framebuffer_attachment_object_name the texture (webgltexture) or renderb...
...he alpha component of the attachment. gl.framebuffer_attachment_blue_size a glint indicating the number of bits in the blue component of the attachment. gl.framebuffer_attachment_color_encoding a glenum indicating the encoding of components of the specified attachment. either gl.linear or gl.srgb. gl.framebuffer_attachment_component_type a glenum indicating the
format of the components of the specified attachment. either gl.float, gl.int, gl.unsigned_int, gl.signed_normalized, or gl.unsigned_normalized. gl.framebuffer_attachment_depth_size a glint indicating the number of bits in the depth component of the attachment. gl.framebuffer_attachment_green_size a glint indicating the number of bits in the green component of the attachment. ...
WebGLRenderingContext.getShaderInfoLog() - Web APIs
examples checking compilation messages /* load shader source code. */ gl.shadersource(shader, shadercode); /* compile shader source code. ...
... examples checking compilation messages /* load shader source code. */ gl.shadersource(shader, shadercode); /* compile shader source code. ...
... examples checking compilation messages /* load shader source code. */ gl.shadersource(shader, shadercode); /* compile shader source code. ...
... examples checking compilation messages /* load shader source code. */ gl.shadersource(shader, shadercode); /* compile shader source code. ...
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
er connection. to do this, we implement the the rtcpeerconnection's ontrack event handler. pc.ontrack = ({track, streams}) => { track.onunmute = () => { if (remotevideo.srcobject) { return; } remotevideo.srcobject = streams[0]; }; }; when the track event occurs, this handler executes. using destructuring, the rtctrackevent's track and streams properties are extracted. the
former is either the video track or the audio track being received. the latter is an array of mediastream objects, each representing a stream containing this track (a track may in rare cases belong to multiple streams at once). in our case, this will always contain one stream, at index 0, because we passed one stream into addtrack() earlier. we add an unmute event handler to the track, because the tr...
...d the process of making its own offer, then we need to look out for offer collision. if we're the impolite peer, and we're receiving a colliding offer, we return without setting the description, and instead set ignoreoffer to true to ensure we also ignore all candidates the other side may be sending us on the signaling channel belonging to this offer. doing so avoids error noise since we never in
formed our side about this offer. if we're the polite peer, and we're receiving a colliding offer, we don't need to do anything special, because our existing offer will automatically be rolled back in the next step. having ensured that we want to accept the offer, we set the remote description to the incoming offer by calling setremotedescription(). this lets webrtc know what the proposed configurat...
... to see if the message is an offer, and if so, if the local signaling state isn't stable. if it's not stable, and the local peer is the polite one, we need to trigger rollback so we can replace the outgoing offer with the new incoming one. and these must both be completed before we can proceed with handling the received offer. since there isn't a single "roll back and use this offer instead", per
forming this change on the polite peer requires two steps, executed in the context of promise.all(), which is used to ensure that both statements execute completely before continuing to handle the received offer. the first statement triggers rollback and the second sets the remote description to the received one, thus completing the process of replacing the previously sent offer with the newly receive...
...to continue to try to use the offer that's already in the process of being sent. that's the impolite peer in action. in any other case, we'll try instead to handle the incoming message. this begins by setting the remote description to the received description by passing it into setremotedescription(). this works regardless of whether we're handling an offer or an answer since rollback will be per
formed automaticaly as needed. at that point, if the received message is an offer, we use setlocaldescription() to create and set an appropriate local description, then we send it to the remote peer over the signaling server. on receiving an ice candidate on the other hand, if the received message is an ice candidate—indicated by the json object containing a candidate member—we deliver it to th...
Introduction to WebRTC protocols - Web APIs
one can create a connection. in this situation we need to turn to turn. turn some routers using nat employ a restriction called ‘symmetric nat’. this means the router will only accept connections from peers you’ve previously connected to. ...
...all in
formation through that server. you would create a connection with a turn server and tell all peers to send packets to the server which will then be forwarded to you. this obviously comes with some overhead so it is only used if there are no other alternatives. sdp session description protocol (sdp) is a standard for describing the multimedia content of the connection such as resolution,
formats, codecs, encryption, etc. so that both peers can understand each other once the data is transferring. this is, in essence, the metadata describing the content and not the media content itself. technically, then, sdp is not truly a protocol, but a data
format used to describe connection that shares media between devices. documenting sdp is well outside the scope of this documentation; however...
...a data
format used to describe connection that shares media between devices. documenting sdp is well outside the scope of this documentation; however, there are a few things worth noting here. 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. the lines of text that begin with a given letter are generally referred to as "letter-lines". ...
...-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. the lines of text that begin with a given letter are generally referred to as "letter-lines". ...
Web Animations API Concepts - Web APIs
ine object: the one based on the active document’s timeline. in the future we may see timeline objects that correspond to the length of the page, perhaps a scrolltimeline, or other things entirely. animation animation objects can be imagined as dvd players: they’re used for controlling media playback, but without media to play, they don’t do anything. ...
... we currently have only one animation effect type available: keyframeeffect. potentially we could have all kinds of animation effects in the future—e.g. ...
...ion object’s methods to play, pause, seek, and control the animation’s playback direction and speed. animation effect if animation objects are dvd players, we can think of animation effects, or keyframe effects, as dvds. keyframe effects are a bundle of in
formation including at the bare minimum a set of keys and the duration they need to be animated over. the animation object takes this in
formation and, using the timeline object, assembles a playable animation we can view and reference. we currently have only one animation effect type available: keyframeeffect. potentially we could have all kinds of animation effects in the future—e.g. effects for grouping and sequencing, not unlike features we had in flash. in fact, group effects and sequence effects have already been outlined in t...
...b animations api.) uses the api allows for the creation of dynamic animations that can be updated on the fly as well as more straightforward, declarative animations like those css creates. it can be used in automated tests to ensure that your ui animations are running correctly. it opens up the browser’s rendering engine for building animation development tools like timelines. it is also a per
formant base on which to build a custom or commercial animation library. (see animating like you just don’t care with element.animate.) in some instances, it may negate the need for a fully fledged library entirely in the same way vanilla javascript can be used without jquery for many purposes. polyfill the web animation api has a polyfill that you can use today. ...
Using the Web Audio API - Web APIs
, and vol and pan sliders to allow you to alter the volume and stereo panning. we could make this a lot more complex, but this is ideal for simple learning at this stage. check out the final demo here on codepen, or see the source code on github. browser support modern browsers have good support for most features of the web audio api. ...
...you have input nodes, which are the source of the sounds you are manipulating, modification nodes that change those sounds as desired, and output nodes (destinations), which allow you to save or hear those sounds. ...
...ck the browser compatibility tables at the bottom of each reference page. audio graphs everything within the web audio api is based around the concept of an audio graph, which is made up of nodes. the web audio api handles audio operations inside an audio context, and has been designed to allow modular routing. basic audio operations are per
formed with audio nodes, which are linked together to
form an audio routing graph. you have input nodes, which are the source of the sounds you are manipulating, modification nodes that change those sounds as desired, and output nodes (destinations), which allow you to save or hear those sounds. several audio sources with different channel layouts are supported, even within a single context. because of this modular design, you can create complex audio f...
...ve a boombox, we most likely want to play a full song track. also, for accessibility, it's nice to expose that track in the dom. we'll expose the song on the page using an <audio> element. <audio src="mycooltrack.mp3"></audio> note: if the sound file you're loading is held on a different domain you will need to use the crossorigin attribute; see cross origin resource sharing (cors) for more in
formation. to use all the nice things we get with the web audio api, we need to grab the source from this element and pipe it into the context we have created. 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 = audiocont...
Using the Web Storage API - Web APIs
orative image: when you choose different options, the page is instantly updated; in addition, your choices are stored in localstorage, so that when you leave the page and load it again, later on, your choices are remembered. we have also provided an event output page — if you load this page in another tab, then make changes to your choices in the landing page, you'll see the updated storage in
formation outputted as a storageevent is fired. note: as well as viewing the example pages live using the above links, you can also check out the source code. testing whether your storage has been populated to start with, in main.js, we test whether the storage object has already been populated (i.e., the page was previously accessed): if(!localstorage.getitem('bgcolor')) { populatestorage()...
...tbyid('bgcolor').value = currentcolor; document.getelementbyid('font').value = currentfont; document.getelementbyid('image').value = currentimage; htmlelem.style.backgroundcolor = '#' + currentcolor; pelem.style.fontfamily = currentfont; imgelem.setattribute('src', currentimage); } here, the first three lines grab the values from local storage. next, we set the values displayed in the
form elements to those values, so that they keep in sync when you reload the page. finally, we update the styles/decorative image on the page, so your customization options come up again on reload. setting values in storage storage.setitem() is used both to create new data items, and (if the data item already exists) update existing values. this takes two arguments — the key of the data item to cr...
...ue); localstorage.setitem('font', document.getelementbyid('font').value); localstorage.setitem('image', document.getelementbyid('image').value); setstyles(); } the populatestorage() function sets three items in local storage — the background color, font, and image path. it then runs the setstyles() function to update the page styles, etc. we've also included an onchange handler on each
form element so that the data and styling are updated whenever a
form value is changed: bgcolor
form.onchange = populatestorage; font
form.onchange = populatestorage; image
form.onchange = populatestorage; responding to storage changes with the storageevent the storageevent is fired whenever a change is made to the storage object (note that this event is not fired for sessionstorage changes). this won...
...value; document.queryselector('.my-url').textcontent = e.url; document.queryselector('.my-storage').textcontent = json.stringify(e.storagearea); }); here we add an event listener to the window object that fires when the storage object associated with the current origin is changed. as you can see above, the event object associated with this event has a number of properties containing useful in
formation — the key of the data that changed, the old value before the change, the new value after that change, the url of the document that changed the storage, and the storage object itself (which we've stringified so you can see its content). deleting data records web storage also provides a couple of simple methods to remove data. we don't use these in our demo, but they are very simple to add...
Window.requestAnimationFrame() - Web APIs
the window.requestanimationframe() method tells the browser that you wish to per
form an animation and requests that the browser calls a specified function to update an animation before the next repaint. the method takes a callback as an argument to be invoked before the repaint. note: your callback routine must itself call requestanimationframe() if you want to animate another frame at the next repaint. you should call this method whenever you're ready to update your animation onscreen. this will request that your animation function be called before the browser per
forms the next repaint. the number of callbacks is usually 60 times per second, but will generally match the display refresh rate in most web browsers as per w3c recommendation. requestanimationframe() calls are paused in most bro...
... the callback method is passed a single argument, a domhighrestimestamp, which indicates the current time (based on the number of milliseconds since time origin). ...
...ess in a frame, otherwise the animation will run faster on high refresh rate screens. check the example below for a way to do this. syntax window.requestanimationframe(callback); parameters callback the function to call when it's time to update your animation for the next repaint. the callback function is passed one single argument, a domhighrestimestamp similar to the one returned by per
formance.now(), indicating the point in time when requestanimationframe() starts to execute callback functions. return value a long integer value, the request id, that uniquely identifies the entry in the callback list. this is a non-zero value, but you may not make any other assumptions about its value. you can pass this value to window.cancelanimationframe() to cancel the refresh callback request...
...the element's final position is 200px (0.1 * 2000) to the right of its initial position. const element = document.getelementbyid('some-element-you-want-to-animate'); let start; function step(timestamp) { if (start === undefined) start = timestamp; const elapsed = timestamp - start; // `math.min()` is used here to make sure that the element stops at exactly 200px. element.style.trans
form = 'translatex(' + math.min(0.1 * elapsed, 200) + 'px)'; if (elapsed < 2000) { // stop the animation after 2 seconds window.requestanimationframe(step); } } window.requestanimationframe(step); notes edge versions below 17 and internet explorer do not reliably fire requestanimationframe before the paint cycle. specification specification status comment htm...
XRPose.emulatedPosition - Web APIs
the emulatedposition read-only attribute of the xrpose interface is a boolean value indicating whether or not both the the position component of the pose's trans
form is directly taken from the xr device, or it's simulated or computed based on other sources. syntax let emulated = xrpose.emulatedposition; value a boolean which is true if the pose's position is computed based on estimates or is derived from sources other than direct sensor data. if the position is precisely gbased on direct sensor inputs, the value is false. usage notes there are two basic categories of xr tracking systems. ...
...ean which is true if the pose's position is computed based on estimates or is derived from sources other than direct sensor data. if the position is precisely gbased on direct sensor inputs, the value is false. usage notes there are two basic categories of xr tracking systems. a basic xr headset provides three degrees of freedom (3dof), tracking the pitch, yaw, and roll of the user's head. no in
formation is available about movement forward, backward, or to the sides. any such data is taken from other sources, such as keyboard or mouse inputs or game controllers. as such, the position is considered to be emulated, so the emulatedposition property is true. contrariwise, xr devices which can also track movement forward and backward as well as laterally—six degree of freedom (6dof) devices—...
...bout movement forward, backward, or to the sides. any such data is taken from other sources, such as keyboard or mouse inputs or game controllers. as such, the position is considered to be emulated, so the emulatedposition property is true. contrariwise, xr devices which can also track movement forward and backward as well as laterally—six degree of freedom (6dof) devices—don't require any in
formation from other sources to determine the user's position, so the value of emulatedposition is false. the same notion applies not just to the user's head, but to any object. a hand controller that can directly report its position would have a value of false for this property as well. if its position is computed as an offset from another object (such as by basing it off the model representing the ...
...s position, so the value of emulatedposition is false. the same notion applies not just to the user's head, but to any object. a hand controller that can directly report its position would have a value of false for this property as well. if its position is computed as an offset from another object (such as by basing it off the model representing the user's body), then this value is true. this in
formation is important because devices whose position is emulated are prone to their offset drifting relative to the real world space over time. this is because emulating a position based on accelerometer inputs and models tends to introduce minor errors which accumulate over time. specifications specification status comment webxr device apithe definition of 'xrpose.emula...
XRPose - Web APIs
been updated using the base frame of reference for the frame and any adjustments needed to position the viewer based on movement or rotation which is being supplied from a source other than the xr device, such as keyboard or mouse inputs. see the article movement, orientation, and motion for further details and an example with thorough explanations of what's going on. ...
...ame of reference for the frame and any adjustments needed to position the viewer based on movement or rotation which is being supplied from a source other than the xr device, such as keyboard or mouse inputs. see the article movement, orientation, and motion for further details and an example with thorough explanations of what's going on. ...
...ts. see the article movement, orientation, and motion for further details and an example with thorough explanations of what's going on. properties xrpose.trans
form read only a xrrigidtrans
form which provides the position and orientation of the pose relative to the base xrspace. xrpose.emulatedposition read only a boolean value which is false if the position and orientation given by trans
form is obtained directly from a full six degree of freedom (6dof) xr device (that is, a device which tracks not only the pitch, yaw, and roll of the head but also the forward, backward, and side-to-side motion of the viewer). ...
...relative to the base xrspace. xrpose.emulatedposition read only a boolean value which is false if the position and orientation given by trans
form is obtained directly from a full six degree of freedom (6dof) xr device (that is, a device which tracks not only the pitch, yaw, and roll of the head but also the forward, backward, and side-to-side motion of the viewer). if any component of the trans
form is computed or created artificially (such as by using mouse or keyboard controls to move through space), this value is instead true, indicating that the trans
form is in part emulated in software. example <<<--- todo: needs example --->>> specifications specification status comment webxr device apithe definition of 'xrpose' in that specification. working draft ...
XRSession: select event - Web APIs
the webxr event select is sent to an xrsession when one of the session's input sources has completed a primary action. examples of comon kinds of primary action are users pressing triggers or buttons, tapping a touchpad, speaking a command, or per
forming a recognizable gesture when using a video tracking system or handheld controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onselect for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources. examples the following example uses addeventlistener() to set up a handler for the select event. the handler fetches the pose representing the ...
... handler property onselect for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources. examples the following example uses addeventlistener() to set up a handler for the select event. ...
...ked-pointer inputs and sends the pose's trans
form to a function called myhandleselectwithray(). ...
... working draft initial definition. ...
XRSession: squeeze event - Web APIs
the webxr event squeeze is sent to an xrsession when one of the session's input sources has completed a primary squeeze action. examples of comon kinds of primary action are users pressing triggers or buttons, tapping a touchpad, speaking a command, or per
forming a recognizable gesture when using a video tracking system or handheld controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onsqueeze for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources. examples the following example uses addeventlistener() to set up a handler for the squeeze event. the handler fetches the ...
...erty onsqueeze for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources. examples the following example uses addeventlistener() to set up a handler for the squeeze event. the handler fetches the pose representing the target ray for tracked-pointer inputs and sends the pose's trans
form to a function called myhandlesqueezewithray(). this code treats the squeeze as an instantaneous action that doesn't involve tracking an ongoing activity. if you need to track a squeeze action that isn't instantaneous, listen for the squeezestart and squeezeend events to sense when the squeeze action begins and ends. xrsession.addeventlistener("squeeze", event => { if (event.inputsource.target...
... for the squeezestart and squeezeend events to sense when the squeeze action begins and ends. ...
... working draft initial definition. ...
XSLT Basic Example - Web APIs
using the ?xml-stylesheet? processing instruction, it links to the xslt stylesheet (example.xsl) via its href attribute. an xslt stylesheet starts with the xsl:stylesheet element, which contains all the templates used to create the final output. ...
...using the ?xml-stylesheet? processing instruction, it links to the xslt stylesheet (example.xsl) via its href attribute. an xslt stylesheet starts with the xsl:stylesheet element, which contains all the templates used to create the final output. ...
...using the ?xml-stylesheet? processing instruction, it links to the xslt stylesheet (example.xsl) via its href attribute. an xslt stylesheet starts with the xsl:stylesheet element, which contains all the templates used to create the final output. ...
...ument (example.xml) : <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="example.xsl"?> <article> <title>my article</title> <authors> <author>mr. foo</author> <author>mr. bar</author> </authors> <body>this is my article text.</body> </article> xsl stylesheet (example.xsl) : <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/trans
form"> <xsl:output method="text"/> <xsl:template match="/"> article - <xsl:value-of select="/article/title"/> authors: <xsl:apply-templates select="/article/authors/author"/> </xsl:template> <xsl:template match="author"> - <xsl:value-of select="." /> </xsl:template> </xsl:stylesheet> browser output : article - my article authors: - mr. foo - mr. bar ...
Generating HTML - Web APIs
the <body> element of the article now contains html elements (a <b> and <u> tag, see figure 2). the xml document contains both html elements and xml elements, but only one namespace is needed, namely for the xml elements. since there is no html namespace, and using the xhtml namespace would force the xsl to create an xml document that would not behave like a html document, the xsl:output in the xsl stylesheet will make sure the resulting document will be handled as html. ...
...ing the xsl:output element. by setting the output to be html and not having a namespace on the resulting elements (colored in blue), those elements will be treated as html elements. figure 3 : xsl stylesheet with 2 namespaces (example2.xsl) xsl stylesheet (example2.xsl): <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/trans
form" xmlns:myns="http://devedge.netscape.com/2002/de"> <xsl:output method="html"/> ... </xsl:stylesheet version="1.0"> a template matching the root node of the xml document is created and used to create the basic structure of the html page. figure 4 : creating the basic html document xsl stylesheet (example2.xsl): ... <xsl:template match="/"> <html> ...
...ore xsl:template's are needed to complete the example. the first xsl:template is used for the author nodes, while the second one processes the body node. the third template has a general matching rule which will match any node and any attribute. it is needed in order to preserve the html elements in the xml document, since it matches all of them and copies them out into the html document the trans
formation creates. figure 5 : final 3 templates xsl stylesheet(example2.xsl): ... <xsl:template match="myns:author"> -- <xsl:value-of select="." /> <xsl:if test="@company"> :: <b> <xsl:value-of select="@company" /> </b> </xsl:if> <br /> </xsl:template> <xsl:template match="myns:body"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy...
...l:template> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> ... ...
XSLTProcessor - Web APIs
an xsltprocessor applies an xslt stylesheet trans
formation to an xml document to produce a new xml document as output. it has methods to load the xslt stylesheet, to manipulate <xsl:param> parameter values, and to apply the trans
formation to documents. syntax the constructor has no parameters. new xsltprocessor() methods [throws] void xsltprocessor.importstylesheet(node stylesheet) imports the xslt stylesheet. if the given node is a document node, you can pass in a full xsl trans
form or a literal result element trans
form; otherwise, it must be an <xsl:stylesheet> or <xsl:trans
form> element. ...
... syntax the constructor has no parameters. new xsltprocessor() methods [throws] void xsltprocessor.importstylesheet(node stylesheet) imports the xslt stylesheet. if the given node is a document node, you can pass in a full xsl trans
form or a literal result element trans
form; otherwise, it must be an <xsl:stylesheet> or <xsl:trans
form> element. [throws] documentfragment xsltprocessor.trans
formtofragment(node source, document owner) trans
forms the node source by applying the stylesheet imported using the xsltprocessor.importstylesheet() function. ...
... trans
form; otherwise, it must be an <xsl:stylesheet> or <xsl:trans
form> element. [throws] documentfragment xsltprocessor.trans
formtofragment(node source, document owner) trans
forms the node source by applying the stylesheet imported using the xsltprocessor.importstylesheet() function. the owner document of the resulting document fragment is the owner node. [throws] document xsltprocessor.trans
formtodocument(node source) trans
forms the node source applying the stylesheet given importing using the xsltprocessor.importstylesheet() function. the resultant object depends on the output method of the stylesheet: output method result type html htmldocument xml xmldocument text xmldocument with a single root element <trans...
...(sets the value of an <xsl:param>.) a null value for namespaceuri is treated the same as an empty string. ...
Using the alertdialog role - Accessibility
as the name implies, alertdialog is a type of dialog. this means that most of the instructions provided in the 'using the dialog role' technique are applicable to the alertdialog role as well: the alert dialog must always be given an accessible name (through aria-labelledby or aria-label) , and in most cases the alert text will have to be marked up as the alert dialog's accessible description (using aria-describedby). ...
...ditionally, alert dialogs can have other interactive controls such as text fields, tabs or checkboxes. which particular control focus should be moved to depends on the purpose of the dialog. the tab order inside the alert dialog must wrap. the difference with regular dialogs is that the alertdialog role should only used when an alert, error, or warning occurs. in other words, when a dialog's in
formation and controls require the user's immediate attention alertdialog should be used instead of dialog. it is up to the developer to make this distinction though. because of its urgent nature, alert dialogs must always be modal. note: this role should only be used for alert messages that have associated interactive controls. if an alert dialog only contains static content and has no interactive ...
...s it. when the alert dialog appears, screen readers should announce the alert. when the alert dialog is correctly labeled and focus is moved to a control inside the dialog, screen readers should announce the dialog's accessible role, name and optionally description before announcing the focused element. note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: a basic alert dialog the code snippet below shows how to mark up an alert dialog that only provides a message and an ok button. <div role="alertdialog" aria-labelledby="dialog1title" aria-describedby="dialog1desc"> <div role="document" tabindex="0"> <h2 id="dialog1title">your login session is a...
..."> <h2 id="dialog1title">your login session is about to expire</h2> <p id="dialog1desc">to extend your session, click the ok button</p> <button>ok</button> </div> </div> working examples: tbd notes aria attributes used alertdialog aria-labelledby aria-describedby related aria techniques using the dialog role using the alert role compatibility tbd: add support in
formation for common ua and at product combinations additional resources ...
Using the aria-describedby attribute - Accessibility
description the aria-describedby attribute is used to indicate the ids of the elements that describe the object. it is used to establish a relationship between widgets or groups and text that described them. this is very similar to aria-labelledby: a label describes the essence of an object, while a description provides more in
formation that the user might need. the aria-describedby attribute is not used only for
form elements; it is also used to associate static text with widgets, groups of elements, panes, regions that have a heading, definitions, and more. the examples section below provides more in
formation about how to use the attribute in these cases. this attribute can be used with any typical html
form element; it is not limited to elements that have an aria role assigned. ...
... examples example 1: application landmark descriptions in the example below, an introductory paragraph describes a calendar application. aria-describedby is used to associate the paragraph with the application container. ...
...ple 2: a close button in the example below, a link that functions as a 'close' button on a dialog is described elsewhere in the document. the aria-describedby attribute is used to associate the description with the link. <button aria-label="close" aria-describedby="descriptionclose" onclick="mydialog.close()">x</button> ... <div id="descriptionclose">closing this window will discard any in
formation entered and return you back to the main page</div> working examples: checkbox example uses aria-describedby tooltip example uses aria-describedby notes the aria-describedby attributed is not designed to reference descriptions on an external resource—since it is an id, it must reference an element in the same dom document. used by aria roles all elements of the base markup r...
...es aria-describedby tooltip example uses aria-describedby notes the aria-describedby attributed is not designed to reference descriptions on an external resource—since it is an id, it must reference an element in the same dom document. used by aria roles all elements of the base markup related aria techniques using the aria-labelledby attribute compatibility tbd: add support in
formation for common ua and at product combinations additional resources wai-aria specification for aria-describedby ...
Using the aria-labelledby attribute - Accessibility
fashion. this idea is similar to how the "for" attribute is used to link a label to an input. assistive technology, such as screen readers, use this attribute to catalog the objects in a document so that users can navigate between them. without an element id, the assistive technology cannot catalog the object. aria-labelledby is very similar to aria-describedby: a label provides essential in
formation about an object, while a description provides extended in
formation that the user might need. in addition to
form elements, you can use the aria-labelledby attribute to associate static text with widgets, groups of elements, panes, regions that have a heading, definitions, and other types of objects. the examples section below provides more in
formation on how to use the attribute this way. ...
...ith widgets, groups of elements, panes, regions that have a heading, definitions, and other types of objects. the examples section below provides more in
formation on how to use the attribute this way. to improve compatibility with user agents that do not support aria, you can use aria-labelledby with the <label> element (using the for attribute). this attribute can be used with any typical html
form element; it is not limited to elements that have an aria role assigned. value a space-separated list of element ids possible effects on user agents and assistive technology when user agents compute the accessible name property of elements that have both an aria-labelledby attribute and an aria-label attribute, the user agents give precedence to aria-labelledby. examples example 1: multiple...
...is associated with the term itself using the aria-labelledby attribute: <p>the doctor explained it had been a <dfn id="placebo">placebo</dfn>, or <span role="definition" aria-labelledby="placebo"> an inert preparation prescribed more for the mental relief of the patient than for its actual effect on a disorder.</span> </p> example 6: definition lists in the example below, the definitions in a
formal definition list are associated with the terms they define using the aria-labelledby attribute: <dl> <dt id="anathema">anathema</dt> <dd role="definition" aria-labelledby="anathema">a ban or curse solemnly pronounced by ecclesiastical authority and accompanied by excommunication</dd> <dd role="definition" aria-labelledby="anathema...
...<div role="menuitem">save</div> <div role="menuitem">save as ...</div> ... </div> ... ...
ARIA: button role - Accessibility
d 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. see the official wai-aria example code. description the button role identifies an element as a button to screen readers. a button is a widget used to per
form actions such as submitting a
form, opening a dialog, cancelling an action, or per
forming a command such as inserting a new record or displaying in
formation. a common convention to in
form users a button will launch a dialog is to append "…" (ellipsis) to the button's label, e.g., "save as…". in addition to the ordinary button widget, role="button" should be included when creating a toggle bu...
...if the design were to call for the button label to change from "mute" to "unmute," a toggle button would not be appropriate, so the the aria-pressed attribute would be omitted. keyboard interactions key function enter activates the button. space activates the button following button activation, focus is set depending on the type of action the button per
forms. for example, if clicking the button opens a dialog, the focus should move to the dialog. if the button closes a dialog, focus should returns to the button that opened the dialog unless the function per
formed in the dialog context logically leads to a different element. if the button alters the current context, then focus typically remains on the button, such as muting and unmuting an audio file...
...example in this example, a span element has been given the button role. because a <span> element is used, the tabindex attribute is required to make the button focusable and part of the page's tab order. the included css style is provided to make the <span> element look like a button, and to provide visual cues when the button has focus. the handlebtnclick and handlebtnkeydown event handlers per
form the button's action when activated using a mouse click or the space or enter key. in this case, the action is to add a new name to the list of names. try the example by adding a name to the text box. the button will cause the name to be added to a list. html <h1>aria button example</h1> <ul id="namelist"></ul> <label for="newname">enter your name: </label> <input type="text" id...
...key in order to be consistent with native buttons. when the button role is used, screen readers announce the element as a button, generally saying "click" followed by the button's accessible name. the accessible name is either the content of the element or the value of an aria-label or element referenced by an aria-labelledby attribute, or description, if included. best practices if a link per
forms the action of a button, giving the element role="button" helps assistive technology users understand the function of the element. however, a better solution is to adjust the visual design so it matches the function and aria role. where possible, it is recommended to use native html buttons (<button>, <input type="button">, <input type="submit">, <input type="reset"> and <input type="image">) r...
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
if you’re using a screen reader, have you noticed that, when you go to this setting in firefox, it tells you “delete history after 21 days”?, followed by the announcement that you’re in a textbox, and that it contains the number 21. isn’t that cool? you do not need to navigate around to find out the unit. ...
... if you’re using a screen reader, have you noticed that, when you go to this setting in firefox, it tells you “delete history after 21 days”?, followed by the announcement that you’re in a textbox, and that it contains the number 21. isn’t that cool? you do not need to navigate around to find out the unit. ...
...ths” or “years”, and in many ordinary dialogs, there is no way to find this out other than navigating around with screen reviewing commands. the solution is in an aria attribute called aria-labelledby. its parameter is a string that consists of the ids of the html elements you want to concatenate into a single accessible name. both aria-labelledby and aria-describedby are specified on the
form element that is to be labelled, for example an <input> in both cases, the label for/label control bindings that may also exist are overridden by aria-labelledby. if on an html page you provide aria-labelledby, you should also provide a label for construct to also support older browsers that do not have aria support yet. with firefox 3, your blind users will automatically get better accessibility ...
... ...
Understanding the Web Content Accessibility Guidelines - Accessibility
the wcag 2.0 and 2.1 provide a detailed set of guidelines for making web content more accessible to people with a wide variety of disabilities. it is comprehensive but incredibly detailed, and quite difficult to gain a rapid understanding of. for this reason, we have summarised the practical steps you need to take to satisfy the different recommendations, with further links to more details where required. ...
...tails where required. the four principles wcag is broadly broken down into four principles — major things that web content must be to be considered accessible (see understanding the four principles of accessibility for the wcag definitions). each of the links below will take you to pages that further expand on these areas, giving you practical advice on how to write your web content so it con
forms to the success criteria outlined in each of the wcag 2.0 and 2.1 guidelines that further sub-divides each principle. perceivable: users must be able to perceive it in some way, using one or more of their senses. operable: users must be able to control ui elements (e.g. buttons must be clickable in some way — mouse, keyboard, voice command, etc.). understandable: the content must be unders...
...however, we are not lawyers, and none of this constitutes legal advice. if you are worried about the legal implications of web accessibility, we'd recommend that you check the specific legislation governing accessibility for the web/public resources in your country or locale, and seek the advice of a qualified lawyer. what is accessibility...
...one of this constitutes legal advice. if you are worried about the legal implications of web accessibility, we'd recommend that you check the specific legislation governing accessibility for the web/public resources in your country or locale, and seek the advice of a qualified lawyer. what is accessibility? and particularity the accessibility guidelines and the law section provide more related in
formation. ...
:disabled - CSS: Cascading Style Sheets
the :disabled css pseudo-class represents any disabled element. an element is disabled if it can't be activated (selected, clicked on, typed into, etc.) or accept focus. the element also has an enabled state, in which it can be activated or accept focus. /* selects any disabled <input> */ input:disabled { background: #ccc; } syntax :disabled examples this example shows a basic shipping
form. ...
...t be activated (selected, clicked on, typed into, etc.) or accept focus. the element also has an enabled state, in which it can be activated or accept focus. /* selects any disabled <input> */ input:disabled { background: #ccc; } syntax :disabled examples this example shows a basic shipping
form. it uses the javascript change event to let the user enable/disable the billing fields. ...
...> </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> <input 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.q...
...ngitems.length; i++) { billingitems[i].disabled = !billingitems[i].disabled; } } result specifications specification status comment html living standardthe definition of ':disabled' in that specification. living standard no change. html5the definition of ':disabled' in that specification. recommendation defines the semantics of html and
forms. selectors level 4the definition of ':disabled' in that specification. working draft no change. selectors level 3the definition of ':disabled' in that specification. recommendation defines the pseudo-class, but not the associated semantics. ...
system - CSS: Cascading Style Sheets
riptor is unable to construct the representation for a particular counter value, then that value's representation will be constructed using the fallback system provided. syntax /* keyword values */ system: cyclic; system: numeric; system: alphabetic; system: symbolic; system: additive; system: fixed; /* combined values */ system: fixed 3; system: extends decimal; this may take one of three
forms: one of the keyword values cyclic, numeric, alphabetic, symbolic, additive, or fixed. the keyword value fixed along with an integer. the keyword value or extends along with a @counter-style name. cyclic cycles through the list of symbols provided. once the end of the list of symbols is reached, it will loop back to the beginning and start over. this system is useful for simple bull...
...nspecified descriptors, and their values will be taken from the extended counter style specified. if the specified counter style name in extends, is not a currently defined counter style name, it will instead extend from the decimal counter style. it must not contain a symbols or additive-symbols descriptor, or else the counter style rule is invalid. ...
...tends, is not a currently defined counter style name, it will instead extend from the decimal counter style. it must not contain a symbols or additive-symbols descriptor, or else the counter style rule is invalid. if one more more counter styles defenitions
form a cycle with their extends values, the browser will treat all the participating counter styles as extending from the decimal style. ...
...nter style. it must not contain a symbols or additive-symbols descriptor, or else the counter style rule is invalid. if one more more counter styles defenitions
form a cycle with their extends values, the browser will treat all the participating counter styles as extending from the decimal style. ...
font-weight - CSS: Cascading Style Sheets
ariation is used to implement varying weights. accessibility concerns people experiencing low vision conditions may have difficulty reading text set with a font-weight value of 100 (thin/hairline) or 200 (extra light), especially if the font has a low contrast color ratio. ...
... low vision conditions may have difficulty reading text set with a font-weight value of 100 (thin/hairline) or 200 (extra light), especially if the font has a low contrast color ratio. ...
...anations understanding success criterion 1.4.8 | w3c understanding wcag 2.0
formal definition related at-rule@font-faceinitial valuenormalcomputed valueas specified
formal syntax <font-weight-absolute>{1,2}where <font-weight-absolute> = normal | bold | <number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to trans
form them as a single component">[1,1000]> examples setting normal font weight in a @font-face rule the following finds a local open sans font or import it, and allows using the font for normal font weights. ...
...cs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to trans
form them as a single component">[1,1000]> examples setting normal font weight in a @font-face rule the following finds a local open sans font or import it, and allows using the font for normal font weights. @font-face { font-family: "open sans"; src: local("open sans")
format("woff2"), url("/fonts/opensans-regular-webfont.woff")
format("woff"); font-weight: 400; } specifications specification status comment css fonts module level 4the definition of 'font-weight' in that specification. working draft css fonts module level 3the definition of 'font-weight' in that specification. candidate recommendation ...
Using CSS animations - CSS: Cascading Style Sheets
e the start and end states of the animation’s style, as well as possible intermediate waypoints. there are three key advantages to css animations over traditional script-driven animation techniques: they’re easy to use for simple animations; you can create them without even having to know javascript. the animations run well, even under moderate system load. simple animations can often per
form poorly in javascript (unless they’re well made). the rendering engine can use frame-skipping and other techniques to keep the per
formance as smooth as possible. letting the browser control the animation sequence lets the browser optimize per
formance and efficiency by, for example, reducing the update frequency of animations running in tabs that aren't currently visible. configuring the anima...
...values, so we start from the beginning again — bounce therefore gets a duration of 2.5s. the iteration counts (and any other property values you specify) will be assigned in the same way. ...
... adding the css we start with creating the css for the animation. this animation will last for 3 seconds, be called “slidein”, repeat 3 times, and alternate direction each time. ...
...ery close to, but not exactly, those expected given the timing established when the animation was configured. note also that after the final iteration of the animation, the animationiteration event isn’t sent; instead, the animationend event is sent. the html just for the sake of completeness, here’s the html that displays the page content, including the list into which the script inserts in
formation about the received events: <h1 id="watchme">watch me move</h1> <p> this example shows how to use css animations to make <code>h1</code> elements move across the page. </p> <p> in addition, we output some text each time an animation event fires, so you can see them in action. </p> <ul id="output"> </ul> and here's the live output. note: reload page to see the animation, or click ...
CSS values and units - CSS: Cascading Style Sheets
every css declaration includes a property / value pair. depending on the property, the value can include a single integer or keyword, to a series of keywords and values with or without units. 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 in
formation. textual data types <custom-ident> pre-defined keywords as an <ident> <string> <url> text data types are either <string>, a quoted series of characters, or an <ident>, a "css identifier" which is an unquoted string. a <string> must be quoted with either single or double quotes. css identifiers, listed in the specifications as <ident> or <custom-ident>, must be unquoted. in the css specificati...
... the <custom-ident> and <string> reference pages for more details. pre-defined keyword values pre-defined keywords are text values defined by the specification for that property. these keywords are also css identifiers and are therefore used without quotes. when viewing css property value syntax in a css specification or the mdn property page, allowable keywords will be listed in the following
form. the following values are the pre-defined keyword values allowed for float. left | right | none | inline-start | inline-end such values are used without quotes: .box { float: left; } css-wide values in addition to the pre-defined keywords that are part of the specification for a property, all css properties accept the css-wide property values initial, inherit, and unset, which explicitl...
...d image, you might use either of the following. .box { background-image: url("images/my-background.png"); } .box { background-image: url("https://www.exammple.com/images/my-background.png"); } the parameter for url() can be either quoted or unquoted. if unquoted, it is parsed as a <url-token>, which has extra requirements including the escaping of certain characters. see <url> for more in
formation. numeric data types <integer> <number> <dimension> <percentage> integers an integer is one or more decimal digits, 0 through 9, such as 1024 or -55. an integer may be preceded by a + or - symbol, with no space between the symbol and the integer. numbers a <number> represents a real number, which may or may not have a decimal point with a fractional component, for example 0.255, 1...
...al notation calc() min() max() clamp() toggle() attr() functional notation is a type of value that can represent more complex types or invoke special processing by css. the syntax starts with the name of the function immediately followed by a left parenthesis ( followed by the argument(s) to the notation followed by a right parenthesis ). functions can take multiple arguments, which are
formatted similarly to a css property value. white space is allowed, but optional inside the parentheses. (but see notes regarding whitespace within pages for min(), max() and clamp() functions.) some legacy functional notations such as rgba() use commas, but generally commas are only used to separate items in a list. if a comma is used to separate arguments, white space is optional before and after...
CSS reference - CSS: Cascading Style Sheets
nguage-overridefont-optical-sizingfont-sizefont-size-adjustfont-stretchfont-stretch (@font-face)font-stylefont-style (@font-face)font-synthesisfont-variantfont-variant (@font-face)font-variant-alternatesfont-variant-capsfont-variant-east-asianfont-variant-ligaturesfont-variant-numericfont-variant-positionfont-variation-settingsfont-variation-settings (@font-face)font-weightfont-weight (@font-face)
format()fr<frequency><frequency-percentage>:fullscreenggapgrad<gradient>grayscale()gridgrid-areagrid-auto-columnsgrid-auto-flowgrid-auto-rowsgrid-columngrid-column-endgrid-column-startgrid-rowgrid-row-endgrid-row-startgrid-templategrid-template-areasgrid-template-columnsgrid-template-rowshhzhanging-punctuationheightheight (@viewport)@historical-
forms:hoverhsl()hsla()hue-rotate()hyphensi<ident><image>i...
...sizetable-layout:targettarget-counter()target-counters()target-text()text-aligntext-align-lasttext-combine-uprighttext-decorationtext-decoration-colortext-decoration-linetext-decoration-skip-inktext-decoration-styletext-decoration-thicknesstext-emphasistext-emphasis-colortext-emphasis-positiontext-emphasis-styletext-indenttext-justifytext-orientationtext-overflowtext-renderingtext-shadowtext-trans
formtext-underline-offsettext-underline-position<time><time-percentage><timing-function>top@top-centertouch-actiontrans
formtrans
form-box<trans
form-function>trans
form-origintrans
form-styletransitiontransition-delaytransition-durationtransition-propertytransition-timing-functiontranslatetranslate()translate3d()translatex()translatey()translatez()turnuunicode-bidiunicode-range (@font-face)unset<url>url()...
...that are not included in html. see also: selectors in the selectors level 4 specification. ...
...s css syntax at-rules cascade comments descriptor inheritance shorthand properties specificity value definition syntax css unit and value types values actual value computed value initial value resolved value specified value used value layout block
formatting context box model containing block layout mode margin collapsing replaced elements stacking context visual
formatting model dom-css / cssom major object types documentorshadowroot.stylesheets stylesheets[i].cssrules cssrules[i].csstext (selector & style) cssrules[i].selectortext htmlelement.style htmlelement.style.csstext (just style) element.classname element.classlist important methods cssstylesheet.insertrule() cssstylesheet.deleterule() ...
Specificity - CSS: Cascading Style Sheets
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). id selectors (e.g., #example). universal selector (*), combinators (+, >, ~, ' ', ||) and negation pseudo-class (:not()) have no effect on specificity. (the selectors declared inside :not() do, however.) for more in
formation, visit: "specificity" in "cascade and inheritance", you can also visit: https://specifishity.com inline styles added to an element (e.g., style="font-weight: bold;") always overwrite any styles in external stylesheets, and thus can be thought of as having the highest specificity. the !important exception when an important rule is used on a style declaration, this declaration overrides any...
...myid#myid span { color: yellow; } .myclass.myclass span { color: orange; } how !important can be used: a) overriding inline styles your global css file that sets visual aspects of your site globally may be overwritten by inline styles defined directly on individual elements. both inline styles and !important are considered very bad practice, but sometimes you need the latter to override the
former. in this case, you could set certain styles in your global css file as !important, thus overriding inline styles set directly on elements. <div class="foo" style="color: red;">what color am i?</div> .foo[style*="color: red"] { color: firebrick !important; } many javascript frameworks and libraries add inline styles. using !important with a very targeted selector is one way to override t...
...portant; } c) or, preferably, rewrite the original rule to avoid the use of !important altogether. [id="someelement"] p { color: blue; } p.awesome { color: red; } including an id as part of an attribute selector instead of as an id selector gives it the same specificity as a class. both selectors above now have the same weight. in a specificity tie, the last rule defined wins. ...
...important; } ... when used with the following html ... <div id="no-where-support"> ⚠️ your browser doesn't support the <code><a href="/docs/web/css/:where" target="_top">:where()</a></code> pseudo-class. </div> <div class="outer"> <p>this is in the outer div.</p> <div class="inner"> <p>this text is in the inner div.</p> </div> </div> ... appears on the screen like this:
form-based specificity specificity is based on the
form of a selector. in the following case, the selector *[id="foo"] counts as an attribute selector for the purpose of determining the selector's specificity, even though it selects an id. the following css styles ... *#foo { color: green; } *[id="foo"] { color: purple; } ... when used with this markup ... <p id="foo">i am a sample text.</p...
animation-timing-function - CSS: Cascading Style Sheets
ing the animation iteration. start same as jump-start. end same as jump-end. step-start equal to steps(1, jump-start) step-end equal to steps(1, jump-end) note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. ...
...end same as jump-end. step-start equal to steps(1, jump-start) step-end equal to steps(1, jump-end) note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more in
formation, see setting multiple animation property values. ...
...ted values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more in
formation, see setting multiple animation property values. ...
... valueas specifiedanimation typediscrete
formal syntax <timing-function>#where <timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to trans
form them as a single component">[0,1]>, <number>, <number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to trans
form them as a single component">[0,1]>, <number>)<step-timing-function> = step-start | step-end | steps(<integer>[, <step-position>]?)where <step-position> = jump-start | jump-end | jump-none | jump-both | start...
background-size - CSS: Cascading Style Sheets
se */ background-size: 25px 50px; background-size: 50% 50%; } note that it's particularly not recommended to use a pixel dimension and an auto dimension with a <gradient>, because it's impossible to replicate rendering in versions of firefox prior to 8, and in browsers not implementing firefox 8's rendering, without knowing the exact size of the element whose background is being specified. ...
...ize of the element whose background is being specified.
formal definition initial valueauto autoapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednopercentagesrelative to the background positioning areacomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typerepeatable list of simple list of length, percentage, or calc
formal syntax <bg-size>#where <bg-size> = [ <length-percentage> | auto ]{1,2} | cover | containwhere <length-percentage> = <length> | <percentage> examples please see scaling background images for examples. specifications specification status comment css backgrounds and borders module level 3the definition of 'background-size' in that specification. candidate recomm...
...ckground-size in which an omitted second value is treated as duplicating the first value; this draft does not include the contain or cover keywords. no support 9.5 — 15prefixed notes prefixed implemented with the vendor prefix: -o-notes opera 9.5's computation of the background positioning area is incorrect for fixed backgrounds. opera 9.5 also interprets the two-value
form as a horizontal scaling factor and, from appearances, a vertical clipping dimension. this has been fixed in opera 10.safari full support 5 full support 5 full support 3prefixed notes prefixed implemented with the vendor prefix: -webkit-notes webkit-based browsers ...
...kground-size in which an omitted second value is treated as duplicating the first value; this draft does not include the contain or cover keywords. no support 10.1 — 14prefixed notes prefixed implemented with the vendor prefix: -o-notes opera 9.5's computation of the background positioning area is incorrect for fixed backgrounds. opera 9.5 also interprets the two-value
form as a horizontal scaling factor and, from appearances, a vertical clipping dimension. this has been fixed in opera 10.safari ios full support 4.2 full support 4.2 full support 1prefixed notes prefixed implemented with the vendor prefix: -webkit-notes webkit-based b...
border-image-slice - CSS: Cascading Style Sheets
the border-image-slice css property divides the image specified by border-image-source into regions. these regions
form the components of an element's border image. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the slicing process creates nine regions in total: four corners, four edges, and a middle region. four slice lines, set a given distance from their respective sides, control the size of the regions. the above diagram illustrates the location of each region. zones 1-4 are corner regions. each one is used a single time to
form the corners of the final border image. zones 5-8 are edge regions. these are...
...der image. zones 5-8 are edge regions. these are repeated, scaled, or otherwise modified in the final border image to match the dimensions of the element. zone 9 is the middle region. it is discarded by default, but is used like a background image if the keyword fill is set. the border-image-repeat, border-image-width, and border-image-outset properties determine how these regions are used to
form the final border image. syntax /* all sides */ border-image-slice: 30%; /* vertical | horizontal */ border-image-slice: 10% 30%; /* top | horizontal | bottom */ border-image-slice: 30 30% 45; /* top | right | bottom | left */ border-image-slice: 7 12 14 5; /* using the `fill` keyword */ border-image-slice: 10% fill 7 12; /* global values */ border-image-slice: inherit; border-image-slice: ...
...ferable in these cases. <percentage> represents an edge offset as a percentage of the source image's size: the width of the image for horizontal offsets, the height for vertical offsets. fill preserves the middle image region and displays it like a background image, but stacked above the actual background. its width and height are sized to match the top and left image regions, respectively. ...
... image regions, respectively.
formal definition initial value100%applies toall elements, except internal table elements when border-collapse is collapse. 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. the source image for the borders is as follows: the diamonds are 30px across, therefore setting 30 pixels as the value for both border-width and border-image-slice will get you compl...
<color> - CSS: Cascading Style Sheets
uring the evolution of css: css level 1 only included 16 basic colors, called the vga colors as they were taken from the set of displayable colors on vga graphics cards. css level 2 added the orange keyword. although various colors not in the specification (mostly adapted from the x11 colors list) were supported by early browsers, it wasn't until svg 1.0 and css colors level 3 that they were
formally defined. they are called the extended color keywords, the x11 colors, or the svg colors. css colors level 4 added the rebeccapurple keyword to honor web pioneer eric meyer. specification keyword rgb hex value live keyword css level 1 black #000000 silver #c0c0c0 gray #808080 white #ffffff mar...
... way. hexadecimal notation: #rrggbb[aa] r (red), g (green), b (blue), and a (alpha) are hexadecimal characters (0–9, a–f). a is optional. for example, #ff0000 is equivalent to #ff0000ff. hexadecimal notation: #rgb[a] r (red), g (green), b (blue), and a (alpha) are hexadecimal characters (0–9, a–f). a is optional. the three-digit notation (#rgb) is a shorter version of the six-digit
form (#rrggbb). for example, #f09 is the same color as #ff0099. likewise, the four-digit rgb notation (#rgba) is a shorter version of the eight-digit
form (#rrggbbaa). for example, #0f38 is the same color as #00ff3388. functional notation: rgb[a](r, g, b[, a]) r (red), g (green), and b (blue) can be either <number>s or <percentage>s, where the number 255 corresponds to 100%. a (alpha) can be a <numb...
... similar to highlighttext. should be used with the -moz-menuhover background color. -moz-menubartext text color in menu bars. often similar to menutext. should be used on top of menu background. -moz-menubarhovertext color for hovered text in menu bars. often similar to -moz-menuhovertext. should be used on top of -moz-menuhover background. -moz-nativehyperlinktext default plat
form hyperlink color. -moz-oddtreerow background color for odd-numbered rows in a tree. should be used with the -moz-fieldtext foreground color. in gecko versions prior to 1.9, use -moz-field. see also -moz-eventreerow. -moz-win-communicationstext should be used for text in objects with -moz-appearance: -moz-win-communications-toolbox;. -moz-win-mediatext should be used for text i...
...a color space to prevent unexpected gray colors from appearing. in animations, the interpolation's speed is determined by the timing function. accessibility considerations some people have difficulty distinguishing colors. the wcag 2.0 recommendation strongly advises against using color as the only means of conveying a specific message, action, or result. see color and color contrast for more in
formation. examples color value tester in this example we provide a <div> and a text input. entering a valid color into the input causes the <div> to adopt that color, allowing you to test our color values. 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 = documen...
content - CSS: Cascading Style Sheets
e escape sequences: for example, \000a9 represents the copyright symbol. <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. <counter>() the value of a css counter, generally a number. it can be displayed using either the counter() or counters() function. the counter() function has two
forms: 'counter(name)' or 'counter(name, style)'. the generated text is the value of the innermost counter of the given name in scope at the given pseudo-element. it is
formatted in the specified style (decimal by default). the counters() function also has two
forms: 'counters(name, string)' or 'counters(name, string, style)'. the generated text is the value of all counters with the given name in sc...
...e string from the quotes property. no-open-quote | no-close-quote introduces no content, but increments (decrements) the level of nesting for quotes. accessibility concerns css-generated content is not included in the dom. because of this, it will not be represented in the accessibility tree and certain assistive technology/browser combinations will not announce it. ...
...bility tree and certain assistive technology/browser combinations will not announce it. if the content conveys in
formation that is critical to understanding the page's purpose, it is better to include it in the main document. accessibility support for css generated content – tink explanation of wcag, guideline 1.3 – mdn understanding success criterion 1.3.1 | w3c understanding wcag 2.0
formal definition initial valuenormalapplies to::before and ::after pseudo-elementsinheritednocomputed valueon elements, always computes to normal. on ::before and ::after, if normal is specified, computes to none. ...
...ion 1.3.1 | w3c understanding wcag 2.0
formal definition initial valuenormalapplies to::before and ::after pseudo-elementsinheritednocomputed valueon elements, always computes to normal. on ::before and ::after, if normal is specified, computes to none. ...
font-kerning - CSS: Cascading Style Sheets
in the image below, for instance, the examples on the left do not use kerning, while the ones on the right do: syntax the font-kerning property is specified as one of the keyword values listed below. ...
... in the image below, for instance, the examples on the left do not use kerning, while the ones on the right do: syntax the font-kerning property is specified as one of the keyword values listed below. values auto the browser determines whether font kerning should be used or not. ...
...ce, the examples on the left do not use kerning, while the ones on the right do: syntax the font-kerning property is specified as one of the keyword values listed below. values auto the browser determines whether font kerning should be used or not. for example, some browsers will disable kerning on small fonts, since applying it could harm the readability of text. ...
...he right do: syntax the font-kerning property is specified as one of the keyword values listed below. values auto the browser determines whether font kerning should be used or not. for example, some browsers will disable kerning on small fonts, since applying it could harm the readability of text. normal font kerning in
formation stored in the font must be applied. none font kerning in
formation stored in the font is disabled.
formal definition initial valueautoapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete
formal syntax auto | normal | none examples enabling and disabling kerning html <div id="kern"></div> <div id="nokern"></div> <textarea id="input">av t. ij</textarea> css div { f...
font-variant - CSS: Cascading Style Sheets
<common-lig-values>, <discretionary-lig-values>, <historical-lig-values>, <contextual-alt-values> specifies the keywords related to the font-variant-ligatures longhand property. the possible values are: common-ligatures, no-common-ligatures, discretionary-ligatures, no-discretionary-ligatures, historical-ligatures, no-historical-ligatures, contextual, and no-contextual. stylistic(), historical-
forms, styleset(), character-variant(), swash(), ornaments(), annotation() specifies the keywords and functions related to the font-variant-alternates longhand property. small-caps, all-small-caps, petite-caps, all-petite-caps, unicase, titling-caps specifies the keywords and functions related to the font-variant-caps longhand property. <numeric-figure-values>, <numeric-spacing-values>, <numeric-f...
...lues are: lining-nums, oldstyle-nums, proportional-nums, tabular-nums, diagonal-fractions, stacked-fractions, ordinal, and slashed-zero. <east-asian-variant-values>, <east-asian-width-values>, ruby specifies the keywords related to the font-variant-east-asian longhand property. the possible values are: jis78, jis83, jis90, jis04, simplified, traditional, full-width, proportional-width, ruby. ...
...sian-width-values>, ruby specifies the keywords related to the font-variant-east-asian longhand property. the possible values are: jis78, jis83, jis90, jis04, simplified, traditional, full-width, proportional-width, ruby.
formal definition initial valuenormalapplies toall elements. ...
..., full-width, proportional-width, ruby.
formal definition initial valuenormalapplies toall elements. ...
grid-template-columns - CSS: Cascading Style Sheets
m. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. fit-content( [ <length> | <percentage> ] ) represents the
formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is greater than the auto minimum. repeat( [ <positive-integer> | auto-fill | auto-fit ] , <track-list> ) represents a repeated fragment of the track list, allowing a large number of columns that exhibit a recurring pattern to be ...
...uto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is greater than the auto minimum. repeat( [ <positive-integer> | auto-fill | auto-fit ] , <track-list> ) represents a repeated fragment of the track list, allowing a large number of columns that exhibit a recurring pattern to be written in a more compact
form. ...
...tten in a more compact
form. subgrid the subgrid value indicates that the grid will adopt the spanned portion of its parent grid in that axis. rather than being specified explicitly, the sizes of the grid rows/columns will be taken from the parent grid’s definition. the subgrid value is from level 2 of the grid specification and currently only has implementation in firefox 71 and onwards. ...
... and onwards. ...
grid-template-rows - CSS: Cascading Style Sheets
m. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. fit-content( [ <length> | <percentage> ] ) represents the
formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is greater than the auto minimum. repeat( [ <positive-integer> | auto-fill | auto-fit ] , <track-list> ) represents a repeated fragment of the track list, allowing a large number of rows that exhibit a recurring pattern to be wri...
...x(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is greater than the auto minimum. repeat( [ <positive-integer> | auto-fill | auto-fit ] , <track-list> ) represents a repeated fragment of the track list, allowing a large number of rows that exhibit a recurring pattern to be written in a more compact
form. ...
...ten in a more compact
form. subgrid the subgrid value indicates that the grid will adopt the spanned portion of its parent grid in that axis. rather than being specified explicitly, the sizes of the grid rows/columns will be taken from the parent grid’s definition. the subgrid value is from level 2 of the grid specification and currently only has implementation in firefox 71 and onwards. ...
...and onwards. ...
<image> - CSS: Cascading Style Sheets
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. a selection of images chosed based on resolution defined by the image-set() function. ...
...images defined by the cross-fade() function. a selection of images chosed based on resolution defined by the image-set() function. description css can handle the following kinds of images: images with intrinsic dimensions (a natural size), like a jpeg, png, or other raster
format. images with multiple intrinsic dimensions, existing in multiple versions inside a single file, like some .ico
formats. (in this case, the intrinsic dimensions will be those of the image largest in area and the aspect ratio most similar to the containing box.) images with no intrinsic dimensions but with an intrinsic aspect ratio between its width and height, like an svg or other vector
format. images with neither intrinsic dimensions, nor an intrinsic aspect ratio, like a css gradient. css determines an o...
...y dimension. if the image has no intrinsic aspect ratio, the intrinsic aspect ratio of the object it applies to is used; if this object has none, the missing width or height are taken from the default object size. note: not all browsers support every type of image on every property. see the browser compatibility section for details. accessibility concerns browsers do not provide any special in
formation on background images to assistive technology. this is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. if the image contains in
formation critical to understanding the page's overall purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations unders...
... /* a selection of images with varying resolutions */ invalid images nourl.jpg /* an image file must be defined using the url() function. */ url(report.pdf) /* a file pointed to by the url() function must be an image. */ element(#fakeid) /* an element id must be an existing id on the page. */ image(z.jpg#xy=0,0) /* the spatial fragment must be written in the
format of xywh=#,#,#,# */ image-set('cat.jpg' 1x, 'dog.jpg' 1x) /* every image in an image set must have a different resolutions */ specifications specification status comment css images module level 4the definition of '<image>' in that specification. working draft adds element(), image(), image-set(), conic-gradient(), repeating-conic-gradient(), and image-resolut...
ime-mode - CSS: Cascading Style Sheets
rty is specified using one of the keyword values listed below. values auto no change is made to the current input method editor state. this is the default. normal the ime state should be normal; this value can be used in a user style sheet to override the page's setting. this value is not supported by internet explorer. active the input method editor is initially active; text entry is per
formed through it unless the user specifically dismisses it. not supported on linux. inactive the input method editor is initially inactive, but the user may activate it if they wish. not supported on linux. disabled the input method editor is disabled and may not be activated by the user. description unlike internet explorer, firefox's implementation of ime-mode allows this property on <input ...
...rs 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. in the past, this was commonly used on fields that entered data into databases which didn't support extended character set...
... specifications specification status comment css basic user interface module level 3the definition of 'ime-mode' in that specification. ...
...rm field. in the past, this was commonly used on fields that entered data into databases which didn't support extended character sets. <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. even with ime disabled, users can still paste extended characters into your
form's fields. specifications specification status comment css basic user interface module level 3the definition of 'ime-mode' in that specification. recommendation initial definition. makes ime-mode officially obsolete. ...
max-height - CSS: Cascading Style Sheets
max-height as an absolute value. <percentage> defines the max-height as a percentage of the containing block's height. auto the browser will calculate and select a max-height for the specified element. none no limit on the size of the box. max-content the intrinsic preferred max-height. min-content the intrinsic minimum max-height. fit-content(<length-percentage>) uses the fit-content
formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). accessibility concerns ensure that elements set with a max-height are not truncated and/or do not obscure other content when the page is zoomed to increase text size. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding ...
...e available space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). accessibility concerns ensure that elements set with a max-height are not truncated and/or do not obscure other content when the page is zoomed to increase text size. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0
formal definition initial valuenoneapplies toall elements but non-replaced inline elements, table columns, and column groupsinheritednopercentagesthe percentage is calculated with respect to the height of the generated box's containing block. if the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the perce...
...centage is calculated with respect to the height of the generated box's containing block. ...
... value is treated as none.computed valuethe percentage as specified or the absolute length or noneanimation typea length, percentage or calc();
formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting max-height using percentage and keyword values table { max-height: 75%; }
form { max-height: none; } specifications specification status comment css box sizing module level 4the definition of 'max-height' in that specification. editor's draft css box sizing module level 3the definition of 'max-height' in that specification. working draft adds the max-content, min-content, fit-content keywords. css level 2 (revis...
min-width - CSS: Cascading Style Sheets
s the min-width as an absolute value. <percentage> defines the min-width as a percentage of the containing block's width. auto the browser will calculate and select a min-width for the specified element. none no limit on the size of the box. max-content the intrinsic preferred min-width. min-content the intrinsic minimum min-width. ...
.... auto the browser will calculate and select a min-width for the specified element. none no limit on the size of the box. max-content the intrinsic preferred min-width. min-content the intrinsic minimum min-width. fit-content(<length-percentage>) uses the fit-content
formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). ...
... available space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). ...
...ritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length, percentage or calc();
formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting minimum element width table { min-width: 75%; }
form { min-width: 0; } specifications specification status comment css box sizing module level 4the definition of 'min-width' in that specification. editor's draft css box sizing module level 3the definition of 'min-width' in that specification. working draft adds the max-content, min-content, fit-content keywords. css flexible box layout m...
offset-anchor - CSS: Cascading Style Sheets
<position> a <position> defines an x/y coordinate, to place an item relative to the edges of an element's box. it can be defined using one to four values. for more specifics, see the <position> and background-position reference pages. note that the 3-value position syntax does not work for any usage of <p...
...e it takes its value from offset-position. <position> a <position> defines an x/y coordinate, to place an item relative to the edges of an element's box. it can be defined using one to four values. for more specifics, see the <position> and background-position reference pages. note that the 3-value position syntax does not work for any usage of <position>, except for in background(-position). ...
...on> a <position> defines an x/y coordinate, to place an item relative to the edges of an element's box. it can be defined using one to four values. for more specifics, see the <position> and background-position reference pages. note that the 3-value position syntax does not work for any usage of <position>, except for in background(-position). ...
...specifics, see the <position> and background-position reference pages. note that the 3-value position syntax does not work for any usage of <position>, except for in background(-position). ...
offset-path - CSS: Cascading Style Sheets
t path is determined by the offset-distance property. each shape or path must define an initial position for the computed value of 0 for offset-distance and an initial direction which specifies the rotation of the object to the initial position. early versions of the spec called this property motion-path. it was changed to offset-path because the property describes static positions, not motion. ...
...y. each shape or path must define an initial position for the computed value of 0 for offset-distance and an initial direction which specifies the rotation of the object to the initial position. early versions of the spec called this property motion-path. it was changed to offset-path because the property describes static positions, not motion. ...
...pecifies the rotation of the object to the initial position. early versions of the spec called this property motion-path. it was changed to offset-path because the property describes static positions, not motion. ...
...6 a11,11 0 0,1 595,789 v434 a11,11 0 0,0 584,423 h506 l900,190" fill="none" stroke="black" stroke-width="13" stroke-linejoin="round" stroke-linecap="round" /> <path id="firstscissorhalf" class="scissorhalf" d="m30,0 h-10 a10,10 0 0,0 -20,10 a20,20 0 1,1 -40,-10 h20 a10,10 0 0,1 30,0 m-40,20 a10,10 1 0,0 -40,0 a10,10 1 0,0 -40,20 m0,0" trans
form="translate(0,0)" fill="green" stroke="black" stroke-width="5" stroke-linejoin="round" stroke-linecap="round" fill-rule="evenodd" /> <path id="secondscissorhalf" class="scissorhalf" d="m30,0 h-10 a10,10 0 0,1 -20,-10 a20,20 0 1,0 -40,10 h20 a10,10 0 0,0 30,0 m-40,-20 a10,10 1 0,0 -40,0 a10,10 1 0,0 -40,-20 m0,0" trans
form="translate...
offset-rotate - CSS: Cascading Style Sheets
ection but facing the opposite direction of `auto` */ offset-rotate: reverse; /* keep a constant rotation regardless the position on the path */ offset-rotate: 90deg; offset-rotate: .5turn; auto the element is rotated by the angle of the direction of the offset-path, relative to the positive x-axis. this is the default value. ...
... <angle> the element has a constant clockwise rotation trans
formation applied to it by the specified rotation angle. auto <angle> if auto is followed by an <angle>, the computed value of the angle is added to the computed value of auto. reverse the element is rotated similar to auto, except it faces the opposite direction. it is the same as specifying a value of auto 180deg. ...
...rotation trans
formation applied to it by the specified rotation angle. auto <angle> if auto is followed by an <angle>, the computed value of the angle is added to the computed value of auto. reverse the element is rotated similar to auto, except it faces the opposite direction. it is the same as specifying a value of auto 180deg. ...
...ed by an <angle>, the computed value of the angle is added to the computed value of auto. reverse the element is rotated similar to auto, except it faces the opposite direction. it is the same as specifying a value of auto 180deg. ...
overflow-x - CSS: Cascading Style Sheets
plicitly compute to auto. hidden content is clipped if necessary to fit horizontally in the padding box. no scrollbars are provided. clip like for hidden, the content is clipped to the element's padding box. the difference between clip and hidden is that the clip keyword also forbids all scrolling, including programmatic scrolling. the box is not a scroll container, and does not start a new
formatting context. if you wish to start a new
formatting context, you can use display: flow-root to do so. scroll content is clipped if necessary to fit horizontally in the padding box. browsers display scrollbars whether or not any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto de...
...ed if necessary to fit horizontally in the padding box. browsers display scrollbars whether or not any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. ...
...ars whether or not any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. if content fits inside the padding box, it looks the same as visible, but still establishes a new block-
formatting context. desktop browsers provide scrollbars if content overflows. ...
...till establishes a new block-
formatting context. desktop browsers provide scrollbars if content overflows. ...
overflow-y - CSS: Cascading Style Sheets
box's top and bottom edges. hidden content is clipped if necessary to fit vertically in the padding box. no scrollbars are provided. clip like for hidden, the content is clipped to the element's padding box. the difference between clip and hidden is that the clip keyword also forbids all scrolling, including programmatic scrolling. the box is not a scroll container, and does not start a new
formatting context. if you wish to start a new
formatting context, you can use display: flow-root to do so. scroll content is clipped if necessary to fit vertically in the padding box. browsers display scrollbars whether or not any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depe...
...pped if necessary to fit vertically in the padding box. browsers display scrollbars whether or not any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. ...
...ars whether or not any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. if content fits inside the padding box, it looks the same as visible, but still establishes a new block-
formatting context. desktop browsers provide scrollbars if content overflows. ...
...till establishes a new block-
formatting context. desktop browsers provide scrollbars if content overflows.
formal definition initial valuevisibleapplies toblock-containers, flex containers, and grid containersinheritednocomputed valueas specified, except with visible/clip computing to auto/hidden respectively if one of overflow-x or overflow-y is neither visible nor clipanimation typediscrete
formal syntax visible | hidden | clip | scroll | auto examples setting overflow-y behavior html <ul> <li><code>overflow-y:hidden</code> — hides the text outside the box <div id="div1"> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliqu...
scroll-behavior - CSS: Cascading Style Sheets
ior css property sets the behavior for a scrolling box when scrolling is triggered by the navigation or cssom scrolling apis. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note that any other scrolls, such as those per
formed by the user, are not affected by this property. when this property is specified on the root element, it applies to the viewport instead. this property specified on the body element will not propagate to the viewport. user agents are allowed to ignore this property. syntax /* keyword values */ scroll-behavior: auto; scroll-behavior: smooth; /* global values */ scroll-behavior: inherit; scrol...
...al values */ scroll-behavior: inherit; scroll-behavior: initial; scroll-behavior: unset; the scroll-behavior property is specified as one of the keyword values listed below. values auto the scrolling box scrolls instantly. smooth the scrolling box scrolls in a smooth fashion using a user-agent-defined timing function over a user-agent-defined period of time. ...
...: inherit; scroll-behavior: initial; scroll-behavior: unset; the scroll-behavior property is specified as one of the keyword values listed below. values auto the scrolling box scrolls instantly. smooth the scrolling box scrolls in a smooth fashion using a user-agent-defined timing function over a user-agent-defined period of time. user agents should follow plat
form conventions, if any. ...
...word values listed below. values auto the scrolling box scrolls instantly. smooth the scrolling box scrolls in a smooth fashion using a user-agent-defined timing function over a user-agent-defined period of time. user agents should follow plat
form conventions, if any. ...
scrollbar-color - CSS: Cascading Style Sheets
lbar-color: dark; scrollbar-color: light; /* <color> values */ scrollbar-color: rebeccapurple green; /* two valid colors. the first applies to the thumb of the scrollbar, the second to the track. */ /* global values */ scrollbar-color: inherit; scrollbar-color: initial; scrollbar-color: unset; values <scrollbar-color> defines the color of the scrollbar. ...
...r-color: inherit; scrollbar-color: initial; scrollbar-color: unset; values <scrollbar-color> defines the color of the scrollbar. auto default plat
form rendering for the track portion of the scrollbar, in the absence of any other related scrollbar color properties. dark show a dark scrollbar, which can be either a dark variant of scrollbar provided by the plat
form, or a custom scrollbar with dark colors. light show a light scrollbar, which can be either a light variant of scrollbar provided by the plat
form, or a custom scrollbar with light colors. <color> <color> applies the first color to the scrollbar thumb, the second to the scrollbar track. note: user agents must apply any scrollbar-color value set on the ro...
...ts must apply any scrollbar-color value set on the root element to the viewport. accessibility concerns when using scrollbar-color property with specific color values, authors should ensure the specified colors have enough contrast between them. for keyword values, uas should ensure the colors they use have enough contrast. see techniques for wcag 2.0: g183: using a contrast ratio of 3:1. ...
...scrollbar-color property with specific color values, authors should ensure the specified colors have enough contrast between them. for keyword values, uas should ensure the colors they use have enough contrast. see techniques for wcag 2.0: g183: using a contrast ratio of 3:1. ...
perspective() - CSS: Cascading Style Sheets
the perspective() css function defines a trans
formation that sets the distance between the user and the z=0 plane, the perspective from which the viewer would be if the 2-dimensional interface were 3-dimensional. its result is a <trans
form-function> data type. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the perspective() trans
form function is part of the trans
form value applied on the element being trans
formed. this differs from the perspective and perspective-origin properties which are attached to the parent of a child trans
formed in 3-dimensional space. syntax the perspective distance used by perspective() ...
...thing appears in a 2-dimensional view, or the screen. a positive value makes the element appear closer to the user than the rest of the interface, a negative value farther. the greater the value, the further away the perspective of the user is. perspective(d) values d is a <length> representing the distance from the user to the z=0 plane. if it is 0 or a negative value, no perspective trans
form is applied. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 this trans
formation applies to the 3d space and can't be represented on the plane. this trans
formation is not a linear trans
formation in ℝ3, and can't be represented using a cartesian-coordinate matrix. 100...
...<div class="face left">c</div> </div> <p>with perspective (4cm):</p> <div class="perspective-box-closer"> <div class="face front">a</div> <div class="face top">b</div> <div class="face left">c</div> </div> css .face { position: absolute; width: 100px; height: 100px; line-height: 100px; font-size: 100px; text-align: center; } p + div { width: 100px; height: 100px; trans
form-style: preserve-3d; margin-left: 100px; } .no-perspective-box { trans
form: rotatex(-15deg) rotatey(30deg); } .perspective-box-far { trans
form: perspective(9cm) rotatex(-15deg) rotatey(30deg); } .perspective-box-closer { trans
form: perspective(4cm) rotatex(-15deg) rotatey(30deg); } .top { background-color: skyblue; trans
form: rotatex(90deg) translate3d(0, 0, 50px); } .left { back...
...in-left: 100px; } .no-perspective-box { trans
form: rotatex(-15deg) rotatey(30deg); } .perspective-box-far { trans
form: perspective(9cm) rotatex(-15deg) rotatey(30deg); } .perspective-box-closer { trans
form: perspective(4cm) rotatex(-15deg) rotatey(30deg); } .top { background-color: skyblue; trans
form: rotatex(90deg) translate3d(0, 0, 50px); } .left { background-color: pink; trans
form: rotatey(-90deg) translate3d(0, 0, 50px); } .front { background-color: limegreen; trans
form: translate3d(0, 0, 50px); } result specifications specification status comment css trans
forms level 2the definition of 'perspective()' in that specification. editor's draft initial definition ...
rotate3d() - CSS: Cascading Style Sheets
the rotate3d() css function defines a trans
formation that rotates an element around a fixed axis in 3d space, without de
forming it. its result is a <trans
form-function> data type. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. in 3d space, rotations have three degrees of liberty, which together describe a single axis of rotation. the axis of rotation is defined by an [x, y, z] vector and pass by the origin (as defined by the trans
form-origin property). if, as specified, the vector is not normalized (i.e., if the sum of the square of its three coordinates is not 1), the user agent will normalize it internally. a non...
...dinate of the vector denoting the axis of rotation which could between 0 and 1. z is a <number> describing the z-coordinate of the vector denoting the axis of rotation which could between 0 and 1. a is an <angle> representing the angle of the rotation. a positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one. cartesian coordinates on ℝ2 this trans
formation applies to the 3d space and can't be represented on the plane. homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 1+(1-cos(a))(x2-1)z·sin(a)+xy(1-cos(a))-y·sin(a)+xz·(1-cos(a))-z·sin(a)+xy·(1-cos(a))1+(1-cos(a))(y2-1)x·sin(a)+yz·(1-cos(a))ysin(a) + xz(1-cos(a))-xsin(a)+yz(1-cos(a))1+(1-cos(a))(z2-1)t0001 homogeneous coordinates on ℝℙ3 ...
...a)+xy·(1-cos(a))1+(1-cos(a))(y2-1)x·sin(a)+yz·(1-cos(a))ysin(a) + xz(1-cos(a))-xsin(a)+yz(1-cos(a))1+(1-cos(a))(z2-1)t0001 homogeneous coordinates on ℝℙ3 examples rotating on the y-axis html <div>normal</div> <div class="rotated">rotated</div> css body { perspective: 800px; } div { width: 80px; height: 80px; background-color: skyblue; } .rotated { trans
form: rotate3d(0, 1, 0, 60deg); background-color: pink; } result rotating on a custom axis html <div>normal</div> <div class="rotated">rotated</div> css body { perspective: 800px; } div { width: 80px; height: 80px; background-color: skyblue; } .rotated { trans
form: rotate3d(1, 2, -1, 192deg); background-color: pink; } result specifications specification statu...
... editor's draft initial definition ...
rotateX() - CSS: Cascading Style Sheets
note: rotatex(a) is equivalent to rotate3d(1, 0, 0, a). note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in other words, the order in which the rotations are applied impacts the result. ...
... note: rotatex(a) is equivalent to rotate3d(1, 0, 0, a). note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in other words, the order in which the rotations are applied impacts the result. syntax the amount of rotation created by rotatex() is specified by an <angle>. ...
...be clockwise; if negative, it will be counter-clockwise. rotatex(a) values a is an <angle> representing the angle of the rotation. a positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one. ...
...rdinates on ℝ3 homogeneous coordinates on ℝℙ3 this trans
formation applies to the 3d space and can't be represented on the plane. 1000cos(a)-sin(a)0sin(a)cos(a) 10000cos(a)-sin(a)00sin(a)cos(a)00001 examples html <div>normal</div> <div class="rotated">rotated</div> css div { width: 80px; height: 80px; background-color: skyblue; } .rotated { trans
form: rotatex(45deg); background-color: pink; } result specifications specification status comment css trans
forms level 2the definition of 'rotatex()' in that specification. editor's draft initial definition ...
rotateY() - CSS: Cascading Style Sheets
note: rotatey(a) is equivalent to rotate3d(0, 1, 0, a). note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in other words, the order in which the rotations are applied impacts the result. ...
... note: rotatey(a) is equivalent to rotate3d(0, 1, 0, a). note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in other words, the order in which the rotations are applied impacts the result. syntax the amount of rotation created by rotatey() is specified by an <angle>. ...
...be clockwise; if negative, it will be counter-clockwise. rotatey(a) values a is an <angle> representing the angle of the rotation. a positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one. ...
...rdinates on ℝ3 homogeneous coordinates on ℝℙ3 this trans
formation applies to the 3d space and can't be represented on the plane. cos(a)0sin(a)010-sin(a)0cos(a) cos(a)0sin(a)00100-sin(a)0cos(a)00001 examples html <div>normal</div> <div class="rotated">rotated</div> css div { width: 80px; height: 80px; background-color: skyblue; } .rotated { trans
form: rotatey(60deg); background-color: pink; } result specifications specification status comment css trans
forms level 2the definition of 'rotatey()' in that specification. editor's draft initial definition ...
rotateZ() - CSS: Cascading Style Sheets
note: rotatez(a) is equivalent to rotate(a) or rotate3d(0, 0, 1, a). note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in other words, the order in which the rotations are applied impacts the result. ...
... note: rotatez(a) is equivalent to rotate(a) or rotate3d(0, 0, 1, a). note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in other words, the order in which the rotations are applied impacts the result. syntax the amount of rotation created by rotatez() is specified by an <angle>. ...
...be clockwise; if negative, it will be counter-clockwise. rotatez(a) values a is an <angle> representing the angle of the rotation. a positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one. ...
...s on ℝ3 homogeneous coordinates on ℝℙ3 this trans
formation applies to the 3d space and can't be represented on the plane. cos(a)-sin(a)0sin(a)cos(a)0001 cos(a)-sin(a)00 sin(a)cos(a)00 0010 0001 examples html <div>normal</div> <div class="rotated">rotated</div> css div { width: 80px; height: 80px; background-color: skyblue; } .rotated { trans
form: rotatez(45deg); background-color: pink; } result specifications specification status comment css trans
forms level 2the definition of 'rotatez()' in that specification. editor's draft initial definition ...
scaleZ() - CSS: Cascading Style Sheets
the scalez() css function defines a trans
formation that resizes an element along the z-axis. its result is a <trans
form-function> data type. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this scaling trans
formation modifies the z-coordinate of each element point by a constant factor, except when the scale factor is 1, in which case the function is the identity trans
form. the scaling is not isotropic, and the angles of the element are not conserved. scalez(-1) defines an axial symmetry, with the z-axis passing through the origin (as specified by the trans
form-origin property). in the above interactive examples, pe...
... note: scalez(sz) is equivalent to to scale3d(1, 1, sz). ...
..., have been set on the cube. note: scalez(sz) is equivalent to to scale3d(1, 1, sz). syntax scalez(s) values s is a <number> representing the scaling factor to apply on the z-coordinate of each point of the element. ...
... this trans
formation applies to the 3d space and can't be represented on the plane. 10001000s 1000010000s00001 examples html <div>normal</div> <div class="perspective">translated</div> <div class="scaled-translated">scaled</div> css div { width: 80px; height: 80px; background-color: skyblue; } .perspective { /* includes a perspective to create a 3d space */ trans
form: perspective(400px) translatez(-100px); background-color: limegreen; } .scaled-translated { /* includes a perspective to create a 3d space */ trans
form: perspective(400px) scalez(2) translatez(-100px); background-color: pink; } result specifications specification status comment css trans
forms level 2the definition of 'scalez()' in that specification. ...
skewX() - CSS: Cascading Style Sheets
the abscissa coordinate of each point is modified by a value proportionate to the specified angle and the distance to the origin; thus, the farther from the origin a point is, the greater will be the value added it. ...
...the abscissa coordinate of each point is modified by a value proportionate to the specified angle and the distance to the origin; thus, the farther from the origin a point is, the greater will be the value added it. ...
... working draft initial definition ...
... working draft initial definition ...
skewY() - CSS: Cascading Style Sheets
the ordinate coordinate of each point is modified by a value proportionate to the specified angle and the distance to the origin; thus, the farther from the origin a point is, the greater will be the value added it. ...
...the ordinate coordinate of each point is modified by a value proportionate to the specified angle and the distance to the origin; thus, the farther from the origin a point is, the greater will be the value added it. ...
... working draft initial definition ...
... working draft initial definition ...
translateX() - CSS: Cascading Style Sheets
the translatex() css function repositions an element horizontally on the 2d plane. its result is a <trans
form-function> data type. note: translatex(tx) is equivalent to translate(tx, 0) or translate3d(tx, 0, 0). syntax /* <length-percentage> values */ trans
form: translatex(200px); trans
form: translatex(50%); values <length-percentage> is a <length> or <percentage> representing the abscissa of the translating vector. a percentage value refers to the width of the reference box defined by the trans
form-box property. ...
...h-percentage> is a <length> or <percentage> representing the abscissa of the translating vector. a percentage value refers to the width of the reference box defined by the trans
form-box property. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 a translation is not a linear trans
formation in ℝ2 and can't be represented using a cartesian-coordinate matrix. ...
...the trans
form-box property. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 a translation is not a linear trans
formation in ℝ2 and can't be represented using a cartesian-coordinate matrix. ...
...ar trans
formation in ℝ2 and can't be represented using a cartesian-coordinate matrix. 10t010001 10t010001 100t010000100001 [1 0 0 1 t 0]
formal syntax translatex(<length-percentage>) examples html <div>static</div> <div class="moved">moved</div> <div>static</div> css div { width: 60px; height: 60px; background-color: skyblue; } .moved { trans
form: translatex(10px); /* equal to translate(10px) */ background-color: pink; } result specifications specification status comment css trans
forms level 1the definition of 'translatex()' in that specification. working draft initial definition ...
translateY() - CSS: Cascading Style Sheets
the translatey() css function repositions an element vertically on the 2d plane. its result is a <trans
form-function> data type. note: translatey(ty) is equivalent to translate(0, ty) or translate3d(0, ty, 0). syntax /* <length-percentage> values */ trans
form: translatey(200px); trans
form: translatey(50%); values <length-percentage> the value is a <length> or <percentage> representing the ordinate of the translating vector. a percentage value refers to the height of the reference box defined by the trans
form-box property. ...
...e> the value is a <length> or <percentage> representing the ordinate of the translating vector. a percentage value refers to the height of the reference box defined by the trans
form-box property. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 a translation is not a linear trans
formation in ℝ2 and can't be represented using a cartesian-coordinate matrix. ...
...he trans
form-box property. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 a translation is not a linear trans
formation in ℝ2 and can't be represented using a cartesian-coordinate matrix. ...
...r trans
formation in ℝ2 and can't be represented using a cartesian-coordinate matrix. 10001t001 10001t001 1000010t00100001 [1 0 0 1 0 t]
formal syntax translatey(<length-percentage>) examples html <div>static</div> <div class="moved">moved</div> <div>static</div> css div { width: 60px; height: 60px; background-color: skyblue; } .moved { trans
form: translatey(10px); background-color: pink; } result specifications specification status comment css trans
forms level 1the definition of 'translatey()' in that specification. working draft initial definition ...
transition-timing-function - CSS: Cascading Style Sheets
00% marks, effectively adding a step during the transition time. start same as jump-start. end same as jump-end. step-start equal to steps(1, jump-start) step-end equal to steps(1, jump-end) accessibility concerns some animations can be helpful such as to guide users to understand what actions are expected, to show relationships within the user interface, and to in
form users as to what actions have occurred. animations can help reduce cognitive load, prevent change blindness, and establish better recall in spatial relationships. however, some animations can be problematic for people with cognitive concerns such as attention deficit hyperactivity disorder (adhd) and certain kinds of motion can be a trigger for vestibular disorders, epilepsy, and migraine and sco...
...uch as attention deficit hyperactivity disorder (adhd) and certain kinds of motion can be a trigger for vestibular disorders, epilepsy, and migraine and scotopic sensitivity. consider providing a mechanism for pausing or disabling animation, as well as using the reduced motion media query to create a complimentary experience for users who have expressed a preference for no animated experiences. ...
...opic sensitivity. consider providing a mechanism for pausing or disabling animation, as well as using the reduced motion media query to create a complimentary experience for users who have expressed a preference for no animated experiences. ...
... valueas specifiedanimation typediscrete
formal syntax <timing-function>#where <timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to trans
form them as a single component">[0,1]>, <number>, <number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to trans
form them as a single component">[0,1]>, <number>)<step-timing-function> = step-start | step-end | steps(<integer>[, <step-position>]?)where <step-position> = jump-start | jump-end | jump-none | jump-both | start...
Demos of open web technologies
open web technology, please add a link to the appropriate section here. ...
...e section here. ...
... and trans
forms) phonetics guide (interactive) 3d objects demo (interactive) blobular (interactive) video embedded in svg (or use the local download) summer html image map creator (source code) video video 3d animation "mozilla constantly evolving" video 3d animation "floating dance" streaming anime, movie trailer and interview billy's browser firefox flick virtual barber shop trans
formers movie trailer a scanner darkly movie trailer (with built in controls) events firing and volume control dragable and sizable videos 3d graphics webgl web audio fireworks ioquake3 (source code) escher puzzle (source code) kai 'opua (source code) virtual reality the polar sea (source code) sechelt fly-through (source code) css css zen garden css floating logo "mozilla" pa...
...(source code) virtual reality the polar sea (source code) sechelt fly-through (source code) css css zen garden css floating logo "mozilla" paperfold css blockout rubik's cube pure css slides planetarium (source code) loader with blend modes text reveal with clip-path ambient shadow with custom properties luminiscent vial css-based single page application (source code) trans
formations impress.js (source code) games ioquake3 (source code) kai 'opua (source code) web apis notifications api html5 notifications (source code) web audio api web audio fireworks oscope.js - javascript oscilloscope html5 web audio showcase (source code) html5 audio visualizer (source code) graphical filter editor and visualizer (source code) file api slide my te...
Audio and video manipulation - Developer guides
having native audio and video in the browser means we can use these data streams with technologies such as <canvas>, webgl or web audio api to modify audio and video directly, for example adding reverb/compression effects to audio, or grayscale/sepia filters to video. this article provides a reference to explain what you need to do. video manipulation the ability to read the pixel values from each frame of a video can be very useful. video and canvas the <canvas> element provides a surface for drawing graphics onto web pages; it is very powerful and can be coupled tightly with video. ...
...estinationnode representing the output device to which the sound is sent after processing. if the audio source is... 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 wave
form oscillatornode an audio track from webrtc (such as the microphone input you can get using getusermedia(). mediastreamaudiosourcenode audio filters the web audio api has a lot of different filter/effects that can be applied to audio using the biquadfilternode, for example. html <video id="my-video" controls src="myvideo.mp4" type="video/mp4"> </video> javascript v...
...es through, but adds a boost (or attenuation) to the higher frequencies. peaking: allows all frequencies through, but adds a boost (or attenuation) to a range of frequencies. notch: allows all frequencies through, except for a set of frequencies. allpass: allows all frequencies through, but changes the phase relationship between the various frequencies. note: see biquadfilternode for more in
formation. convolutions and impulses it's also possible to apply impulse responses to audio using the convolvernode. an impulse response is the sound created after a brief impulse of sound (like a hand clap). an impulse response will signify the environment in which the impulse was created (for example, an echo created by clapping your hands in a tunnel). example var convolver = context.createcon...
...on); source.connect(panner); source.start(0); // position the listener at the origin. context.listener.setposition(0, 0, 0); note: you can find an example on our github repository (see it live also). javascript codecs it's also possible to manipulate audio at a low level using javascript. this can be useful should you want to create audio codecs. libraries currently exist for the following
formats : aac: aac.js alac: alac.js flac: flac.js mp3: mp3.js opus: opus.js vorbis: vorbis.js note: at audiocogs, you can try out a few demos; audiocogs also provides a framework, aurora.js, which is intended to help you author your own codecs in javascript. examples various web audio api (and other) examples three.js video cube example convolution effects in real-time ...
Mouse gesture events - Developer guides
ack. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. gecko 1.9.1 added support for several mozilla-specific dom events used to handle mouse gestures. these are special movements that can be made with a mouse or trackpad and can be interpreted to per
form specific tasks. note: these gesture events are available to add-ons and other browser chrome code, but are never sent to regular web page content. note: some operating systems, including mac os x and windows 7, provide default actions when gesture events occur. if you handle a gesture event and wish to prevent the default action from taking place as well, be sure to call the event's preventde...
...ons when gesture events occur. if you handle a gesture event and wish to prevent the default action from taking place as well, be sure to call the event's preventdefault() method. types of gesture events mozswipegesture the mozswipegesture event is sent when the user uses three fingers to "swipe" the trackpad. mozmagnifygesturestart the mozmagnifygesturestart event is sent when the user begins per
forming a "pinch" gesture, by using two fingers as the corners of a rectangle and moving them either closer together or farther apart. this is typically used to zoom in and out on content (this is the default behavior in firefox, for example). mozmagnifygestureupdate the mozmagnifygestureupdate event is sent periodically while processing a magnify gesture, to provide updated status in
formation. the ev...
...ou can simply watch for this event; however, if you want to provide feedback during the handling of the gesture, you should also watch the mozmagnifygesturestart and mozmagnifygestureupdate events. the delta value is the cumulative change over the course of handling the entire sequence of magnify gesture events. mozrotategesturestart the mozrotategesturestart event is sent when the user begins per
forming a rotate gesture, by placing two fingers on the trackpad and rotating them around the center of the trackpad. firefox uses this gesture to move backward and forward through the tabs in the current window. mozrotategestureupdate the mozrotategestureupdate event is sent periodically while processing a rotate gesture, to provide updated status in
formation. the event's delta value represents the a...
...he rotate gesture, you can simply watch for this event; however, if you want to provide feedback during the handling of the gesture, you should also watch the mozrotategesturestart and mozrotategestureupdate events. the delta value is the cumulative change over the course of handling the entire sequence of rotate gesture events. event fields mouse gesture events have additional fields providing in
formation about the gesture. these are: direction the direction in which the swipe moved. delta the amount by which the gesture moved; for rotation, this value is in degrees. positive values are clockwise and negative values are counterclockwise. for magnification, this value is implementation-specific, but the value is positive for zooming in and negative for zooming out. direction ...
A hybrid approach - Developer guides
h piece of content, so that the content can adapt its layout to the user’s browser. this is generally thought to be a good thing. instead of maintaining two completely different sites, we simply redirect users to pages for the content they care about. and since the design is responsive, you know that each page looks as good as possible on the user’s screen. we can also address some of the per
formance problems with responsive design by incorporating server-side techniques. for example, an often-criticized point about responsive web design is that full-resolution images are sent to all devices, including phones that show the images scaled down anyway. one such technique for dealing with this issue uses server-side user-agent detection along with the wurfl device capability library to send a...
... for dealing with this issue uses server-side user-agent detection along with the wurfl device capability library to send a properly sized image for the user’s device. a range of products are also emerging which provide this as a service. of course, this technique suffers from all the downsides associated with user-agent detection. but even if it does not work, it is no worse with respect to per
formance than only using fluid images. by combining the techniques listed above, we can get a mobile web development strategy that is both more flexible than pure separate sites and has better per
formance than pure responsive design. the bad one downside of mixing approaches is that it can lead to an increase in the number of code paths, both on the client and server side. this can make it more tim...
...“the good” section above: using user-agent detection, route visitors to a landing page for the firefox version for their device. every page on the site should look great at a wide variety of resolutions, being built with responsive design in mind. future plans include exploring serving images based on user-agent. so far there is not much to see for mobile, since things are still in the
formative stages of development, but you can always watch the new mozilla.org grow up on github. subscribe to the mozilla webdev blog for updates about our progress. summary no approach is a one-size-fits-all solution. web applications that want to heavily modify the content or user flow for mobile users should probably go for a separate mobile site. content-oriented pages that don’t need to modif...
... benefits of a responsive design, a hybrid approach may be your best bet. decisions like these are at the heart of mobile web development: be specific about what you would like to accomplish, and pick a practical approach while being aware of the tradeoffs. good luck! approaches to mobile web development see the following articles for background and other approaches to developing for mobile plat
forms. what is mobile-friendliness? separate sites responsive design original document in
formation this article was originally published on 27 june 2011, on the mozilla webdev blog as "approaches to mobile web development part 4 – a hybrid approach", by jason grlicky. ...
<head>: The Document Metadata (Header) element - HTML: Hypertext Markup Language
otherwise, one or more elements of metadata content where exactly one is a <title> element. ...
... otherwise, one or more elements of metadata content where exactly one is a <title> element. ...
... otherwise, one or more elements of metadata content where exactly one is a <title> element. ...
... otherwise, one or more elements of metadata content where exactly one is a <title> element. ...
<isindex> - HTML: Hypertext Markup Language
that put a text field in a page for querying the document. <isindex> provided a single line text input for entering a query string. when sent, the server would return a list of pages matching the query. its support depended on both the browser and the server to react to the query. <isindex> is removed html standard. it was deprecated in html 4.01. the same behaviour can be achieved with an html
form. all major browsers have now removed <isindex>. attributes like all other html elements, this element accepted the global attributes. prompt this attribute added its value as a prompt for text field. action this attribute determined the server url to which the query was sent. example <head> <isindex prompt="search document..." action="/search"> </head> in past browsers, this would g...
...other html elements, this element accepted the global attributes. prompt this attribute added its value as a prompt for text field. action this attribute determined the server url to which the query was sent. example <head> <isindex prompt="search document..." action="/search"> </head> in past browsers, this would generate, at parse time, a dom tree equivalent to the following html: <
form action="/search"> <hr> <label> search document... <input name="isindex"> </label> <hr> </
form> history on june 1992, dan connolly would prefer a different anchor type instead of isindex. on november 1992, indexes as links rather than documents started by dan connolly who is pushing the idea that indexes are more links than documents. in this thread, different type of solutions...
...bel> search document... <input name="isindex"> </label> <hr> </
form> history on june 1992, dan connolly would prefer a different anchor type instead of isindex. on november 1992, indexes as links rather than documents started by dan connolly who is pushing the idea that indexes are more links than documents. in this thread, different type of solutions are proposed. the question of
forms for making queries is mentioned in reference to dynatext browser: "the browser displays toggle buttons, text fields etc. the user fills in the fields, clicks ok, and the query results come up in the table of contents window." a thread about isindex in november 1992, kevin hoadley questioned the need for an isindex element and proposed to drop it. he proposed to have instead an input element (id...
...end the current www framework with a specific httpd configuration and defined that some uris mapping create search queries. in 2016, after it was removed from edge and chrome, it was proposed to remove isindex from the standard; this removal was completed the next day, after which safari and firefox also removed support. html reference the html standard classifies it as a obsolete and non-con
forming feature. isindex element deprecated in html 4.01 isindex in html 3.2 isindex in html 2.0 as well the description of the behavior in queries and indexes (html 2.0) isindex in html+ ...
<meter>: The HTML Meter element - HTML: Hypertext Markup Language
pts phrasing content. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlmeterelement attributes this element includes the global attributes. value the current numeric value. this must be between the minimum and maximum values (min attribute and max attribute) if they are specified. if unspecified or mal
formed, the value is 0. if specified, but not within the range given by the min attribute and max attribute, the value is equal to the nearest end of the range. note: unless the value attribute is between 0 and 1 (inclusive), the min and max attributes should define the range so that the value attribute's value is within it. min the lower numeric bound of the measured range. this must be less tha...
...in attribute and max attribute). when used with the low attribute and high attribute, it gives an indication where along the range is considered preferable. for example, if it is between the min attribute and the low attribute, then the lower range is considered preferred. the browser may color the meter's bar differently depending on whether the value is less than or equal to the optimum value. ...
...e and max attribute). when used with the low attribute and high attribute, it gives an indication where along the range is considered preferable. for example, if it is between the min attribute and the low attribute, then the lower range is considered preferred. the browser may color the meter's bar differently depending on whether the value is less than or equal to the optimum value. ...
...d high attribute, it gives an indication where along the range is considered preferable. for example, if it is between the min attribute and the low attribute, then the lower range is considered preferred. the browser may color the meter's bar differently depending on whether the value is less than or equal to the optimum value.
form the <
form> element to associate the <meter> element with (its
form owner). the value of this attribute must be the id of a <
form> in the same document. if this attribute is not set, the <button> is associated with its ancestor <
form> element, if any. this attribute is only used if the <meter> element is being used as a
form-associated element, such as one displaying a range corresponding to an <input type="number">. examples simple example html <p>heat the ...
<tbody>: The Table Body element - HTML: Hypertext Markup Language
(<tr> elements), indicating that they comprise the body of the table (<table>). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the <tbody> element, along with its cousins <thead> and <tfoot>, provide useful semantic in
formation that can be used when rendering for either screen or printer as well as for accessibility purposes. content categories none. permitted content zero or more <tr> elements. tag omission the <tbody> element is not a required child element for a parent <table> element to graphically render. however, it must not be present, if its parent <table> element has a ...
...le includes a <thead> block (to semantically identify header rows), the <tbody> block must come after it. if you use <tbody>, you can't also have table rows (<tr> elements) which are direct children of the <table> but not included inside the <tbody>. all non-header and non-footer rows must be inside the <tbody> if one is used. when printing a document, the <thead> and <tfoot> elements specify in
formation that may be the same—or at least very similar—on every page of a multi-page table, while the <tbody> element's contents generally will differ from page to page. when a table is presented in a screen context (such as a window) which is not large enough to display the entire table, the user agent may let the user scroll the contents of the <thead>, <tbody>, <tfoot>, and <caption> blocks s...
...window) which is not large enough to display the entire table, the user agent may let the user scroll the contents of the <thead>, <tbody>, <tfoot>, and <caption> blocks separately from one another for the same parent table. you may use more than one <tbody> per table as long as they are all consecutive. this lets you divide the rows in large tables into sections, each of which may be separately
formatted if so desired. examples below are some examples showing the use of the <tbody> element. for more examples of this tag in use, see the examples for <table>. basic example in this relatively simple example, we create a table listing in
formation about a group of students with a <thead> and a <tbody>, with a number of rows in the body. html the table's html is shown here. note that all of...
...les below are some examples showing the use of the <tbody> element. for more examples of this tag in use, see the examples for <table>. basic example in this relatively simple example, we create a table listing in
formation about a group of students with a <thead> and a <tbody>, with a number of rows in the body. html the table's html is shown here. note that all of the body cells including in
formation about students are contained within a single <tbody> element. <table> <thead> <tr> <th>student id</th> <th>name</th> <th>major</th> </tr> </thead> <tbody> <tr> <td>3741255</td> <td>jones, martha</td> <td>computer science</td> </tr> <tr> <td>3971244</td> <td>nim, victor</td> <td>russian literature</td> </tr> ...
<time> - HTML: Hypertext Markup Language
a valid time duration. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... a valid time duration. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... permitted parents any element that accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmltimeelement attributes like all other html elements, this element supports the global attributes. datetime this attribute indicates the time and/or date of the element and must be in one of the
formats described below. usage notes this element is for presenting dates and times in a machine readable
format. for example, this can help a user agent offer to add an event to a user's calendar. this element should not be used for dates prior to the introduction of the gregorian calendar (due to complications in calculating those dates). the datetime value (the machine-readable value of the da...
...if the element does not have a datetime attribute, it must not have any element descendants, and the datetime value is the element’s child text content. ...
Microdata - HTML: Hypertext Markup Language
microdata is part of the whatwg html standard and is used to nest metadata within existing content on web pages. search engines and web crawlers can extract and process microdata from a web page and use it to provide a richer browsing experience for users. search engines benefit greatly from direct access to this structured data because it allows search engines to understand the in
formation on web pages and provide more relevant results to users. microdata uses a supporting vocabulary to describe an item and name-value pairs to assign values to its properties. microdata is an attempt to provide a simpler way of annotating html elements with machine-readable tags than the similar approaches of using rdfa and classic micro
formats. at a high level, microdata consists of a group of name-v...
...ements. to create an item, the itemscope attribute is used. to add a property to an item, the itemprop attribute is used on one of the item's descendants. vocabularies google and other major search engines support the schema.org vocabulary for structured data. this vocabulary defines a standard set of type names and property names, for example, schema.org music event indicates a concert per
formance, with startdate and location properties to specify the concert's key details. in this case, schema.org music event would be the url used by itemtype and startdate and location would be itemprop's that schema.org music event defines. note: more about itemtype attributes can be found at http://schema.org/thing microdata vocabularies provide the semantics or meaning of an item. web developer...
...me purposes, an ad-hoc vocabulary is adequate. for others, a vocabulary will need to be designed. where possible, authors are encouraged to re-use existing vocabularies, as this makes content re-use easier. localization in some cases, search engines covering specific regions may provide locally-specific extensions of microdata. for example, yandex, a major search engine in russia, supports micro
formats such as hcard (company contact in
formation), hrecipe (food recipe), hreview (market reviews) and hproduct (product data) and provides its own
format for the definition of the terms and encyclopedic articles. this extension was made to solve transliteration problems between the cyrillic and latin alphabets. due to the implementation of additional marking parameters of schema's vocabulary, the i...
... global attributes itemid – the unique, global identifier of an item. itemprop – used to add properties to an item. every html element may have an itemprop attribute specified, where an itemprop consists of a name and value pair. ...
Data URLs - HTTP
note: data urls are treated as unique opaque origins by modern browsers, rather than inheriting the origin of the settings object responsible for the navigation. syntax data urls are composed of four parts: a prefix (data:), a mime type indicating the type of data, an optional base64 token if non-textual, and the data itself: data:[<mediatype>][;base64],<data> the mediatype is a mime type string, such as 'image/jpeg' for a jpeg image file. ...
... endings that delimit rows of the spreadsheet. data:text/plain;base64,sgvsbg8sifdvcmxkiq== base64-encoded version of the above data:text/html,%3ch1%3ehello%2c%20world!%3c%2fh1%3e an html document with <h1>hello, world!</h1> data:text/html,<script>alert('hi');</script> an html document that executes a javascript alert. note that the closing script tag is required. encoding data into base64
format base64 is a group of binary-to-text encoding schemes that represent binary data in an ascii string
format by translating it into a radix-64 representation. by consisting only in ascii characters, base64 strings are generally url-safe, and that's why they can be used to encode data in data urls. encoding in javascript the web apis have native methods to encode or decode to base64: base64 enco...
...outputs to console: agvsbg8= # the backtick (`) is used to escape the piping (|) character here common problems this section describes problems that commonly occur when creating and using data urls. ...
...at commonly occur when creating and using data urls. data:text/html,lots of text...<p><a name%3d"bottom">bottom</a>?arg=val this represents an html resource whose contents are: lots of text...<p><a name="bottom">bottom</a>?arg=val syntax the
format for data urls is very simple, but it's easy to forget to put a comma before the "data" segment, or to incorrectly encode the data into base64
format.
formatting in html a data url provides a file within a file, which can potentially be very wide relative to the width of the enclosing document. as a url, the data should be
formatable with whitespace (linefeed, tab, or spaces), but there are practical issues that arise when using base64 encoding. length limitations although firefox supports data urls of essentially unlimited length, brows...
Cache-Control - HTTP
ectives have an optional argument, which can be either a token or a quoted-string. (see spec for definitions) cache request directives standard cache-control directives that can be used by the client in an http request. ...
...ds> cache-control: max-stale[=<seconds>] cache-control: min-fresh=<seconds> cache-control: no-cache cache-control: no-store cache-control: no-trans
form cache-control: only-if-cached cache response directives standard cache-control directives that can be used by the server in an http response. cache-control: must-revalidate cache-control: no-cache cache-control: no-store cache-control: no-trans
form cache-control: public cache-control: private cache-control: proxy-revalidate cache-control: max-age=<seconds> cache-control: s-maxage=<seconds> extension cache-control directives extension cache-control directives are not part of the core http caching standards document. check the compatibility table for their support; user-agents that don't recognize them should ignore them. cache-control: i...
...tes the client wants a response that will still be fresh for at least the specified number of seconds. stale-while-revalidate=<seconds> indicates the client will accept a stale response, while asynchronously checking in the background for a fresh one. the seconds value indicates how long the client will accept a stale response. see "keeping things fresh with stale-while-revalidate" for more in
formation. stale-if-error=<seconds> indicates the client will accept a stale response if the check for a fresh one fails. the seconds value indicates how long the client will accept the stale response after the initial expiration. revalidation and reloading must-revalidate indicates that once a resource becomes stale, caches must not use their stale copy without successful validation on the ...
...e, if unexpired, is unchanged on the server and therefore the client should not send a conditional revalidation for it (e.g. if-none-match or if-modified-since) to check for updates, even when the user explicitly refreshes the page. clients that aren't aware of this extension must ignore them as per the http specification. in firefox, immutable is only honored on https:// transactions. for more in
formation, see also this blog post. other no-trans
form an intermediate cache or proxy cannot edit the response body, content-encoding, content-range, or content-type. it therefore forbids a proxy or browser feature, such as google’s web light, from converting images to minimize data for a cache store or slow connection. only-if-cached set by the client to indicate "do not use the network" fo...
Content-Encoding - HTTP
ize and can even make the payload longer. 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. this is the original
format of the unix gzip program. the http/1.1 standard also recommends that the servers supporting this content-encoding should recognize x-gzip as an alias, for compatibility purposes. compress a
format using the lempel-ziv-welch (lzw) algorithm. the value name was taken from the unix compress program, which implemen...
...ons, this content-encoding is not used by many browsers today, partly because of a patent issue (it expired in 2003). deflate using the zlib structure (defined in rfc 1950) with the deflate compression algorithm (defined in rfc 1951). identity indicates the identity function (i.e., no compression or modification). this token, except if explicitly specified, is always deemed acceptable. br a
format using the brotli algorithm. examples compressing with gzip on the client side, you can advertise a list of compression schemes that will be sent along in an http request. the accept-encoding header is used for negotiating content encoding. accept-encoding: gzip, deflate the server responds with the scheme used, indicated by the content-encoding response header. content-encoding: gzip no...
...ent encoding. accept-encoding: gzip, deflate the server responds with the scheme used, indicated by the content-encoding response header. content-encoding: gzip note that the server is not obligated to use any compression method. ...
...zip, deflate the server responds with the scheme used, indicated by the content-encoding response header. content-encoding: gzip note that the server is not obligated to use any compression method. ...
Feature-Policy - HTTP
eny the use of browser features in its own frame, and in content within any <iframe> elements in the document. this header is still in an experimental state, and is subject to change at any time. be wary of this when implementing it on your website. the header has now been renamed to permissions-policy in the spec, and this article will eventually be updated to reflect that change. for more in
formation, see the main feature policy article. header type response header forbidden header name yes syntax feature-policy: <directive> <allowlist> <directive> the feature policy directive to apply the allowlist to. see directives below for a list of the permitted directive names. <allowlist> an allowlist is a list of origins that takes one or more of the follow...
...s (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level and nested browsing contexts. directives accelerometer controls whether the current document is allowed to gather in
formation about the acceleration of the device through the accelerometer interface. ambient-light-sensor controls whether the current document is allowed to gather in
formation about the amount of light in the environment around the device through the ambientlightsensor interface. autoplay controls whether the current document is allowed to autoplay media requested through the htmlmediaelement inte...
...d, the returned promise rejects with a typeerror. geolocation controls whether the current document is allowed to use the geolocation interface. when this policy is disabled, calls to getcurrentposition() and watchposition() will cause those functions' callbacks to be invoked with a positionerror code of permission_denied. ...
...rentposition() and watchposition() will cause those functions' callbacks to be invoked with a positionerror code of permission_denied. gyroscope controls whether the current document is allowed to gather in
formation about the orientation of the device through the gyroscope interface. layout-animations controls whether the current document is allowed to show layout animations. legacy-image-
formats controls whether the current document is allowed to display images in legacy
formats. magnetometer controls whether the current document is allowed to gather in
formation about the orientation of the device through the magnetometer interface. microphone controls whether the current document is allowed to use audio input devices. when this policy is disabled, the promise returned by medi...
Large-Allocation - HTTP
the non-standard large-allocation response header tells the browser that the page being loaded is going to want to per
form a large allocation. it is currently only implemented in firefox, but is harmless to send to every browser. webassembly or asm.js applications can use large contiguous blocks of allocated memory. for complex games, for example, these allocations can be quite large, sometimes as large as 1gb. the large-allocation tells the browser that the web content in the to-be-loaded page is going to want to per
form a large contiguous memory allocation and the browser can react to this header by starting a dedicated process for the to-be-loaded document, for example. header type response header forbidden header name no syntax large-allocation: 0 large-a...
...his header by starting a dedicated process for the to-be-loaded document, for example. header type response header forbidden header name no syntax large-allocation: 0 large-allocation: <megabytes> directives 0 0 is a special value which represents uncertainty as to what the size of the allocation is. <megabytes> the expected size of the allocation to be per
formed, in megabytes. examples large-allocation: 0 large-allocation: 500 troubleshooting errors the large-allocation header throws warnings or error messages when used incorrectly. you'll encounter them in the web console. this page was loaded in a new process due to a large-allocation header. this message means that the browser saw the large-allocation header, and was able to reload the pag...
...e available contiguous memory. a large-allocation header was ignored due to the load being triggered by a non-get request. when a post request is used to load a document, that load cannot currently be redirected into a new process. this error is displayed when loading a document with a large-allocation header with a non-get http method. this could be caused due to the document being loaded by a
form submission, for example. a large-allocation header was ignored due to the presence of windows which have a reference to this browsing context through the frame hierarchy or window.opener. this error means that the document was not loaded at the top level of an user-opened or noopener-opened tab or window. it can occur in these situations: the document with the large-allocation header was...
...can prevent firefox from using this new, faster, multiprocess architecture. if you have one of these addons installed, then we will continue to use the old single process architecuture for compatibility, and cannot handle the large-allocation header. this page would be loaded in a new process due to a large-allocation header, however large-allocation process creation is disabled on non-win32 plat
forms. firefox currently only supports the large-allocation header in our 32-bit windows builds, as memory fragmentation is not an issue in 64-bit builds. if you are running a non-win32 version of firefox, this error will appear. this check can be disabled with the "dom.largeallocation. forceenable" boolean preferece in about:config. specifications not part of any current specifications. an exp...
Set-Cookie - HTTP
the user agent can send it back to the server later. to send multiple cookies, multiple set-cookie headers should be sent in the same response. browsers block frontend javascript code from accessing the set cookie header, as required by the fetch spec, which defines set-cookie as a forbidden response-header name that must be filtered out from any response exposed to frontend code. for more in
formation, see the guide on http cookies. header type response header forbidden header name no forbidden response-header name yes syntax set-cookie: <cookie-name>=<cookie-value> set-cookie: <cookie-name>=<cookie-value>; expires=<date> set-cookie: <cookie-name>=<cookie-value>; max-age=<non-zero-digit> set-cookie: <cookie-name>=<cookie-value>; domain=<domain-...
...can be any us-ascii characters, except control characters, spaces, or tabs. it also must not contain a separator character like the following: ( ) < > @ , ; : \ " / [ ] ? = { }. a <cookie-value> can optionally be wrapped in double quotes and include any us-ascii characters excluding control characters, whitespace, double quotes, comma, semicolon, and backslash. encoding: many implementations per
form url encoding on cookie values, however it is not required per the rfc specification. it does help satisfying the requirements about which characters are allowed for <cookie-value> though. __secure- prefix: cookies names starting with __secure- (dash is part of the prefix) must be set with the secure flag from a secure page (https). __host- prefix: cookies with names starting with __host- must...
...et with the secure flag from a secure page (https). __host- prefix: cookies with names starting with __host- must be set with the secure flag, must be from a secure page (https), must not have a domain specified (and therefore aren't sent to subdomains) and the path must be /. expires=<date> optional the maximum lifetime of the cookie as an http-date timestamp. see date for the required
formatting. if unspecified, the cookie becomes a session cookie. a session finishes when the client shuts down, and session cookies will be removed. warning: many web browsers have a session restore feature that will save all tabs and restore them next time the browser is used. session cookies will also be restored, as if the browser was never closed. when an expires date is set, the deadlin...
... must exist in the requested url, or the browser won't send the cookie header. the forward slash (/) character is interpreted as a directory separator, and subdirectories will be matched as well: for path=/docs, /docs, /docs/web/, and /docs/web/http will all match. secure optional a secure cookie is only sent to the server when a request is made with the https: scheme. (however, confidential in
formation should never be stored in http cookies, as the entire mechanism is inherently insecure and doesn't encrypt any in
formation.) note: insecure sites (http:) can't set cookies with the secure attribute (since chrome 52 and firefox 52). httponly optional forbids javascript from accessing the cookie, for example, through the document.cookie property. note that a cookie that has been created w...
Proxy servers and tunneling - HTTP
rward proxies can hide the identities of clients whereas reverse proxies can hide the identities of servers. reverse proxies have several use cases, a few are: load balancing: distribute the load to several web servers, cache static content: offload the web servers by caching static content like pictures, compression: compress and optimize content to speed up load time. ...
...to several web servers, cache static content: offload the web servers by caching static content like pictures, compression: compress and optimize content to speed up load time. forwarding client in
formation through proxies proxies can make requests appear as if they originated from the proxy's ip address. this can be useful if a proxy is used to provide client anonymity, but in other cases in
formation from the original request is lost. the ip address of the original client is often used for debugging, statistics, or generating location-dependent content. ...
... in
formation through proxies proxies can make requests appear as if they originated from the proxy's ip address. this can be useful if a proxy is used to provide client anonymity, but in other cases in
formation from the original request is lost. the ip address of the original client is often used for debugging, statistics, or generating location-dependent content. a common way to disclose this in
formation is by using the following http headers: the standardized header: forwarded contains in
formation from the client-facing side of proxy servers that is altered or lost when a proxy is involved in the path of the request. or the de-facto standard versions: x-forwarded-for identifies the originating ip addresses of a client connecting to a web server through an http proxy or a load b...
...-forwarded-for identifies the originating ip addresses of a client connecting to a web server through an http proxy or a load balancer. x-forwarded-host identifies the original host requested that a client used to connect to your proxy or load balancer. x-forwarded-proto identifies the protocol (http or https) that a client used to connect to your proxy or load balancer. to provide in
formation about the proxy itself (not about the client connecting to it), the via header can be used. via added by proxies, both forward and reverse proxies, and can appear in the request headers and the response headers. http tunneling tunneling transmits private network data and protocol in
formation through public network by encapsulating the data. http tunneling is using a protocol of higher...
HTTP resources and specifications - HTTP
cs and content proposed standard rfc 7232 hypertext transfer protocol (http/1.1): conditional requests proposed standard rfc 7233 hypertext transfer protocol (http/1.1): range requests proposed standard rfc 7234 hypertext transfer protocol (http/1.1): caching proposed standard rfc 5861 http cache-control extensions for stale content in
formational rfc 8246 http immutable responses proposed standard rfc 7235 hypertext transfer protocol (http/1.1): authentication proposed standard rfc 6265 http state management mechanism defines cookies proposed standard draft spec cookie prefixes ietf draft draft spec same-site cookies ietf draft draft spec dep...
... proposed standard rfc 6265 http state management mechanism defines cookies proposed standard draft spec cookie prefixes ietf draft draft spec same-site cookies ietf draft draft spec deprecate modification of 'secure' cookies from non-secure origins ietf draft rfc 2145 use and interpretation of http version numbers in
formational rfc 6585 additional http status codes proposed standard rfc 7538 the hypertext transfer protocol status code 308 (permanent redirect) proposed standard rfc 7725 an http status code to report legal obstacles on the standard track rfc 2397 the "data" url scheme proposed standard rfc 3986 uni
form resource identifier (uri)...
... an http status code to report legal obstacles on the standard track rfc 2397 the "data" url scheme proposed standard rfc 3986 uni
form resource identifier (uri): generic syntax internet standard rfc 5988 web linking defines the link header proposed standard experimental spec hypertext transfer protocol (http) keep-alive header in
formational (expired) draft spec http client hints ietf draft rfc 7578 returning values from
forms: multipart/
form-data proposed standard rfc 6266 use of the content-disposition header field in the hypertext transfer protocol (http) proposed standard rfc 2183 communicating presentation in
formation in internet messages: the content-disposition he...
...pplication-layer protocol negotiation extension used to negotiate http/2 at the transport to save an extra request/response round trip. proposed standard rfc 6454 the web origin concept proposed standard fetchthe definition of 'cors' in that specification. ...
About JavaScript - JavaScript
overy (javascript programs can decompile function bodies back into their source text). for a more in depth discussion of javascript programming follow the javascript resources links below. what javascript implementations are available? the mozilla project provides two javascript implementations. the first ever javascript was created by brendan eich at netscape, and has since been updated to con
form to ecma-262 edition 5 and later versions. this engine, code named spidermonkey, is implemented in c/c++. the rhino engine, created primarily by norris boyd (also at netscape) is a javascript implementation written in java. like spidermonkey, rhino is ecma-262 edition 5 compliant. several major runtime optimizations such as tracemonkey (firefox 3.5), jägermonkey (firefox 4) and ionmonkey were ad...
...hino engine, created primarily by norris boyd (also at netscape) is a javascript implementation written in java. like spidermonkey, rhino is ecma-262 edition 5 compliant. several major runtime optimizations such as tracemonkey (firefox 3.5), jägermonkey (firefox 4) and ionmonkey were added to the spidermonkey javascript engine over time. work is always ongoing to improve javascript execution per
formance. besides the above implementations, there are other popular javascript engines such as:- google's v8, which is used in the google chrome browser and recent versions of opera browser. this is also the engine used by node.js. the javascriptcore (squirrelfish/nitro) used in some webkit browsers such as apple safari. carakan in old versions of opera. the chakra engine used in internet expl...
...re are other popular javascript engines such as:- google's v8, which is used in the google chrome browser and recent versions of opera browser. this is also the engine used by node.js. the javascriptcore (squirrelfish/nitro) used in some webkit browsers such as apple safari. carakan in old versions of opera. the chakra engine used in internet explorer (although the language it implements is
formally called "jscript" in order to avoid trademark issues). each of mozilla's javascript engines expose a public api which application developers can use to integrate javascript into their software. by far, the most common host environment for javascript is web browsers. web browsers typically use the public api to create host objects responsible for reflecting the dom into javascript. another c...
... for reflecting the dom into javascript. another common application for javascript is as a (web) server side scripting language. a javascript web server would expose host objects representing a http request and response objects, which could then be manipulated by a javascript program to dynamically generate web pages. node.js is a popular example of this. javascript resources spidermonkey in
formation specific to mozilla's implementation of javascript in c/c++ engine (aka spidermonkey), including how to embed it in applications. rhino in
formation specific to the javascript implementation written in java (aka rhino). language resources pointers to published javascript standards. a re-introduction to javascript javascript guide and javascript reference. javascript® is a trademar...
Regular expression syntax cheatsheet - JavaScript
character classes if you are looking to contribute to this document, please also edit the original article characters meaning . has one of the following meanings: matches any single character except line terminators: \n, \r, \u2028 or \u2029. ...
... the underscore. equivalent to [a-za-z0-9_]. for example, /\w/ matches "a" in "apple", "5" in "$5.28", and "3" in "3d". \w matches any character that is not a word character from the basic latin alphabet. equivalent to [^a-za-z0-9_]. for example, /\w/ or /[^a-za-z0-9_]/ matches "%" in "50%". \s matches a single white space character, including space, tab,
form feed, line feed, and other unicode spaces. equivalent to [ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]. for example, /\s\w*/ matches " bar" in "foo bar". \s matches a single character other than white space. equivalent to [^ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]. for example, /\s\w*/ matches "foo" in "foo bar". ...
... \s matches a single character other than white space. equivalent to [^ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]. for example, /\s\w*/ matches "foo" in "foo bar". \t matches a horizontal tab. \r matches a carriage return. \n matches a linefeed. \v matches a vertical tab. \f matches a
form-feed. [\b] matches a backspace. if you're looking for the word-boundary character (\b), see boundaries. \0 matches a nul character. do not follow this with another digit. \cx matches a control character using caret notation, where "x" is a letter from a–z (corresponding to codepoints u+0001–u+001f). for example, /\cm/ matches "\r" in "\r\n". ...
... in an array whose members are in the same order as the left parentheses in the capturing group. this is usually just the order of the capturing groups themselves. this becomes important when capturing groups are nested. matches are accessed using the index of the the result's elements ([1], ..., [n]) or from the predefined regexp object's properties ($1, ..., $9). capturing groups have a per
formance penalty. if you don't need the matched substring to be recalled, prefer non-capturing parentheses (see below). string.match() won't return groups if the /.../g flag is set. however, you can still use string.matchall() to get all matches. \n where "n" is a positive integer. a back reference to the last substring matching the n parenthetical in the regular expression (...
Unicode property escapes - JavaScript
may be written nd, digit, or decimal_number). for most values, the unicodepropertyname part and equals sign may be omitted. if a unicodepropertyname is specified, the value must correspond to the property type given. note: as there are many properties and values available, we will not describe them exhaustively here but rather provide various examples rationale before es2018 there was no per
formance-efficient way to match characters from different sets based on scripts (like macedonian, greek, georgian etc.) or propertyname (like emoji etc) in javascript. check out tc39 proposal on unicode property escapes for more info. examples general categories general categories are used to classify unicode characters and subcategories are available to define a more precise categorization. it is ...
...ers from different sets based on scripts (like macedonian, greek, georgian etc.) or propertyname (like emoji etc) in javascript. check out tc39 proposal on unicode property escapes for more info. examples general categories general categories are used to classify unicode characters and subcategories are available to define a more precise categorization. ...
...categorization. it is possible to use both short or long
forms in unicode property escapes. they can be used to match letters, numbers, symbols, punctuations, spaces, etc. for a more exhaustive list of general categories, please refer to the unicode specification. ...
......
JavaScript error reference - JavaScript
end the problem in your code. for a beginner's introductory tutorial on fixing javascript errors, see what went wrong? troubleshooting javascript. list of errors in this list, each page is listed by name (the type of error) and message (a more detailed human-readable error message). together, these two properties provide a starting point toward understanding and resolving the error. ...
...onreferenceerror: deprecated caller or arguments usagereferenceerror: invalid assignment left-hand sidereferenceerror: reference to undefined property "x"syntaxerror: "0"-prefixed octal literals and octal escape seq. are deprecatedsyntaxerror: "use strict" not allowed in function with non-simple parameterssyntaxerror: "x" is a reserved identifiersyntaxerror: json.parse: bad parsingsyntaxerror: mal
formed
formal parametersyntaxerror: unexpected tokensyntaxerror: using //@ to indicate sourceurl pragmas is deprecated. use //# insteadsyntaxerror: a declaration in the head of a for-of loop can't have an initializersyntaxerror: applying the "delete" operator to an unqualified name is deprecatedsyntaxerror: for-in loop head declarations may not have initializerssyntaxerror: function statement requires...
...error: identifier starts immediately after numeric literalsyntaxerror: illegal charactersyntaxerror: invalid regular expression flag "x"syntaxerror: missing ) after argument listsyntaxerror: missing ) after conditionsyntaxerror: missing : after property idsyntaxerror: missing ; before statementsyntaxerror: missing = in const declarationsyntaxerror: missing ] after element listsyntaxerror: missing
formal parametersyntaxerror: missing name after . operatorsyntaxerror: missing variable namesyntaxerror: missing } after function bodysyntaxerror: missing } after property listsyntaxerror: redeclaration of
formal parameter "x"syntaxerror: return not in functionsyntaxerror: test for equality (==) mistyped as assignment (=)?syntaxerror: unterminated string literaltypeerror: "x" has no propertiestypeerro...
...not use "in" operator to search for "x" in "y"typeerror: cyclic object valuetypeerror: invalid "instanceof" operand "x"typeerror: invalid array.prototype.sort argumenttypeerror: invalid argumentstypeerror: invalid assignment to const "x"typeerror: property "x" is non-configurable and can't be deletedtypeerror: setting getter-only property "x"typeerror: variable "x" redeclares argumenturierror: mal
formed uri sequencewarning: 08/09 is not a legal ecma-262 octal constantwarning: -file- is being assigned a //# sourcemappingurl, but already has onewarning: date.prototype.tolocale
format is deprecatedwarning: javascript 1.6's for-each-in loops are deprecatedwarning: string.x is deprecated; use string.prototype.x insteadwarning: expression closures are deprecatedwarning: unreachable code after return ...
Array.prototype.map() - JavaScript
turn a return a; }; } examples mapping an array of numbers to an array of square roots the following code takes an array of numbers and creates a new array containing the square roots of the numbers in the first array. ...
...s an array of numbers and creates a new array containing the square roots of the numbers in the first array. let numbers = [1, 4, 9] let roots = numbers.map(function(num) { return math.sqrt(num) }) // roots is now [1, 2, 3] // numbers is still [1, 4, 9] using map to re
format objects in an array the following code takes an array of objects and creates a new array containing the newly re
formatted objects. ...
...et roots = numbers.map(function(num) { return math.sqrt(num) }) // roots is now [1, 2, 3] // numbers is still [1, 4, 9] using map to re
format objects in an array the following code takes an array of objects and creates a new array containing the newly re
formatted objects. ...
...s is still [1, 4, 9] using map to re
format objects in an array the following code takes an array of objects and creates a new array containing the newly re
formatted objects. let kvarray = [{key: 1, value: 10}, {key: 2, value: 20}, {key: 3, value: 30}] let re
formattedarray = kvarray.map(obj => { let robj = {} robj[obj.key] = obj.value return robj }) // re
formattedarray is now [{1: 10}, {2: 20}, {3: 30}], // kvarray is still: // [{key: 1, value: 10}, // {key: 2, value: 20}, // {key: 3, value: 30}] mapping an array of numbers using a function containing an argument the following code shows how map works when a function requiring one argument is used with it. the argument will automatically be assigned from each element of the array as map loops th...
Date() constructor - JavaScript
date objects contain a number that represents milliseconds since 1 january 1970 utc. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new date() new date(value) new date(datestring) new date(year, monthindex [, day [, hours [, minutes [, seconds [, milliseconds]]]]]) note: the only correct way to instantiate a new date object is by using the new operator. ...
...st. syntax new date() new date(value) new date(datestring) new date(year, monthindex [, day [, hours [, minutes [, seconds [, milliseconds]]]]]) note: the only correct way to instantiate a new date object is by using the new operator. if you simply call the date object directly, such as now = date(), the returned value is a string rather than a date object. parameters there are four basic
forms for the date() constructor: no parameters when no parameters are provided, the newly-created date object represents the current date and time as of the time of instantiation. time value or timestamp number value an integer value representing the number of milliseconds since january 1, 1970, 00:00:00 utc (the ecmascript epoch, equivalent to the unix epoch), with leap seco...
...ue or timestamp number value an integer value representing the number of milliseconds since january 1, 1970, 00:00:00 utc (the ecmascript epoch, equivalent to the unix epoch), with leap seconds ignored. keep in mind that most unix timestamp functions are only accurate to the nearest second. timestamp string datestring a string value representing a date, specified in a
format recognized by the date.parse() method. (these
formats are ietf-compliant rfc 2822 timestamps, and also strings in a version of iso8601.) note: parsing of date strings with the date constructor (and date.parse(), which works the same way) is strongly discouraged due to browser differences and inconsistencies. support for rfc 2822
format strings is by convention only. support ...
... by the date.parse() method. (these
formats are ietf-compliant rfc 2822 timestamps, and also strings in a version of iso8601.) note: parsing of date strings with the date constructor (and date.parse(), which works the same way) is strongly discouraged due to browser differences and inconsistencies. support for rfc 2822
format strings is by convention only. support for iso 8601
formats differs in that date-only strings (e.g. "1970-01-01") are treated as utc, not local. individual date and time component values given at least a year and month, this
form of date() returns a date object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. any missing fields are given the lowest possible ...
Intl.PluralRules.supportedLocalesOf() - JavaScript
the intl.pluralrules.supportedlocalesof() method returns an array containing those of the provided locales that are supported in plural
formatting without having to fall back to the runtime's default locale. syntax intl.pluralrules.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings. for the general
form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are lookup and best fit; the default is best fit. ...
...ules.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings. for the general
form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are lookup and best fit; the default is best fit. for in
formation about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in plural
formatting without having to fall back to the runtime's default locale. description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in p...
...about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in plural
formatting without having to fall back to the runtime's default locale. description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in plural
formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. ...
...rray with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in plural
formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof() assuming a runtime that supports indonesian and german but not balinese in plural
formatting, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is neither relevant to plural
formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the lookup algorithm here — a best fit matcher might decide that indonesian is an adequate match for balinese since most b...
Object.fromEntries() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax object.fromentries(iterable); parameters iterable an iterable such as array or map or other objects implementing the iterable protocol. return value a new object whose properties are given by the entries of the iterable. description the object.fromentries() method takes a list of key-value pairs and returns a new object whose properties are given by those entries. ...
...turns a new object whose properties are given by those entries. the iterable argument is expected to be an object that implements an @@iterator method, that returns an iterator object, that produces a two element array-like object, whose first element is a value that will be used as a property key, and whose second element is the value to associate with that property key. object.fromentries() per
forms the reverse of object.entries(). examples converting a map to an object with object.fromentries, you can convert from map to object: const map = new map([ ['foo', 'bar'], ['baz', 42] ]); const obj = object.fromentries(map); console.log(obj); // { foo: "bar", baz: 42 } converting an array to an object with object.fromentries, you can convert from array to object: const arr = [ ['0', 'a'],...
...for more detai...
...for more details, refer to: https://discourse.mozilla.org/t/mdn-rfc-001-mdn-wiki-pages-shouldnt-be-a-distributor-of-polyfills/24500 specifi...
RegExp - JavaScript
rototype.compile() (re-)compiles a regular expression during execution of a script. regexp.prototype.exec() executes a search for a match in its string parameter. regexp.prototype.test() tests for a match in its string parameter. regexp.prototype.tostring() returns a string representing the specified object. overrides the object.prototype.tostring() method. regexp.prototype[@@match]() per
forms match to given string and returns match result. regexp.prototype[@@matchall]() returns all matches of the regular expression against a string. regexp.prototype[@@replace]() replaces matches in given string with new substring. regexp.prototype[@@search]() searches the match in given string and returns the index the pattern found in the string. regexp.prototype[@@split]() splits given stri...
...ular expression against a string. regexp.prototype[@@replace]() replaces matches in given string with new substring. regexp.prototype[@@search]() searches the match in given string and returns the index the pattern found in the string. regexp.prototype[@@split]() splits given string into an array by separating the string into substrings. examples using a regular expression to change data
format the following script uses the replace() method of the string instance to match a name in the
format first last and output it in the
format last, first. in the replacement text, the script uses $1 and $2 to indicate the results of the corresponding matching parentheses in the regular expression pattern. let re = /(\w+)\s(\w+)/ let str = 'john smith' let newstr = str.replace(re, '$2, $1') cons...
...ses $1 and $2 to indicate the results of the corresponding matching parentheses in the regular expression pattern. let re = /(\w+)\s(\w+)/ let str = 'john smith' let newstr = str.replace(re, '$2, $1') console.log(newstr) this displays "smith, john". using regular expression to split lines with different line endings/ends of line/line breaks the default line ending varies depending on the plat
form (unix, windows, etc.). the line splitting provided in this example works on all plat
forms. let text = 'some text\nand some more\r\nand yet\rthis is the end' let lines = text.split(/\r\n|\r|\n/) console.log(lines) // logs [ 'some text', 'and some more', 'and yet', 'this is the end' ] note that the order of the patterns in the regular expression matters. using regular expression on multiple lin...
...d some more', 'and yet', 'this is the end' ] note that the order of the patterns in the regular expression matters. using regular expression on multiple lines let s = 'please yes\nmake my day!' s.match(/yes.*day/); // returns null s.match(/yes[^]*day/); // returns ["yes\nmake my day"] using a regular expression with the sticky flag the sticky flag indicates that the regular expression per
forms sticky matching in the target string by attempting to match starting at regexp.prototype.lastindex. let str = '#foo#' let regex = /foo/y regex.lastindex = 1 regex.test(str) // true regex.lastindex = 5 regex.test(str) // false (lastindex is taken into account with sticky flag) regex.lastindex // 0 (reset after match failure) the difference between the sticky flag and the global ...
String.prototype.replace() - JavaScript
he new substring to be used to replace the matches to the given regexp or substr. the arguments supplied to this function are described in the "specifying a function as a parameter" section below. return value a new string, with some or all matches of a pattern replaced by a replacement. description this method does not change the calling string object. it simply returns a new string. to per
form a global search and replace, include the g switch in the regular expression. specifying a string as a parameter the replacement string can include the following special replacement patterns: pattern inserts $$ inserts a "$". $& inserts the matched substring. $` inserts the portion of the string that precedes the matched substring. $'...
... $<name> where name is a capturing group name. if the group is not in the regular expressions (or not in the match), this will resolve to the empty string. only available in browser versions supporting named capturing groups. specifying a function as a parameter you can specify a function as the second parameter. in this case, the function will be invoked after the match has been per
formed. the function's result (return value) will be used as the replacement string. (note: the above-mentioned special replacement patterns do not apply in this case.) note that the function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. the arguments to the function are as follows: possible name supplied va...
...ies the matched characters in this example, all occurrences of capital letters in the string are converted to lower case, and a hyphen is inserted just before the match location. the important thing here is that additional operations are needed on the matched item before it is given back as a replacement. ...
...in the string are converted to lower case, and a hyphen is inserted just before the match location. the important thing here is that additional operations are needed on the matched item before it is given back as a replacement. the replacement function accepts the matched snippet as its parameter, and uses it to trans
form the case and concatenate the hyphen before returning. function stylehyphen
format(propertyname) { function uppertohyphenlower(match, offset, string) { return (offset > 0 ? '-' : '') + match.tolowercase(); } return propertyname.replace(/[a-z]/g, uppertohyphenlower); } given stylehyphen
format('bordertop'), this returns 'border-top'. because we want to further trans
form the result of the match before the final substitution is made, we must use a function. this forc...
Property accessors - JavaScript
ixed in a method. put another way, this does not necessarily refer to the object containing a method. instead, this is "passed" by the function call. see method binding. examples bracket notation vs. eval javascript novices often make the mistake of using eval() where the bracket notation can be used instead. for example, the following syntax is often seen in many scripts. ...
...n a method. put another way, this does not necessarily refer to the object containing a method. instead, this is "passed" by the function call. see method binding. examples bracket notation vs. eval javascript novices often make the mistake of using eval() where the bracket notation can be used instead. for example, the following syntax is often seen in many scripts. ...
...y, this does not necessarily refer to the object containing a method. instead, this is "passed" by the function call. see method binding. examples bracket notation vs. eval javascript novices often make the mistake of using eval() where the bracket notation can be used instead. for example, the following syntax is often seen in many scripts. ...
...sed" by the function call. see method binding. examples bracket notation vs. eval javascript novices often make the mistake of using eval() where the bracket notation can be used instead. for example, the following syntax is often seen in many scripts. x = eval('document.
forms.
form_name.elements.' + str
formcontrol + '.value') eval() is slow and should be avoided whenever possible. also, str
formcontrol would have to hold an identifier, which is not required for names and ids of
form controls. it is better to use bracket notation instead: x = document.
forms['
form_name'].elements[str
formcontrol].value specifications specification ecmascript (ecma-262)the definition of 'property accessors' in that specification. ...
throw - JavaScript
} } try { // statements to try var mymonth = 15; // 15 is out of bound to raise the exception var monthname = getmonthname(mymonth); } catch (e) { monthname = 'unknown'; console.error(e.message, e.name); // pass exception object to err handler } another example of throwing an object the following example tests an input string for a u.s. zip code. if the zip code uses an invalid
format, the throw statement throws an exception by creating an object of type zipcode
formatexception. /* * creates a zipcode object. * * accepted
formats for a zip code are: * 12345 * 12345-6789 * 123456789 * 12345 6789 * * if the argument passed to the zipcode constructor does not * con
form to one of these patterns, an exception is thrown. */ function zipcode(zip) { zip = ...
... */ const zipcode_invalid = -1; const zipcode_unknown_error = -2; func...
... */ const zipcode_invalid = -1; const zipcode_unknown_error = -2; function verifyzipcode(z) { try { z = new...
...code value will be the first match in the string this.value = zip.match(pattern)[0]; this.valueof = function() { return this.value }; this.tostring = function() { return string(this.value) }; } else { throw new zipcode
formatexception(zip); } } function zipcode
formatexception(value) { this.value = value; this.message = 'does not con
form to the expected
format for a zip code'; this.tostring = function() { return this.value + this.message; }; } /* * this could be in a script that validates address data * for us addresses. */ const zipcode_invalid = -1; const zipcode_unknown_error = -2; function verifyzipcode(z) { try { z = new zipcode(z); } catch (e) { if (e instanceof zipcode
formatexception) { ...
related_applications - Web app manifests
type array mandatory no the related_applications field is an array of objects specifying native applications that are installable by, or accessible to, the underlying plat
form — for example, a native android application obtainable through the google play store. such applications are intended to be alternatives to the manifest's website that provides similar/equivalent functionality — like the native app equivalent. note: developer can specify that the native applications are preferred over the web application by setting prefer_related_applications to true. ...
...n obtainable through the google play store. such applications are intended to be alternatives to the manifest's website that provides similar/equivalent functionality — like the native app equivalent. note: developer can specify that the native applications are preferred over the web application by setting prefer_related_applications to true. ...
...ilar/equivalent functionality — like the native app equivalent. note: developer can specify that the native applications are preferred over the web application by setting prefer_related_applications to true. examples "related_applications": [ { "plat
form": "play", "url": "https://play.google.com/store/apps/details?id=com.example.app1", "id": "com.example.app1" }, { "plat
form": "itunes", "url": "https://itunes.apple.com/app/example-app1/id123456789" } ] related application values application objects may contain the following values: member description plat
form the plat
form on which the application can be found. list of available values url the url at which the application can be found. id the id used to repr...
...le.com/app/example-app1/id123456789" } ] related application values application objects may contain the following values: member description plat
form the plat
form on which the application can be found. list of available values url the url at which the application can be found. id the id used to represent the application on the specified plat
form. specification specification status comment feedback web app manifestthe definition of 'related_applications' in that specification. working draft initial definition. web app manifest working group drafts ...
Web app manifests
web app manifests are part of a collection of web technologies called progressive web apps (pwas), which are websites that can be installed to a device’s homescreen without an app store. unlike regular web apps with simple homescreen links or bookmarks, pwas can be downloaded in advance and can work offline, as well as use regular web apis. the web app manifest provides in
formation about a web application in a json text file, necessary for the web app to be downloaded and be presented to the user similarly to a native app (e.g., be installed on the homescreen of a device, providing users with quicker access and a richer experience). pwa manifests include its name, author, icon(s), version, description, and list of all the necessary resources (among other things). can pwa manifest cont...
...file, necessary for the web app to be downloaded and be presented to the user similarly to a native app (e.g., be installed on the homescreen of a device, providing users with quicker access and a richer experience). pwa manifests include its name, author, icon(s), version, description, and list of all the necessary resources (among other things). ...
...users with quicker access and a richer experience). pwa manifests include its name, author, icon(s), version, description, and list of all the necessary resources (among other things). can pwa manifest contain comments? it is a json-
formatted file, with one exception: it is allowed to contain "//"-style comments. members web manifests can contain the following keys. ...
...n96.png", "sizes": "96x96", "type": "image/png" }, { "src": "images/touch/homescreen144.png", "sizes": "144x144", "type": "image/png" }, { "src": "images/touch/homescreen168.png", "sizes": "168x168", "type": "image/png" }, { "src": "images/touch/homescreen192.png", "sizes": "192x192", "type": "image/png" }], "related_applications": [{ "plat
form": "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...
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. ...
...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. ...
... 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. this guide covers techniques you can use to develop web content that meets your media needs while providing the most broadly compatible experience possible. topics we will examine fallbacks, baseline media
formats, and error handling practices that will let your content work in as many situations as possible. using poster frames a poster frame is a still image that's representative of the content of a video. this may be simply the first frame of video; however, in many cases, the first frame is blank, or contains nothing but the logo of a business, or some other image that doesn't give the reader any ...
...-quality version is available to be displayed. we'll look at both of these scenarios and how to implement them. poster frames for video progressive images images—whether embedded using <img> or <picture>—don't support a concept similar to poster frames. however, there are ways to present an image in low quality while it's still loading. this requires creating your images using progressive
formats, such as progressive jpeg or interlaced png. once your image has been converted to progressive
form, you can simply use it as usual. <img src="/images/stafff-photo-huge-progressive.jpg" alt="staff photo, taken in january of 1972"> when using a progressive image, the data is stored in such a way that the browser is able to render a low-quality representation of the image as soon as poss...
Digital video concepts - Web media technologies
in this article, we explore important concepts that are useful to understand in order to fully grasp how to work with video on the web. encoding color representing the colors in an image or video requires several values for each pixel. what those values are depends on how you "split up" the color when converting it to numeric
form. there are several color models, and video codec makes use of one or more of these to represent their pixels during the encoding process as well as after decoding the video frames. rgb most computer graphics models use the rgb color system, wherein some number of bits of data are used to represent each of the red, green, and blue components of the color of an individual pixel, and an image is comprised of a two-dimensional array of these pixels. there ...
... pixels. yuv concepts yuv works by defining a color space with three components: luma (y') the brightness of the pixel. without the other two components, the luma of each pixel in the frame produces a greyscale representation of the image. in bt.709 (used for hdtv), for example, the luma value is the weighted sum of the gamma-corrected red, green, and blue components of the pixel, using the
formula y' = 0.2126r' + 0.7152g' + 0.0722b'. this weighting is per
formed because of the previously-mentioned ratio of green, red, and blue cones in the eye. blue-difference (u or cb) the blue-difference component of the chroma, or color, of the color sample. this value is computed by subtracting the luma from the gamma corrected blue value; that is, u = b' - y'. red-difference (v or cr) the red-di...
...r pixels of each row in the block of luminance data are used in the decoded image. looking at 4:2:0 chroma subsampling, in the first column, the value 2 indicates that the first row of chroma data has two samples in it; the 0 indicates that the second row has no chroma samples of its own, and that the first row's samples should be duplicated to the second row. in other words, we're taking color in
formation from every other row of pixels in the source image and applying them to the greyscale image represented by the luma. the second column shows 4:2:2 subsampling. the top row of four luma samples has two chroma samples applied to it, and the bottom row of luma has two samples applied to it as well. the eight pixels represented by this block, then, have four chroma samples shared among them. t...
...r, the values of y', u, and v are not typically stored together, one sample per pixel, the way rgb images are stored in memory. each frame of video is represented by a matrix of luma values, y, with each pixel's color computed using the values in the u and v matrices. for example, in the av1 codec, a record stores the encoded luma for a tile, and a second record contains the chroma data in the
form of the u and v values. in broadcast television, the luma signal is the primary signal, while the chrominance data is sent on a subcarrier. the jpeg file type's compression works by first converting the image to the y'uv color system, then compressing that data. each of y', cb, and cr are able to have values from 0 to 255. ...
Add to Home screen - Progressive web apps (PWAs)
eb technologies (a2hs included) will work only on secure contexts. to have a manifest file with the correct fields filled in, linked from the html head. to have an appropriate icon available for displaying on the home screen. chrome additionally requires the app to have a service worker registered (e.g., so it can function when offline). manifest the web manifest is written in standard json
format and should be placed somewhere inside your app directory (in the root is probably best) with the name somefilename.webmanifest (we've chosen manifest.webmanifest). it contains multiple fields that define certain in
formation about the web app and how it should behave. note: the .webmanifest extension is specified in the media type registration section of the specification, but generally browse...
...es/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 can include more sizes if you want; android will choose the most appropriate size for each different use case. you could also decide to include different types of icons so devices can use the best one they are able to (e.g., chrome already supports the webp
format). note that the type member in each icon's object specifies the icon's mimetype, so the browser can quickly read what type the icon is, and then ignore it and move to a different icon if it doesn't support it. in terms of how to design the icon, you should follow the same best practices you'd follow for any android icon (see the android icon design guidelines). link the html to the manifest ...
...ssary files. the service worker is registered against the site with the final code block in the index.js file. we then cache all the site's assets using the cache api, and serve them from the cache instead of the network using the code in the sw.js file. a2hs on desktop while originally intended to improve user experience on mobile oses, there is movement to make pwas installable on desktop plat
forms too. note: at the time of writing, the functionality described below was only supported in newer versions of chrome — by default on windows, and behind the #enable-desktop-pwas flag on macos. adding an install button to make our pwa installable on desktop, we first added a button to our document to allow users to do the installation — this isn't made available automatically on desktop a...
...the a2hs prompt'); } else { console.log('user dismissed the a2hs prompt'); } deferredprompt = null; }); }); }); so here we: call event.preventdefault() to stop chrome 67 and earlier from calling the install prompt automatically (this behavior changed in chrome 68). store the event object in the deferredprompt variable so it can be used later on to per
form the actual installation. set the button to display: block so it appears in the ui for the user to click. set a click handler for the button. the click handler contains the following steps: hide the button again with display: none — it is no longer needed once the app is installed. use the prompt() method available on the beforeinstallprompt event object (stored in deferredprompt) to tri...
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
available. two apis, one goal the push api and notifications api are two separate apis, but they work well together when you want to provide engaging functionality in your app. push is used to deliver new content from the server to the app without any client-side intervention, and its operation is handled by the app's service worker. notifications can be used by the service worker to show new in
formation to the user, or at least alert them when something has been updated. they work outside of the browser window, just like service workers, so updates can be pushed and notifications can be shown when the app's page is out of focus or even closed. notifications let's start with notifications — they can work without push, but are very useful when combined with them. let’s look at them in ...
...ps. push push is more complicated than notifications — we need to subscribe to a server that will then send the data back to the app. the app's service worker will receive data from the push server, which can then be shown using the notifications system, or another mechanism if desired. the technology is still at a very early stage — some working examples use the google cloud messaging plat
form, but are being rewritten to support vapid (voluntary application identification), which offers an extra layer of security for your app. you can examine the service workers cookbook examples, try to set up a push messaging server using firebase, or build your own server (using node.js for example). as mentioned before, to be able to receive push messages, you have to have a service worker, the ba...
...on.pushmanager.getsubscription() .then( /* ... */ ); once the user is subscribed, they can receive push notifications from the server. from the server-side, the whole process has to be encrypted with public and private keys for security reasons — allowing everyone to send push messages unsecured using your app would be a terrible idea. see the web push data encryption test page for detailed in
formation about securing the server. the server stores all the in
formation received when the user subscribed, so the messages can be sent later on when needed. to receive push messages, we can listen to the push event in the service worker file: self.addeventlistener('push', function(e) { /* ... */ }); the data can be retrieved and then shown as a notification to the user immediately. this, for exa...
... previous overview: progressive next ...
Mobile first - Progressive web apps (PWAs)
st is more about having the mobile implementation as a default layer to build on. we consider the overall experience during the planning stage, look at what subset of features will be available on mobile, desktop, etc. in tandem and how they will be implemented. ...
...e, we present the mobile layout and functionality as the default configuration provided, before additional in
formation is loaded on top of that, whenever appropriate. this means that mobiles (often the target devices with the least available memory, bandwidth or processing power available) can be given an experience suitable for them as quickly as possible, and as free as possible of extraneous in
formation. for example: if you are serving different styling and layout in
formation for different viewport sizes, etc., it makes more sense to include the narrow screen/mobile styling as the default styling before any media queries are encountered, rather than having desktop/wider screen styling first. this way, mobile devices don't have to load assets and other in
formation twice. if you are using...
... have less viewport size available. therefore, as well as splitting content into different views, and simplifying the interface and content on each view of your application for mobile as much as possible, it is also a good idea to not include visual effects such as shadows, animations, and gradients. you should at least consider it as an option, especially if you are experiencing slow or laggy per
formance when your application is running on mobile. control mechanisms control mechanisms are another large constraint on mobile devices. anyone who has ever tried to enter data into a
form on a mobile device, or even just navigated around a complex site, knows this well. therefore we should try to simplify things on mobile, keeping each view cut down to a single, simple purpose where possible, and...
...d try to simplify things on mobile, keeping each view cut down to a single, simple purpose where possible, and reducing the amount of typing users are expected to do. the latter will please desktop users as well as mobile users! usage context on top of everything else, you must consider the kinds of situations mobile devices will be used in, and the kinds of tasks users most commonly want to per
form on mobiles. a phrase you'll read in a few places is "one eyeball, one thumb", referring to how much of the user's attention you are likely to have. of course, your users will be concentrating on what they're doing, but they are likely to be in a car with bad lighting, or in a noisy bar with the sport on tv in the background! you need to consider this, and again make sure your content/functionalit...
Progressive web apps (PWAs)
pwa can be thought of as similar to ajax or other similar patterns that encompass a set of application attributes, including use of specific web technologies and techniques. this set of docs tells you all you need to know about them. ...
...pwa can be thought of as similar to ajax or other similar patterns that encompass a set of application attributes, including use of specific web technologies and techniques. this set of docs tells you all you need to know about them. ...
...of how a web browser handles its network requests and asset caching. with service workers, web developers can create reliably fast web pages and offline experiences. manifest file a json file that controls how your app appears to the user and ensures that progressive web apps are discoverable. it describes the name of the app, the start url, icons, and all of the other details necessary to trans
form the website into an app-like
format. pwa advantages pwas should be discoverable, installable, linkable, network independent, progressive, re-engageable, responsive, and safe. to find out more about what these mean, read progressive web app advantages. to find out how to implement pwas, read through our pwa developer guide. documentation <-- the temporary automatic list below will be replace...
...rkers. be sure to check out our further documentation if you want to learn more about the concepts behind the service worker api and how to use it in more detail. progressive loadingin previous articles we covered apis that help us make our js13kpwa example a progressive web app: service workers, web manifests, notifications and push. in this article we will go even further and improve the per
formance of the app by progressively loading its resources.progressive web app structurenow that we know the theory behind pwas, let's look at the recommended structure of an actual app. we will start with analyzing the js13kpwa application, why it is built that way, and what benefits it brings.pwa developer guidein the articles listed here, you'll find guides about every aspect of development specifi...
SVG Presentation Attributes - SVG: Scalable Vector Graphics
value: auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical|inherit; animatable: yes baseline-shift it allows repositioning ...
...entcolor) for the fill, stroke, stop-color, flood-color and lighting-color presentation attributes. value: <color>|inherit; animatable: yes color-interpolation it specifies the color space for gradient interpolations, color animations, and alpha compositing. value: auto|srgb|linearrgb|inherit; animatable: yes color-interpolation-filters it specifies the color space for imaging operations per
formed via filter effects. value: auto|srgb|linearrgb|inherit; animatable: yes color-profile deprecated since svg 2 it defines which color profile a raster image included through the <image> element should use. value: auto|srgb|linearrgb|<name>|<iri>|inherit; animatable: yes color-rendering it provides a hint to the browser about how to optimize its color interpolation and compositing operations...
...ols glyph orientation when the inline-progression-direction is horizontal. value: <angle>|inherit; animatable: no glyph-orientation-vertical deprecated since svg 2 it controls glyph orientation when the inline-progression-direction is vertical. value: auto|<angle>|inherit; animatable: no image-rendering it provides a hint to the browser about how to make speed vs. quality tradeoffs as it per
forms image processing. value: auto|optimizequality|optimizespeed; animatable: yes kerning deprecated since svg 2 it indicates whether the browser should adjust inter-glyph spacing. value: auto|<length>|inherit; animatable: yes letter-spacing it controls spacing between text characters. value: normal|<length>|inherit; animatable: yes lighting-color it defines the color of the light source for...
...l alignment a string of text. value: start|middle|end|inherit; animatable: yes text-decoration sets the appearance of decorative lines on text. value: none|underline|overline|line-through|blink|inherit; animatable: yes text-rendering hints about what tradeoffs to make as the browser renders text. value: auto|optimizespeed|optimizelegibility|geometricprecision|inherit; animatable: yes trans
form defines a list of trans
form definitions that are applied to an element and the element's children. value: <trans
form-list>; animatable: yes unicode-bidi - value:; animatable: - vector-effect specifies the vector effect to use when drawing an object. value: default|non-scaling-stroke|inherit|<uri>; animatable: yes visibility lets you control the visibility of graphical elements. value: ...
fill - SVG: Scalable Vector Graphics
mation it defines the final state of the animation. as a presentation attribute, it can be applied to any element but it only has an effect on the following eleven elements: <altglyph>, <circle>, <ellipse>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan>. for animation five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetrans
form>, and <set>. html,body,svg { height:100% } <svg viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"> <!-- simple color fill --> <circle cx="50" cy="50" r="40" fill="pink" /> <!-- fill circle with a gradient --> <defs> <radialgradient id="mygradient"> <stop offset="0%" stop-color="pink" /> <stop offset="100%" stop-color="black" /> </radialgradient> </def...
... (keep the state of the first animation frame) default value remove animatable no animatemotion for <animatemotion>, fill defines the final state of the animation. value freeze (keep the state of the last animation frame) | remove (keep the state of the first animation frame) default value remove animatable no animatetrans
form for <animatetrans
form>, fill defines the final state of the animation. value freeze (keep the state of the last animation frame) | remove (keep the state of the first animation frame) default value remove animatable no circle for <circle>, fill is a presentation attribute that defines the color of the circle. value <paint> defaul...
...be used as a css property. tspan for <tspan>, fill is a presentation attribute that defines the color of the text. value <paint> default value black animatable yes note: as a presentation attribute fill can be used as a css property. specifications specification status comment svg animations level 2the definition of 'trans
form' in that specification. editor's draft definition for animations scalable vector graphics (svg) 2the definition of 'fill' in that specification. candidate recommendation definition for shapes and texts. adds context-fill and context-stroke. scalable vector graphics (svg) 1.1 (second edition)the definition of 'fill' in that specification. recommendation init...
... ...
href - SVG: Scalable Vector Graphics
the href attribute defines a link to a resource as a reference url. the exact meaning of that link depends on the context of each element using it. note: specifications before svg 2 defined an xlink:href attribute, which is now rendered obsolete by the href attribute. fifteen elements are using this attribute: <a>, <animate>, <animatemotion>, <animatetrans
form>, <discard>, <feimage>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, and <use> html, body, svg { height: 100%; } <svg viewbox="0 0 160 40" xmlns="http://www.w3.org/2000/svg"> <a href="https://developer.mozilla.org/"><text x="10" y="25">mdn web docs</text></a> </svg> in svg a for <a>, href defines the location of the referenced object, expressed as a url reference. ...
...: 100%; } <svg viewbox="0 0 160 40" xmlns="http://www.w3.org/2000/svg"> <a href="https://developer.mozilla.org/"><text x="10" y="25">mdn web docs</text></a> </svg> in svg a for <a>, href defines the location of the referenced object, expressed as a url reference. value <url> default value none animatable yes animate, animatemotion, animatetrans
form, set for the <animate>, <animatemotion>, <animatetrans
form>, and <set>, href defines a url referring to the element which is the target of this animation element and which therefore will be modified over time. the url must point to exactly one target element which is capable of being the target of the given animation element. if the url points to multiple target elements, if the given target el...
...age. if the href attribute is not provided, then the target element will be the immediate parent element of the <discard> element. value <url> default value none animatable no feimage for <feimage>, href defines a url referring to an image resource or to an element. if both, the xlink:href and the href attribute are specified, the latter overrides the
former. value <url> default value none animatable yes image for <image>, href defines a url referring to the image to render. value <url> default value none animatable yes example html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <image href="/files/2917/fxlo...
... <url> default value none animatable yes specifications specification status comment scalable vector graphics (svg) 2the definition of 'href for <a>' in that specification. candidate recommendation defines href for the <a> element. svg animations level 2the definition of 'href for <animate>, <animatemotion>, <animatetrans
form>, and <set>' in that specification. editor's draft defines href for animation elements. svg animations level 2the definition of 'href for <discard>' in that specification. editor's draft defines href for the <discard> element. filter effects module level 1the definition of 'href for <feimage>' in that specification. candidate recommendation defines href for the...
<feColorMatrix> - SVG: Scalable Vector Graphics
| r' | | r1 r2 r3 r4 r5 | | r | | g' | | g1 g2 g3 g4 g5 | | g | | b' | = | b1 b2 b3 b4 b5 | * | b | | a' | | a1 a2 a3 a4 a5 | | a | | 1 | | 0 0 0 0 1 | | 1 | in simplified terms, below is how each color channel in the new pixel is calculated. the last row is ignored because its values are constant. ...
...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" trans
form="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" trans
form="translate(0 140)"...
... 0 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0" /> </filter> <use href="#circles" trans
form="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" trans
form="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" trans
form="translate(0 280)" filter="url(#colormehuerotate)" /> <text x="70" y="330">huerotate</text> <!-- luminancetoalpha -...
... working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition...
<linearGradient> - SVG: Scalable Vector Graphics
applied to fill or stroke of graphical elements. don't be confused with css linear-gradient() as css gradients can only apply to html elements where svg gradient can only apply to svg elements. ...
... value type: <url> ; default value: none; animatable: yes spreadmethod this attribute indicates how the gradient beha...
... </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 gradienttrans
form this attribute provides additional trans
formation to the gradient coordinate system. value type: <trans
form-list> ; default value: identity trans
form; 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 ...
...obal event attributes, document element 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, trans
form, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetrans
form>, <set>, <stop> specifications specification status comment scalable vector graphics (svg) 2the definition of '<lineargradient>' in that spec...
SVG animation with SMIL - SVG: Scalable Vector Graphics
although chrome 45 deprecated smil in favor of css animations and web animations, the chrome developers have since suspended that deprecation. firefox 4 introduced support for animating svg using synchronized multimedia integration language (smil). smil allows you to: animate the numeric attributes of an element (x, y, ...) animate trans
form attributes (translation or rotation) animate color attributes follow a motion path this is done adding an svg element like <animate> inside the svg element to animate. below are examples for the four different ways. animating attributes of an element the following example animates the cx attribute of a circle. to do so, we add an <animate> element inside the <circle> element. the important attributes for <animate> are: attributename...
...e <animate> elements. <svg width="300" height="100"> <title>attribute animation with smil</title> <rect x="0" y="0" width="300" height="100" stroke="black" stroke-width="1" /> <circle cx="0" cy="50" r="15" fill="blue" stroke="black" stroke-width="1"> <animate attributename="cx" from="0" to="500" dur="5s" repeatcount="indefinite" /> </circle> </svg> animating the trans
form attributes the <animatetrans
form> element let you animate trans
form attributes. this new element is necessary because we are not animating a simple attribute like x which is just a number. rotation attributes look like this: rotation(theta, x, y), where theta is the angle in degrees, and x and y are absolute positions. in the example below, we animate the center of the rotation and the angle. <...
...orm attributes. this new element is necessary because we are not animating a simple attribute like x which is just a number. rotation attributes look like this: rotation(theta, x, y), where theta is the angle in degrees, and x and y are absolute positions. in the example below, we animate the center of the rotation and the angle. ...
...the angle in degrees, and x and y are absolute positions. in the example below, we animate the center of the rotation and the angle. <svg width="300" height="100"> <title>svg smil animate with trans
form</title> <rect x="0" y="0" width="300" height="100" stroke="black" stroke-width="1" /> <rect x="0" y="50" width="15" height="34" fill="blue" stroke="black" stroke-width="1"> <animatetrans
form attributename="trans
form" begin="0s" dur="20s" type="rotate" from="0 60 60" to="360 100 60" repeatcount="indefinite" /> </rect> </svg> animation following a path the <animatemotion> element lets you animate an element position and rotation according to a path. the path is defined the same way as in <path>. you can set the attribute to def...
Other content in SVG - SVG: Scalable Vector Graphics
xt » apart from graphic primitives like rectangles and circles, svg offers a set of elements to embed other types of content in images as well. embedding raster images much like the img element in html svg has an image element to serve the same purpose. you can use it to embed arbitrary raster (and vector) images. ...
...ns to support at least png, jpeg and svg
format files. the embedded picture becomes a normal svg element. this means, that you can use clips, masks, filters, rotations and all other tools of svg on the content: <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"> <image x="90" y="-65" width="128" height="146" trans
form="rotate(45)" xlink:href="https://developer.mozilla.org/static/img/favicon144.png"/> </svg> screenshotlive sample embedding arbitrary xml since svg is an xml application, you can of course always embed arbitrary xml anywhere in an svg document. but then you have no means to define how the surrounding svg should react on the content. ...
...therefore the specification adds the <foreignobject> element to svg. its sole purpose is to be a container for other markup and a carrier for svg styling attributes (most prominently width and height to define the space the object will take). ...
...nt to svg. its sole purpose is to be a container for other markup and a carrier for svg styling attributes (most prominently width and height to define the space the object will take). the foreignobject element is a good way to embed xhtml in svg. if you have longer texts, the html layout is more suitable and comfortable than the svg text element. another often cited use case is the embedding of
formulas with mathml. for scientific applications of svg this is a very good way to join both worlds. note: please keep in mind, that the content of the foreignobject must be processable by the viewer. a standalone svg viewer is unlikely to be able to render html or mathml. since the foreignobject is an svg element, you can, like in the case of image, use any svg goodness with it, which then will be...
Same-origin policy - Web security
with a resource from another origin. it helps isolate potentially malicious documents, reducing possible attack vectors. definition of an origin two urls have the same origin if the protocol, port (if specified), and host are the same for both. you may see this referenced as the "scheme/host/port tuple", or just "tuple". ...
... for example, about:blank is often used as a url of new, empty popup windows into which the parent script writes content (e.g. via the window.open() mechanism). if this popup also contains javascript, that script would inherit the same origin as the script that created it. data: urls get a new, empty, security context. exceptions in internet explorer internet e...
...rent domain back to its original value. failure to do this may result in permission errors. cross-origin network access the same-origin policy controls interactions between two different origins, such as when you use xmlhttprequest or an <img> element. these interactions are typically placed into three categories: cross-origin writes are typically allowed. examples are links, redirects, and
form submissions. some http requests require preflight. cross-origin embedding is typically allowed. (examples are listed below.) cross-origin reads are typically disallowed, but read access is often leaked by embedding. for example, you can read the dimensions of an embedded image, the actions of an embedded script, or the availability of an embedded resource. here are some examples of resources ...
...lock cross-origin access to prevent cross-origin writes, check an unguessable token in the request — known as a cross-site request forgery (csrf) token. you must prevent cross-origin reads of pages that require this token. to prevent cross-origin reads of a resource, ensure that it is not embeddable. it is often necessary to prevent embedding because embedding a resource always leaks some in
formation about it. to prevent cross-origin embeds, ensure that your resource cannot be interpreted as one of the embeddable
formats listed above. browsers may not respect the content-type header. for example, if you point a <script> tag at an html document, the browser will try to parse the html as javascript. when your resource is not an entry point to your site, you can also use a csrf token to pr...
XML introduction - XML: Extensible Markup Language
xml (extensible markup language) is a markup language similar to html, but without predefined tags to use. instead, you define your own tags designed specifically for your needs. this is a powerful way to store data in a
format that can be stored, searched, and shared. most importantly, since the fundamental
format of xml is standardized, if you share or transmit xml across systems or plat
forms, either locally or over the internet, the recipient can still parse the data due to the standardized xml syntax. there are many languages based on xml, including xhtml, mathml, svg, xul, xbl, rss, and rdf. you can also define your own. structure of an xml document this sub-article in process writing... whole structure xml and xml based languages built on tags. xml declaration xml - decla...
...ocess writing... whole structure xml and xml based languages built on tags. xml declaration xml - declaration is not a tag. it is used for the transmission of the meta-data of a document. <?xml version="1.0" encoding="utf-8"?> attributes: version : used version xml in this document. encoding : used encoding in this document. comments <!-- comment --> "correct" xml (valid and well-
formed) Сorrect design rules for an xml document to be correct, the following conditions must be fulfilled: document must be well-
formed. document must con
form to all xml syntax rules. document must con
form to semantic rules, which are usually set in an xml schema or a dtd (document type definition). example <?xml version="1.0" encoding="utf-8"?> <message> <warning> hello world ...
...rning> --> </message> now let's look at a corrected version of that same document: <?xml version="1.0" encoding="utf-8"?> <message> <warning> hello world </warning> </message> a document that contains an undefined tag is invalid. for example, if we never defined the <warning> tag, the document above wouldn't be valid. most browsers offer a debugger that can identify poorly-
formed xml documents. entities like html, xml offers methods (called entities) for referring to some special reserved characters (such as a greater than sign which is used for tags). there are five of these characters that you should know: entity character description < < less than sign > > greater than sign & & ampersand ...
...o display xml data. if you don't define a specific way for the xml to be rendered, the raw xml is displayed in the browser. one way to style xml output is to specify css to apply to the document using the xml-stylesheet processing instruction. <?xml-stylesheet type="text/css" href="stylesheet.css"?> there is also another more powerful way to display xml: the extensible stylesheet language trans
formations (xslt) which can be used to trans
form xml into other languages such as html. this makes xml incredibly versatile. <?xml-stylesheet type="text/xsl" href="trans
form.xsl"?> recommendations this article is obviously only a very brief introduction to what xml is, with a few small examples and references to get you started. for more details about xml, you should look around on the web for more...
Index - XPath
tags and summary 1 xpath css selectors, dom, jxon, landing, path, xml, xpath, xslt xpath stands for xml path language. it uses a non-xml syntax to provide a flexible way of addressing (pointing to) different parts of an xml document. it can also be used to test addressed nodes within a document to determine whether they match a pattern or not. 2 axes trans
forming_xml_with_xslt, xpath, xpath_reference, xslt, xslt_reference for further in
formation on using xpath expressions, please see the for further reading section at the end of trans
forming xml with xslt document. also see the 'axes' section in the xpath spec. 3 ancestor axe, xpath no summary! 4 ancestor-or-self axe, xpath the ancestor-or-self axis indic...
... self axis indicates the context node itself. it can be abbreviated as a single period (.). 16 comparison of css selectors and xpath css, draft, needscontent, reference, selectors, xpath this article seeks to document the difference between css selectors and xpath for web developers to be able to better choose the right tool for the right job. 17 functions trans
forming_xml_with_xslt, xpath, xpath_reference, xslt, xslt_reference no summary! 18 boolean xslt, xslt_reference the boolean function evaluates an expression and returns true or false. 19 ceiling xslt, xslt_reference the ceiling function evaluates a decimal number and returns the smallest integer greater than or equal to the decimal number. 20 ...
...slt_reference the element-available function determines if an element is available and returns true or false. 27 false xslt, xslt_reference the false function returns boolean false. 28 floor xslt, xslt_reference the floor function evaluates a decimal number and returns the largest integer less than or equal to the decimal number. 29
format-number xslt, xslt_reference the
format-number function evaluates a number and returns a string representing the number in a given
format. 30 function-available xslt, xslt_reference the function-available function determines if a given function is available and returns boolean true or false. 31 generate-id xslt, xslt_reference the generat...
...4 unparsed-entity-url xslt, xslt_reference the unparsed-entity-url() function returns the uri of the unparsed entity with the given name. this is non-xml data referenced in the dtd of the source document. 55 index index, reference, xpath, xslt found 57 pages: 56 introduction to using xpath in javascript add-ons, dom, extensions, javascript, trans
forming_xml_with_xslt, web development, xml, xpath, xslt this document describes the interface for using xpath in javascript internally, in extensions, and from websites. mozilla implements a fair amount of the dom 3 xpath, which means that xpath expressions can be run against both html and xml documents. 57 xpath snippets example, snippets, xml, xpath, xslt this article pro...
Introduction to using XPath in JavaScript - XPath
as the namespaceresolver parameter. note: xpath defines qnames without a prefix to match only elements in the null namespace. there is no way in xpath to pick up the default namespace as applied to a regular element reference (e.g., p[@id='_myid'] for xmlns='http://www.w3.org/1999/xhtml'). to match default elements in a non-null namespace, you either have to refer to a particular element using a
form such as ['namespace-uri()='http://www.w3.org/1999/xhtml' and name()='p' and @id='_myid'] (this approach works well for dynamic xpath's where the namespaces might not be known) or use prefixed name tests, and create a namespace resolver mapping the prefix to the namespace. read more on how to create a user-defined namespace resolver, if you wish to take the latter approach. notes adapts any dom ...
...e a user-defined namespace resolver, if you wish to take the latter approach. notes adapts any dom node to resolve namespaces so that an xpath expression can be easily evaluated relative to the context of the node where it appeared within the document. this adapter works like the dom level 3 method lookupnamespaceuri on nodes in resolving the namespaceuri from a given prefix using the current in
formation available in the node's hierarchy at the time lookupnamespaceuri is called. also correctly resolves the implicit xml prefix. specifying the return type the returned variable xpathresult from document.evaluate can either be composed of individual nodes (simple types), or a collection of nodes (node-set types). simple types when the desired result type in resulttype is specified as either:...
...h which might work better (and allow namespaces not to be known ahead of time) is described in the next section. using xpath functions to reference elements with a default namespace another approach to match default elements in a non-null namespace (and one which works well for dynamic xpath expressions where the namespaces might not be known), involves referring to a particular element using a
form such as [namespace-uri()='http://www.w3.org/1999/xhtml' and name()='p' and @id='_myid']. this circumvents the problem of an xpath query not being able to detect the default namespace on a regularly labeled element. getting specifically namespaced elements and attributes regardless of prefix if one wishes to provide flexibility in namespaces (as they are intended) by not necessarily requiring a ...
...8 a result node-set containing any single node that matches the expression. the node is not necessarily the first node in the document that matches the expression. first_ordered_node_type 9 a result node-set containing the first node in the document that matches the expression. see also xpath xml path language from what is xslt? by g. ken holman original document in
formation based upon original document mozilla xpath tutorial original source author: james graham. other contributors: james thompson. last updated date: 2006-3-25. ...
Web technology for developers
guage makes it possible to display complex mathematical equations and syntax. temporary the stuff below here is temporary to help keep track of things while organization work is ongoing. pay it no mind. ...
... complex mathematical equations and syntax. temporary the stuff below here is temporary to help keep track of things while organization work is ongoing. pay it no mind. ...
...of things while organization work is ongoing. pay it no mind. ...
...xsltevent referencehtml: hypertext markup languagehttpjavascriptmathmlopensearch description
formatprivacy, permissions, and in
formation securityprogressive web apps (pwas)svg: scalable vector graphicstutorialsweb apisweb componentsweb per
formanceweb app manifestsweb media technologiesweb securityweb technology referencexml: extensible markup languagexpathxslt: extensible stylesheet language trans
formations ...
Compiling from Rust to WebAssembly - WebAssembly
rust project to wasm and use it in an existing web app. rust and webassembly use cases there are two main use cases for rust and webassembly: to build an entire application — an entire web app based in rust. to build a part of an application — using rust in an existing javascript frontend. for now, the rust team is focusing on the latter case, and so that's what we cover here. for the
former case, check out projects like yew. in this tutorial, we build an npm package using wasm-pack, a tool for building npm packages in rust. this package will contain only webassembly and javascript code, and so the users of the package won't need rust installed. they may not even notice that it's written in webassembly. rust environment setup let's go through all the required steps to get our en...
...st code for us in src/lib.rs: #[cfg(test)] mod tests { #[test] fn it_works() { assert_eq!(2 + 2, 4); } } we won't use this test code at all, so go ahead and delete it. let's write some rust let's put this code into src/lib.rs instead: use wasm_bindgen::prelude::*; #[wasm_bindgen] extern { pub fn alert(s: &str); } #[wasm_bindgen] pub fn greet(name: &str) { alert(&
format!("hello, {}!", name)); } this is the contents of our rust project. it has three main parts; let's talk about them in turn. we give a high-level explanation here, and gloss over some details; to learn more about rust, please check the free online book the rust programming language. using wasm-bindgen to communicate between rust and javascript the first part looks like this: use wasm_bindgen:...
...n in the next section. whenever you want to call javascript functions, you can add them to this file, and wasm-bindgen takes care of setting everything up for you. not everything is supported yet, but we're working on it. please file bugs if something is missing. producing rust functions that javascript can call the final part is this one: #[wasm_bindgen] pub fn greet(name: &str) { alert(&
format!("hello, {}!", name)); } once again, we see the #[wasm_bindgen] attribute. in this case, it's not modifying an extern block, but a fn; this means that we want this rust function to be able to be called by javascript. it's the opposite of extern: these aren't the functions we need, but rather the functions we're giving out to the world. this function is named greet, and takes one argument, a s...
...ck, but a fn; this means that we want this rust function to be able to be called by javascript. it's the opposite of extern: these aren't the functions we need, but rather the functions we're giving out to the world. this function is named greet, and takes one argument, a string (written &str), name. it then calls the alert function we asked for in the extern block above. it passes a call to the
format! macro, which lets us concatenate strings. the
format! macro takes two arguments in this case, a
format string, and a variable to put in it. the
format string is the "hello, {}!" bit. it contains {}s, where variables will be interpolated. the variable we're passing is name, the argument to the function, so if we call greet("steve") we should see "hello, steve!". this is passed to alert(), so ...
WebAssembly
webassembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary
format that runs with near-native per
formance and provides languages such as c/c++, c# and rust with a compilation target so that they can run on the web. it is also designed to run alongside javascript, allowing both to work together. in a nutshell webassembly has huge implications for the web plat
form — it provides a way to run code written in multiple languages on the web at near native speed, with client apps running on the web that previously couldn’t have done so. webassembly is designed to complement and run alongside javascript — using the webassembly javascript apis, you can load webassembly modules into a javascript app and share functi...
...ritten in multiple languages on the web at near native speed, with client apps running on the web that previously couldn’t have done so. webassembly is designed to complement and run alongside javascript — using the webassembly javascript apis, you can load webassembly modules into a javascript app and share functionality between the two. this allows you to take advantage of webassembly's per
formance and power and javascript's expressiveness and flexibility in the same apps, even if you don't know how to write webassembly code. and what's even better is that it is being developed as a web standard via the w3c webassembly working group and community group with active participation from all major browser vendors. guides webassembly concepts get started by reading the high-level conc...
...ou don't know how to write webassembly code. and what's even better is that it is being developed as a web standard via the w3c webassembly working group and community group with active participation from all major browser vendors. guides webassembly concepts get started by reading the high-level concepts behind webassembly — what it is, why it is so useful, how it fits into the web plat
form (and beyond), and how to use it. compiling a new c/c++ module to webassembly when you’ve written code in c/c++, you can then compile it into .wasm using a tool like emscripten. let’s look at how it works. compiling an existing c module to webassembly a core use-case for webassembly is to take the existing ecosystem of c libraries and allow developers to use them on the web. compiling fro...
...cript api once you've loaded a .wasm module, you'll want to use it. in this article we show you how to use webassembly via the webassembly javascript api. exported webassembly functions exported webassembly functions are the javascript reflections of webassembly functions which allow calling webassembly code from javascript. this article describes what they are. understanding webassembly text
format this article explains the wasm text
format. this is the low-level textual representation of a .wasm module shown in browser developer tools when debugging. converting webassembly text
format to wasm this article provides a guide on how to convert a webassembly module written in the text
format into a .wasm binary. api reference webassembly this object acts as the namespace for all we...
Classes and Inheritance - Archive of obsolete content
ined by creating a constructor function for that class. ...
...in fact, some people (including the add-on sdk team) prefer to use constructors this way. ...
...as are any arguments passed to it (including the this object). in effect, initialize specifies the body of the constructor. note that the constructors created with class automatically check whether they are called as constructors, so an explicit check is no longer necessary. another special property is extends. it specifies the base class from which this class inherits, if any. class uses this in
formation to automatically set up the prototype chain of the constructor. if the extends property is omitted, class itself is used as the base class: var shape = new shape(2, 3); shape instanceof shape; // => true shape instanceof class; // => true to illustrate the use of the extends property, let's redefine the constructor for the class circle in terms of class: var circle = class({ extends:...
hotkeys - Archive of obsolete content
choosing hotkeys hotkeys should be chosen with care. it's very easy to use combinations that clash with hotkeys defined for firefox or for other add-ons. the following commonly used hotkey combinations will not pass amo review: accel-z, accel-c, accel-x, accel-v or accel-q if you choose to use a key combination that's already defined, choose one which makes sense for the operation it will per
form. for example, accel-s is typically used to save a file, but if you use it for something completely different, then it would be extremely confusing for users. no matter what you choose, it's likely to annoy some people, and to clash with some other add-on, so consider making the combination you choose user-configurable. globals constructors hotkey(options) creates a hotkey whose onpress liste...
... a hotkey whose onpress listener method is invoked when key combination defined by hotkey is pressed. if more than one hotkey is created for the same key combination, the listener is executed only on the last one created. parameters options : object required options: name type combo string any function key: "f1, f2, ..., f24" or key combination in the
format of 'modifier-key': "accel-s" "meta-shift-i" "control-alt-d" all hotkeys require at least one modifier as well as the key. these are the possible modifiers you can supply: shift: the shift key. alt: the alt key. on the macintosh, this is the option key. on macintosh this can only be used in conjunction with another modifier, since alt-letter combinations are reserved fo...
...e shift key. alt: the alt key. on the macintosh, this is the option key. on macintosh this can only be used in conjunction with another modifier, since alt-letter combinations are reserved for entering special characters in text. meta: the meta key. on the macintosh, this is the command key. control: the control key. accel: the key used for keyboard shortcuts on the user's plat
form, which is control on windows and linux, and command on mac. usually, this would be the value you would use. pageup: the page up key. pagedown: the page down key. onpress function function that is invoked when the key combination hotkey is pressed. hotkey methods destroy() stops this instance of hotkey from reacting to the key combinations. once...
l10n - Archive of obsolete content
iers the default language: var _ = require("sdk/l10n").get; console.log(_("hello!")); however, this will make it more difficult to maintain your code if you have many localizations, because any changes to the identifier values break all your .properties files. if you're supplying different localizations for a string depending on the number of items (that is, whether to use a singular or plural
form) then get() takes a second integer parameter which indicates the number of items there are. you can supply one or more placeholders to get(), which are strings, such as proper names, that should not be translated themselves but instead should be inserted into the translated string. you can't use plurals and placeholders in the same expression: if you do, the placeholders will be ignored. param...
...but instead should be inserted into the translated string. you can't use plurals and placeholders in the same expression: if you do, the placeholders will be ignored. parameters identifier : string a identifier for the localization of a particular string in the current locale. count : integer optional parameter. if you're supplying different localizations for a string for singular or plural
forms, this parameter is the number of items there are in this case. var _ = require("sdk/l10n").get; console.log(_("child_id", 1)); console.log(_("child_id", 2)); see the tutorial on plural support for more in
formation. note that if you use this parameter, you can't supply any placeholders. placeholder1...n : string optional parameters. if you do not include the count parameter, you can supply o...
...ters. if you do not include the count parameter, you can supply one or more placeholder strings that are to be inserted into the translated string at locations defined by the translator. if you supply multiple placeholders, each one is a separate string parameter. var _ = require("sdk/l10n").get; console.log(_("home_town", "alan", "norwich")); see the tutorial on placeholder support for more in
formation. returns string : the localized string referenced by the identifier parameter passed in, or the identifier itself if no referent for the identifier can be found. ...
panel - Archive of obsolete content
pening a new one, you can call the hide() or the destroy() method. panel content the panel's content is specified as html, which is loaded from the url supplied in the contenturl option to the panel's constructor. you can load remote html into the panel: var mypanel = require("sdk/panel").panel({ width: 180, height: 180, contenturl: "https://en.wikipedia.org/w/index.php?title=jetpack&use
format=mobile" }); mypanel.show(); you can also load html that's been packaged with your add-on, and this is most probably how you will create dialogs. to do this, save the html in your add-on's data directory and load it using the data.url() method exported by the self module, like this: var mypanel = require("sdk/panel").panel({ contenturl: require("sdk/self").data.url("myfile.html") }); myp...
...pe="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. ...
... panel limitations although panels can host html documents, they are not implemented as browser tabs, so many things that work i...
console/traceback - Archive of obsolete content
experimental functionality similar to python's traceback module. usage tracebacks are stored in json
format. the stack is represented as an array in which the most recent stack frame is the last element; each element thus represents a stack frame and has the following keys: filename the name of the file that the stack frame takes place in. lineno the line number is being executed at the stack frame. funcname the name of the function being executed at the stack frame, or null if the function is anonymous or the stack frame is being executed in a top-level script or module. see nsiexception for more in
formation. globals functions fromexception(exception) attempts to extract the traceback from exception. parameters exception : exception exc...
...if no argument is provided, the stack at the point this function is called is used. ...
...aceback from exception. parameters exception : exception exception where exception is an nsiexception. returns traceback : json representation of the traceback or null if not found. get() returns json : returns the json representation of the stack at the point that this function is called.
format(tborexception) given a json representation of the stack or an exception instance, returns a
formatted plain text representation of it, similar to python's
formatted stack tracebacks. if no argument is provided, the stack at the point this function is called is used. parameters tborexception : object ...
io/file - Archive of obsolete content
this means that on windows paths are specified using the backslash path separator (\), and on unix-like systems like linux and os x paths are specified using the forward slash path separator (/). if your add-on uses literal windows-style path specifications with this api, your add-on likely won't work when users run it on unix-like systems. likewise, if your add-on uses literal unix-style path specifications, it won't work for users on windows. to ensure your add-on works for everyone, generate paths using the join function. ...
...h and false otherwise. parameters path : string the path of a file. returns boolean : true if the file exists and false otherwise. join(...) takes a variable number of strings, joins them on the file system's path separator, and returns the result. parameters ... : strings a variable number of strings to join. the first string must be an absolute path. returns string : a single string
formed by joining the strings on the file system's path separator. list(path) returns an array of file names in the given directory. parameters path : string the path of the directory. returns array : an array of file names. each is a basename, not a full path. mkpath(path) makes a new directory named by the given path. any subdirectories that do not exist are also created. mkpath can be call...
.../realityripple/uxp/blob/master/nsprpub/pr/include/prio.h#550). this means that: if the file does not exist it is created if the file exists, its length is truncated to zero it is not possible to open the file in append mode. returns stream : if the file is opened in text read-only mode, a textreader is returned, and if text write-only mode, a textwriter is returned. see text-streams for in
formation on these text stream objects. if the file is opened in binary read-only mode, a bytereader is returned, and if binary write-only mode, a bytewriter is returned. see byte-streams for more in
formation on these byte stream objects. opened files should always be closed after use by calling close on the returned stream. read(path, mode) opens a file and returns a string containing its entire co...
Getting Started (jpm) - Archive of obsolete content
h cfx. the command-line jpm tool. see the instructions for installing jpm. once you've done that, you'll be looking at a command prompt. install firefox developer version for testing your add-on. initializing an empty add-on in the command prompt, create a new directory. 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 in
formation about your add-on: this will be used to create your add-on's package.json file. for now, just press enter to accept the default for each property. for more in
formation on jpm init, see the jpm command reference. once you've supplied a value or accepted the default for these properties, you'll be shown the complete contents of "package.json" and asked to accept it. implementing the add-on ...
...untu: jpm run -b /usr/bin/firefox when firefox launches, in the top-right corner of the browser you'll see an icon with the firefox logo. click the icon, and a new tab will open with http://www.mozilla.org/ loaded into it. that's all this add-on does. it uses two sdk modules: the action button module, which enables you to add buttons to the browser, and the tabs module, which enables you to per
form basic operations with tabs. in this case, we've created a button whose icon is the firefox icon, and added a click handler that loads the mozilla home page in a new tab. try editing this file. for example, we could change the page that gets loaded: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "...
..."./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://developer.mozilla.org/"); } at the command prompt, execute jpm run again. this time clicking it takes you to https://developer.mozilla.org/. packaging the add-on when you've finished the add-on and are ready to distribute it, you'll need to package it as an xpi file. this is the installable file
format for firefox add-ons. you can distribute xpi files yourself or publish them to https://addons.mozilla.org so other users can download and install them. to build an xpi, just execute the command jpm xpi from the add-on's directory: jpm xpi you should see a message like: jpm info successfully created xpi at /path/to/my-addon/@my-addon-0.0.1.xpi to test that this worked, try installing the x...
Logging - Archive of obsolete content
to follow this tutorial you'll need to have learned the basics of jpm. the dom console object is useful for debugging javascript. because dom objects aren't available to the main add-on code, the sdk provides its own global console object with most of the same methods as the dom console, including methods to log error, warning, or in
formational messages. you don't have to require() anything to get access to the console. ...
...or debugging javascript. because dom objects aren't available to the main add-on code, the sdk provides its own global console object with most of the same methods as the dom console, including methods to log error, warning, or in
formational messages. you don't have to require() anything to get access to the console. it is automatically made available to you. ...
...ou've installed the add-on in firefox then the messages appear in firefox's browser console. but note that by default, calls to console.log() will not result in any output in the error console for any installed add-ons: this includes add-ons installed using the add-on builder or using tools like the extension auto-installer. see "logging levels" in the console reference documentation for more in
formation on this. learning more for the complete console api, see its api reference. ...
Canvas code snippets - Archive of obsolete content
code usable from web content getting the number of pixels of a certain color in a canvas the following function will return the number of pixels in a canvas that have the rgb color of r, g and b. this can be very useful to compare for example if a user has painted over another area as explained in this blog post. ...
...anvas.getcontext('2d'); if (!canvas2dcontext.prototype.arc) { canvas2dcontext.setup.call(this, this.ctx); } } canvas2dcontext.setup = function() { var methods = ['arc', 'arcto', 'beginpath', 'beziercurveto', 'clearrect', 'clip', 'closepath', 'drawimage', 'fill', 'fillrect', 'filltext', 'lineto', 'moveto', 'quadraticcurveto', 'rect', 'restore', 'rotate', 'save', 'scale', 'settrans
form', 'stroke', 'strokerect', 'stroketext', 'trans
form', 'translate']; var gettermethods = ['createpattern', 'drawfocusring', 'ispointinpath', 'measuretext', // drawfocusring not currently supported // the following might instead be wrapped to be able to chain their child objects 'createimagedata', 'createlineargradient', 'createradialgradient', 'getimagedata', 'putimagedata' ]; ...
... saving a canvas image to a file ...
Finding window handles - Archive of obsolete content
note: starting in gecko 2.0, only the top level browser window has an hwnd. web content windows (in tabs) do not have their own hwnds. ...
... note: starting in gecko 2.0, only the top level browser window has an hwnd. web content windows (in tabs) do not have their own hwnds. ...
... note: starting in gecko 2.0, only the top level browser window has an hwnd. web content windows (in tabs) do not have their own hwnds. ...
Examples and demos from articles - Archive of obsolete content
typewriter all the text content of the nodelist which match a specified group of selectors. [article] fade in/out [html] sometimes a page uses dozens and dozens of animations. in such a condition is difficult and unnatural to keep track of all events started and then to stop them when appropriate through the cleartimeout() function. a possible approach to solve this problem is to nest all the in
formations needed by each animation to start, stop, etc. etc. in different objects and then to create a constructor for such class of objects in order to standardize and simplify the instantiation of them. here is a possible and minimalist example of such abstraction, which for this reason we named minidaemon. [article] image preview before upload [html] the filereader.prototype.readasdataurl() met...
...ample shows how to insert some html tags or smiles or any custom text in a textarea. using setinterval within animations sometimes a page uses dozens and dozens of animations. in such a condition is difficult and unnatural to keep track of all events started and then to stop them when appropriate through the cleartimeout() function. a possible approach to solve this problem is to nest all the in
formations needed by each animation to start, stop, etc. etc. in different objects and then to create a constructor for such class of objects in order to standardize and simplify the instantiation of them. convert relative paths to absolute this example show how to translate relative paths to absolute paths. a shortcut to massively modify the dom this example shows how to create a framework able t...
...to create a constructor for such class of objects in order to standardize and simplify the instantiation of them. convert relative paths to absolute this example show how to translate relative paths to absolute paths. a shortcut to massively modify the dom this example shows how to create a framework able to modify many properties of dom objects at the same time. filter the digitation into a
form field, capture the digitation of a hidden word this example shows the use of the onkeypress event during a digitation into a
form field. ajax – submitting
forms and uploading files this paragraph shows how to submit
forms in pure-ajax. multipage ajax navigation example this article provides a working (minimalist) example of a pure-ajax web site composed only of three pages. do something i...
Label and description - Archive of obsolete content
ensure the long-running text is a text node child of <description/> or <label/> (i.e., do not specify the long-running text in the value attribute of these elements). the default style for these xul elements includes white-space: wrap;. this reduces all whitespace chunks (including newlines) to single spaces. text is permitted to wrap. <description>i am your father's brother's nephew's cousin's
former roommate. what's that make us? absolutely nothing!</description> with white-space: pre; all whitespace, including newlines, is rendered literally. text cannot wrap automatically but can still be achieved with <html:br/> if desired. <description style="white-space: pre-wrap;">i am your father's brother's nephew's cousin's
former roommate. what's that make us? absolutely nothing!</description>...
...s that make us? absolutely nothing!</description> with white-space: pre-wrap; all whitespace is rendered literally, but text is additionally permitted to wrap at spaces. note: prior to firefox 3, it was necessary to use -moz-pre-wrap instead of -pre-wrap. you may wish to use both for backward compatibility. ...
...ty. <description style="white-space: pre;">i am your father's brother's nephew's cousin's
former roommate. what's that make us? absolutely nothing!</description> text can also be made to wrap by inserting an <html:br/> element regardless of the css style, but this creates a hard-break that does not change as parent elements resize. <description>i am your father's brother's nephew's cousin's
former roommate.<html:br/> what's that make us?<html:br/> absolutely nothing!</description> using labels as anchors its possible to make a label look and act like an html <a> tag: <label class="text-link" href="http://whatever.com" value="click here to go to whatever"/> "text-link" is a built-in, predefined class. note: if running in a xulrunner application add the following preferences to your...
JavaScript timers - Archive of obsolete content
nly used if you wish to have your function called once after the specified delay. the setinterval() function is commonly used to set a delay for functions that are executed again and again, such as animations. the setimmediate() function can be used instead of the settimeout(fn, 0) method to execute heavy operations in ie. the requestanimationframe() function tells the browser that you wish to per
form an animation and requests that the browser schedule a repaint of the window for the next animation frame. documentation settimeout() calls a function or executes a code snippet after specified delay. setinterval() calls a function or executes a code snippet repeatedly, with a fixed time delay between each call to that function. setimmediate() calls a function immediately after the browse...
... task that runs as a background process, rather than being under the direct control of an interactive user. in javascript programming language, all daemons are processes created by javascript timers or by a worker instantiation. here are some code snippets which simplify and abstract the management of daemons. requestanimationframe() requestanimationframe() tells the browser that you wish to per
form an animation and requests that the browser schedule a repaint of the window for the next animation frame. the method takes as an argument a callback to be invoked before the repaint. per
formance.now() per
formance.now() returns a timestamp, measured in milliseconds, accurate to one thousandth of a millisecond. this timestamp is equal to the number of milliseconds since the navigationstart attr...
... date.now() date.now() returns the number of milliseconds elapsed since 1 january 1970 00:00:00 utc. ...
Common Pitfalls - Archive of obsolete content
t in almost all cases, when creating a uri object you want to use the newuri method on the nsiioservice interface, like so: javascript: try { var ioserv = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uriobj = ioserv.newuri(uristring, uricharset, baseuri); } catch (e) { // may want to catch ns_error_mal
formed_uri for some applications } c++: nsresult rv; nscomptr<nsiioservice> ioserv = do_getservice("@mozilla.org/network/io-service;1"); ns_ensure_success(rv, rv); nscomptr<nsiuri> uriobj; rv = ioserv->newuri(uristring, uricharset, baseuri, getter_addrefs(uriobj)); if (ns_failed(rv)) { // may want to handle ns_error_mal
formed_uri for // some applications return rv; } or,...
...ting a specific uri class via createinstance is acceptable, is when one is implementing a protocol handler's newuri method. in that case you may not be able to use the i/o service because that service calls the newuri method on the appropriate protocol handler, which may be your own handler. how to do security checks for uri loads before loading a uri, one of two security checks needs to be per
formed: if the uri is a string that will be loaded via passing the string to nsiwebnavigation::loaduri, the one must call checkloaduristrwithprincipal and pass the principal that the uri originates from as the first argument and the uri string as the second argument. in all other cases, one should call checkloaduriwithprincipal and pass the principal that the uri originates from as the first argume...
...t the uri originates from as the first argument and the uri string as the second argument. in all other cases, one should call checkloaduriwithprincipal and pass the principal that the uri originates from as the first argument and an nsiuri object representing the uri as the second argument. if there is no nsiuri object on hand, it is secure to call checkloaduristrwithprincipal, but this will per
form a more stringent security check than is strictly necessary. what not to do all other security checks (including calls to checkloaduri and checkloaduristr) are incorrect, because they do not properly capture the originating principal. those methods should be removed. ...
Communication between HTML and your extension - Archive of obsolete content
vileged and non-privileged pages. communication between an html page and and extension after building a sample extension by reading carefully and following the complete instructions for building an extension i was able to get an extension that could display something on the status bar. what i wanted to do was have an extension "look" for something on an html page and if it found that something per
form some operation on the found thing and then update the status bar with the results of the operation. with a lot of help from irc://irc.mozilla.org#js and irc://irc.mozilla.org#extdev i was able to get it running pretty well, but i still would rather have the client less responsible for pinging the extension to "look" for what is on the page. what i tried my first attempt was trying to create an...
...designed for creating custom components and their specific component behavior rather than trying to impose some kind of messaging on existing components. next i started investigating events, there are only a handful of events and the w3c documentation is pretty complete. the basic problem with the event model is probably due to what i was trying to do. in my html i have an input element in a
form. i set the onblur action to a little javascript function that per
formed a standard ajax request to get a result. the onreadystatechange was set to another little javascript function that would update a specific element on the html page with the result. the result of the ajax request was the something that i wanted the extension to find. there were only a handful of events that seemed relevant (lo...
...extension went looking for the element, it wasn't there yet. as a last ditch effort i tried setting a timeout using settimeout when i got the event in the extension to wait a few milliseconds before looking for the desired element. this was non-optimal and the timeout wasn't very reliable for some reason. sometimes i would get the timeout, sometimes i would'nt. what i ended up with some helpful in
formation on the irc channel led me to believe that a custom event might help. i started to research custom events on google but everything that i found was far too complicated for what i wanted to achieve. eventually i put the creation of the custom event into the statechanged function that was handling the receipt of the ajax request. after the html component was update with the result of the ajax r...
Developing add-ons - Archive of obsolete content
mozilla based software is typically extensible through add-ons. there are three primary types of add-on: extensions, plugins, and themes. this page will help guide you to the in
formation you need in order to create add-ons for firefox, thunderbird, or other software based on the mozilla plat
form, as well as how to distribute your add-ons. add-ons topics submitting an add-on to amo provides helpful in
formation for add-on developers to help them properly package and deliver their add-ons. this includes in
formation about addons.mozilla.org, mozilla's add-on distribution web site. extensions extensions add new functionality to mozilla applications such as firefox, seamonkey and thunderbird. they can add anything from a toolbar button...
... jetpack browser extension development for everyone. jetpack developers only need to know the tools of the modern web: html, css, and javascript. ...
... themes themes let users customize the appearance of the user interface presented by mozilla-based applications. search engine plugins firefox supports search engine plugins, which enable the search box to support different search engines. addons.mozilla.org (amo) api developers' guide the amo developers' guide describes how to use the amo api to fetch in
formation about add-ons from the addons.mozilla.org site. the mozilla plat
form in
formation about the mozilla plat
form, including all of its apis and technologies, as well as how to use them in your own projects. per
formance per
formance guides and utilities to help you make your add-on per
form well (and to play nicely with others). ...
How to convert an overlay extension to restartless - Archive of obsolete content
note that the usage of an octal integer literal, while standard for handling permissions, is dangerous and deprecated; usage of use es5 strict mode to disable this and other foot-guns is recommended) if you need to read/manipulate binary data, a nsibinaryinputstream instance is what you'll use on that stream (e.g. 32-bit integers, or fun stuff like 48-bit integers). not ideal, but it works and per
forms more than sufficiently well. all of that code above is no longer viable if you also go extractionless (which you should). step 3a: option 1: use nsizipreader let zipreader = components.classes["@mozilla.org/libjar/zip-reader;1"] .createinstance(components.interfaces.nsizipreader); zipreader.open(addondata.installpath); ... from there you can open nsiinputstreams, ex...
...ently well. all of that code above is no longer viable if you also go extractionless (which you should). step 3a: option 1: use nsizipreader let zipreader = components.classes["@mozilla.org/libjar/zip-reader;1"] .createinstance(components.interfaces.nsizipreader); zipreader.open(addondata.installpath); ... from there you can open nsiinputstreams, extract files, or per
form some other functions. worst case would be that you extract a file to a temporary location and then use nsifile operations upon the extracted file. step 3b: option 2: use xmlhttprequest now, how do we replace that? the answer to that question is to load your file from a chrome:// uri using xmlhttprequest. you may now have another question: wait, what does this have to do with xml or http? the an...
...-on to add your interface, where it needs to go into a xul window, and how to do it. docs: document.getelementbyid(), document.createelement(), element reference, node reference (dom elements are also nodes). you'll need to write two functions. one to take a xul window object and then create and add your elements, and then another to find your elements and remove them from the window object. the
former will need to be run on add-on startup and the later on add-on shutdown. until you get your bootstrap.js running you should use a basic overlay onto the xul window with an event listener for "load" to catch overlay load and then run your manual ui construction function. step 6a. details on adding elements dynamically to chrome xul window there is a way that makes constructing of ui a lot simil...
Interaction between privileged and non-privileged pages - Archive of obsolete content
reated element, or create it once when the web page loads then re-use it each time. another option is to send a return event from the extension to the web page. this can be done using the same principle as the above example. there is only one extension, but there can be many active web pages. so to trigger the right event on the right page we have to tell the extension which page to call. the in
formation we need for that is contained in evt.target.ownerdocument. we can extend the above example with some data transfer from the extension to the web page. in the following code sample 2 methods are combined: setting an extra attribute in the original event target element, and creating a new event message with a new event target element. for this to work we need to define the original target ele...
... chromium-like messaging: json request with json callback web page: <html> <head> <script> var something = { send_request: function(data, callback) { // analogue of chrome.extension.sendrequest var request = document.createtextnode(json.stringify(data)); request.addeventlistener("something-respons...
... needs to carefully check every value passed (you need to do that either way). ...
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
ecial source-code browsing tools to make sense of it. mozilla cross-reference mozilla cross-reference is a full-text searchable source-code listing hosted at mozilla.org. we’re going to use mxr (http://mxr.mozilla.org), a linux source-code browser. getting started visit this url: http://mxr.mozilla.org . in the left-hand sidebar, you should see a link to a search starting point and a search
form (figure 5). fixme: figure 5: mxr.mozilla.org usage what am i looking for? if you just start poking through the source code at random, you may not find much of anything. so let’s figure out where to start looking. let’s say we’ve found the contents of listing 7 in the source. we can guess from the name that this has something to do with handling files, but we’ve still got the followin...
...inherit from nsisupports (fixme: why 'nearly' ?), so adding a trailing space when you search serves as a delimiter on the inheritance position, and makes it easier to specify what you’re looking for (see figures 6, 7).4 this results in the file nsilocalfile.idl. let’s display it. every method includes explanatory comments. in initwithpath, the nsilocalfile object gets initialized, and any in
formation already in it gets reset. also be aware of a potential problem when using paths not representing entities.5 this requires a full path as an argument. relative paths will throw errors. this should help you understand the initwithpath specification. fixme: figure 6: searching without a trailing space fixme: figure 7: searching with a trailing space fixme: listing 7: source-code fragment ...
... from your web browser by typing the following into your location bar : http://localhost:46984 this lets you browse all packages, click on links to traverse them, and take traversed-link locations as search starting points (figure a). fixme: figure a: gonzui 1 - http://quicknote.mozdev.org 2 - http://www5f.biglobe.ne.jp/~t-susumu/ 3 - reverse-polish notation. a way to represent arithmetic
formulas. for example, (1+2)*(3-4) would be represented in rpn as 1 2 + 3 4 - * it uses no parentheses. it is also easy to program. 4 - gonzui does not handle search strings with spaces very well; instead, go to the advanced search page, search on a few terms, and then use your browser’s find function to search for the “:” character. 5 - mac os x and other oss seemingly do not internationalize...
Adding windows and dialogs - Archive of obsolete content
nd favor them. using the prompt service is the recommended way to create common dialogs in an extension. read the article and its examples carefully, because there are many useful functions to use in the prompt service. there are some equivalent, simpler functions that are available in the window object, but those are meant for unprivileged html javascript code. alert the alert is the simplest
form of dialog. all it does is display a text message that the user can read and then click the ok button to dismiss it. we have been using the window.alert function to open alert messages in our examples so far, but that's not the right way to do it. it's ok to use this function if you're just debugging some problem and want to see if the program reaches a specific line of code, or to inspect the val...
... are the most customizable, allowing a great deal of options that cover most common dialog cases. using the prompt service will save you a lot of xul coding, and you'll be at ease knowing that you're using mozilla's tried and tested code. the dialog element when the prompt service is not enough, you'll have to create you own xul dialogs. luckily, you still get a great deal of help from the plat
form if you use the dialog element as the document root instead of the more generic window element. you may be asking yourself what's the big deal about defining a simple xul window with an ok and maybe a cancel button. the dialogs we have covered in this section are very simple and shouldn't be too hard to implement manually using xul. well, it's more complicated than that. different operating syste...
... localization problems. dialogs are sized to their contents and will generally work fine. however, there are cases where the dialog contents are generated or expanded dynamically by your code, and you'll need to resize them appropriately. the window.sizetocontent function is what you need in this case. input controls most additional xul windows and dialogs in extensions are some kind of input
form. let's look into the most commonly used
form elements and how to use them in your xul windows. there isn't much we need to add from what the xul tutorial explains, so go ahead and read the following sections: input controls numeric controls list controls there are some other aspects to take into account when handling input controls, which we cover in the following sections. groupboxes th...
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
alternative: use (anonymous) functions you can always create a small anonymous function to pass around instead. closures will ensure the code is still valid, even if your ou...
... alternative: use (anonymous) functions you can always create a small anonymous function to pass around instead. closures will ensure the code is still valid, even if your outer function already returned from execution. addeventlistene...
...), true); settimeout(alert.bind(null, xhr.responsetext), 100); function.bind() returns a new function. this is important to know in particular when you later want to call removeeventlistener: you'll have to pass the resulting function from the first .bind() call. calling .bind() again with removeeventlistener will not work. also, calling .bind() in a tight (inner) loop should be avoided for per
formance reasons, as calling .bind() does require some work and memory. overriding/extending/amending existing functions a common thing add-ons do during their initialization is overriding/extending existing browser functions by using function.tostring/function.tosource and eval to "string-patch" the function body. // do not use! var functionbody = gbrowser.addtab.tosource(); var afterbracket = fu...
User Notifications and Alerts - Archive of obsolete content
message, true, "", this, "xulschool hello message"); we pass this as an argument, assuming that this is an object that implements nsiobserver. we do this when we need to handle clicks on the alert box. the image can have any size, but it is recommended that you use a medium, fixed size. the main disadvantage of using alerts is that support for the alerts service is not guaranteed for all plat
forms and firefox versions. support for windows has existed since firefox 2. for mac os x, support was added on firefox 3, and only through a third-party tool called growl. on linux systems, we have confirmed that it works on firefox 3 on ubuntu linux, but we haven't tested all distributions and firefox versions. because of the inconsistent support and temporary nature of these alerts, we don't recom...
...r windows has existed since firefox 2. for mac os x, support was added on firefox 3, and only through a third-party tool called growl. on linux systems, we have confirmed that it works on firefox 3 on ubuntu linux, but we haven't tested all distributions and firefox versions. because of the inconsistent support and temporary nature of these alerts, we don't recommend using this service to show in
formation the user needs to know and can't get in any other way. custom alerts creating custom solutions for alerting the user is not complicated, given the advantages of xul overlays and css positioning. however, these solutions are prone to be buggy and have accessibility issues. you should use the 2 alternatives mentioned above whenever possible. if none of those fit your needs then this is an ac...
...which you can fill with any content you need before removing the hidden attribute so that it is displayed to the user. the best locations for this kind of box are above and below the tab browser. below is preferrable because it only cuts the bottom part of the current page, as opposed to pushing down all tabs and content. notification boxes are a good guideline to what you should aim for: thin, in
formative and easy to dismiss. another option is to also add a hidden box to the overlay, but use css positioning to locate it where you want. this usually means that the box will be hovering on top of the page's content, and there are a few things you must know about this. first of all, switching tabs will probably make your alert disappear. this is probably due to the fact that the browser tab box ...
Security best practices in extensions - Archive of obsolete content
above in this section. in certain circumstances you may want to run code in your extension, but you would like to give it restricted privileges. one of the best ways to do this is to use components.utils.evalinsandbox(). note that objects passed into the sandbox are restricted, but objects that come back out from it are not. refer to the document to find out how to avoid such pitfalls. for more in
formation, refer to the evalinsandbox section. the sidebar: a use case the sidebar in firefox is designed to hold both chrome (privileged) content and web (nonprivileged) content, the latter being in the
form of web pages. these web pages can come from a server, or come from local html files bundled with the extension. for pages coming from the server, you need to take steps to ensure that the conte...
...content is more than just pages, and more and more add-ons are interacting with web services via an application programming interface (api). many of the items talked about so far in this document apply in this sphere, but here are some additional tips: api providers should use the https protocol, which provides better protection for data passed over the network. json has become a popular data
format for return
formats for web services. be sure to read using native json to find out the correct way to handle it. apis can't be used with self-signed certificates. remote javascript and content there are a number of ways of remote scripts being used in extensions. they can be included in content, or downloaded at intervals. non-chrome urls in chrome xul or html such as the following example...
...d: <script type="text/javascript" src="http://mysite.greatsite.com/js/wow-content.js" /> in general, scripts that are from remote sources that run in the chrome context are not acceptable, as many times the source of the script can never be 100% guaranteed, and they are vulnerable to man-in-the-middle attacks. the only legitimate environment for remote scripts is to run in a sandbox. for more in
formation, refer to the evalinsandbox() section. evalinsandbox the evalinsandbox document explains very well how it works, so there will be no repetition here. the usefulness of it and power of how it works is best illustrated by the popular greasemonkey extension, which works on the premise of scripts being downloaded and stored locally, to be injected into the web content context via the sandbox. ...
Add-ons - Archive of obsolete content
our extension using xul and javascript only. for complex extensions, it may be necessary to create components in c++ that provide additional functionality. extension etiquette this article describes best practices when making extensions, including how to be kind to your users. it assumes that you are already familiar with building an extension. extension packaging extensions are packaged in a
form of installable bundle which can be downloaded and installed by a user, or provided pre-packaged with an application or by an external program. extensions use a directory structure which can provide chrome, components, and other files to extend the functionality of an xul program. extensions support in seamonkey 2 starting with seamonkey 2 alpha 1 seamonkey supports toolkit/-style extensions. th...
... extensions. the user interface for the preferences defined with this new syntax appears in the extension's detail view in the add-on manager. this functionality originally appeared in firefox mobile and is now available in firefox on the desktop as well. install manifests an install manifest is the file an add-on manager-enabled xul application (e.g. firefox or thunderbird) uses to determine in
formation about an add-on as it is being installed. it contains metadata identifying the add-on, providing in
formation about who created it, where more in
formation can be found about it, which versions of what applications it is compatible with, how it should be updated, and so on. interaction between privileged and non-privileged pages an easy way to send data from a web page to an extension is by ...
...egacy add-ons this section contains links to documentation for legacy technology for add-on development, including: legacy extensions for firefox for android add-ons that work with desktop firefox do not automatically work in firefox for android: overlay extensions this page contains links to documentation for the approach to developing extensions for gecko-based applications which uses: per
formance best practices in extensions one of firefox's great advantages is its extreme extensibility. extensions can do almost anything. there is a down side to this: poorly written extensions can have a severe impact on the browsing experience, including on the overall per
formance of firefox itself. this article offers some best practices and suggestions that can not only improve the per
formance and...
XML data - Archive of obsolete content
this page contains an example of how you can use css with xml data. you create a sample xml document, and a stylesheet that you can use to display it in your browser. this is the 3rd section of part ii of the css tutorial. previous section: svg next section: xbl binding in
formation: xml data xml (extensible markup language) is a general-purpose language for any kind of structured data. by default, your mozilla browser displays xml in a
format very similar to the original data in the xml file. you see the actual tags that define the data's structure. by linking a css stylesheet with the xml document, you can define other ways to display it. to do this, your stylesheet uses rules that map tags in the xml document to the display types used by html. example data in an xml document...
... the element like a list item, or like a component of a table. for the full list of display types, see the display property in the css specification. using css alone, the structure of the display must be the same as the structure of the document. other technologies can modify the structure of the display—for example, xbl can add content, and javascript can modify the dom. for more in
formation about xml in mozilla, see the xml page in this wiki. action: an xml demonstration make a new xml file, doc9.xml. copy and paste the content from here, making sure that you scroll to get all of it: <?xml version="1.0"?> <!-- xml demonstration --> <?xml-stylesheet type="text/css" href="style9.css"?> <!doctype planet> <planet> <ocean> <name>arctic</name> <area>13,000</area> <dept...
...n top of the border. challenge change the stylesheet so that it displays the document as a table. (see the tables chapter in the css specification for examples that you can adapt.) what next? if you had difficulty understanding this page, or if you have other comments about it, please contribute to its discussion page. this is the last page of the tutorial. for more in
formation about css in mozilla, see the main css page in this wiki. ...
Bonsai - Archive of obsolete content
it also includes tools for looking at checkin logs (and comments); doing diffs between various versions of a file; and finding out which person is responsible for changing a particular line of code ("cvsblame"). start at the main bonsai query page or seamonkey tree control page here are some example queries that will give you a taste of what bonsai is capable of: today's checkins to the mozilla source mainline. ...
... a particular line of code ("cvsblame"). start at the main bonsai query page or seamonkey tree control page here are some example queries that will give you a taste of what bonsai is capable of: today's checkins to the mozilla source mainline. ...
...-1998 differences between revisions 3.1 and 3.3 of the file mozilla/cmd/xfe/
forms.c that's a small sample, but it should be enough to get you started. play around with the various options on the main bonsai query page. if you're updating our cvs tree you'll need to learn about hacking with bonsai. bonsai source code the source code to the bonsai tool itself is also available, check out the in
formation available at the bonsai project page. original document in
formation author(s): jamie zawinski last updated date: september 8, 2004 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Bookmark Keywords - Archive of obsolete content
ttp://www.cnn.com/ could be given the keyword cnn. 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. mozilla will automatically expand the keyword to the corresponding bookmarked url, and load up the site. that's pretty interesting on its own, but mozilla takes it a step further by allowing the user to define an "entry point" for added in
formation. 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. laying the groundwork we're going to pick a relatively...
... be ready to go. fill in the value bz, as shown in figure 5. 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. this is illustrated in figure 6. that's all it takes! setting up a google keymark to set up a keymark that will search google directly
form the address bar, go to google and run a search for any word. once you get a result page, bookmark that page. you'll need to replace the word for which you searched. one such example, with the relevant term highlighted, is shown in figure 7. once this result page has been bookmarked, we need only adjust the boookmark's properties. in this case, we'll give it a keyword and title of google and repl...
...ary search dictionary, dict, define, word thesaurus search thesaurus, like fedex tracking fedex ups tracking ups of course, these are just a beginning. any web site that you commonly search is a candidate for its own keymark. acknowledgements thanks to asa dotzler and his article how cool are custom keywords?, which provided the inspiration to write this article. original document in
formation author(s): eric a. meyer, netscape communications last updated date: published 15 mar 2002 copyright in
formation: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
overlay. xpis have a complex structure designed to separate ui layers from each other. to make our xpi we'll start out by creating a directory to hold the files we're going to add to the xpi. then we'll modify urls in our files so they point to the right place. after that we'll create a contents.rdf file describing the tinderstatus component for the chrome registry and an install.js script to per
form the installation. finally we'll zip the files into an archive. start out by creating a directory called tinderstatus-installer. create a tinderstatus subdirectory in it and a content sub-subdirectory in that subdirectory. copy the following files into the content sub-subdirectory: tinderstatusoverlay.xul tinderstatus.js tinderstatus.css tb-busted.png tb-nostatus.png tb-success.png tb-te...
...contents.rdf goes in the content sub-subdirectory: <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> <rdf:seq about="urn:mozilla:package:root"> <rdf:li resou...
...make sure that file and directory are on the top level of the archive. « previousnext » ...
Getting Started - Archive of obsolete content
n the my_theme directory, then open it up in your text editor. this file is a small xml database that describes the skin. <description about="urn:mozilla:install-manifest"> <em:id>{themes_uuid}</em:id> <em:version>themes_version</em:version> the first section requires that you establish a uuid for your theme and that you give your theme a version number. once you've done this, insert the in
formation as above, and scroll down. you will also have to update the minimum and maximum compatible versions for the target application (seamonkey) in the following section: <em:targetapplication> <description> <!-- seamonkey's uuid --> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>min_sm_version</em:minversion> <em:maxversion>max_sm_version</em:ma...
...50c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>min_sm_version</em:minversion> <em:maxversion>max_sm_version</em:maxversion> </description> </em:targetapplication> establishing both minimum and maximum compatible versions lets you avoid conflicts with versions of seamonkey your theme wasn't designed for -- or wasn't tested on. see install manifests for the reference in
formation about the install.rdf file. css files the css files in these directories tell the browser how to display the buttons and other controls, where to put the images, what border and padding it should put around them, and so on. as an example, let's change the standard button. go into the global directory and open button.css in your favorite text editor. scroll down to button {. this section defi...
...ut the files in the zip folder, rename it to myskin.jar triggering the install from the web to install the theme's jar file directly from the web, you need to run some javascript. <a href='javascript:installtrigger.installchrome(installtrigger.skin, "myskin.jar", "my skin theme")'>install my skin</a> if you have jar files on your hard drive and would like to install them, then download/use this
form. you can also just open the themes window in mozilla and drag and drop your .jar file onto it. now to change your folder(s) back into a .jar well it's easy! what you do is put your folder(s) into a .zip file and then when it's compressed make the .zip into a .jar ...
Getting Started - Archive of obsolete content
the installed-chrome.txt file and double check that you modified the lines correctly. changing borders and colours this is the part where knowing css comes in handy. to find all of the css files that we're going to be modifying, we must first understand the directory structure. directories in \mozilla\chrome\classic\skin\classic there are a number of different directories which contain the skin in
formation for the default packages that come with mozilla. the most important directory is \global. the default widgets are defined here, and anything that is modified will change throughout mozilla. if you want to modify how checkboxes, radio buttons, and scrollbars appear, this is the place. the next directory is the \communicator directory. this is a catchall directory which holds all of the images...
...ou've changed the images, launch mozilla and you should see them. creating the install script getting it ready for the installation before we can package everything up for installation, we need to remove all references to classic. copy everything in \mozilla\chrome\classic\skin\classic to a directory called \myskin. skin info when switching skins in mozilla, it displays a preview image and some in
formation about the theme. this is what we're going to create now. take a screenshot of mozilla running your theme and create an image that is 438x89 pixels in size. place it in \myskin and call it preview.png (if it's a jpg or gif call it preview.jpg or preview.gif). make a copy of contents.rdf and place it in \myskin and open it up in your text editor. this file is a small xml database which is used...
...obal\... \editor\... \communicator\... triggering the install from the web to install your jar file directly from the web, you need to run some javascript. <a href="javascript:installtrigger.installchrome(installtrigger.skin, 'myskin.jar', 'my skin theme')">install my skin</a> if you have jar files on your hard drive and would like to install them, then download/use this
form. ...
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
the my_theme directory, then open it up in your text editor. this file is a small xml database that describes the skin. <description about="urn:mozilla:install-manifest"> <em:id>{themes_uuid}</em:id> <em:version>themes_version</em:version> the first section requires that you establish a uuid for your theme and that you give your theme a version number. once you've done this, insert the in
formation as above, and scroll down. you will also have to update the minimum and maximum compatible versions for the target application (firefox) in the following section: <em:targetapplication> <description> <!-- firefox's uuid --> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>min_ff_version</em:minversion> <em:maxversion>max_ff_version</em:maxv...
...030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>min_ff_version</em:minversion> <em:maxversion>max_ff_version</em:maxversion> </description> </em:targetapplication> establishing both minimum and maximum compatible versions lets you avoid conflicts with versions of firefox your theme wasn't designed for -- or wasn't tested on. see install manifests for the reference in
formation about the install.rdf file. css files the css files in these directories tell the browser how to display the buttons and other controls, where to put the images, what border and padding it should put around them, and so on. as an example, let's change the standard button. go into the global global directory and open button.css in your favorite text editor. scroll down to "button {". this...
... files in the zip folder, rename it to my_theme.jar triggering the install from the web to install the theme's jar file directly from the web, you need to run some javascript. <a href='javascript:installtrigger.installchrome(installtrigger.skin, "myskin.jar", "my skin theme")'>install my skin</a> if you have jar files on your hard drive and would like to install them, then download/use this
form. you can also just open the themes window in mozilla and drag and drop your .jar file onto it. now to change your folder(s) back into a .jar well it's easy! what you do is put your folder(s) into a .zip file and then when it's compressed make the .zip into a .jar ...
Developing New Mozilla Features - Archive of obsolete content
warning: the content of this article may be out of date. it was last updated in 2004. tips for contributing new features to mozilla. learn the codebase and coding practices before you start your feature include learning time in your schedule. mozilla is a complex codebase. our portability requirements may be new to even seasoned developers. our cross-plat
form component model (“xpcom”) is similar to com, but you’ll want to make sure you use it well before going too far with your project. and of course, we have a set of coding practices to help everyone live together. life will be much easier if your team has one or more members who are already familiar with and to the mozilla world. develop relationships with existing developers in the area of your feature if you want t...
...obtain cvs access. help the existing developers to understand that you are “for real” that you have a clue about mozilla development; that your team is going to ship a product. our developers get a lot of mail, and not all of it is helpful. we appreciate the attention and interest in mozilla, but the developers have to prioritize how they spend their time. help them to realize you’re an in
formed developer who is interested and able to contribute. this will be much easier if you’ve been working on suggestion two. designate someone on your team to be involved with the mozilla.org cvs repository on a regular basis the ease of integrating your feature will increase if someone on your team is intimately involved with the source tree. reviewing the tree only at the milestone releases is ...
... is limited to the developers and the reviewers rather than everyone in the tree. we’re committed to this style of development, but recognize that vigilance is necessary to make sure newcomers and their features don’t get lost. if you’re having a particularly bad experience or if you’ve got suggestions on how to improve our process, please let mozilla.org staff know. original document in
formation author(s): mitchell baker last updated date: october 30, 2004 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Drag and Drop - Archive of obsolete content
g. the following properties and methods are available: candrop set this property to true if the element the mouse is currently over can accept the object currently being dragged to be dropped on it. set the value to false if it doesn't make sense to drop the object on it. this should be changed in the ondragover and ondragenter event handlers. dragaction set to the current action to be per
formed, which should be one or more of the constants described earlier. this can be used to provide extra feedback to the user. numdropitems the number of items being dragged. for example, this will be set to 5 if five bookmarks are being dragged. getdata(transfer,index) get the data being dragged. the first argument should be an nsitransferable object to hold the data. the second argument, inde...
...ged. the first argument should be an nsitransferable object to hold the data. ...
...he data. the second argument, index, should be the index of the item to return. sourcedocument the document where the drag started. ...
Block and Line Layout Cheat Sheet - Archive of obsolete content
padding mcomputedpadding mcomputedoffsets mcomputedminwidth mcomputedmaxwidth mcomputedminheight mcomputedmaxheight given the current container frame and the style applied to the child, these values are the resolved values for the child frame's box. nshtmlreflowmetrics the structure that is "filled in" by a frame during reflow, and is used to communicate the frame's desired size in
formation back to its container. mmaximumwidth the maximum width that the frame would consume if it were reflowed with an unconstrained available width. it might be better named "preferred width". this is computed when the nsblockreflowstate flag brs_computemaxwidth is set. maxelementwidth the maximum width for elements within the frame that cannot be broken down further; e.g., the longest word ...
...sblockreflowstate flag brs_computemaxwidth is set. maxelementwidth the maximum width for elements within the frame that cannot be broken down further; e.g., the longest word in a paragraph. note that an out-of-flow frame (e.g., a floater) may affect this value. this field is a pointer to an nssize object. when null, the frame need not compute it. nsblockreflowstate additional reflow state in
formation that the block frame uses along with nshtmlreflowstate. like nshtmlreflowstate, this is read-only data that is passed down from a parent frame to its children. mflags brs_unconstrainedwidth this flag is set in the nsblockreflowstate constructor when: there is no computed width for the frame in the nshtmlreflowstate, and the frame being reflowed has been given ns_unconstrainedsize as i...
...he span as they are reflowed. mlastframe may also be directly manipulated if a line is split, or if frames are pushed from one line to the next. mframe the perframedata of the inline frame that "owns" the span, or null if this is the root span. mframe is initialized to the containing inline frame's perframedata when a new perspandata is pushed in nslinelayout::beginspan. original document in
formation author(s): chris waterson last updated date: december 4, 2004 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
l implements too many interfaces to count; the ones that matter to us most are nsiwebnavigation and nsilinkhandler. nsuriloader this is a service implementing nsiuriloader. it keeps track of currently pending loads and registered content listeners. some facilities are provided for starting loads, canceling loads, and other such micromanagement. nsdocumentopeninfo this class encapsulates all the in
formation related to a particular load. there is basically one of these per load (though see the section on stream converters). nsdocumentopeninfo implements nsistreamlistener and proxies the nsistreamlistener calls over to the "real" stream listener once one is chosen. this is the class that handles deciding where the data from the load should go. supporting roles necko this is the mozilla network...
...contentlistener. these registered listeners are used later during content dispatch. api calls to load a new uri. these can come in via nsiwebnavigation (a scriptable embedding interface) or nsilinkhandler (an internal interface used for link clicks). both interfaces are implemented by nswebshell/nsdocshell. these api calls will typically pass in a uri string or object to load, and may include in
formation like the name of the target frame (for <a target="something">, e.g.). nsdocshell::internalload() handles targeting to the correct docshell (if the load has a target window associated with it), scrolling to anchors (if the load is an anchor within the current page), and session history issues. it calls douriload(). douriload() creates a channel, massages it to have the right post data, load...
...s our stream listener and are done -- we just need to pump data into it and let the downstream nsdocumentopeninfo handle the final dispatch. if we still do not have a stream listener, that means that we failed to find an nsiuricontentlistener or nsicontenthandler for this type. give the load to the helper app service; this will return an nsistreamlistener that we can use. original document in
formation author(s): boris zbarsky last updated date: october 24, 2003 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
GRE Registration - Archive of obsolete content
successfully embedding the gre requires that in
formation about installed gres be stored on the system. this in
formation is stored differently on each operating system. this document describes the registration mechanism. windows on windows, gre registration in
formation is kept in the win32 registry under the hkey_local_machine/software/mozilla.org/gre and hkey_current_user/software/mozilla.org/gre keys. ...
... about installed gres be stored on the system. this in
formation is stored differently on each operating system. this document describes the registration mechanism. windows on windows, gre registration in
formation is kept in the win32 registry under the hkey_local_machine/software/mozilla.org/gre and hkey_current_user/software/mozilla.org/gre keys. each subkey is searched for gre registration in
formation: hklm/software/mozilla.org/gre/1.8_1 version=1.8 grehome=c:\path\to\installed-dir feature=value feature2=value2 hklm/software/mozilla.org/gre/1.8_2 version=1.8 grehome=c:\path\to\second-installation when installing a gre via the mozilla suite gre installer, the installer will blindly overwrite any previous gre in
formation in hklm/software/mozilla.org/gre/<version>. when instal...
... is already an installation at hklm/software/mozilla.org/gre/<version> and will try alternate keys <version>_1 _2 until an available key is found. mac on mac, the only gre is the libxul framework xul.framework. this framework is installed either in /library/frameworks/xul.framework/versions/<version> or in ~/library/frameworks/xul.framework/versions/<version>. linux on linux, registration in
formation is kept in ini-style files of the following
form: [1.7.10] gre_path=/usr/lib/mozilla-1.7.10 feature=value feature2=value2 these ini files can be in any of the following locations: /etc/gre.conf /etc/gre.d/*.conf ~/.gre.conf ~/.gre.d/*.conf mozilla has never officially shipped a linux gre based on the mozilla suite. however, some linux distributors including red hat/fedora core ship /etc/gr...
HTTP Class Overview - Archive of obsolete content
tioninfo identifies a connection nshttptransaction implements nsirequest encapsulates a http request and response parses incoming data nshttpchunkeddecoder owned by a transaction strips chunked transfer encoding nshttprequesthead owns a nshttpheaderarray knows how to fill a request buffer nshttpresponsehead owns a nshttpheaderarray knows how to parse response lines per
forms common header manipulations/calculations nshttpheaderarray stores http "<header>:<value>" pairs nshttpauthcache stores authentication credentials for http auth domains nshttpbasicauth implements nsihttpauthenticator generates basic auth credentials from user:pass nshttpdigestauth implements nsihttpauthenticator generates digest auth credentials from user:pass original do...
... ...
... ...
Help Viewer - Archive of obsolete content
mozilla's help viewer makes providing documentation an easy job, and this document will describe how you can use it. ...
...mozilla's help viewer makes providing documentation an easy job, and this document will describe how you can use it. ...
...mozilla's help viewer makes providing documentation an easy job, and this document will describe how you can use it. ...
Basics - Archive of obsolete content
you can find the console in the extra menu of firefox. the namespace for this api is console. methods info()this method does stuff. log(stringstring)this method writes a notification message to the console. ...
...(stringstring)this method writes a notification message to the console. stringthe message to add to the consolestring console.log("hello world!"); arn()this method does stuff. error()this method does stuff. exception()this method does stuff. logfromcaller()this method does stuff. class notifications the notification box appears at the bottom right corner of the browser and displays important in
formation to the user. the namespace for this class is jetpack.notificaitons. methods show(titlestringbodystringiconstring)draws a notification box. titlethe head of the notification message.string bodythe messagestringfalse iconthe url of an .ico file.string jetpack.notifications.show("hello world");var mybody = " my first message body on jetpack";var myicon = "http://www.mozilla.com/favicon.ico";...
...ion box. titlethe head of the notification message.string bodythe messagestringfalse iconthe url of an .ico file.string jetpack.notifications.show("hello world");var mybody = " my first message body on jetpack";var myicon = "http://www.mozilla.com/favicon.ico";jetpack.notifications.show({title: "my first message on jetpack", body: mybody, icon: myicon}); class tabs in this class you can find in
formation about the tabs in your firefox window. the namespace for this class is jetpack.tabs. blah(lengthstringfocusedstringtostringstringpopstringpushstringreversestringshiftstringsortstringsplicestringunshiftstring)this is some default text lengththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstu...
New Security Model for Web Services - Archive of obsolete content
atransporturi - the service uri atype - type requested by the script ( ex. soapv, soap, load, etc. ) return pr_true if access granted else pr_false void invalidatecache(in string atransporturi); invalidate cached entry for the given transport uri. empty the cache by passing in a empty string nswebscriptsaccess(implements nsiwebscriptsaccessservice) maintains access in
formation, for servers, in an access-info-cache ( hashtable ). if an entry was not found in the cache creates one by loading the declaration file (web-scripts-access.xml) and extracting in
formation from it (declaration file); requested type and subject princple's prefix are compared to the allowed type and prefix in order to determine access. an entry is created if and only if the declaration file is ...
... note: script access is checked via declaration file only if the script security manager denies access. ...
... allowed type and prefix in order to determine access. an entry is created if and only if the declaration file is considered valid (validation based on the syntax described above); an invalid document will result in access denial. denies script access in the event of an xml-well
formedness error, or validation error, or if the declaration file does not grant access. reports errors (validation, well
formedness, file not found, etc.) to the console via nsiconsoleservice. note: script access is checked via declaration file only if the script security manager denies access. summary advantages the proposed declaration file places the server operator, not the client in control of access to his server by untrusted scripts. the access hole is no bigger than the service in question. the access is d...
Priority Content - Archive of obsolete content
d into the wiki. the list of completed documents is available through the devedge page. if you would like to sign up to do the migration of any of these works, just "edit" this page and add your name to the "migrators" list for the piece. if there is devedge content you think should be migrated that isn't currently on this list, feel free to add it. note: use example at sample:original document in
formation to credit original authors. devedge devedge mirror note: if you're digging around the mirror and see anything there that you think should be migrated to devmo that isn't on this list, feel free to add it below. a raw list of everything that has not been migrated at all appears there. book length works in progress: netscape gecko plugin api reference 1.0 original: netscape gecko plugi...
...s not been migrated at all appears there. book length works in progress: netscape gecko plugin api reference 1.0 original: netscape gecko plugin api reference 1.0 wiki location: gecko plugin api reference migrators: started: core javascript reference 1.5 original: core javascript reference 1.5 wiki location: core javascript 1.5 reference migrators: deb richardson in progress: trans
forming xml: netscape and xslt 1.0 original: trans
forming xml: netscape and xslt 1.0 wiki location: trans
forming xml with xslt migrators: serge k. keller in progress: rapid application development with mozilla original: author's page and planned host, ben's temporary host wiki location: toc and links page still under construction. migrators: nigel mcfarlane and ben karel shorter works mo...
...is materials in devedge in the devmo wiki under the cc:by-sa license (yay!) started: browser feature detection original: browser feature detection wiki location: browser feature detection migrators: serge k. keller mostly completed*: rich-text editing in mozilla 1.3 "mostly completed" means i'm waiting for a location to store example and source files which are required for demoing the in
formation in the articles. original: rich-text editing in mozilla 1.3 wiki location: rich-text editing in mozilla i dropped the 1.3, as the article still applies and shouldn't sound outdated. migrators: joel coreson note: the article links some external example files, not sure how to migrate them (perhaps via "upload file" function that's normally used for images?) also check if any extra files ...
New Skin Notes - Archive of obsolete content
(so large whitespace area's are non-existant), suggest min-width:some-em-size; width: 88%; and max-width set to 95% or something like that. --callek i tried this, but it gets totally screwed up in ie for some reason. i'll try again, but can't guarantee this will be fixed for the initial upgrades. --dria took two days, but i finally got this sorted out. when the skin is updated on test/docs, edit
form textarea should be resizeable in all browsers. yay! --dria wordpress skins need footer in
formation. -- dria when a page is redirected, need to say-so and what it was redirected from, (see document for an example of such.) this is only an issue in mw1.5 so far. devmo skin vs cavendish skin --callek i can probably pull-off this patch if needed (quickly), so dria or others do not have to hunt...
...pretty annoying places. i'll try to get those fixed today. --dria well, with mediawiki skin, you can have the clear:both's in content area without a problem. i understand it might be hard to fix in the skin, but it is very desirable (because we sometimes use the floats and 'clears' in our pages). --nickolay 04:52, 25 aug 2005 (pdt) the clear/boths aren't in the content, they're embedded style in
formation in the .php files in the /includes directory. it's just sloppy coding. i cannot think of any reason for writers or editors to add "clear:both" brs to their document. under what situations does this seem like something that should be embedded directly into the wiki content? --dria when using floated divs - images and such. if you don't use it they overlap with headings, which is something we...
...ndalf 00:39, 31 aug 2005 (pdt) link url fixed for wiki skin only. tab text will currently remain untranslated ("documentation"). devnews and webwatch are not currently being localised so shall remain as they are, with link to english wiki. --dria further notes and ideas (future) skin designed more for the editorial crowd, with the editor tools more prominently placed in the skin. the core
format would be the same as "default", however. skin designed with simplicity in mind -- minimal header, nav, footer -- plausibly good for alternate or small screen display, or people who prefer more straight-up
formatting for on-screen docs. skin designed specifically with accessibility in mind. might want to consult with aaronlev to see what would be best. also see about improving accessibility ...
Merging TraceMonkey Repo - Archive of obsolete content
checkout repos. ...
...to tracemonkey via hg pull ../mozilla-central you will see a notice about adding at least one head to the repository -- this is the mozilla-central head that you are about to merge. merge via hg merge you may see a number of conflicts. conflicting files can be listed via hg resolve -l. exercise caution, because leaving off the -l will re-merge and lose all of the resolutions you've already per
formed. for each unresolved file (with a u next to it), open the file and find the conflict markers that look like <<<<<<. if it's obvious how to fix the conflict, just do it. otherwise, you can run hg parents filename to find the changesets which may have contributed to the conflict. inspecting the files at those two changesets can be helpful: hg cat -c changeset filename once all the conflict mar...
... (with a u next to it), open the file and find the conflict markers that look like <<<<<<. if it's obvious how to fix the conflict, just do it. otherwise, you can run hg parents filename to find the changesets which may have contributed to the conflict. inspecting the files at those two changesets can be helpful: hg cat -c changeset filename once all the conflict markers are removed, you've per
formed the manual resolution, which you tell to mercurial by running hg resolve -m filename. again, exercuse caution. once you've resolved all the files, all the entries in hg resolve -l will have rs next to them. per
form a build. if the tree does not build successfully you've likely merged something incorrectly. historically, auto-merge doesn't mess up much. land. if the sheriff gives you permi...
Tamarin Acceptance Testing - Archive of obsolete content
hat changes to the tamarin code base are high quality before submitting, all developers are required to complete the following steps. ...
...e following test suites: acceptance test suite [info] self tests [info] submit a sandbox build request to test against plat
forms that you may not have locally [info] available tamarin acceptance test suites actionscript acceptance tests: actionscript acceptance tests running tamarin acceptance tests abc assembler tests cmdline tests per
formance tests actionscript per
formance tests running tamarin per
formance tests built-in self tests see instructions in doc/selftest.html in the tamarin repository. ...
...cceptance tests abc assembler tests cmdline tests per
formance tests actionscript per
formance tests running tamarin per
formance tests built-in self tests see instructions in doc/selftest.html in the tamarin repository. avmdiff see instruction in doc/avmdiff.txt in the tamarin repository. misc the acceptance and per
formance tests can be run on windows mobile devices connected to windows desktop machine with activesync. to build and setup the tools see building_tamarin_windows_mobile_utilities. ...
Tamarin-central rev 703:2cee46be9ce0 - Archive of obsolete content
tamarin-central rev 703:2cee46be9ce0 was declared stable on 12/02/08. the announcement sent to tamarin-devel can be read here. testing summary acceptance tests have passed on the following supported plat
forms: * windows, 32 & 64 bit * mac ox x ppc & intel, 32 bit * linux, 32 bit * windows mobile arm version asc-4200 of the actionscript compiler was used for all tests. per
formance testsuite time metric the following is a comparison of the current tamarin-central (tc-703) versus the prior build (tc-700) as well as current against the vm in flash player 10. the key takeaway is that the interpreter is much improved. osdefault-jitinterpretedaggressive jit mac (os/x 10.4 in...
... there is no linux comparison due to a linux memstat bug only recently resolved in the tamarin-central branch. osdefault-jitinterpretedaggressive jit mac (os/x 10.4 intel, 2ghz dual core)tc-703 vs tc-700: 2.0% smallertc-703 vs ...
... recursive pcre testcases kills the stack on pocketpc builds ...
The new nsString class implementation (1999) - Archive of obsolete content
res of the new nsstrimpl implementation are: intrinsic support for 1 and 2 byte character widths provides automatic conversion between strings with different character sizes inviolate base structure eliminates class fragility problem; safe across dll boundaries offers c-style function api to manipulate nsstrimpl offers simple memory allocator api for specialized memory policy shares binary
format with bstring coming soon: a new xpcom (nsistring) interface non-templatized; this is a requirement for gecko very efficient buffer manipulation architecture the fundamental data type in the new architecture is struct nsstrimpl, given below: struct nsstrimpl { print32 mlength; void* mbuffer; print32 mcapacity; char mcharsize; char munused; // and now for the nsstrimpl ap...
...will seriously hinder our ability to localize the source base. it is recognized that (ascii) nscstring's are useful in the following contexts: whenever calling libraries that expect a char* variant whenever maximum memory efficiency is essential i would argue that only the first case is normatively legitimate. the i18n folks will tell you it's better to use a wide string and convert to 1-byte
forms for this purpose even though there is a per
formance penalty for doing so. since i have to acknowledge the idiom, i have made nscstring available but note that it should be used sparingly. memory management a principal enhancement of the new architecture is pluggable memory allocators. all nsstring subclasses provide their own default allocator implementations, but programmers are free to use the...
...nd implementation). second, they are concerned that programmers be prevented from abusing the string classes in a number of ways. to wit: they want to ensure that the underlying buffers cannot be corrupted or altered erroneously they want to ensure that the appropriate set of conversion functions get applied they want some control over the usage pattern of strings, such that the 2-byte (ucs2)
form is used whenever possible, and some restrictions are applied to the use of 1-byte (ascii) nscstrings. original document in
formation author: rick gessner last updated date: january 20, 1999 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Treehydra Manual - Archive of obsolete content
treehydra simply reflects the gcc internals structures into javascript. for now, the best way to learn gimple is to look at existing code as there is little newbie documentation to be had. callbacks and gcc intermediate representations like dehydra, treehydra sends program representations to the user javascript via callbacks. there are 3 treehydra callbacks. ...
...n cfg_bb_iterator(cfg)) { print(" basic block " + bb_label(cfg, bb)); for (let isn in bb_isn_iterator(bb)) { print(" " + isn_display(isn)); } } } post-inlining gimple cfgs treehydra can be positioned after any pass, allowing you access various levels of gimple. in this example, we show how to access the gimple just after function inlining is per
formed. (this allows a simple version of interprocedural analysis.) at this point, gcc is using a different internal structure, so treehydra uses a different callback, process_cgraph. require({ after_gcc_pass: "einline" + (isgcc42 ? "" : "_ipa")}); include('gcc_util.js'); // for function_decl_cfg function process_cgraph(cgraph) { // cgraph is a gcc structure representing a group of fu...
...tract state the represents the empty set of concrete states. if the state is bottom at a certain program point, that means that program point is unreachable. in esp, this is esp.not_reached. top. this is a special abstract state that represents all possible states. top is also used to name a special abstract value that represents all possible concrete values. thus, top means the analysis has no in
formation about that value or state. meet. meet is a relation on abstract values used to filter states at conditional statements. for example, if the current abstract value of a variable x is nonzero, and the analysis goes inside an if statement with the condition x == 1, then in the new abstract value of x will be nonzero meet 1. esp uses a user-defined meet function supplied to the analysis construc...
Using addresses of stack variables with NSPR threads on win16 - Archive of obsolete content
however, since it affects the portability of code, it was deemed prudent to include a short memo describing the issue. problem statement win-16 (aka, windows 3.1, et al), is unique in that the architecture depends on the operating environment (i.e., windows) knows the address of the stack, and that there is only one such address. consequently, implementing threads, with their implication of a unique stack for each thread, requires that the nspr copy the stacks during thread context switches. the actual copying of the stack is not such a hardship as one would imagine. ...
...on win-16, the thread's attempt to address the <tt>shareddata</tt> through the pointer shared will provide interesting (though always incorrect) results. it's difficult to tell exaclty where the updated <tt>counter</tt> is being stored. the only portable manner to write this program requires that the shared structure be allocated from the heap. well, that isn't so hard to reme...
...ly to cause problems is passing addresses of automatically allocated variables to a function that wends its way though arbitrary amounts of convoluted logic, and finds its way into an object that is shared. ...
Venkman - Archive of obsolete content
r mozilla's javascript debugger. it aims to provide a powerful javascript debugging environment for mozilla based browsers namely firefox, netscape 7.x/9.x and seamonkey. note that it is not included in the gecko-based browsers such as k-meleon, galeon and netscape 8.x. venkman has been provided as part of the mozilla install distribution since october 2001, as well as an extension package in xpi
format. documentation venkman introduction an overview and some practical examples of using the javascript debugger in web development. using breakpoints in venkman this article describes breakpoints in javascript and how to use venkman to set and examine breakpoints. learning the javascript debugger venkman wri...
...1998, john bandhauer was in charge of creating the netscape 4.x javascript debugger. in order to keep things modular, he began by creating a mid-level javascript debugging api known as js/jsd. this api augments the existing javascript api, providing clients with a useful set of debugger functionality implemented in c. bandhauer then went on to reflect that api into java, and create his cross plat
form front end, eventually producing netscape javascript debugger 1.0 and 1.1. in april of 2001, robert ginda began work on a javascript debugger for mozilla, called venkman. venkman builds on the js/jsd portion of john's 1998 work, exposing it as an xpcom component. this allows the user interface be written in javascript and xul, which allows venkman to be fully cross-plat
form. venkman is nam...
...... mailing list newsgroup rss feed irc: #venkman on irc.mozilla.org report a bug in venkman if you find a problem with venkman, please follow directives mentioned at venkman faq section 5.4 and then you may report a bug on javascript debugger component. related topics javascript, web development, developing mozilla original document in
formation author(s): robert ginda other contributors: doctor unclear last updated date: july 13, 2007 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Anonymous Content - Archive of obsolete content
of nesting. explicit content is said to be at the document-level scope. anonymous content nodes are in their own binding-level scopes. binding scopes are determined by the bound element that contains the binding responsible for the generation of the anonymous nodes. the scope of an element can be determined using the getbindingparent method on the documentxbl interface. see section 3 for more in
formation. this method returns the bound element in the enclosing scope that is responsible for the anonymous node. if invoked on an element at the document-level scope, it returns null. dom methods that can be invoked on elements (e.g., getelementsbytagname) will only see nodes that are in the same scope. methods invoked on the document (e.g., getelementbyid) only see nodes that are at the document-...
...eating new insertion points, or for removing insertion points? perhaps on elementxbl?] event flow and targeting flow and targeting across scopes dom events can fire on anonymous targets just as they can on explicit targets. as long as the event flows within the same scope, it is no different from the behavior outlined in the dom level 2 events specification. events flow through the final trans
formed content model after all elements have been repositioned through the usage of children tags. whenever events flow from an anonymous element in a bound element's scope to the bound element itself, one of two actions occurs. either the event is retargeted so that the bound element becomes the target, or the event is stopped and flow proceeds to the next phase. whenever an event is retargeted, the...
..., the events are not allowed to flow to the file control. if the user continues moving to the right and leaves the button, then the mouseout generated will be retargeted, since the file control will also have been exited. anonymous content and css selectors and scopes bindings can interleave anonymous elements between the bound element and its explicit children. see insertion points for more in
formation. in this situation, a new tree emerges that is different from the explicit content node tree. in addition to having a single explicit parent (the bound element) the explicit children also have an arbitrary set of anonymous parents (created by bindings when child insertion points were used). child, descendant, and sibling selectors will match on any path of anonymous and explicit elements. a...
Mac stub installer - Archive of obsolete content
how do i add an installer package to the mac installer? adding a package involves a few steps: add a section named for your <component> to the packages-mac manif...
...s. if it finds your module's jst file it will substitute that for the install.js. ...
...f files from dist per the directives in packages-mac if your module's section has some file entries. ...
compareTo - Archive of obsolete content
returns if the versions are the same, this method returns 0. ...
... returns if the versions are the same, this method returns 0. ...
...on version); compareto ( string version); compareto ( int major, int minor, int release, int build); parameters the compareto method has the following parameters: maj the major version number. min minor version number. rev revision number. bld build number. version an installversion object or a string representing version in
formation in the
format "4.1.2.1234". returns if the versions are the same, this method returns 0. if this version object represents a smaller (earlier) version than that represented by the version parameter, this method returns a negative number. otherwise, it returns a positive number. in particular, this method returns one of the following values: -4 this version object has a small...
addDirectory - Archive of obsolete content
slash). an absolute pathname is used as specified. a relative pathname is appended to the registry name of the package as specified by the package parameter to the initinstall method.this parameter can also be null, in which case the xpisourcepath parameter is used as a relative pathname.note that the registry pathname is not the location of the software on the computer; it is the location of in
formation about the software inside the client version registry. version an installversion object or a string of up to four integer values delimited by periods, such as "1.17.1999.1517". for variants of this method without a version argument the value from initinstall will be used. xpisourcepath a string specifying the location of the directory within the xpi file.an empty ...
...is an empty string, registryname cannot be null. localdirspec an object representing a directory. the file is installed under this directory on the user's computer. you create this object by passing a string representing the directory to the getfolder method. subdir the name of a directory to append to localdirspec, using '/' as the path separator regardless of the plat
form.if subdir is missing, null, or "", the filenames are appended directly to the folder name specified by localdirspec. flags an optional field; reserved for future use. pass 0 as the default value. returns an integer error code. for a list of possible values, see return codes. in some situations, adddirectory may return other errors. description the adddirectory method puts the file...
... an optional field; reserved for future use. pass 0 as the default value. returns an integer error code. for a list of possible values, see return codes. in some situations, adddirectory may return other errors. description the adddirectory method puts the files in the specified directory in a temporary location. to move the files and all other subcomponents to their final location, call the per
forminstall method after you've successfully added all subcomponents. also see the note about binaries on the macintosh plat
form in addfile. ...
execute - Archive of obsolete content
of the file to finish before it resumes. default is false. see note below. the blocking parameter is not available as part of this method in versions of netscape before 6.1/mozilla 0.9.3. returns an integer error code. for a list of possible values, see return codes. description the execute method extracts the named file from the xpi file to a temporary file name. your code must call the per
forminstall method to actually execute the file. you can use this method to launch an installshield installer or any install executable file stored in a xpi file. executing installed files note: if the file you wish to execute is one you are installing (as opposed to an installer executable that you plan to delete once it runs), then use the execute method on the file object instead. file.execute() ...
...aise an error when you restart the browser. passing arguments to the executable the args parameter, when present, passes a string to the executable as command-line parameters. the following line, for example, passes the "-c" command-line parameter to the executable: err = file.execute(myfile, "-c", true); when you want to pass more than one parameter to the executable itself, however, you must
format the args string in a particular way so that the parameters can be broken up and passed separately as required. in general, you should use single quotes for the args string and double quotes to delimit the command-line arguments within args. the following parsing rules apply: double quotes are treated as quotes; single quotes are ignored by the executable but legal in the execute() method. ...
...executable but legal in the execute() method. the outer quotes that frame the args string itself are stripped off when the string is passed to the executable. quotes that are escaped, or "backslashed," are passed through the executable intact. all other backslashed cases are ignored. this means that in order to pass three command-line arguments (-c, -d, and -s) to the executable, you should
format the args string as follows: err = file.execute(myfile, '"-c""-d""-s"', true); //technically, given the rules above, you could also pass the same //arguments with the following line, but the result is much less //readable: err = file.execute(myfile, "\"-c\"\"-d\"\"-s\"", true); also see the note about binaries on the macintosh plat
form in addfile. ...
getFolder - Archive of obsolete content
ername); filespecobject getfolder ( string foldername, string subdirectory); filespecobject getfolder ( object localdirspec, string subdirectory); parameters the getfolder method has the following parameters: foldername a string representing one of netscape's standard directories. there are two sets of possible values for this parameter. the first set contains plat
form-independent locations; the second set contains plat
form-specific locations. you are encouraged to use the plat
form-independent locations. see the list in the description section for the two sets of locations. subdirectory a string that specifies the name of a subdirectory. if the specified subdirectory doesn't exist, it is created. this parameter is available in netscape 6 or later ...
...you should be careful about using one of those directories, ...
... "win desktop" "win desktop common" "win program files" "win programs" "win programs common" "win startmenu" "win startmenu common" "win startup" "win startup common" "win system" the "file:///"
form is only valid when the subdirectory parameter is used. it must be in file: url
format minus the "file:///" part. for example, mydir = getfolder("file:///", "c|/mysoftco/somedir"); note that forward slashes are used, regardless of the plat
form. the folders whose names start with "win", "mac", or "unix" are specific to those plat
forms. you should be careful about using one of those directories, as it makes your installation plat
form-specific. example to get an object represent...
patch - Archive of obsolete content
at come from another vendor, such as /microsoft/shared/msvcrt40.dll. typically, relative pathnames are relative to the main pathname specified in the initinstall method. this parameter can also be null, in which case the xpisourcepath parameter is used as a relative pathname. note that the registry pathname is not the location of the software on the computer; it is the location of in
formation about the software inside the client version registry. version an installversion object or a string of up to four integer values delimited by periods, such as "1.17.1999.1517". for variants or this method without a version argument the value from initinstall will be used. xpisourcepath a string specifying the location of the differences file within the xpi file. ...
...ard slashes (/) in this pathname, regardless of the convention of the underlying operating system. if this parameter is blank or null, xpisourcepath is used. returns an integer error code. for a list of possible values, see return codes. description the patch method to update an existing component by applying a set of differences between two known versions. the set of differences is in gdiff
format and is created by the nsdiff utility. a patch can only be applied between two known versions. if the existing version of the file does not match the checksum stored in the gdiff file, patch returns an error without applying the patch. after patch applies a patch, it compares a checksum.of the resulting file against a checksum stored in the gdiff file. if the checksums do not match, the origin...
...rns an error without applying the patch. after patch applies a patch, it compares a checksum.of the resulting file against a checksum stored in the gdiff file. if the checksums do not match, the original version of the file is preserved, the patched version of the file is discarded, and an error code is returned. any single installation process can apply multiple patches to the same file. if per
forminstall indicates that a reboot is necessary to complete the installation, patch may not work in subsequent xpinstall processes until the reboot is per
formed. ...
Properties - Archive of obsolete content
f this api is now deprecated and as of gecko 1.9 no longer available. extension, theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. in particular plugin developers should see how to package a plugin as an extension. properties archive full local path of the archive after it is downloaded to the plat
form specific temp folder. (e.g. c:\temp\argstest.xpi) arguments args can be passed in through the triggering apis by attaching a ? and then the rg string to the xpi url: (e.g. startsoftwareupdate("http://webserver/argstest.xpi?argument_string") will result in the value of install.arguments being argument_string #). note that spaces in the arg string are legal. everything after the quest...
...ing a ? and then the rg string to the xpi url: (e.g. startsoftwareupdate("http://webserver/argstest.xpi?argument_string") will result in the value of install.arguments being argument_string #). note that spaces in the arg string are legal. everything after the question mark is treated as one string which becomes the install.arguments property. ...
...tall.arguments property. buildid the application build id in the
form 20041231. note that due to branching (different versions of gecko with different feature sets might be built on the same day), using this property to "detect" the application version may produce false results. additionally, the build id can be 0 for custom builds. jarfile alias for archive plat
form contains in
formation about the plat
form xpinstall was compiled for/runs on. for example, the value could begin with "windows", "macintosh" or "x11" (for unix/linux). for more details, see the corresponding code living in the getinstallplat
form method of class nsinstall. url the fully qualified url of the xpi (file url, http url, ftp url, etc.) (e.g. http://dolfin/sgehani/zzz/...
Install Object - Archive of obsolete content
sed primarily in installation scripts. in all cases, the install object is implicit--like the window object in regular web page scripts--and needn't be prefixed to the object methods. ...
...eedn't be prefixed to the object methods. the following two lines, for example, are equivalent: f = getfolder("program"); f = install.getfolder("program"); an installation script is composed of calls to the install object, and generally takes the following
form: initialize the installation call initinstall with the name of the installation and the necessary registry and version in
formation. ...
...tall object, and generally takes the following
form: initialize the installation call initinstall with the name of the installation and the necessary registry and version in
formation. add the files to the installation add files to the installation by calling getfolder to get file objects and passing those object refs to addfile as many times as necessary. per
form installation check that the files have been added successfully (e.g., by checking the error return codes from many of the main installation methods, and go ahead with the install if everything is in order: per
formorcancel(); function per
formorcancel() { if (0 == getlasterror()) per
forminstall(); else cancelinstall(); } for complete script examples, see script examples. ...
Return Codes - Archive of obsolete content
name code explanation success 0 success. reboot_needed 999 the files were installed, but one or more components were in use. restart the computer and the application to complete the installation process. ...
... file cannot be deleted because its permissions are set to read only. is_directory -216 the specified file cannot be deleted because it is a directory. network_file_is_in_use -217 the specified file cannot be deleted because it is in use. apple_single_err -218 an error occurred when unpacking a file in applesingle
format. invalid_path_err -219 the path provided to getfolder was invalid. patch_bad_diff -220 an error occurred in gdiff. patch_bad_checksum_target -221 the checksum generated for the source file does not match the checksum in the xpi file. patch_bad_checksum_result -222 the checksum of the ...
... -234 expected source directory and got file insufficient_disk_space -235 not enough disk space for install filename_too_long -236 unable_to_locate_lib_function -237 unable_to_load_library -238 chrome_registry_error -239 mal
formed_install -240 key_access_denied -241 access to the registry key has been denied key_does_not_exist -242 registry key does not exist value_does_not_exist -243 registry value does not exist invalid_signature -260 the signature used in the xpi is not valid in...
Deprecated and defunct markup - Archive of obsolete content
{many elements on this page are wrongly marked as deprecated, this page needs review} the following xul tags and attribute should be considered deprecated, if not defunct. the list below may include a few elements which are actually in use, but at a deeper level in the code. even some of the in
formation on the tags below may be out of date, but is provided here for historical reference and to help anyone who comes across them in old code or documentation. elements <actions> (listed here by mistake or was it a container tag?) typo for <action> --neil 03 march 2011 <autorepeatbutton> (action occurs repeatedly on mouse hover--used to construct other elements; used in <arrowscrollbox> and large drop-down menus) so, not deprecated? --neil 03 march 2011 <bulletinboard> (made to...
...--neil 03 march 2011 <sidebarheader> not true, still in use --neil 03 march 2011 <slider> (clickable tray in <scrollbar> whi...
... <titledbutton> (attempt to combine text and images before <button>) <toolbarpaletteitem> required to embed non-buttons in customisable toolbars --neil 03 march 2011 <treebody> (old/experimental and unsupported xul tags) lives on as the internal name for the ancestor <treechildren> element --neil 03 march 2011 <treecaption> (old/experimental and unsupported xul tags) <treecolgroup> (
former name for <treecols> <treecolpicker> (internal use only; part of xbl for <tree>) <treefoot> (old/experimental and unsupported xul tags) <treeindentation> (old/experimental and unsupported xul tags) was a part of the old <tree> that predated <outliner> that was not converted to <listbox>--neil 03 march 2011 <treeicon> (old/experimental and unsupported xul tags) <treerows> (internal...
Dynamically modifying XUL-based user interface - Archive of obsolete content
it is written for beginner to intermediate xul developers. we assume that the reader has basic knowledge of both xul and javascript. you may also want to read some introductory documents about dom, like the about the document object model article or the introduction page of the gecko dom reference. ...
...cument is a data structure which is manipulated through dom apis. a logical structure of every document is a tree, with nodes being elements, attributes, processing instructions, comments, etc. use the dom inspector tool to see the tree representation of any document. todo: simple example of a xul document and a tree you can think of a document as an in-memory representation of valid html or well-
formed xml such as xhtml or xul. it is important to remember that different web pages (and even different instances of the same web page) correspond to different documents. each xul window has its own distinct document, and there may even be a few different documents in a single window, when there is an <iframe>, <browser>, or a <tabbrowser> element. you must be sure to always manipulate the correct d...
...u need to use the methods of nsidomdocumentxbl interface instead. for example: // gets the first anonymous child of the given node document.getanonymousnodes(node)[0]; // returns a nodelist of anonymous elements with anonid attribute equals el1 document.getanonymouselementbyattribute(node, "anonid", "el1"); see getanonymousnodes and getanonymouselementbyattribute in the xbl reference for more in
formation. once you have an anonymous node, you can use regular dom methods to navigate and manipulate the rest of the nodes of that binding. see also a related chapter on dom xul tutorial:modifying a xul interface ...
Moving, Copying and Deleting Files - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file in
formation | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the plat
form (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. there are several methods of the nsifile object ...
...ce.txt"); var destination = io.newfile("desktop", ""); file.copyto(destination, "destination.txt"); this example copies a file called 'source.txt' within the user's home directory to the desktop. in addition, the file is renamed to 'destination.txt'. two file objects are created, the first is the file to copy, and the second is the directory in which to copy the file to. nsifile.copyto() of the
former is called, passing the latter as the first argument to nsifile.copyto(). naturally, the destination must be a directory or an error will occur. in this case, we assume that 'source.txt' is a file. if the item to copy is a directory, it can be copied in the same manner as above without changes. this allows an entire directory and its contents to be copied from one location to another. you might...
...var file = io.newfile("home", "importantdata"); var destination = io.newfile("desktop", ""); destination.append("backups"); file.copyto(destination, ""); this example copies an item called 'importantdata' into a directory called 'backups' within the desktop directory. nsifile.append() is used to retrieve the 'backups' subdirectory. this method is used to navigate into subdirectories. for more in
formation about nsifile.append(), see working with directories. in this last example, the destination filename is set to an empty string. this causes the item to be copied without changing its name. this will be the usual behaviour when copying to a different directory, but you would want to specify a filename when copying a file to another name within the same directory. in this latter situation, yo...
MenuButtons - Archive of obsolete content
so the 'save' alert will appear. however, we can associate a different command with the items on the submenu. when the command is fired, it bubbles up through the chain of elements to the top of the document. when the first item on the menu ('save this document') is activated, it will also display the 'save' alert as the command event bubbles up to the button. ...
...as with this example, the 'menu-button' type of button is usually used when the menu provides more specific options pertaining to the operation. we might want to extend this example to insert a list of the unsaved documents to the save button menu so that each could be saved individually. ...
...button menu so that each could be saved individually. you might want to set the first item in the example above as the default button, so it indicates to the user that the command is carried out when the main button is pressed. this can be done by setting the default attribute on the item to true. <menuitem label="save this document" default="true"/> see indicating_the_default_item for more in
formation about the default attribute. as with the 'menu' type, the 'menu-button' type may be applied to either the button or the toolbarbutton element. ...
Panels - Archive of obsolete content
panel with a button, place the <panel> element directly inside the button element. 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. the popup panel will, by default, appear with its topleft corner just underneath the bottom edge of the button, much as a menu does. the position can, however, be changed. for more in
formation about positioning the popup, see positioning popups. only buttons (and toolbarbuttons) have this automatic behaviour which opens the popup when pressed. for other types of elements, you need to use a different technique as in the following example. <label value="search" popup="search-panel"/> <panel id="search-panel"> <label control="search" value="terms:"/> <textbox id="search"/> </p...
...ample: <panel id="search-panel" position="after_start"> <label control="search" value="terms:"/> <textbox id="search"/> </panel> <label value="search" popup="search-panel"/> the position attribute has been added to the panel element with the value 'after_start'. this causes the panel to be displayed not where the mouse was clicked but aligned along the bottom edge of the label. for more in
formation about this attribute and other possible values that can be used, see positioning popups. it is also possible to open a panel like a context menu using the context attribute instead of the popup attribute. this works just like using context menus except that the panel element is used instead of the menupopup element. see context menus for more details on this. opening a panel with script t...
...o true. <panel id="search-panel" noautohide="true"> <textbox id="search"/> <button label="search" oncommand="dosearch();"/> <button label="cancel" oncommand="this.parentnode.hidepopup();"/> </panel> because the panel can no longer be closed by clicking elsewhere, the panel should always provide a means to close the panel itself. in this example a cancel button has been added. for more in
formation about these types of panels, see floating panels. focus in panels elements within panels may be focused with the mouse, and the currently focused element may be adjusted by pressing the tab key. when a popup is opened, if an element in the main window is focused, that element is unfocused, and a blur event is fired at it. although no element within the popup panel is focused by default, th...
Popup Guide - Archive of obsolete content
of a selected element. tooltips when the mouse is positioned over a ui control, a tooltip provides a small box with descriptive help about that control. when the mouse is moved away from the control, the tooltip automatically disappears. a tooltip can be created by setting the tooltiptext attribute on an element or by using the tooltip element. ...
...e tooltiptext attribute on an element or by using the tooltip element. working with popups the following additional in
formation is available about manipulating menus and popups. opening a menu or popup most menus and popups are opened automatically when they are associated with an element. to open a popup using script use the openpopup method or the openpopupatscreen method. for detailed in
formation about how to open a popup see opening a popup or opening a menu. closing a menu or popup for in
formation about closing a popup, see closing a popup or closing a menu. how popups are placed to read about how the position of a popup on screen is determined, and how to align popups to other elements, see positioning popups. determining if a popup is open to determine if a popup o...
... various features of items on a menu, see features of the menuitem element modifying the items on a menu to append, insert and remove elements from a menu, see modifying a menu. events when popups are opened or closed the popupshowing and popupshown events are fired when a menu or popup is opened. the popuphiding and the popuphidden events are fired when a menu or popup is closed. for in
formation about these events, see popup events. handling keys within popups for in
formation about how keys are handled within menus and panels, see handling keys within popups. plat
form specific menu considerations see special per-plat
form menu considerations for some notes about handling menus on certain plat
forms, for instance creating the application menu on a macintosh. using popups in...
Building Menus With Templates - Archive of obsolete content
ver, unlike with other elements, the content of a menu is only generated once the menu has been opened. this means that a menu created with a template will not have any of the generated items until the user opens the menu, or a script opens the menu. this applies to menus on menubars, submenus, as well as menu-type buttons such as those with a type attribute set to menu. this allows for better per
formance as the entire content of a complex menu does not need to be created until the user needs to use the menu. it is very simple to create a menu using a template. here is an example using an xml source: <button type="menu" datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"/> <action> <menupopup> <menuitem uri="?" label="?name"/> </menup...
...mplate-driven button has. if you press this button before opening the menu, there will be one child (the template itself). however, after the menu has been opened, there will be two children, one is the template and the other is the generated menupopup. ...
...the special feature of menus to not generate content immediately applies only to the menu itself. generating a recursive menu menus are often generated from a template recursively. ...
Introduction - Archive of obsolete content
typically, the value will be a uri that identifies the location of the data. for example, for an xml datasource, the url of an xml file is specified. when the xul parser sees an element with this attribute, it constructs a template builder for the element and attaches it to the element. it is expected that there will be a template inside the element. the template builder loads the datasource, per
forms a query on the datasource and generates content based on the results in combination with the template. the type of datasource is specified with the querytype attribute. the type affects how the datasource is used as well as the syntax for specifying queries. content generated by the template is inserted into the xul just as if you had placed it there yourself. here is an example: <vbox datasourc...
... anything to do until the data is loaded. actually, this isn't quite true. the rdf service starts the loading of the datasource in the background, and the template builder goes through the process of building content anyway. naturally, since there is no data yet, no results will be available, so the builder ends up building nothing. once some data starts arriving, the template builder scans its in
formation to see if some results can be created. if so, some content can be generated. if not, nothing gets generated again. an interesting thing to note is that due to the nature of the rdf parsing process, the builder generates results and builds content incrementally while the data arrives. of course, since the data arrives so quickly from the network, you really don't notice this. if the datasourc...
...hich holds the user's browser bookmarks and use your own datasource to add custom data about those bookmarks. <vbox datasources="rdf:bookmarks http://www.xulplanet.com/ds/sample.rdf"> in addition, when using the rdf type for chrome xul (such as in extensions), the datasource rdf:local-store is always included in the composite. the local store is a datasource which is usually used to hold state in
formation such as window sizes, which columns in a tree are showing, and which tree items are open. you can query for any data in the local store in a template though this is rarely done. sometimes, you will want to specify the datasource to be used later, possibly determined dynamically by a script. the special uri rdf:null is used to indicate that you intend no datasources, or an empty datasource. t...
Simple Query Syntax - Archive of obsolete content
attribute to be set to the photo's title. you can get other predicates in the same way, just by using the predicate uri and prefixing it with 'rdf:'. you can also combine two in one attribute by separating them with a space or a caret (^) just as you can with the full syntax. for example: <label value="rdf:http://purl.org/dc/elements/1.1/title http://www.xulplanet.com/rdf/country"/> the 'rdf:'
form is really equivalent to the <binding> tag in the full syntax. the subject of the binding is the result member resource, the predicate is the string that comes after 'rdf:' and the object isn't necessary as the value is replaced directly in the attribute. as with bindings, the value is not required to match, so the data doesn't have to exist in the rdf graph. if one photo doesn't have a title, it ...
...ut of the member resource. that is, you cannot filter on predicates pointing into the member resource nor can you cannot filter based on predicates pointing out of other resources. for that, you need to use the full syntax. the triples to check are specified using attributes on the rule element (thus, a rule element should be used). the namespace of the attribute and the attribute name combine to
form the predicate you wish to filter by and the value of the attribute will be the value to filter by. any results that match the criteria are accepted and any that do not match are rejected. you can use multiple attributes to filter by several criteria. in this case, all of the criteria must match for the result to be accepted. for example, to filter for photos with a specific country: <hbox id="ph...
... a single attribute may be used to filter for only those results that have a country set to 'http://www.daml.org/2001/09/countries/iso#it'. photos that do not have this country will not have any content generated for them. the attribute has a namespace that, when expanded, becomes 'http://www.xulplanet.com/rdf/country'. this syntax is much like how predicates are the specifed in the rdf/xml. this
form of attribute syntax on a rule is equivalent to a <triple> in the extended syntax. in fact, the builder will internally convert the attribute into the same compiled
form that would be used for a <triple>. the equivalent triple for the above example might be: <triple subject="?photo" predicate="http://www.xulplanet.com/rdf/country" object="http://www.daml.org/2001/09/countries/iso#...
Template Logging - Archive of obsolete content
. enabling logging will output details to the error console for each result. the error console can be found on the firefox tools menu. this logging of results can be very useful for debugging, but remember to remove this flag when you have finished and the template works correctly, as the logging can take up extra time that is not necessary when the template is working. each result is logged in a
form much like the following: in template with id root using ref http://www.some-fictitious-zoo.com/birds new active result for query 2 matching rule 1: http://www.some-fictitious-zoo.com/birds/emperorpenguin in the example above, a new result has been added. for references, the value of the template's id and ref attributes are provided in each logged message. this is useful if multiple templates are...
...byid using this id will retrieve the generated content for that result if you want to further study the content that was generated. the example also specifies 'query 2 matching rule 1'. this indicates that the result is for the second <query> element. if only one <query> is used, naturally this will always indicate a query of 1. in addition, this result matches the first <rule> of query 2. this in
formation may be used to determine if results are not matching the correct rules. if you, for example, were expecting rule 2 to match, examine the rules and ensure that the logic is correct. the final piece of in
formation is the phrase 'new active result'. this indicates first, that this is a new result, as opposed to a result being removed, and second, that this result is 'active'. being active means...
...t with the same id is being removed from the first query instead. note that this result is active and an indication is made in parantheses that there is no longer any active query. this indicates that the generated content will be removed. the log may instead indicate that another query is active; this would mean that the content for a different query is now generated. to summarize, the following
forms of message may be logged: new active result for query 1 matching rule 2 a new data result has been added. in this example, the result matches the second rule of query 1. the generated content is from rule 2 of query 1. new inactive result for query 2 (overridden by query 1) a new data result has been added for query 2, but an earlier query 1 overrides it. the generated content is still from the...
textbox (Toolkit autocomplete) - Archive of obsolete content
h-autocomplete requires seamonkey 2.1 the user's default search engine's suggestions are searched. places-tag-autocomplete requires seamonkey 2.1 the user's places tags are searched. mydomain new in thunderbird 3 requires seamonkey 2.0 the user's email domain is suggested. history requires seamonkey 2.0 the user's url history is searched.
form-history requires seamonkey 2.0 search the values that the user has entered into
form fields. file (linux only) the local file system is searched. gloda new in thunderbird 3 addrbook new in thunderbird 3 requires seamonkey 2.0 the user's address book is searched. ldap new in thunderbird 25 requires seamonkey 2.22 the user's ldap dir...
...hange this attribute. if false, the default, autocomplete is enabled. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
...nt. there is no default. the timer starts after the user types a character. if the user types another character, the timer resets. 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. autocomplete a textbox that supports autocomplete. for more in
formation about autocomplete textboxes, see the autocomplete documentation (xpfe [thunderbird/seamonkey]) (firefox) number a textbox that only allows the user to enter numbers. in addition, arrow buttons appear next to the textbox to let the user step through values. there are several attributes that allow the number textbox to be configured, including decimalplaces, min, max, increment, wraparou...
Adding Style Sheets - Archive of obsolete content
mozilla applies a default style sheet to each xul window. ...
...mozilla applies a default style sheet to each xul window. ...
...e stored in chrome://findfile/skin/findfile.css. all the xul examples so far have actually been using a style sheet already. 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/. in mozilla, this will be translated as the file global.css, which contains default style in
formation for xul elements. you could leave the line out and the elements will still work, however they will look fairly plain. the style sheet applies various fonts, colors and borders to make the elements look more suitable. changing the styles however, there will be times when the default look of elements will not give the look that is desired. for this, we will need to add a style sheet of our own...
Creating Dialogs - Archive of obsolete content
ow one might construct them. creating a dialog the opendialog() function is used to open a dialog, and is related to open(). this function differs from open() in several ways. it displays a dialog instead of a window, which implies that it is asking something of the user. it also has subtle differences in the way it works and appears to the user. these differences will vary depending on the plat
form the application is running on. in addition, the opendialog() function can take additional arguments beyond the first three. these arguments are passed to the new dialog and placed in an array stored in the new window's arguments property. you can pass as many arguments as you wish. this is a convenient way to supply default values to the fields in the dialog. var somefile=document.getelementbyi...
...ans it will not work on remote sites; for those, use window.open() instead. the dialog element the dialog element should be used in place of the window element when creating a dialog. it provides the useful ability to construct up to four buttons along the bottom of the dialog forok,cancel, and so on. you do not need to include the xul for each button; however, you do need to supply code to per
form the appropriate tasks when the user presses each button. this mechanism is necessary because different plat
forms have a specific order in which the buttons appear. example dialog source view <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing" title="dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/the...
...ace any elements that you wish in a dialog. the dialog element has some additional attributes that windows do not have. the buttons attribute is used to specify which buttons should appear in the dialog. the following values may be used, seperated by commas: accept - an ok button cancel - a cancel button help - a help button disclosure - a disclosure button, which is used for showing more in
formation you can set code to execute when the buttons are pressed using the ondialogaccept, ondialogcancel, ondialoghelp and ondialogdisclosure attributes. if you try the example above, you will find that the dook() function is called when the ok button is pressed and the docancel() function is called when the cancel button is pressed. the two functions dook() and docancel() both return true, whic...
Localization - Archive of obsolete content
ypically, you will have one dtd file for each xul file, usually with the same filename except with a .dtd extension. so, for the find files dialog, we will need a file called findfile.dtd. for non-installed chrome files, you can just put the dtd file in the same directory as the xul file. note: you should encode dtd files as utf-8 for non-ascii characters. ...
...ile for each xul file, usually with the same filename except with a .dtd extension. so, for the find files dialog, we will need a file called findfile.dtd. for non-installed chrome files, you can just put the dtd file in the same directory as the xul file. note: you should encode dtd files as utf-8 for non-ascii characters. that is, you should save them in utf-8
format (without bom). for more in
formation, see mozilla language packs. ...
...in this case, we have declared that we want to use the findfile.dtd dtd file. ...
Manipulating Lists - Archive of obsolete content
ents which implement this interface have these methods. this includes the menulist, radiogroup and tabs elements. for example, to add a new item to a menulist, you can use the same syntax as for a listbox. the right kind of element will be appended in each situation. list selection the nsidomxulselectcontrolelement interface provides two additonal properties, selectedindex and selecteditem. the
former returns the index of the selected item while the latter returns the selected element. for instance the selecteditem of a menulist will be the menuitem that is selected. if no item is selected, selectedindex will return -1, while selecteditem will return null. getting the selected item these two properties are commonly inspected during a select event, as in the following example: example 2 : ...
... selection and the functions of the nsidomxulmultiselectcontrolelement interface. this interface provides a number of functions specifically for handling multiple selection. for example the selecteditems property holds a list of the items that are selected, while the selectedcount property holds the number of items selected. typically, you will use these properties to iterate over the list and per
form some operation for each item. be careful when iterating over the selected items; if you modify the items in the list while iterating, the list will change and the selection properties may return different values. this is one reason why it is useful to manipulate the list by the item rather than by index. deleting selected items the following example shows a method of deleting the selected items...
...roll position may be adjusted using a couple of listbox methods. the scrolltoindex() method scrolls to a given row. this listbox will scroll such that the row will be the top row visible, unless the row is near the end of the list of items. the ensureindexisvisible() method is similar in that it also scrolls to show a row, but this method does not scroll if the item is already visible. thus, the
former function is used to scroll to a specific row while the latter is used just to make sure that a row is visible. there is also an ensureindexisvisible() that takes an item as an argument instead of an index. compare the effect of both functions at different scroll positions in this example: example 5 : source view <button label="scrolltoindex" oncommand="document.getelementbyid('thel...
Using Spacers - Archive of obsolete content
« previousnext » in this section, we will find out how to add some spacing in between the elements we have created. adding spacers one of the problems with developing user interfaces is that each user has a different display. some users may have larger displays with higher resolutions and others may have lower resolutions. in addition, different plat
forms may have special requirements on the user interface. ...
...ping user interfaces is that each user has a different display. some users may have larger displays with higher resolutions and others may have lower resolutions. in addition, different plat
forms may have special requirements on the user interface. if adding support for multiple languages, the text for one language may require more room than another. applications that need to support multiple plat
forms and languages usually have their windows laid out with lots of space to allow for this. some plat
forms and user interface toolkits provide components that are smart enough to resize and re-position themselves to fit the needs of the user. (java uses layout managers for example.) xul provides the capability for elements to position and resize automatically. as we've seen, the find files window ha...
...e space. the buttons have been pushed over. our find file example the code to add a spacer is shown below. insert it just before the find button. <spacer flex="1"/> <button id="find-button" label="find"/> more about flexibility xul lays out elements on a window by calculating suitable widths and heights for the elements and then adding space where they are flexible. unless you specify in
formation about the width and height of an element, the default size of an element is determined by its contents. you'll notice that the cancel button in the dialogs has always set its width so that it fits the text inside it. if you create a button with a very long label, the button's default size will be large enough to hold the entire label. other elements, such as the text box have chosen a suitab...
Using the Editor from XUL - Archive of obsolete content
s placeholder transaction enables us to batch typing events together, so that an undo undoes the whole series of keystrokes. another stack-based class, nsautorules, ensures that text insertion is wrapped with calls to nshtmleditor::startoperation() / endoperation(). these functions call beforeedit() and afteredit() on the current typing rules. now, we initialize a nstextrulesinfo with the in
formation about the string being inserted, and call willdoaction() on the current editing rules. because the implementation of inserting text differs between the different rules (plain text vs. html, for example), it is handled entirely by the rules code, in the willdoaction()call. in composer, we are using nshtmleditrules, so we end up in nshtmleditrules::willdoaction(). for text insertion, this d...
...ey presses, this will just insert a single character. ...
...ction() call, and drop into willdoaction(), which, for text insertion, does nothing. ...
XUL element attributes - Archive of obsolete content
nodes and which ones are not containers. this attribute should be placed on the same element that the datasources and the ref attribute is on. it may be set to a space-separated list of rdf properties or resources. context type: id should be set to the value of the id of the popup element that should appear when the user context-clicks on the element. a context-click varies on each plat
form. usually it will be a right click. you can use the special value '_child' to indicate the first menupopup child of the element. contextmenu type: id alternate name for the context attribute, but also has a corresponding script property contextmenu. datasources type: space separated list of datasource uris a space-separated list of datasources that an element's template will use ...
...pe: space-separated list of the values below a set of flags used for miscellaneous purposes. two flags are defined, which may be the value of this attribute. dont-test-empty: for template generated content, the builder will not check that a container is empty. dont-build-content: this flag may be used on a tree to indicate that content elements should not be generated. this results in a per
formance enhancement, but you will not be able to use the dom functions to retrieve the tree rows. flex type: string (representing an integer) indicates the flexibility of the element, which indicates how an element's container distributes remaining empty space among its children. flexible elements grow and shrink to fit their given space. elements with larger flex values will be made lar...
... boolean if true, the element may be used as one that modifies a preference in a prefwindow. the preference attribute may be used to connect to a preference element. this is useful for custom elements implemented in xbl. the element should fire change, command, or input event when the value is changed so that the preference will update accordingly. see the pref system documentation for more in
formation. querytype type: string indicates the type of datasource used in a template. firefox 3 provides 3 built-in datasources: 'rdf', default, 'xml' and 'storage'. extensions may provide support for additional datasources. ref type: uri for template-generated elements, this attribute is used to specify the root rdf node where content generation begins. this will correspond to the ...
XUL Template Primer - Bindings - Archive of obsolete content
l value="?name"/> <label value="?street"/> </hbox> </action> </rule> </template> </vbox> </window> the xul template primer covers the <conditions> and <action> elements, so we won't discuss those here. we'll use a the following data model to illustrate how bindings work. see the rdf/xml file friends.rdf, below, a simple database with name and address in
formation for some of my good friends. <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:nc="http://home.netscape.com/nc-rdf#"> <rdf:description about="urn:root"> <nc:friends> <rdf:seq> <rdf:li> <rdf:description nc:name="alison appel"> <nc:address resource="#home"/> </rdf:description> </rdf:li> ...
...:street="435 hoffman"/> </rdf:rdf> the rdf model that this file creates can be represented with the following graph. when displayed in mozilla, something like this appears: note that even though poor lumpy has no nc:address property, he still appears in the content model! unlike the <conditions>, bindings do not affect whether or not a rule matches: they just "pull through" additional in
formation if it is available. the <bindings> element the <bindings> element is optional in a xul template, but if present, must appear as a sibling of the <conditions> and <action> elements in a rule. the <binding> element the <bindings> element (plural) may contain any number of <binding> (singular) elements. <bindings> <binding subject="?friend" predicate="http://home.netscape.com/nc...
...lly. ...
XUL Event Propagation - Archive of obsolete content
neral way in a previous xulnote. but to use events effectively in xul, you must be aware of what the actual process for raising, listening to, and handling events is. collectively, this process is referred to as the event model. events are used for different purposes, but they play a particularly important role in creating interactive xul-based user interfaces, since it is events that bring the in
formation about user actions to the code behind the interface. the following image describes in a very basic way how the various actors in the event model interact with one another. the user clicks a button in the interface. this button responds to the user action by raising an event, a message meant to travel from one element within the interface to another. in this case, the event raised was the...
...lement includes an "oncommand" event listener attribute for getting events. ...
...tener is the way to register event listeners for events other than the generalized "command" event, and the way to register a particular element for event capture, which preempts the regular flow of events. original author: ian oeschger other documents: w3c dom events, mozilla xul events original document in
formation author(s): ian oeschger last updated date: january 18, 2002 copyright in
formation: copyright (c) ian oeschger ...
description - Archive of obsolete content
| related ] this element is used to create a block of text. the text can be set either with the value attribute or by placing text inside the open and close description tags. the value attribute is used to set text that appears in a single line. if text appears as a child of the description, it will wrap to multiple lines. it may contain arbitrary markup, which can be styled as needed. more in
formation is available in the xul tutorial. attributes crop, disabled, tabindex value properties accessibletype, crop, disabled, tabindex, value style classes header, indent, monospace, plain, small-margin examples this is a long section of text that will word wrap when displayed <description> this is a long section of text that will word wrap when displayed. </description> this is ...
...he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
... menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
dialog - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element should be used in place of the window element for dialog boxes. the buttons attribute may be used to set which buttons should appear in the dialog box. these buttons will be placed in the correct locations for the user's plat
form. more in
formation is available in the xul tutorial and dialogs and prompts (code snippets). attributes buttonaccesskeyaccept, buttonaccesskeycancel, buttonaccesskeydisclosure, buttonaccesskeyextra1, buttonaccesskeyextra2, buttonaccesskeyhelp, buttonalign, buttondir, buttondisabledaccept, buttonlabelaccept, buttonlabelcancel, buttonlabeldisclosure, buttonlabelextra1, buttonlabelextra2, buttonlabelhelp, buttonorient, buttonpack, buttons, defaultbutton, title ...
.... buttonorient type: string the value of the orient attribute for the box containing the buttons. buttonpack type: string the value of the pack attribute for the box containing the buttons. buttons type: comma-separated list of the values below a comma-separated list of buttons to appear in the dialog box. the buttons will be placed in suitable locations for the user's plat
form and basic event handling will be per
formed automatically. the following values can be used in the list: accept: the ok button, which will accept the changes when pressed. this button will also be the default button. cancel: the cancel button which will cancel the operation. help: a help button for displaying help about the dialog. disclosure: a button to show more in
formation. this migh...
...ve (background). moreover this hides separator between titlebar and window contents. this affects only on mac os x. title type: string the text to appear in the title bar of the window. properties buttons type: comma-separated list of the values below a comma-separated list of buttons to appear on the dialog box. the buttons will be placed in suitable locations for the user's plat
form and basic event handling will be per
formed automatically. the following values can be used in the list: accept: the ok button, which will accept the changes when pressed. this button will also be the default button. cancel: the cancel button which will cancel the operation. help: a help button for displaying help about the dialog. disclosure: a button to show more in
formation. this migh...
label - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to provide a label for a control element. if the user clicks the label, it will move the focus to the associated control, specified with the control attribute. more in
formation is available in the xul tutorial. attributes accesskey, control, crop, disabled, href, value properties accesskey, accessibletype, control, crop, disabled, value style classes header, indent, monospace, plain, small-margin, text-link examples <label value="email address" control="email"/> <textbox id="email"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appea...
...he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
... menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
menu - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element, much like a button, that is placed on a menubar. when the user clicks the menu element, the child menupopup of the menu will be displayed. this element is also used to create submenus. more in
formation is available in the xul tutorial. attributes acceltext, accesskey, allowevents, command, crop, disabled, image, label, menuactive, open, sizetopopup, tabindex, value properties accessibletype, accesskey, command, control, crop, disabled, image, itemcount, label, labelelement, menupopup, open, parentcontainer, selected, tabindex, value methods appenditem, getindexofitem, getitematindex, insertitemat, removeitemat style classes menu-iconic example <menubar id="sample...
...he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
... menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
menuseparator - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used to create a separator between menu items. typically drawn as a thin line. more in
formation is available in the xul tutorial. attributes acceltext, accesskey, allowevents, command, crop, disabled, image, label, selected, tabindex, value properties accessibletype, accesskey, command, control, crop, disabled, image, label, labelelement, parentcontainer, selected, tabindex, value examples <menu label="menu"> <menupopup> <menuitem label="item1"/> <menuseparator/> <menuitem label="item2"/> <menuitem label="item3"/> </menupopup> </menu> attributes acceltext type: string text that appears beside the menu label to indicate the shortcut ...
...he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
... menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
panel - Archive of obsolete content
is pressed, the panel will be displayed. a panel may also be opened via a script using the openpopup method. the panel is closed when the user clicks outside the panel, presses escape or when the panel's hidepopup method is called. warning: for firefox versions between 3.6 and 4.0, placing an iframe, browser or editor inside a panel is not supported. some features may work, but only on some plat
forms. for those versions of firefox, it is best to avoid child frames in a panel, if possible. this limitation was resolved as of firefox 4.0. attributes backdrag, close, consumeoutsideclicks, fade, flip, ignorekeys, label, left, level, noautofocus, noautohide, norestorefocus, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, titlebar, top, type properties accessibletype...
...bar, set the panel's close attribute to true to have a close button appear on the titlebar. pressing the close button will close the panel. consumeoutsideclicks type: boolean controls whether or not the event that caused the popup to be automatically dismissed (or "rolled up") should be consumed or be dispatched as a normal event. if it is not set, it defaults to the plat
form behavior. if it set to true the rollup event is consumed. if set to false, the rollup event is not consumed. this attribute should be used instead of setconsumerollupevent. fadetype: one of the values belowthe fade attribute, which may only be used with arrow panels, lets you set up a panel that will automatically fade away after a short time. the default is none. nonethe panels doesn't autom...
...ype: string for panels with titlebars, the label on the titlebar. left type: integer overrides the horizontal position of the popup specified by the showpopup method. level type: one of the values below specifies whether the panel appears on top of all windows, or just on top of the window the panel is in. if this attribute is not set, the popup window level depends on the plat
form. on linux, the default value is top, otherwise, the default value is parent. if a panel has one or more text fields, this attribute should not be set, otherwise ime or on-screen keyboard popups will appear incorrectly. for these reasons, you should avoid setting the level if not needed. top the panel is shown in front of all other normal windows, including those of other applications. p...
radio - Archive of obsolete content
an be turned on and off. radio buttons are almost always listed together in groups. only one radio button within the same radiogroup may be selected at a time. the user can switch which radio button is turned on by selecting it with the mouse or keyboard. other radio buttons in the same group are turned off. a label, specified with the label attribute may be added beside the radio button. more in
formation is available in the xul tutorial. attributes accesskey, command, crop, disabled, focused, group, image, label, selected, tabindex, value properties accesskey, accessibletype, control, crop, disabled, image, label, radiogroup, selected, tabindex, value examples <radiogroup> <radio id="orange" label="red" accesskey="r"/> <radio id="violet" label="green" accesskey="g" selecte...
...he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
... menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
radiogroup - Archive of obsolete content
rence home [ examples | attributes | properties | methods | related ] a group of radio buttons. only one radio button inside the group can be selected at a time. the radio buttons may either direct children of the radiogroup or descendants. place the radiogroup inside a groupbox if you would like a border or caption for the group. the radiogroup defaults to vertical orientation. more in
formation is available in the xul tutorial. attributes disabled, focused, preference, tabindex, value properties accessibletype, disabled, focuseditem, itemcount, selectedindex, selecteditem, tabindex, value methods appenditem, checkadjacentelement, getindexofitem, getitematindex, insertitemat, removeitemat examples <radiogroup> <radio id="orange" label="red"/> <radio id="violet...
...rue"/> <radio id="yellow" label="blue"/> </radiogroup> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
...controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. focused type: boolean this attribute is true if the element is focused. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more in
formation is available in the preferences system article. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. value type: string the string attribute allows you to associate a data value with an element. it is not used for any spe...
richlistbox - Archive of obsolete content
lement and use the keyboard to move the selection around. attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
... specific items within the element by pressing keys corresponding to letters in the item's label. this is done incrementally, so typing more letters with select more specific items. this feature may be disabled by setting this attribute to true. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more in
formation is available in the preferences system article. seltype type: one of the values below used to indicate whether multiple selection is allowed. single only one row may be selected at a time. (default in listbox and richlistbox.) multiple multiple rows may be selected at once. (default in tree.) for trees, you can also use the following values: cell individua...
...alue", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. currentindex type: integer set to the index of the currently focused item in the list. if no item is focused, the value will be -1. (or, on some plat
forms, typeof(listboxcurrentindex) will be undefined) in a single selection list, the current index will always be the same as the selected index. in a multiple selection list, the currently focused row may be modified by the user without changing the selection by pressing the control key and pressing the cursor keys to navigate. currentitem type: listitem element returns the currently focused ...
stringbundle - Archive of obsolete content
gbundles should be placed inside a stringbundleset element. a property file is a list of property key-value pairs each on a separate line. the key and value is separated with an equals sign. for example, the following defines two properties: message.displayerror=an error occured trying to display this message message.namealreadyused=the name %s is already being used by another account. more in
formation is available in the xul tutorial. the "src" attribute accepts only absolute chrome:// urls (see bugs 133698, 26291) attributes src properties applocale , src, stringbundle, strings methods get
formattedstring, getstring examples (example needed) attributes src type: uri the uri of the property file that contains the localized strings. inherited from xul elem...
...this is an object which implements nsilocale. src type: url gets and sets the value of the src attribute. stringbundle type: nsistringbundle returns the xpcom string bundle object which implements nsistringbundle. strings type: nsisimpleenumerator an enumeration of all of the strings in the string bundle. the enumeration contains nsipropertyelem...
.... this is an object which implements nsilocale. src type: url gets and sets the value of the src attribute. stringbundle type: nsistringbundle returns the xpcom string bundle object which implements nsistringbundle. strings type: nsisimpleenumerator an enumeration of all of the strings in the string bundle. the enumeration contains nsipropertyelement objects. methods get
formattedstring( key, strarray ) return type: string looks up the
format string for the given key name in the string bundle and returns a
formatted copy where each occurrence of %s (uppercase) is replaced by each successive element in the supplied array. alternatively, numbered indices of the
format %n$s (e.g. %1$s, %2$s, etc.) can be used to specify the position of the corresponding parameter expli...
tab - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single tab which should be placed inside a tabs element. the user may click a tab to bring the associated page of the tabbox to the front. more in
formation is available in the xul tutorial. attributes accesskey, afterselected, beforeselected, command, crop, disabled, first-tab, image, label, last-tab, linkedpanel, oncommand, pending, pinned, selected, tabindex, unread, validate, value properties accesskey, accessibletype, command, control, crop, disabled, image, label, linkedpanel, selected, tabindex, value examples (example needed) attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characte...
...he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
... menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
tooltip - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used for the tooltip popups. for text-only tooltips, this element doesn't need to be used; instead you may just add a tooltiptext attribute to an element. more in
formation is available in the xul tutorial. ...
...an ellipsis...
...he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
treecol - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a column of a tree. it displays the column header and holds the size and other in
formation about the column. you can also place splitter elements between the columns to allow column resizing. you should always place an id attribute on a treecol element to ensure that the column positioning is handled properly. more in
formation is available in the xul tutorial. attributes crop, cycler, dragging, editable, fixed, hidden, hideheader, ignoreincolumnpicker, label, primary, sort, sortactive, sortdirection, src, type, width properties accessibletype style classes treecol-image examples this example shows a checkbox in the first column, requires the style below. <tree flex="1" edit...
...on firefox 2.x and 3.x, all operating systems other than mac os x already use these styles by default. if targeting firefox for mac os x, be sure to use these styles but include your own checkbox image. however, chrome://global/skin/checkbox/cbox-check.gif is available in seamonkey on mac os x.. treechildren::-moz-tree...
...he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
Building XULRunner with Python - Archive of obsolete content
com work from active state. xpcom components can also be created in python. currently (mar 07) python is not enabled by default so a custom build of mozilla is needed. this page provides instructions in the hope of eliminating much trial and error. you should also read the the developer documentation on source code and building as wells as pyxpcom xulrunner with python promises to be a good plat
form for accessibility projects and both jambu alternative input and the iaccessible2 test tool are using it. of particular interested is access to msaa and iaccessible2 via the python comtypes package. development machine setup first a word of warning that zonealarm has exhibited memory leaks that cause build machines to crash with rather spurious errors. you may want to uninstall it if you suspe...
...c71. both must use the same version of the c runtime library msvcrt?.dll or crashes will ensue. the alternative is to build python with msvc8 as well asmozilla, but that may be problematic. it might also be possible to use the open source mingw compiler with the correct msvc run time but that is apparently not recommended. apply any service packs and for msvc71 sp 1 is available. the matching plat
form sdk is also needed and for msvc71 that is .net framework sdk 1.1. the latest mozilla build system is easy to use. install the included python distro usingpython25\python-2.5.msi. it doesn't need to be installed for the build but will be useful later when installing python packages which look for entries in the windows' registry. building the batch filestart-msvc71.bat is used to launch the bu...
...stalled reg query "hklm\software\python\pythoncore\2.5" > nul 2>&1 || reg query "hkcu\software\python\pythoncore\2.5" > nul 2>&1 if errorlevel 1 ( echo python 2.5 was not found. please install it. echo exiting... pause exit /b 1 ) start "xulrunner with python" "%moz_bin%\xulrunner.exe" -app application.ini %opts% exit /b 0 see xulrunner:deploying_xulrunner_1.8 for general in
formation. sample a sample xulrunner application with these python features is available. this includes the pyxpcom tests and a basic python console from alex badea ...
Deploying XULRunner - Archive of obsolete content
ment should be managed for self contained portable applications built on xulrunner. note: to actually install a xulrunner application, a compatible version of xulrunner must be registered on the system and the app must be deployed per the instructions at xul application packaging. ...
... it may turn out to be easier to create a self contained portable application, as described here, and deploy it with a generic installer that would create shortcuts to scripts that launch your application in the unregistered bundled xulrunner. ...
...the xulrunner section of article command line options. it may turn out to be easier to create a self contained portable application, as described here, and deploy it with a generic installer that would create shortcuts to scripts that launch your application in the unregistered bundled xulrunner. the responsibility still lies with the developer to provide the correct version of xulrunner per plat
form. in the end, most users are afraid of links that don't have a pretty icon so you may want to have a look at the branding section of xulrunner tips. windows on windows, xulrunner does not yet have a complete built-in installation solution; app developers should use pre-existing solutions for a native windows installer. an example of one such solution may be found in the article: creating a wind...
XUL Application Packaging - Archive of obsolete content
ey=value pairs. lines beginning with ; or # are treated as comments. a sample application.ini file can be found in the mozilla source tree. the [app] section the app section specifies metadata about the application name specifies the application name. required name example: name=testapplication version specifies the application version number. ...
... required see toolkit version
format for version numbering details example: version=0.1 buildid specifies a unique build identifier. this is typically a date identifier, and should be different for every released version of an application. required example: buildid=20060201 id specifies the unique application id required the application id, like extension ids, can be
formatted either like an email applicationname@vendor.tld or a uuid {12345678-1234-1234-1234-123456789abc}. the email
format is recommended for newly developed applications. example: id=testapplication@example.tld vendor specifies the application vendor optional example: vendor=grinch productions profile specifies the path to use for the application's profile, based within the us...
... example: enableprofilemigrator=1 the [crash reporting] section using crash reporting in a xulrunner application ...
nsIContentPolicy - Archive of obsolete content
type_dtd 13 indicates a dtd loaded by an xml document. type_font 14 indicates a font loaded via @font-face rule. type_media 15 indicates a video or audio load. type_websocket 16 indicates a websocket load. type_csp_report 17 indicates a content security policy report. type_xslt 18 indicates a style sheet trans
formation. type_beacon 19 indicates a beacon post. type_fetch 20 indicates a load initiated by the globalfetch.fetch() method, which is available as a global in both window and worker contexts. type_imageset 21 indicates a request to load an <img> (with the srcset attribute or <picture>. type_web_manifest 22 indicates a request to load a web ...
...request, or something that can queryinterface() to one of those; can be null if inapplicable. note: acontext is the new tab/window when a user uses the context menu to open a link in a new tab/window or cmd/ctrl + clicks the link (i.e., acontext is not the tab which the link was on in these cases). amimetypeguess optional. a guess for the requested content's mime type, based on in
formation available to the request initiator (e.g., an object's type attribute); does not reliably reflect the actual mime type of the requested content. aextra an optional argument, pass-through for non-gecko callers to pass extra data to callees. arequestprincipal optional. defines the principal that caused the load. this is optional only for non-gecko code: all gecko code should set this arg...
...ass extra data to callees. arequestprincipal optional. defines the principal that caused the load. this is optional only for non-gecko code: all gecko code should set this argument. for navigation events, this is the principal of the page that caused this load. return value accept or reject_* shouldprocess() should the resource be processed? shouldprocess() will be called once all the in
formation passed to it has been determined about the resource, typically after part of the resource has been loaded. "processing" means handling by the application. for instance, shouldprocess could be used to allow a response from a server to be handled or ignored depending on the mime type of the response. note: shouldprocess() can be called while the dom and layout of the document involved is in ...
2006-11-03 - Archive of obsolete content
aid that the problem that phil is experiencing is a known issue. he also mentioned that airbag doesn't build with msvc 7.1. (http://www.google.com/url?sa=d&q=htt...tail%3fid%3d64) gavin recommended that phil should add |ac_add_options --disable-airbag| to his .mozconfig. new windows compatibility issue? originally posted on november 1st: dale dale has set up a windows machine in order to per
form mozilla builds but has been unsuccessful to do so. according to him he has followed the windows build requirements recommended by mozilla. he also noted that he has had different results (error messages when compiling) on different machines. dale has discovered that there are other people who are experiencing the same issues as he is. he has also found a work around which is to use version 20040...
...piling) on different machines. dale has discovered that there are other people who are experiencing the same issues as he is. he has also found a work around which is to use version 20040127-1 of sh.exe instead of the sh.exe version 20040127-3. fix host_libidl_libs originally posted on october 29th: gery gery claims to have discovered a problem when he compiles mozilla across different plat
forms when pkg_config is used. on november 1st peter weilbacher responded gery's question. he told gery to create a bug for this problem in bugzilla. on november 2nd gery replied with the bug number 358706. problems building browser's trunk on windows using vs 2005 originally posted on october 29th: ricardo sixel is trying to retrieve the trunk source code using the browser check out opti...
...xes. on october 30th boris zbarsky boris expresses his opinion about paul taking down one of the two build boxes that produces nightly builds for linux. on october 30th j. paul reed responds to boris with the following explanation on why he is taking down one of two the linux build servers. paul explains that his goal is to do only singular sets of builds where the coverage of all the plat
forms is constant. meetings there were no meetings this week. summarized by: vanessa miranda & mohammad tirtashi ...
Extentsions FAQ - Archive of obsolete content
le your extension is still active, user can cancel uninstallation, and when it is physically uninstalled, your code can't run. right. and if you uninstall firefox, the profile data is left behind. it would be nice to give the option of clearing extension's data, but it should be implemented at application level, not by each extension individually. it might be an option to stick with it and per
form stuff when it comes to application shutdown. the sanitize stuff does this (clean stuff on exit). http://lxr.mozilla.org/mozilla1.8/so...ents/nsbrowser... firefox will clean all those preferences which are still "default", that is not changed by the user or the application/extension. to provide those default preferences to your extension see: http://kb.mozillazine.org/dev_:_usin...lt_preferen...
...addresses. it seems what you want is a one button access to that extension with a prefilled bounce address, right? could someone make an extension for thunderbird that preview upcomeing events and number of new messages? in our company i write this extension that connects to our groupware server (http). what server should souch extension work gainst? did you mean exchange? how to attach in
formation using the stringproperties of an imap message with out changing the properties? string properties are implemented as imap user flags. however not all servers support user flags, in which case you get reduced functionality as follows: all flags are stored in your local cache and are lost if your cache gets invalidated, and only "known" properties are copied when messages are copied. the list...
... asking about the feasibility of making an extension that has the same functionality as “trace route”. friday, september 29 - october 6, 2006 (↑ top) how can we programmatically extract the subject, sender, date and the body of an e- mail when you are reading one (in thunderbird presumably)?
Monitoring plugins - Archive of obsolete content
summary a new component of the plugin system is now available to measure how long it takes plugins (e.g., adobe flash) to execute their calls. this component then reports the plugin runtime using the observer service to anyone registered to receive the notifications. this article discusses how developers can make use of this new feature. runtime data the runtime in
formation reported is always in fractions of a second. because the component measures the wall clock time it takes for blocking plugin calls to execute, the value includes both cpu time, the wait time between allocation of cpu time to the process as well as any disk i/o time. it is therefore technically incorrect to say that the runtime is a measure of cpu use, however, it is a good representation of overall resources being consu...
...s a good representation of overall resources being consumed by the plugin. usage to make use of the new component you must register to receive its runtime notifications using the observer service. the notification's topic is experimental-notify-plugin-call. if you are new to the mozilla observer service, you may want to familiarize yourself with it before proceeding further. you can find more in
formation on the observer service here and here. below are a number of javascript snippets that would be useful to developers trying to use this feature: registration to register for runtime notifications with the observer service you must create a class with an observe method which receives 3 parameters (subject, topic and data) as well as a register method that contains the following code: v...
... unregister: function() { if (this.registered == true) { var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.removeobserver(this, "experimental-notify-plugin-call"); this.registered = false; } } } additional resources more in
formation on the observer service: nsiobserverservice nsiobserver ...
NPN_GetValueForURL - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary provides in
formation to a plugin which is associated with a given url, for example the cookies or preferred proxy. syntax #include <npapi.h> typedef enum { npnurlvcookie = 501, npnurlvproxy } npnurlvariable; nperror npn_getvalueforurl(npp instance, npnurlvariable variable, const char *url, char **value, uint32_t *len); parameters this function has the following parameters: instance pointer to the current plug-in instance. variable selects the type of in
formation to be retrieved (npnurlvcookie or npnurlvproxy) url the url for which to fetch in
formation. value out parameter. the browser passes back the reque...
...r *url, char **value, uint32_t *len); parameters this function has the following parameters: instance pointer to the current plug-in instance. variable selects the type of in
formation to be retrieved (npnurlvcookie or npnurlvproxy) url the url for which to fetch in
formation. value out parameter. the browser passes back the requested in
formation. if the function succeeds, the result buffer will be allocated with npn_memalloc; the plugin is responsible for freeing the buffer. note: the value may have internal null bytes and may not be null-terminated. when multiple cookies are returned for a given url, the
format of the return value is: cookie1=value1;cookie2=value2;cookie3=value3 len out parameter. the length of the returned ...
... the
format of the return value is: cookie1=value1;cookie2=value2;cookie3=value3 len out parameter. the length of the returned value buffer. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes. description this entry point is designed to allow plugins which implement their own http stacks to
form requests to the web server in the same way the browser does. see also npn_setvalueforurl, npn_getauthenticationinfo ...
NPN_Version - Archive of obsolete content
syntax #include <npapi.h> void npn_version(int* plugin_major, int* plugin_minor, int* netscape_major, int* netscape_minor); parameters the function has the following parameters: plugin_major pointer to a plug-in's major version number; changes with major code release number. plugin_minor pointer to a plug-in's minor version number; changes with point release number. ...
...r are compiled. for example, plug-in api version 4.03 has a major version number of 4 and a point release number of 3. this function gets the values from the plug-in rather than from the browser. a plug-in can use this function to check that the version of the plug-in api it is using is compatible with the version in use by the browser. this could be part of the initialization process. for more in
formation and an example, see getting the current version. you can use npn_version() to inquire on version constants (npvers constants), which represent particular browser features. once the plug-in obtains a version number, it can inquire on a version constant to find out if the feature it represents exists in this version. for example, the plug-in could inquire on the constant npvers_has_windowless ...
...ire on version constants (npvers constants), which represent particular browser features. once the plug-in obtains a version number, it can inquire on a version constant to find out if the feature it represents exists in this version. for example, the plug-in could inquire on the constant npvers_has_windowless to see if it is running in a browser that supports windowless functionality. for more in
formation and an example, see finding out if a feature exists. for a listing of version constants defined in the plug-in api, see version feature constants. note: plat
form-specific code in the plug-in api files npwin.cpp, npmac.cpp, or npunix.c checks version numbers automatically. a plug-in whose major version is less than the major version of the browser is not loaded. see also npn_useragent() ...
NPP_SetWindow - Archive of obsolete content
r code. for possible values, see error codes. description the browser calls npp_setwindow after creating the instance to allow drawing to begin. subsequent calls to npp_setwindow indicate changes in size or position; these calls pass the same npwindow object each time, but with different values. if the window handle is set to null, the window is destroyed. in this case, the plug-in must not per
form any additional graphics operations on the window and should free any associated resources. the data structure passed in npp_setwindow is an npwindow object, which contains the coordinates of the instance's area and various plat
form-specific data. this window is valid for the life of the instance, or until npp_setwindow is called again with a different value. for windowed plug-ins on windows and...
... for windowless plugins, npp_setwindow is called with a cliprect of 0,0,0,0 to signal that the plugin is not visible. ...
...dow is called again with a different value. for windowed plug-ins on windows and unix, the window parameter contains a handle to a subwindow of the browser window hierarchy. on mac os, this field points to an np_port structure. for windowless plug-ins, it is a plat
form-specific handle to a drawable. before setting the window parameter to point to a new window, it is a good idea to compare the in
formation about the new window to the previous window (if one existed) to account for any changes. for windowless plugins, npp_setwindow is called with a cliprect of 0,0,0,0 to signal that the plugin is not visible. note: npp_setwindow is useful only for embedded (np_embed) or full-screen (np_full) plug-ins, which are drawn into windows. it is irrelevant for hidden plug-ins. see also npp_handlee...
Writing a plugin for Mac OS X - Archive of obsolete content
project file, and if you built it in release mode, that folder in turn contains a "release" directory with the plugin inside it. to install the plugin, just copy it into one of these two locations: /library/internet plugins/ ~/library/internet plugins/ from this point, you can simply modify the sample plugin to do whatever you want. notes and tips this section provides some additional in
formation that may be helpful if you're trying to get a plugin building on your own. info.plist the plugin communicates its mime and filename extension in
formation using the info.plist file, which is packaged in the plugin bundle. the plugin also communicates its bundle type in that file, under the key cfbundlepackagetype; the type is 'brpl'. if the type isn't an npapi plugin type, the bundle won'...
... generated by the c++ compiler. the three symbols that must always be visible are: np_initialize() np_getentrypoints() np_shutdown() the sample plugin is written entirely in c, using a standard xcode build configuration, so by default all of its symbols are c-style and visible. ...
...-c++, you need to tell the compiler to export them in c
format by using extern "c" in the header, like this: #pragma gcc visibility push(default) extern "c" { nperror np_initialize(npnetscapefuncs *browserfuncs); nperror np_getentrypoints(nppluginfuncs *pluginfuncs); void np_shutdown(void); } #pragma gcc visibility pop you can check to be sure your symbols are visible and in standard c
format by using the nm utility provided among the mac os x developer tools: [user@foo mymac] nm basicplugin ... 00000810 t _np_getentrypoints 000007fa t _np_initialize 000008a0 t _np_shutdown ...
Element - Archive of obsolete content
rss well-
formed web module elements note: in the list of elements below the wfw xml namespace prefix is used (since it is a popular choice). however, use of wfw as the xml namespace prefix is not necessary. you are free to to choose your own prefix for this. ...
... rss well-
formed web module elements note: in the list of elements below the wfw xml namespace prefix is used (since it is a popular choice). however, use of wfw as the xml namespace prefix is not necessary. you are free to to choose your own prefix for this. ...
... rss well-
formed web module elements note: in the list of elements below the wfw xml namespace prefix is used (since it is a popular choice). however, use of wfw as the xml namespace prefix is not necessary. you are free to to choose your own prefix for this. ...
Digital Signatures - Archive of obsolete content
r digital signing. the key pair consists of a private signing key and a public verification key. the public key is widely distributed, while the private key is known only to its proprietor. the keys are related mathematically, but the parameters are chosen so that calculating the private key from the public key is either impossible or prohibitively expensive.the encrypted hash, along with other in
formation, such as the hashing algorithm, is known as a digital signature. figure 1 shows a simplified view of the way a digital signature can be used to validate the integrity of signed data. figure 1 shows two items transferred to the recipient of some signed data: the original data and the digital signature, which is basically a one-way hash (of the original data) that has been encrypted with t...
...the original data and the digital signature, which is basically a one-way hash (of the original data) that has been encrypted with the signer's private key. to validate the integrity of the data, the receiving software first uses the signer's public key to decrypt the hash. it then uses the same hashing algorithm that generated the original hash to generate a new one-way hash of the same data. (in
formation about the hashing algorithm used is sent with the digital signature, although this isn't shown in the figure.) finally, the receiving software compares the new hash against the original hash. if the two hashes match, the data has not changed since it was signed. if they don't match, the data may have been tampered with since it was signed, or the signature may have been created with a privat...
...ult to deny doing so later, assuming that the private key has not been compromised or out of the owner's control. this quality of digital signatures provides a high degree of nonrepudiation; that is, digital signatures make it difficult for the signer to deny having signed the data. in some situations, a digital signature may be as legally binding as a handwritten signature. original document in
formation author(s): ella deon lackey last updated date: 2012 copyright in
formation: © 2012 red hat, inc. link: red hat certificate system common criteria certification 8.1: deployment, planning, and installation ...
Vulnerabilities - Archive of obsolete content
escribed below. vulnerability categories a software flaw vulnerability is caused by an unintended error in the design or coding of software. an example is an input validation error, such as user-provided input not being properly evaluated for malicious character strings and overly long values associated with known attacks. another example is a race condition error that allows the attacker to per
form a specific action with elevated privileges. a security configuration setting is an element of a software’s security that can be altered through the software itself. examples of settings are an operating system offering access to control lists that set the privileges that users have for files, and an application offering a setting to enable or disable the encryption of sensitive data stored by ...
...ptions are often implicit, such as creating a feature without first evaluating the risks it would introduce. threats may also change over the lifetime of software or a protocol used in software. for example, the address resolution protocol (arp) trusts that an arp reply contains the correct mapping between media access control (mac) and internet protocol (ip) addresses. the arp cache uses that in
formation to provide a useful service—to enable sending data between devices within a local network. however, an attacker could generate false arp messages to poison a system’s arp table and thereby launch a denial-of-service or a man-in-the-middle attack. the arp protocol was standardized over 25 years ago, and threats have changed a great deal since then, so the trust assumptions inherent in it...
...tings have both positive and negative consequences for security. an example is the number of consecutive failed authentication attempts to permit before locking out a user account. setting this to 1 would be the most secure setting against password guessing attacks, but it would also cause legitimate users to be locked out after mistyping a password once, and it would also permit attackers to per
form denial-of-service attacks against users more easily by generating a single failed login attempt for each user account. because of the number of vulnerabilities inherent in security configuration settings and software feature misuse possibilities, plus the number of software flaw vulnerabilities on a system at any given time, there may be dozens or hundreds of vulnerabilities on a single system. ...
Sunbird Theme Tutorial - Archive of obsolete content
/tt> at the end. you can use this kind of zip tool if you rename each file before and after using the tool. you also need knowledge of: using your operating system to create files and directories using the tools listed above css graphic design knowledge of xul, xbl and javascript is useful for advanced themes. making a theme a theme consists of: a unique identifier a file containing in
formation about the theme a file that registers the theme with sunbird some files containing the theme itself set up your theme in sunbird's profile directory. for in
formation on how to find the profile directory, see the mozillazine article: profile folder inside the profile directory, go to the <tt>extensions</tt> directory. note: if the <tt>extensions</tt> directory is empty, you are in the wro...
...before and after the at-sign, it can only contain the characters a-z, a-z, 0-9, full stop, hyphen and underscore. if you do not own a domain name, you can make up something else. ...
...l stop, hyphen and underscore. if you do not own a domain name, you can make up something else. if you want to make it clear that your made-up name is not a real domain, add <tt>.invalid</tt> to the end. create a new directory in the <tt>extensions</tt> directory. use the identifer as your new directory's name. this new directory is your theme directory. go into your theme directory. creating in
formation about your theme in your theme directory, create a plain text file named <tt>install.rdf</tt>. copy and paste the content from here, making sure that you scroll to get all of it: <?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="just-testing@examp...
Theme changes in Firefox 2 - Archive of obsolete content
he browser when you browse to a suspected phishing site. search/enginemanager.xul enginemanager.css new file containing the ui for the search engine manager window. toolkit/mozapps/preferences/fontscaling.xul - removed from firefox 2. changes to the default theme the table below lists all the changes made in the default theme for firefox 2; you can use this in
formation as a starting point for figuring out the changes you need to make. file description of change browser/bookmarks/addbookmark.css updated to include microsummary-related css changes. browser/bookmarks/bookmarksproperties.css new file; includes microsummary-related css. browser/browser.css needs to be updated to include new css for microsummaries...
...ire directory is no longer used in firefox 2 and should be removed. changes in browser bookmarks/addbookmark.css the addbookmarks.css file should have the following lines added to the top: @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); @namespace html url("http://www.w3.org/1999/xhtml"); some microsummary-related css also needs to be added, to provide
formatting for the microsummary picker. these are used to make the picker look like a regular text box instead of like an editable menu list when there are no microsummaries available. menulist#name[droppable="false"] menulist#name[droppable="false"] > .menulist-editable-box menulist#name[droppable="false"] > .menulist-editable-box > html|*.textbox-input menulist#name[droppable="false"] > .menul...
...e"] radio[pane=panetabs]:hover radio[pane=panetabs][selected="true"] you may of course wish to change other styles as well. feeds/addfeedreader.css this is a new file in firefox 2. it's used to skin the window displayed to add a new feed reader, which is defined in the file browser/feeds/addfeedreader.xul. #imagebox the box that displays the feed icon. #content style in
formation for the content area of the window. #sitelabel style in
formation for the site label. feeds/subscribe.css this is a new file in firefox 2. it skins the window displayed to subscribe to an rss feed, which is at browser/feeds/subscribe.xhtml. #application #feedbody #feedchangesubscribeoptions #feederror #feedheader #feedheader[firstrun="true"] #feedheader[firstrun="...
Theme changes in Firefox 3 - Archive of obsolete content
r of changed and deleted files in the browser that may require you to make changes to your theme. the table lists both the changed xul file and the theme's corresponding css file that you might need to update. filename css file details changes to the default theme the table below lists changes made in the default theme for firefox 3; you can use this in
formation as a starting point for figuring out the changes you need to make. all file list all plat
forms file description of change browser/themes/*/browser/browser.css the width of the drag and drop indicator is no longer calculated during the drag (tabbrowser.xml). instead a '-moz-margin-start' property must be added to .tab-drop-indicator-bar, with a value that is half of...
...owser/themes/pinstripe/browser/tabbrowser/tabdragindicator.png removed superfluous blank pixels from the edges, so that the image is smaller. may or may not affect other mac themes that use it. browser/themes/pinstripe/browser/browser.css .tabbrowser-tab[first-tab="true"] > .tab-image-left no longer has a margin-left. instead .tabs-left now displayed and given the same width as the
former margin-left. it was already done this way in winstripe. changes in browser --- changes in global all plat
forms the yellow background for the location bar has been deprecated; instead, themes should style the new #identity-box element depending on its verifieddomain/verifiedidentity class. the go button is now located inside the location bar, so the image for it (chrome://browser/ski...
...o the image for it (chrome://browser/skin/go-arrow.png) needs to be smaller. the rule that's needed to show and hide the go button and other location bar icons is: #urlbar[pageproxystate="invalid"] > #urlbar-icons > :not(#go-button) , #urlbar[pageproxystate="valid"] > #urlbar-icons > #go-button { visibility: collapse; } images to add add the following images: chrome://global/skin/icons/in
formation-16.png used when presenting in
formation notices. chrome://global/skin/icons/warning-16.png used when displaying warnings. images to remove the following images were removed: chrome://mozapps/skin/extensions/question.png no longer used. mac os x mac os x themes for firefox 3 should add these two rules to the end of chrome://global/skin/wizard.css: .wizard-buttons-btm { padding...
Writing JavaScript for XHTML - Archive of obsolete content
an still use strings like in document.write(), but it takes a little more effort. ...
... domparser(); var documentfragment = parser.parsefromstring(string, "text/xml"); body.appendchild(documentfragment); // assuming 'body' is the body element but be aware that if your string is not well-
formed xml (e.g., you have an & where it should not be), then this method will crash, leaving you with a parser error. problem: i want to remain forward compatible! given the direction away from
formatting attributes and the possibility of xhtml becoming eventually more prominent (or at least the document author having the possibility of later wanting to make documents available in xhtml for browsers that support it), one may wish to avoid features which are not likely to stay compatible into the future. solution: avoid html-specific dom the html dom , even though it is compatible with xhtm...
...t least the document author having the possibility of later wanting to make documents available in xhtml for browsers that support it), one may wish to avoid features which are not likely to stay compatible into the future. solution: avoid html-specific dom the html dom , even though it is compatible with xhtml 1.0, is not guaranteed to work with future versions of xhtml (perhaps especially the
formatting properties which have been deprecated as element attributes). the regular xml dom provides sufficient methods via the element interface for getting/setting/removing attributes. problem: my favourite js library still breaks if you use javascript libraries like the famous prototype.js or yahoo's one, there is bad news for you: as long as the developers don't apply the fixes mentioned above,...
Community - Archive of obsolete content
if you know of useful mailing lists, newsgroups, forums, or other communities related to x
forms, please link to them here. view mozilla forums... ...
... if you know of useful mailing lists, newsgroups, forums, or other communities related to x
forms, please link to them here. view mozilla forums... ...
... if you know of useful mailing lists, newsgroups, forums, or other communities related to x
forms, please link to them here. view mozilla forums... ...
Archived open Web documentation - Archive of obsolete content
sktop notifications"; these are notifications that are displayed to the user outside the context of the web content, using the standard notification system provided by the operating system. e4x ecmascript for xml (e4x) is a programming language extension that adds native xml support to javascript. it does this by providing access to the xml document in a
form that feels natural for ecmascript programmers. the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces. a valid alternative to e4x is a non-native jxon algorithm. e4x tutorial this tutorial walks you through the basic syntax of e4x (ecmascript for xml). with e4x, programmers can mani...
...e that your code executes in parallel, it is suggested that the functions should be limited to the parallelizable subset of js that firefox supports. properly using css and javascript in xhtml documents xhtml™ 1.0 the extensible hypertext markup language (second edition) defines xhtml to be a re
formulation of html 4 as an xml 1.0 application. talk:javascript reference the guide section links to an interesting document discussing how to create and use private variables in objects, which is great if you want to protect the various properties within an object from being poked at accidentally. i also just read a document on proper inheritance...
... because opening windows on mobile isn't necessarily appropriate, the firefox mobile team designed the importdialog() method to replace window.opendialog(). instead of opening a new window, it merges the specified xul dialog into the main window. writing javascript for xhtml technical review completed. editorial review completed. x
forms x
forms were envisioned as the future of online
forms as envisioned by the w3c. drawing on other w3c standards like xml schema, xpath, and xml events, x
forms tried to address some of the limitations of the current html
forms model. however, x
forms never gained traction and is now considered obsolete. ...
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
scriptable with only minor modifications in their code. the present document describes the steps of what should be done to the plugin code to turn it scriptable again. what's in the mozilla code? a couple of lines have been added to the dom code asking a plugin to return a scriptable iid and a pointer to a scriptable instance object. the old plugin api call npp_getvalue is used to retrieve this in
formation from the plugin. 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 = ...
... ...
... ...
Examples - Game development
this page lists a number of impressive web technology demos for you to get inspiration from, and generally have fun with. a testament to what can be done with javascript, webgl, and related technologies. the first two sections list playable games, while the second is a catch-all area to list demos that aren't necessarily interactive/games. free/demo games beloola webvr plat
form to connect passionate people. experience both available on 2d screens and on vr hmds (settings / switch to vr mode). tanx a multiplayer tank battle game, created with playcanvas. hyper vanguard force a neat vertically scrolling space shooter. swooop a plane flying game: control your plane and collect the jewels. again, created with playcanvas. save the day fly your rescue chopper around the disaster area...
...e chopper around the disaster area and save the stranded victims (ga.me.) polycraft a shipwreck 'n survive game. explore the island and defeat the monsters. hexgl a fast-paced, futuristic racing game. dead trigger 2 classic zombie splatter action, made with unity3d. angry bots a futuristic aliens-esque isometric 3rd person shooter demo, made with unity3d. nutmeg cute retro scrolling plat
forming action. back to candyland a match-3 (candy crush) style game. biolab disaster side-scrolling plat
form shooter. x-type vertically scrolling space shooter demo. xibalba retro (doom-style) first person shooter. gorescript another retro style first person shooter. the wizard a turn-based, dungeon puzzle game. hextris tetris-like hexagonal puzzle game. 2048 a sliding number tiles pu...
...endy entertainment. auralux webgl and asm.js-based strategy game: capture all the suns to win! browserquest a mmorpg created by the little workshop and mozilla. shoot the rocks a canvas 2d single-player shooter in the style of atari's classic asteroids arcade game from 1979. star citadel a new take on star castle, cinematronics' classic 1980 arcade game, built with canvas 2d. classic plat
former canvas 2d game based on `visual-ts game engine` - physics based on matter.js commercial games oort online a mmo exploration, building, and battle game (currently in development.) a wizard's lizard top down zelda-esque exploration/rpg. qbqbqb a sci-fi themed arcade puzzle game. bullet force 3d multiplayer first-person shooter. elliot quest 8-bit graphic retro adventure g...
Game monetization - Game development
ne, but it's not designed for games and it's a pretty bad practice to use it for that purpose. instead of risking of having your account closed and all the money blocked try to use the usual, gamedev targeted portals like leadbolt. they offer easy to implement systems to show the adverts in your games and split the earnings with you. video ads are getting more and more popular, especially in the
form of a pre-roll — they are shown at the beginning of your game while it's still loading. and on the topic of where to put the advertisements in your game it really depends on you. it should be as subtle as possible so as to not annoy the players too much, but visible enough to make them click it or at least take notice. adding adverts between game sessions on game over screens is a popular approa...
...e license is usually a one-time deal. you get the money and they can get creative with using your game to make money. finding publishers might be hard at first — try to look for them at the html5 gamedevs forums. if you're well known they may reach out to you. most of the deals are done through emails when talking to a dedicated person on the publisher side. some publisher websites have that in
formation easily available, while some others are harder to find. when reaching a publisher try to be nice and straight to the point — they are busy people. exclusive licenses the exclusive license is a type of license for one publisher — you've built a game and you're selling all the rights to it to a single entity along with the rights to redistribute it — softgames are an example of such a ...
...are harder to find. when reaching a publisher try to be nice and straight to the point — they are busy people. exclusive licenses the exclusive license is a type of license for one publisher — you've built a game and you're selling all the rights to it to a single entity along with the rights to redistribute it — softgames are an example of such a publisher. you can't sell it again in any
form while that publisher has the rights— that's why exclusive deals are worth quite a lot of money. how much exactly? it depends on the quality of the game, it's genre, its publisher, and many others, but usually it will be something between 2000 and 5000 usd. once you've sold an exclusive license you can forget about promoting that particular game as you won't earn more, so go into such a deal onl...
Game promotion - Game development
famous, or so they say. many great games get started as a quick, sloppy demo submitted to a competition. if both the idea and the execution are good enough, you will succeed. plus competitions generally require games to follow a mandatory theme, so you can get creative around a theme if you are stuck for ideas. website and blog you should definitely create your own website containing all the in
formation about your games, so people can see what you've worked on. the more in
formation you can include the better — you should include screenshots, description, trailer, press kit, requirements, available plat
forms, support details and more. you'll get bonus points for allowing your users to directly play your games online — at least in demo
form. also, you should do some work on seo to allow p...
...r users to directly play your games online — at least in demo
form. also, you should do some work on seo to allow people to find your games more easily. you should also blog about everything related to your gamedev activities. write about your development process, nasty bugs you encounter, funny stories, lessons learned, and the ups and downs of being a game developer. continually publishing in
formation about your games will help educate others, increase your reputation in the community, and further improve seo. a further option is to publish monthly reports that summarize all your progress — it helps you see what you've accomplished throughout the month and what's still left to do, and it keeps reminding people that your game is coming out soon — building buzz is always good. while yo...
... tool to make games visible to a broader audience if you have no budget and limited time. press you can try and reach the press about your game, but bear in mind that they get a tonne of requests like this every single day, so be humble and patient if they don't answer right away, and be polite when talking to them. be sure to check first if they are dealing with specific genres of games or plat
forms, so you don't send them something that is not relevant to them in the first place. if you're honest with your approach and your game is good, then you've got more of a chance of success. if you want to learn more about the etiquette of contacting the press you should definitely check out how to contact press - a great guide from pixel prospector, and the video game journaliser site curated by t...
2D collision detection - Game development
algorithms to detect collision in 2d games depend on the type of shapes that can collide (e.g. rectangle to rectangle, rectangle to circle, circle to circle). generally you will have a simple generic shape that covers the entity known as a "hitbox" so even though collision may not be pixel perfect, it will look good enough and be per
formant across multiple entities. this article provides a review of the most common techniques used to provide collision detection in 2d games. axis-aligned bounding box one of the simpler
forms of collision detection is between two rectangles that are axis aligned — meaning no rotation. the algorithm works by ensuring there is no gap between any of the 4 sides of the rectangles. any gap means a collision does not exist. var rect1 = {x: 5, y: 5, width: 50, ...
...ius + circle2.radius) { // collision detected! } note: here is another example without canvas or external libraries. separating axis theorem this is a collision algorithm that can detect a collision between any two *convex* polygons. it's more complicated to implement than the above methods but is more powerful. ...
...usually games will split collision into two phases, broad and narrow. broad phase broad phase should give you a list of entities that *could* be colliding. ...
WebVR — Virtual Reality for the Web - Game development
ming soon to the market, the future looks bright — we already have sufficient technology to make the vr experience "good enough" for playing games. there are many devices to chose from: desktop ones like oculus rift or htc vive, through consoles with playstation vr (which admittedly doesn't support webvr at this time), to mobile experiences like gear vr or google cardboard. note: for more in
formation, read our webvr concepts article. the webvr api the webvr api is the central api for capturing in
formation on vr devices connected to a computer and headset position/orientation/velocity/acceleration in
formation, and converting that into useful data you can use in your games and other applications. note: there are of course other apis useful for creating games, for example the gamepad a...
...e. for more info be sure to visit the mozvr.com and webvr.info websites. using the webvr api the webvr api is based on two concepts — sending stereoscopic images to both lenses in your headset and receiving positional data for your head from the sensor, and those two are handled by hmdvrdevice (head-mounted display virtual reality device) and positionsensorvrdevice. ...
...etcustomfov(up,right,down,left) { var testfov = new vrfieldofview(up,right,down,left); ghmd.setfieldofview(testfov,testfov,0.01,10000.0); } the gpositionsensor variable holds the positionsensorvrdevice — using this you can get the current position or orientation state (for example to update the scene view on every frame), or reset the sensor. ...
Unconventional controls - Game development
nal ways to control your web game, some more unconventional than others. tv remote playing games on a tv screen doesn't always have to be done through consoles. there's already a gamepad api working on the desktop computers, so we can imitate the experience, but we can go even further. modern smart tvs can handle html5 games, because they have a built-in browser that can be used as a gaming plat
form. smart tvs are shipped with remote controls, which can be used to control your games if you know how. the earliest demo of captain rogers: battle at andromeda was adjusted to work on a huge tv. interestingly enough, the first captain rogers game (asteroid belt of sirius) was optimized for low-end, small-screen, cheap smartphones running firefox os, so you can see the difference three years can m...
...rking on your computer you have to first install it by following the steps at leapmotion.com/setup. when everything is installed and the controller is connected to your computer we can proceed with implementing support in our little demo. first, we add a <script> tag with the url pointing at this file, and add <div id="output"></div> just before the closing </body> tag for outputting diagnostic in
formation. we will need a few helper variables for our code to work — one for the purpose of calculating the degrees from radians, two for holding the horizontal and vertical amount of degrees our hand is leaning above the controller, one for the threshold of that lean, and one for the state of our hand's grab status. we next add these lines after all the event listeners for keyboard and mouse, but...
...controller, one for the threshold of that lean, and one for the state of our hand's grab status. ...
Implementing game control mechanisms - Game development
streamlining cross device differences creates multiple challenges, not least when providing appropriate controls for different contexts. in this series of articles we will show you how you can approach building a game that can be played using touchscreen smartphones, mouse and keyboard, and also less common mechanisms such as gamepads. case study we'll be using the captain rogers: battle at andromeda demo as an example. ...
...t now, but it should be fairly easy to reuse the knowledge contained within these articles when building games in pure javascript or any other framework. if you're looking for a good introduction to phaser, then check the 2d breakout game using phaser tutorial. in the following articles we will show how to implement various different control mechanisms for captain rogers to support different plat
forms — from touch on mobile, through keyboard/mouse/gamepad on desktop, to more unconventional ones like tv remote, shouting to or waving your hand in front of the laptop, or squeezing bananas. setting up the environment let's start with a quick overview of the game's folder structure, javascript files and in-game states, so we know what's happening where. the game's folders look like this: as...
...source code available on github where the basic support for the control mechanisms described in the articles is implemented in pure javascript. it will be explained in the given articles themselves below, but you can play with it already, and use the code however you want for learning purposes. the articles javascript is the perfect choice for mobile gaming because of html5 being truly multiplat
form; all of the following articles focus on the apis provided for interfacing with different control mechanisms: mobile touch controls — the first article will kick off with touch, as the mobile first approach is very popular. desktop mouse and keyboard controls — when playing on a desktop/laptop computer, providing keyboard and mouse controls is essential to provide an acceptable level of ac...
Implementing controls using the Gamepad API - Game development
heme 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. the second, hidden "change" implementation is the ability to trans
form the static fridge into a full-blown moving, shooting and eating machine. when you connect the controller, the game significantly changes (hungry fridge turns into the super turbo hungry fridge) and you're able to control the armored fridge using the gamepad api. 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 yo...
...le for turning on turbo mode without needing to have a gamepad connected, for reasons explained above.) disconnect: function(evt) { gamepadapi.turbo = false; delete gamepadapi.controller; console.log('gamepad disconnected.'); }, the disconnect function sets the gamepad.turbo property to false and removes the variable containing the gamepad object. gamepad object there's lots of useful in
formation contained in the gamepad object, with the states of buttons and axes being the most important: id: a string containing in
formation about the controller. index: a unique indentifier for the connected device. connected: a boolean variable, true if the device is connected. mapping: the layout type of the buttons; standard is the only available option for now. axes: the state of each axis...
...ayout available, but new ones may appear in the future. if the layout is unknown, it is set to an empty string. events there were more events available in the spec than just gamepadconnected and gamepaddisconnected available, but they were removed from the specification as they were thought to not be very useful. the discussion is still ongoing as to whether they should be put back, and in what
form. summary the gamepad api is very easy to develop with. now it's easier than ever to deliver a console-like experience to the browser without the need for any plugins. you can play the full version of the hungry fridge game directly in your browser, install it from the firefox marketplace or check the source code of the demo along with all the other resources on the gamepad api content kit. ...
WebRTC data channels - Game development
ications; however, it also offers peer-to-peer data channels. this article explains more about this, and shows you how to use libraries to implement data channels in your game. what is a data channel? a webrtc data channel lets you send text or binary data over an active connection to a peer. in the context of a game, this lets players send data to each other, whether text chat or game status in
formation. data channels come in two flavors. reliable channels guarantee that messages you send arrive at the other peer and in the same order in which they're sent. this is analogous to a tcp socket. unreliable channels make no such guarantees; messages aren't guaranteed to arrive in any particular order and, in fact, aren't guaranteed to arrive at all. this is analogous to a udp socket. we have ...
...ibrary one library you can use is the p2p library. this library provides a simple api for creating peer connections and setting up streams and data channels. ...
...data channels. there's also a broker server component and a hosted broker you can use instead of having to set one up for yourself. ...
Tools for game development - Game development
on this page you can find links to our game development tools articles, which eventually aims to cover frameworks, compilers, and debugging tools. asm.js asm.js is a very limited subset of the javascript language, which can be greatly optimized and run in an ahead-of-time (aot) compiling engine for much faster per
formance than your typical javascript per
formance. this is, of course, great for games. emscripten an llvm to javascript compiler; with emscripten, you can compile c++ and other languages that can compile to llvm bytecode into high-per
formance javascript. this is a great tool for porting applications to the web! there is a useful emscripten tutorial available on the wiki. note that we are aiming to cover emscripten in its own section of mdn. gecko profiler the gecko p...
... shumway shumway is a renderer for adobe flash built entirely in javascript, webgl, etc., bridging the gap between flash and web standards. this article shows how to make use of shumway, and how to contribute fixes and bugs to the project. ...
...ow to contribute fixes and bugs to the project. ...
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). with strong connection with webpack physics done with (matter.js) matter ts this part is removed from this project. ...
... in folder starter/ with all your game object was created in editor style . or you can use visual-js source editor. visual-js source editor (2d part only) is new and better way .in future visual staff will be better (real time simulator will be implemented).for now this place is good for coding . visual-js works direct with project files , no need for build . 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. inserting new code will be always at current line selected intro editor . save on drop menu or better with ctrl+s before testing i...
... : tile's background draw for images (alias sprite - but for now there's no sprite and frame by frame animation methods). small engine config . some option in aspect view like npm install ... 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. ...
Control flow - MDN Web Docs Glossary: Definitions of Web-related terms
the control flow is the order in which the computer executes statements in a script. code is run in order from the first line in the file to the last line, unless the computer runs across the (extremely frequent) structures that change the control flow, such as conditionals and loops. for example, imagine a script used to validate user data from a webpage
form. ...
...uctures that change the control flow, such as conditionals and loops. for example, imagine a script used to validate user data from a webpage
form. the script submits validated data, but if the user, say, leaves a required field empty, the script prompts them to fill it in. to do this, the script uses a conditional structure or if...else, so that different code executes depending on whether the
form is complete or not: if (field==empty) { promptuser(); } else { submit
form(); } a typical script in javascript or php (and the like) includes many control structures, including conditionals, loops and functions. parts of a script may also be set to execute when events occur. for example, the above excerpt might be inside a function that runs when the user clicks the submit button for t...
... complete or not: if (field==empty) { promptuser(); } else { submit
form(); } a typical script in javascript or php (and the like) includes many control structures, including conditionals, loops and functions. parts of a script may also be set to execute when events occur. for example, the above excerpt might be inside a function that runs when the user clicks the submit button for the
form. the function could also include a loop, which iterates through all of the fields in the
form, checking each one in turn. looking back at the code in the if and else sections, the lines promptuser and submit
form could also be calls to other functions in the script. as you can see, control structures can dictate complex flows of processing even with only a few lines of code. control flow means th...
HTML - MDN Web Docs Glossary: Definitions of Web-related terms
in 1994 berners-lee founded the w3c to develop the web. in 1996, the w3c took over the html work and published the html 3.2 recommendation a year later. ...
...in 1994 berners-lee founded the w3c to develop the web. in 1996, the w3c took over the html work and published the html 3.2 recommendation a year later. ...
...aft in 2008 and the final standard in 2014. concept and syntax an html document is a plaintext document structured with elements. elements are surrounded by matching opening and closing tags. each tag begins and ends with angle brackets (<>). there are a few empty or void tags that cannot enclose any text, for instance <img>. you can extend html tags with attributes, which provide additional in
formation affecting how the browser interprets the element: an html file is normally saved with an .htm or .html extension, served by a web server, and can be rendered by any web browser. learn more general knowledge html on wikipedia learning html our html tutorial the web course on codecademy.com technical reference the html documentation on mdn the html specification ...
JSON - MDN Web Docs Glossary: Definitions of Web-related terms
javascript object notation (json) is a data-interchange
format. although not a strict subset, json closely resembles a subset of javascript syntax. though many programming languages support json, json is especially useful for javascript-based apps, including websites and browser extensions. json can represent numbers, booleans, strings, null, arrays (ordered sequences of values), and objects (string-value mappings) made up of these values (or of other arrays and objects). json does not natively represent more complex data types like functions, regular expressions, dates, and so on. ...
...s and browser extensions. json can represent numbers, booleans, strings, null, arrays (ordered sequences of values), and objects (string-value mappings) made up of these values (or of other arrays and objects). json does not natively represent more complex data types like functions, regular expressions, dates, and so on. ...
...ensions. json can represent numbers, booleans, strings, null, arrays (ordered sequences of values), and objects (string-value mappings) made up of these values (or of other arrays and objects). json does not natively represent more complex data types like functions, regular expressions, dates, and so on. (date objects by default serialize to a string containing the date in iso
format, so the in
formation isn't completely lost.) if you need json to represent additional data types, trans
form values as they are serialized or before they are deserialized. much like xml, json has the ability to store hierarchical data unlike the more traditional csv
format. many tools provide translation between these
formats such as this online json to csv converter or this alternative json to csv converter. ...
Packet - MDN Web Docs Glossary: Definitions of Web-related terms
a packet contains: hop limit a hop occurs when a packet is passed from one network to the next network. it is a field that is decreases by one each time a packet goes through, once it reaches 0 it has failed and the packet is discarded. ...
... a packet contains: hop limit a hop occurs when a packet is passed from one network to the next network. it is a field that is decreases by one each time a packet goes through, once it reaches 0 it has failed and the packet is discarded. ...
...s that occur when data is transmitted to the receiver. there are two types of error corrections backward and forward error correction. backward error correction is when the receiver requests the sender to retransmit the entire data unit. forward error correction is when the receiver uses the error-correcting code which automatically corrects the errors at the transmitter, the calculation is per
formed before the packet is sent. when received at the destination, the checksum is recalculated, and compared with the one in the packet. priority this field indicates which packet should have higher priority over the others. the high priority queue is emptied more quickly than lower priority queues when the network is congested. addresses when routing network packets it requir...
Synthetic monitoring - MDN Web Docs Glossary: Definitions of Web-related terms
synthetic monitoring involves monitoring the per
formance of a page in a 'laboratory' environment, typically with automation tooling in an environment that is as consistent as possible. with a consistent baseline, synthetic monitoring is good for measuring the effects of code changes on per
formance. however, it doesn't necessarily reflect what users are experiencing. synthetic monitoring involves deploying scripts to simulate the path an end-user might take through a web application, reporting back the per
formance of the simulator experiences. examples of popular synthetic monitoring tools include webpagetest and lighthouse. the traffic measured is not of your actual users, but rather synthetically generated traffic collecting data on page per
formance. unlike rum, synthetic monitoring...
...combined with other tools, such as network throttling, can provide excellent insight into potential problem areas. ...
...ences. examples of popular synthetic monitoring tools include webpagetest and lighthouse. the traffic measured is not of your actual users, but rather synthetically generated traffic collecting data on page per
formance. unlike rum, synthetic monitoring provides a narrow view of per
formance that doesn't account for user differences, making it useful in getting basic data about an application's per
formance and spot-checking per
formance in development environments. combined with other tools, such as network throttling, can provide excellent insight into potential problem areas. see also real user monitoring (rum) real user monitoring (rum) versus synthetic monitoring beacon ...
WCAG - MDN Web Docs Glossary: Definitions of Web-related terms
ent accessible primarily for people with disabilities but also for limited-resource devices such as mobile phones. wcag 2.0 which superseded wcag 1.0 was published as a w3c recommendation on 11 december 2008. it consists of 12 guidelines organized under 4 principles (perceivable, operable, understandable, and robust) and each guideline has testable success criteria. wcag uses three levels of con
formance: priority 1: web developers must satisfy these requirements, otherwise it will be impossible for one or more groups to access the web content. con
formance to this level is described as a. priority 2: web developers should satisfy these requirements, otherwise some groups will find it difficult to access the web content. con
formance to this level is described as aa or double-a. priority 3...
...s to access the web content. con
formance to this level is described as a. priority 2: web developers should satisfy these requirements, otherwise some groups will find it difficult to access the web content. con
formance to this level is described as aa or double-a. priority 3: web developers may satisfy these requirements, in order to make it easier for some groups to access the web content. con
formance to this level is described as aaa or triple-a. ...
...e groups will find it difficult to access the web content. con
formance to this level is described as aa or double-a. priority 3: web developers may satisfy these requirements, in order to make it easier for some groups to access the web content. con
formance to this level is described as aaa or triple-a. ...
Time to first byte - MDN Web Docs Glossary: Definitions of Web-related terms
time to first byte (ttfb) refers to the time between the browser requesting a page and when it receives the first byte of in
formation from the server. this time includes dns lookup and establishing the connection using a tcp handshake and ssl handshake if the request is made over https. ...
... a page and when it receives the first byte of in
formation from the server. this time includes dns lookup and establishing the connection using a tcp handshake and ssl handshake if the request is made over https. ...
...s the first byte of in
formation from the server. this time includes dns lookup and establishing the connection using a tcp handshake and ssl handshake if the request is made over https. ...
MDN Web Docs Glossary: Definitions of Web-related terms
hsts html html5 http http header http/2 http/3 https hyperlink hypertext i i18n iana icann ice ide idempotent identifier idl ietf iife imap immutable index indexeddb in
formation architecture inheritance input method editor instance internationalization internet intrinsic size ip address ipv4 ipv6 irc iso isp itu j jank java javascript jpeg jquery json k key ...
... object object reference oop opengl openssl opera browser operand operator origin ota owasp p p2p pac packet page load time page prediction parameter parent object parse parser pdf perceived per
formance percent-encoding php pixel placeholder names plaintext png polyfill polymorphism pop3 port prefetch preflight request prerender presto primitive privileged privileged code progressive enhancement progressive web apps ...
... (user datagram protocol) ui undefined unicode uri url urn usenet user agent utf-8 ux v validator value variable vendor prefix viewport visual viewport voip w w3c wai wcag web per
formance web server web standards webassembly webdav webextensions webgl webidl webkit webm webp webrtc websockets webvtt whatwg whitespace world wide web wrapper x x
forms xhr (xmlhttprequest) xhtml ...
Assessment: Accessibility troubleshooting - Learn web development
ges the images are currently inaccessible to screenreader users. can you fix this? the audio player the <audio> player isn't accessible to hearing impaired (deaf) people — can you add some kind of accessible alternative for these users? the <audio> player isn't accessible to those using older browsers that don't support html5 audio. ...
...to screenreader users. can you fix this? the audio player the <audio> player isn't accessible to hearing impaired (deaf) people — can you add some kind of accessible alternative for these users? the <audio> player isn't accessible to those using older browsers that don't support html5 audio. ...
... the show/hide comment control the show/hide comment control button is not current keyboard-accessible. ...
Test your skills: HTML accessibility - Learn web development
ver it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. html accessibility 1 in this task we will test your understanding of text semantics, and why they are good for accessibility. the given text is a simple in
formation panel with action buttons, but the html is really bad. we want you to update it use appropriate semantic html. you don't need to worry too much about recreating the exact same look and text sizing, as long as the semantics are good. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online edi...
... we want you to update it use appropriate semantic html. you don't need to worry too much about recreating the exact same look and text sizing, as long as the semantics are good. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. html accessibility 2 in the second task, you have a
form containing three input fields. you need to: semantically associate the input with their labels. assume that these inputs will be part of a larger
form, and wrap them in an element that associates them all together as a single related group. give the group a description/title that summarises all of the in
formation as personal data. try updating the live code below to recreate the finished e...
... the first two links just go to regular web pages. the third link goes to a pdf, and it's large — 8mb. ...
CSS selectors - Learn web development
ment. the :hover pseudo-class for example selects an element only when it is being hovered over by the mouse pointer: a:hover { } it also includes pseudo-elements, which select a certain part of an element rather than the element itself. for example, ::first-line always selects the first line of text inside an element (a <p> in the below case), acting as if a <span> was wrapped around the first
formatted line and then selected. p::first-line { } combinators the final group of selectors combine other selectors in order to target elements within our documents. the following for example selects paragraphs that are direct children of <article> elements using the child combinator (>): article > p { } next steps you can take a look at the reference table of selectors below for direct links t...
...ut about type, class, and id selectors. previous overview: building blocks next reference table of selectors the below table gives you an overview of the selectors you have available to use, along with links to the pages in this guide which will show you how to use each type of selector. i have also included a link to the mdn page for each selector where you can check browser support in
formation. you can use this as a reference to come back to when you need to look up selectors later in the material, or as you experiment with css generally. selector example learn css tutorial type selector h1 { } type selectors universal selector * { } the universal selector class selector .box { } class selectors id select...
... general sibling combinator h1 ~ p general sibling 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 values and units - Learn web development
rgb(197,93,161); } a value in css is a way to define a collection of allowable sub-values. this means that if you see <color> as valid you don't need to wonder which of the different types of color value can be used — keywords, hex values, rgb() functions, etc. you can use any available <color> values assuming they are supported by your browser. the page on mdn for each value will give you in
formation about browser support. for example, if you look at the page for <color> you will see that the browser compatibility section lists different types of color value and support for them. let's have a look at some of the types of value and unit you may frequently encounter, with examples so that you can try out different possible values. numbers, lengths, and percentages there are various nume...
...() to make the box 20% + 100px wide. the 20% is calculated from the width of the parent container .wrapper and so will change if that width changes. we can't do this calculation beforehand because we don't know what 20% of the parent will be, so we use calc() to tell the browser to do it for us. test your skills! we have covered a lot in this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: values and units. summary this has been a quick run through of the most common types of values and units you might encounter. you can have a look at all of the different types on the css values and units reference page; you will encounter many of these in use as you...
... knowledge to have! ...
Legacy layout methods - Learn web development
ut it may seem surprising to anyone coming from a design background that css didn’t have an inbuilt grid system until very recently, and instead we seemed to be using a variety of sub-optimal methods to create grid-like designs. we now refer to these as "legacy" methods. for new projects, in most cases css grid layout will be used in combination with one or more other modern layout methods to
form the basis for any layout. you will however encounter "grid systems" using these legacy methods from time to time. it is worth understanding how they work, and why they are different to css grid layout. this lesson will explain how grid systems and grid frameworks based on floats and flexbox work. having studied grid layout you will probably be surprised how complicated this all seems! this knowl...
...els of padding on the right hand side of the container. so we have 12 gutters in total — 12 x 20 = 240. we need to subtract that from our total width of 960 pixels, giving us 720 pixels for our columns. if we now divide that by 12, we know that each column should be 60 pixels wide. our next step is to create a rule for the class .col, floating it left, giving it a margin-left of 20 pixels to
form the gutter, and a width of 60 pixels. add the following rule to the bottom of your css: .col { float: left; margin-left: 20px; width: 60px; background: rgb(255, 150, 150); } the top row of single columns will now lay out neatly as a grid. note: we've also given each column a light red color so you can see exactly how much space each one takes up. layout containers that we want to sp...
...nt and markup becomes tied to your visual presentation. you will sometimes hear this use of css classes described as being “unsemantic” — describing how the content looks — rather than a semantic use of classes that describes the content. this is the case with our span2, span3, etc., classes. these are not the only approach. you could instead decide on your grid and then add the sizing in
formation to the rules for existing semantic classes. for example, if you had a <div> with a class of content on it that you wanted to span 8 columns, you could copy across the width from the span8 class, giving you a rule like so: .content { width: calc((6.25%*8) + (2.08333333%*7)); } note: if you were to use a preprocessor such as sass, you could create a simple mixin to insert that value for y...
Beginner's guide to media queries - Learn web development
. in practice, using minimum or maximum values is much more useful for responsive design so you will rarely see width or height used alone. there are a number of other media features that you can test for, although some of the newer features introduced in level 4 and 5 of the media queries specification have limited browser support. each feature is documented on mdn along with browser support in
formation, and you can find a full list at using media queries: media features. orientation one well-supported media feature is orientation, which allows us to test for portrait or landscape mode. to change the body text color if the device is in landscape orientation, use the following media query. @media (orientation: landscape) { body { color: rebeccapurple; } } open this exampl...
...r text size. add the below code into the bottom of your step1.html css. @media screen and (min-width: 40em) { article { display: grid; grid-template-columns: 3fr 1fr; column-gap: 20px; } nav ul { display: flex; } nav li { flex: 1; } } this css gives us a two-column layout inside the article, of the article content and related in
formation in the aside element. we have also used flexbox to put the navigation into a row. open step 2 in the browser, or view the source. lets continue to expand the width until we feel there is enough room for the sidebar to also
form a new column. inside a media query we'll make the main element into a two column grid. we then need to remove the margin-bottom on the article in order that the two...
...t the width it has available for this component. it might seem strange to wrap up a section about media queries with a suggestion that you might not need one at all! however, in practice you will find that good use of modern layout methods, enhanced with media queries, will give the best results. test your skills! you've reached the end of this article, but can you remember the most important in
formation? you can find a test to verify that you've retained this in
formation before you move on — see test your skills: responsive web design. summary in this lesson you have learned about media queries, and also discovered how to use them in practice to create a mobile first responsive design. you could use the starting point that we have created to test out more media queries. for example, pe...
What text editors are available? - Learn web development
criteria so, in more detail, what should you be thinking about when you choose a text editor? which os (operating system) do i want to work with? of course it's your choice. however, some editors are only available for certain oss, so if you like switching back and forth, that would narrow down the possibilities. any text editor can get the job done, if it runs on your system, but a cross-plat
form editor eases migration from os to os. so first find out which os you're using, and then check if a given editor supports your os. most editors specify on their website whether they support windows or mac, though some editors only support certain versions (say, only windows 7 or later and not vista). if you're running ubuntu, your best bet is to search within the ubuntu software center. in genera...
... editor? it depends on your needs and plans. these functionalities are often helpful: search-and-replace, in one or multiple documents, based on regular expressions or other patterns as needed quickly jump to a given line view two parts of a large document separately view html as it will look in the browser select text in multiple places at once view your project's files and directories
format your code automatically with code beautifier check spelling auto-indent code based on indentation settings do i want to add extra features to my text editor? an extensible editor comes with fewer built-in features, but can be extended based on your needs. if you aren't sure which features you want, or your favorite editor lacks those features out of the box, look for an extensible editor.
...ple like customizing every bit of the ui (user interface), from colors to button positions. editors vary widely in flexibility, so check beforehand. it's not hard to find a text editor that can change color scheme, but if you want hefty customizing you may be better off with an ide. install and set up installing a text editor is usually quite straightforward. the method varies based on your plat
form but it shouldn't be too hard: windows. the developers will give you an .exe or .msi file. sometimes the software comes in a compressed archive like .zip, .7z, or .rar, and in that case you'll need to install an additional program to extract the content from the archive. windows supports .zip by default. mac. on the editor's website you can download a .dmg file. some text editors you can find ...
How do you host your website on Google App Engine? - Learn web development
google app engine is a powerful plat
form that lets you build and run applications on google’s infrastructure — whether you need to build a multi-tiered web application from scratch or host a static website. here's a step-by-step guide to hosting your website on google app engine. creating a google cloud plat
form project to use google's tools for your own site or app, you need to create a new project on google cloud plat
form. this requires having a google account. go to the app engine dashboard on the google cloud plat
form console and press the create button. if you've not created a project before, you'll need to select whether you want to receive email updates or not, agree to the terms of service, and then you should be able to continue. enter a name for the project, edit y...
...ther you want to receive email updates or not, agree to the terms of service, and then you should be able to continue. enter a name for the project, edit your project id and note it down. for this tutorial, the following values are used: project name: gae sample site project id: gaesamplesite click the create button to create your project. creating an application each cloud plat
form project can contain one app engine application. let's prepare an app for our project. we'll need a sample application to publish. if you've not got one to use, download and unzip this sample app. have a look at the sample application's structure — the website folder contains your website content and app.yaml is your application configuration file. your website content must go inside t...
...e application to publish. if you've not got one to use, download and unzip this sample app. have a look at the sample application's structure — the website folder contains your website content and app.yaml is your application configuration file. your website content must go inside the website folder, and its landing page must be called index.html, but apart from that it can take whatever
form you like. the app.yaml file is a configuration file that tells app engine how to map urls to your static files. you don't need to edit it. publishing your application now that we've got our project made and sample app files collected together, let's publish our app. open google cloud shell. drag and drop the sample-app folder into the left pane of the code editor. run the followin...
What is the difference between webpage, website, web server, and search engine? - Learn web development
te a collection of web pages which are grouped together and usually connected together in various ways. often called a "web site" or simply a "site." web server a computer that hosts a website on the internet. search engine a web service that helps you find other web pages, such as google, bing, yahoo, or duckduckgo. search engines are normally accessed through a web browser (e.g. you can per
form search engine searches directly in the address bar of firefox, chrome, etc.) or through a web page (e.g. bing.com or duckduckgo.com). let's look at a simple analogy — a public library. this is what you would generally do when visiting a library: find a search index and look for the title of the book you want. make a note of the catalog number of the book. go to the particular section con...
...ing available yet. deeper dive so, let's dig deeper into how those four terms are related and why they are sometimes confused with each other. web page a web page is a simple document displayable by a browser. such documents are written in the html language (which we look into in more detail in other articles). a web page can embed a variety of different types of resources such as: style in
formation — controlling a page's look-and-feel scripts — which add interactivity to the page media — images, sounds, and videos. note: browsers can also display other documents such as pdf files or images, but the term web page specifically refers to html documents. otherwise, we only use the term document. all web pages available on the web are reachable through a unique address. to acce...
...s. otherwise, we only use the term document. all web pages available on the web are reachable through a unique address. 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. each web page of a given website provides explicit links—most of the time in the
form of clickable portion of text—that allow the user to move from one page of the website to another. 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. suc...
How do you upload your files to a web server? - Learn web development
ch as sftp clients, rsync and github. sftp there are several sftp clients out there. our demo covers filezilla, since it's free and available for windows, macos and linux. to install filezilla go to the filezilla downloads page, click the big download button, then install from the installer file in the usual way. note: of course there are lots of other options. see publishing tools for more in
formation. open the filezilla application; you should see something like this: logging in for this example, we'll suppose that our hosting provider (the service that will host our http web server) is a fictitious company "example hosting provider" whose urls look like this: mypersonalwebsite.examplehostingprovider.net. we have just opened an account and received this info from them: congratul...
...steps: choose file > site manager... from the main menu. in the site manager window, press the new site button, then fill in the site name as demozilla in the provided space. fill in the sftp server your host provided in the host: field. in the logon type: drop down, choose normal, then fill in your provided username and password in the relevant fields. fill in the correct port and other in
formation. your window should look something like this: now press connect to connect to the sftp server. note: make sure your hosting provider offers sftp (secure ftp) connection to your hosting space. ftp is inherently insecure, and you shouldn't use it. here and there: local and remote view once connected, your screen should look something like this (we've connected to an example of our own ...
... the path to the local file or directory that you want to copy files over from. user@ is the credentials of the user on the remote server you want to copy files over to. x.x.x.x is the ip address of the remote server. destination is the path to the location you want to copy your directory or files to on the remote server. you'd need to get such details from your hosting provider. for more in
formation and further examples, see how to use rsync to copy/sync files between servers. of course, it is a good idea to use a secure connection, like with ftp. in the case of rsync, you specify ssh details to make the connection over ssh, using the -e option. for example: rsync [-options] -e "ssh [ssh details go here]" source user@x.x.x.x:destination you can find more details of what is needed at ...
Front-end web developer - Learn web development
le first. getting help we have tried to make learning front-end web development as comfortable as possible, but you will probably still get stuck because you don't understand something, or some code is just not working. don't panic. we all get stuck, whether we are beginner or professional web developers. the learning and getting help article provides you with a series of tips for looking up in
formation and helping yourself. if you are still stuck, feel free to post a question on our discourse forum. let's get started. good luck! the learning pathway getting started time to complete: 1.5–2 hours prerequisites nothing except basic computer literacy. how will i know i'm ready to move on? there are no assessments in this part of the course. but make sure you don't skip. it is importa...
...ubject matter. completing the assessments confirms that you are ready to move on to the next module. modules javascript first steps (30–40 hour read/exercises) javascript building blocks (25–35 hour read/exercises) introducing javascript objects (25–35 hour read/exercises) client-side web apis (30–40 hour read/exercises) asynchronous javascript (25–35 hour read/exercises) web
forms — working with user data time to complete: 40–50 hours prerequisites
forms require html, css, and javascript knowledge. given the complexity of working with
forms, it is a dedicated topic. how will i know i'm ready to move on? the assessments in each module are designed to test your knowledge of the subject matter. completing the assessments confirms that you are ready to move on to th...
...many of the techniques and best practices touch on multiple technologies. ...
Getting started with the Web - Learn web development
's a lot to pick from. if you're just starting out, you might be confused by the array of code editors, frameworks, and testing tools out there. in installing basic software, we show you step-by-step how to install just the software you need to begin some basic web development. what will your website look like? before you start writing the code for your website, you should plan it first. what in
formation are you showcasing? what fonts and colors are you using? what will your website look like? we outline a simple method you can follow to plan out your site's content and design. dealing with files a website consists of many files: text content, code, stylesheets, media content, and so on. when you're building a website, you need to assemble these files into a sensible structure and make sur...
...file structure for your website and what issues you should be aware of. html basics hypertext markup language (html) is the code that you use to structure your web content and give it meaning and purpose. for example, is my content a set of paragraphs or a list of bullet points? do i have images inserted on my page? do i have a data table? without overwhelming you, html basics provides enough in
formation to make you familiar with html. css basics cascading stylesheets (css) is the code that you use to style your website. for example, do you want the text to be black or red? where should content be drawn on the screen? what background images and colors should be used to decorate your website? css basics takes you through what you need to get started. javascript basics javascript is the pr...
...or red? where should content be drawn on the screen? what background images and colors should be used to decorate your website? css basics takes you through what you need to get started. javascript basics javascript is the programming language that you use to add interactive features to your website. some examples could be games, things that happen when buttons are pressed or data is entered in
forms, dynamic styling effects, animation, and much more. javascript basics gives you an idea of what is possible with this exciting language, and how to get started. publishing your website once you have finished writing the code and organizing the files that make up your website, you need to put it all online so people can find it. publishing your sample code describes how to get your simple sampl...
Using data attributes - Learn web development
html5 is designed with extensibility in mind for data that should be associated with a particular element but need not have any defined meaning. data-* attributes allow us to store extra in
formation on standard, semantic html elements without other hacks such as non-standard attributes, extra properties on dom, or node.setuserdata(). html syntax the syntax is simple. any attribute on any element whose attribute name starts with data- is a data attribute. say you have an article and you want to store some extra in
formation that doesn’t have any visual representation. just use data attributes for that: <article id="electric-cars" data-columns="3" data-index-number="12314" data-parent="cars"> ... </article> javascript access reading the values of these attributes out in javascript...
... use generated content in css with the attr() function: article::before { content: attr(data-parent); } you can also use the attribute selectors in css to change styles according to the data: article[data-columns='3'] { width: 400px; } article[data-columns='4'] { width: 600px; } you can see all this working together in this jsbin example. data attributes can also be stored to contain in
formation that is constantly changing, like scores in a game. using the css selectors and javascript access here this allows you to build some nifty effects without having to write your own display routines. see this screencast for an example using generated content and css transitions (jsbin example). data values are strings. number values must be quoted in the selector for the styling to take effec...
...sitions (jsbin example). data values are strings. number values must be quoted in the selector for the styling to take effect. issues do not store content that should be visible and accessible in data attributes, because assistive technology may not access them. in addition, search crawlers may not index data attributes' values. the main issues to consider are internet explorer support and per
formance. internet explorer 11+ provides support for the standard, but all earlier versions do not support dataset. to support ie 10 and under you need to access data attributes with getattribute() instead. also, the per
formance of reading data-attributes compared to storing this data in a regular js object is poor. that said, though, for custom element-associated metadata, they are a great solution.
Use HTML to solve common problems - Learn web development
mon everyday problems you'll need to solve with html. basic structure the most basic application of html is document structure. if you're new to html you should start with this. how to create a basic html document how to divide a webpage into logical sections how to set up a proper structure of headings and paragraphs basic text-level semantics html specializes in providing semantic in
formation for a document, so html answers many questions you might have about how to get your message across best in your document. how to create a list of items with html how to stress or emphasize content how to indicate that text is important how to display computer code with html how to annotate images and graphics how to mark abbreviations and make them understandable how to add quotatio...
...ractive. how to use css within a webpage how to use javascript within a webpage embedded content how to embed a webpage within another webpage how to add flash content within a webpage uncommon or advanced problems beyond the basics, html is very rich and offers advanced features for solving complex problems. these articles help you tackle the less common use cases you may face:
forms
forms are a complex html structure made to send data from a webpage to a web server. we encourage you to go over our full dedicated guide. here is where you should start: how to create a simple web
form how to structure a web
form tabular in
formation some in
formation, called tabular data, needs to be organized into tables with columns and rows. it's one of the most complex html structure...
... the <ins> and <del> elements. ...
Marking up a letter - Learn web development
previous overview: introduction to html next we all learn to write a letter sooner or later; it is also a useful example to test our text
formatting skills. in this assignment, you'll have a letter to mark up as a test for your html text
formatting skills, as well as hyperlinks and proper use of the html <head> element. prerequisites: before attempting this assessment you should have already worked through getting started with html, what's in the head? metadata in html, html text fundamentals, creating hyperlinks, and advanced text
formatting. objective: test basic and advanced html text
formatting, use of hyperlinks, and use of html <head>. starting point to begin, get the raw text you need to mark up, and the the css to style the html. create a new...
...rst date in the letter should have a class attribute value of sender-column. the css you'll add later will cause these to be right aligned, as it should be in the case in a classic letter layout. mark up the five acronyms/abbreviations in the main text of the letter to provide expansions of each acronym/abbreviation. the six sub/superscripts should be marked up appropriately — in the chemical
formulae, and the numbers 103 and 104 (they should be 10 to the power of 3 and 4, respectively). try to mark up at least two appropriate words in the text with strong importance/emphasis. there are two places where the letter should have a hyperlink. add appropriate links with titles. for the location that the links point to, you may use http://example.com as the url. mark up the university motto ...
...op. it's very hard to help someone with a coding problem without seeing their code. ...
Function return values - Learn web development
tion completes (finishes running), it returns a value, which is a new string with the replacement made. in the code above, the result of this return value is saved in the variable newstring. if you look at the replace() function mdn reference page, you'll see a section called return value. it is very useful to know and understand what values are returned by functions, so we try to include this in
formation wherever possible. some functions don't return any value. (in these cases, our reference pages list the return value as void or undefined.) for example, in the displaymessage() function we built in the previous article, no specific value is returned when the function is invoked. it just makes a box appear somewhere on the screen — that's it! generally, a return value is used where the f...
...m) { if (num < 0) return undefined; if (num == 0) return 1; let x = num - 1; while (x > 1) { num *= x; x--; } return num; } the squared() and cubed() functions are fairly obvious — they return the square or cube of the number that was given as a parameter. the factorial() function returns the factorial of the given number. next, we're going to include a way to print out in
formation about the number entered into the text input. enter the following event handler below the existing functions: input.onchange = function() { const num = input.value; if (isnan(num)) { para.textcontent = 'you need to enter a number!'; } else { para.textcontent = num + ' squared is ' + squared(num) + '. ' + num + ' cubed is ' + cubed(num) + '. ' + ...
...u go further into your programming career, you'll start doing the same kinds of things over and over again. it is a good idea to create your own library of utility functions to do these sorts of things. you can copy them over to new code, or even just apply it to html pages wherever you need it. test your skills! you've reached the end of this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: functions. conclusion so there we have it — functions are fun, very useful, and although there's a lot to talk about in regards to their syntax and functionality, they are fairly understandable. if there is anything you didn't understand, feel free to read throug...
JavaScript building blocks - Learn web development
rage 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. you've seen this stuff already in the course, but only in passing — here we'll discuss it all explicitly. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites before starting this module, you should have some familiarity with the basics of html and css, and you should have also worked through our previous module, javascript first steps. note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) ...
...the player's number of lives is 0, then it's game over. in a weather app, if it is being looked at in the morning, show a sunrise graphic; show stars and a moon if it is nighttime. in this article we'll explore how conditional structures work in javascript. looping code sometimes you need a task done more than once in a row. for example, looking through a list of names. in programming, loops per
form this job very well. here we will look at loop structures in javascript. functions — reusable blocks of code another essential concept in coding is functions. 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. in th...
...make use of them in your code, and how to make your own custom functions return useful values. introduction to events events are actions or occurrences that happen in the system you are programming, which the system tells you about so you can respond to them in some way if desired. for example if the user clicks a button on a webpage, you might want to respond to that action by displaying an in
formation box. in this final article we will discuss some important concepts surrounding events, and look at how they work in browsers. assessments the following assessment will test your understanding of the javascript basics covered in the guides above. image gallery now that we've looked at the fundamental building blocks of javascript, we'll test your knowledge of loops, functions, conditio...
Client-side web APIs - Learn web development
nipulating different aspects of the browser and operating system the site is running on, or manipulating data from other web sites or services. in this module, we will explore what apis are, and how to use some of the most common apis you'll come across often in your development work. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites to get the most out of this module, you should have worked your way through the previous javascript modules in the series (first steps, building blocks, and javascript objects). those modules typically involve simple api usage, as it is often difficult to write client-side javascript examples without them. for this tutorial, w...
...r code, and how are they structured? we'll also take a look at what the different main classes of apis are, and what kind of uses they have. manipulating documents when writing web pages and apps, one of the most common things you'll want to do is manipulate web documents in some way. this is usually done by using the document object model (dom), a set of apis for controlling html and styling in
formation that makes heavy use of the document object. in this article, we'll look at how to use the dom in detail, along with some other interesting apis that can alter your environment in interesting ways. fetching data from the server another very common task in modern websites and applications is retrieving individual data items from the server to update sections of a webpage without having to l...
...to use the dom in detail, along with some other interesting apis that can alter your environment in interesting ways. fetching data from the server another very common task in modern websites and applications is retrieving individual data items from the server to update sections of a webpage without having to load an entirely new page. this seemingly small detail has had a huge impact on the per
formance and behavior of sites. in this article, we'll explain the concept, and look at technologies that make it possible, such as xmlhttprequest and the fetch api. third party apis the apis we've covered so far are built into the browser, but not all apis are. many large websites and services such as google maps, twitter, facebook, paypal, etc. provide apis allowing developers to make use of thei...
JavaScript object basics - Learn web development
res you to instantiate a new object instance using the constructor for each notification you want to fire. try entering the following into your javascript console: const mynotification = new notification('hello!'); again, we'll look at constructors in a later article. ...
...a later article. note: it is useful to think about the way objects communicate as message passing — when an object needs another object to per
form some kind of action often it sends a message to another object via one of its methods, and waits for a response, which we know as a return value. test your skills! you've reached the end of this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: object basics. summary congratulations, you've reached the end of our first js objects article — you should now have a good idea of how to work with objects in javascript — including creating your own simple objects. you should also appreciate that objects are v...
.... you should also appreciate that objects are very useful as structures for storing related data and functionality — if you tried to keep track of all the properties and methods in our person object as separate variables and functions, it would be inefficient and frustrating, and we'd run the risk of clashing with other variables and functions that have the same names. objects let us keep the in
formation safely locked away in their own package, out of harm's way. in the next article we'll start to look at object-oriented programming (oop) theory, and how such techniques can be used in javascript. overview: objects next in this module object basics object-oriented javascript for beginners object prototypes inheritance in javascript working with json data object building prac...
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. ...
...in than the requesting document. if your stylesheet comes from a different origin than the document, you must serve it with the correct mime type (text/css). gecko 1.9.1.11 (firefox 3.5.11) and gecko 1.9.2.5 (firefox 3.6.5) also implement this security fix, but to improve compatibility, there was a temporary heuristic that allows the load if the first line in the style sheet appears to be a well-
formed css construct; the heuristic has been removed in firefox 4, and you have to properly set the text/css mime types to have your css pages recognized. why browsers should not guess mime types apart from violating the http specification, it is a bad strategy for browsers to guess mime types for the following reasons: loss of control if the browser ignores the reported mime type, web administra...
...onse. ...
Server-side website programming - Learn web development
the modules provide a general introduction to server-side programming. most major websites use some kind of server-side technology to dynamically display data as required. for example, imagine how many products are available on amazon, and imagine how many posts have been written on facebook. ...
...pt), and then dynamically update the data displayed inside those templates when needed, such as when you want to view a different product on amazon. in the modern world of web development, learning about server-side development is highly recommended. learning pathway getting started with server-side programming is usually easier than client-side development, because dynamic websites tend to per
form a lot of very similar operations (retrieving data from a database and displaying it in a page, validating user-entered data and saving it in a database, checking user permissions and logging users in, etc.), and are constructed using web frameworks that make these and other common web server operations easy. basic knowledge of programming concepts (or of a particular programming language) is use...
...ou'll be ready to work your way through the modules in this section. modules this topic contains the following modules. you should start with the first module, then go on to one of the following modules, which show how to work with two very popular server-side languages using appropriate web frameworks. server-side website programming first steps this module provides technology-agnostic in
formation about server-side website programming such as "what is it?", "how does it differ from client-side programming?", and "why is it useful?". this module also outlines some of the more popular server-side web frameworks and gives guidance on how to select the best one for your site. lastly, an introduction to web server security is provided. ...
Ember interactivity: Events, classes and state - Learn web development
a decorator is basically a wrapper function, which wraps and calls other functions or properties, providing additional functionality along the way. for example, the @tracked decorator (see slightly later on) runs code it is applied to, but additionally tracks it and automatically updates the app when values change. read javascript decorators: what they are and when to use them for more general in
formation on decorators. coming back to our browser tab with the app running, we can type whatever we want, and when we hit enter we'll be greeted with an alert message telling us exactly what we typed. with the interactivity of the header input out of the way, we need a place to store todos so that other components can access them. storing todos with a service ember has built-in application-le...
... completed or not. when instantiated, a todo object will have an initial text value equal to the text given to it when created (see below), and an iscompleted value of false. the only ember-specific part of this class is the @tracked decorator — this hooks in to the reactivity system and allows ember to update what you're seeing in your app automatically if the tracked properties change. more in
formation on tracked can be found here. now it's time to add to the body of the service. first add another import statement below the previous one, to make actions available inside the service: import { action } from '@ember/object'; update the existing export default class tododataservice extends service { … } block as follows: export default class tododataservice extends service { @tracked ...
... ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo
form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced s...
React resources - Learn web development
tyles although this tutorial doesn't use this approach, many react applications define their styles on a per-component basis, rather than in a single, monolithic stylesheet. create-react-app makes it possible to import css files into javascript modules, so that css is only sent to your user when the corresponding component is rendered. for this app, we could have for example written a dedicated
form.css file to house the styles of those respective components, then imported the styles into their respective modules like this: import
form from './
form'; import './
form.css' this approach makes it easy to identify and manage the css that belongs to a specific component. however, it also fragments your stylesheet across your codebase, and this fragmentation might not be worthwhile. for larger ap...
...d even edit state and props to make immediate changes to your application. this screenshot shows our finished application as it appears in react devtools: on the left, we see all of the components that make up our application, including some unique keys for the things that are rendered from arrays. on the right, we see the props and hooks that our app component utilizes. notice, too, that the
form, filterbutton, and todo components are indented to the right – this indicates that app is their parent. in more complex apps, this view is great for understanding parent/child relationships at a glance. react devtools is available in a number of
forms: a chrome browser extension. a firefox browser extension. a chromium edge browser extension (available soon). a stand-alone application yo...
... ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo
form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced s...
Using Vue computed properties - Learn web development
ry could read "3 items completed out of 5". while it might be tempting to do something like this: <h2>{{todoitems.filter(item => item.done).length}} out of {{todoitems.length}} items completed</h2> it would be recalculated on every render. for a small app like this, that probably doesn't matter too much. for bigger apps, or when the expression is more complicated, that could cause a serious per
formance problem. a better solution is to use vue’s computed properties. computed properties work similarly to methods, but only re-run when one of their dependencies changes. in our case, this would only re-run when the todoitems array changes. to create a computed property, we need to add a computed property to our component object, much like the methods property we've used previously. adding a...
...item.id" @checkbox-changed="updatedonestatus(item.id)"> </to-do-item> now if you check a todoitem, you should see the summary update appropriately! summary in this article we've used a computed property to add a nice little feature to our app. we do however have bigger fish to fry — in the next article we will look at conditional rendering, and how we can use it to show an edit
form when we want to edit existing todo items. previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rende...
... ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo
form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced s...
Cross browser testing - Learn web development
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. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites you should really learn the basics of the core html, css, and javascript languages first before attempting to use the tools detailed here. 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 cro...
...an be used to prevent problems from happening, or fix problems that occur. this includes linting code, handing css prefixes, using browser dev tools to track down problems, using polyfills to add support into browsers, tackling responsive design problems, and more. handling common javascript problems now we'll look at common cross-browser javascript problems and how to fix them. ...
...problems now we'll look at common cross-browser javascript problems and how to fix them. this includes in
formation on using browser dev tools to track down and fix problems, using polyfills and libraries to work around problems, getting modern javascript features working in older browsers, and more. handling common accessibility problems next we turn our attention to accessibility, providing in
formation on common problems, how to do simple testing, and how to make use of auditing/automation tools for finding accessibility issues. implementing feature detection feature detection involves working out whether a browser supports a certain block of code, and running different code dependent on whether it does (or doesn't), so that the browser can always provide a working experience rather than...
Accessibility/LiveRegionDevGuide
region support. this guide was written from an atk/at-spi point of view as part of the orca live region support project. however, many of the concepts were also used during the development of firevox, an at using iaccessible2. sometimes the very best guide for some developers is the code itself. please refer to the liveregions and gecko python modules in orca for a real world example. for more in
formation about live regions, please read the aria properties spec or the live region report to learn about aria live region markup and the live region api support document for the latest firefox api with regards to live regions. as always, we're open to questions and suggestions for changes in community forums. priority queue the heart of any live region support module is the priority queue. it i...
...vents should be examined for the presence of an embed character. if one is present, the text changed event should be discarded because an object changed event will follow. filtering user actions this paragraph describes object properties and event naming schemes that are used to help an at determine if an event is an actual live region event or is the result of user action. filtering for per
formance the most significant difference between at-spi and iaccessible2 is that at-spi is an inter-process communication service while iaccessible2 runs in process. as a result, care must be taken in an at-spi based application to minimize per
formance degradation by only acting on events that are truly live regions. these "non-live" events may be events originating from the chrome, user interaction ...
...ss level for the event and can have values of "off", "polite", "assertive" and "rude". this property, along with an event's time stamp, determine the priority of a message within the priority queue. the following describes actions that should be taken for an event with the given politeness level: off: no action should be taken. the event should be filtered out as early as possible to prevent per
formance degradation. polite: a message should be derived from the event and added to the queue. assertive: the queue should be purged of 'polite' messages and the new message should be added to the queue. speak should not be interrupted. rude: the queue should be purged of 'polite' and 'assertive' messages and the new message should be added to the queue. current utterances should be allowed to fi...
Creating a Login Manager storage module
so for example, on kde is is desirable to fully employ the kde wallet manager, rather than any secondary replacements of kdewallet. ...
...the category registration looks like this: nscomptr<nsicat...
...the category registration looks like this: nscomptr<nsicategorymanager> cat = do_getservice(ns_categorymanager_contractid); ns_ensure_state(cat); cat->addcateg...
Creating a spell check dictionary add-on
this page describes how to package a hunspell spell check dictionary as a firefox add-on, or how to update your existing add-on, so that it can be installed, uninstalled and updated without a restart. parts needed to create a dictionary add-on, you first need two things: a spell check dictionary in hunspell or myspell
format, with a license which allows you to use it. such a dictionary consists of two files, one with a .dic and one with an .aff file extension. a locale code to describe the language of the dictionary. for example en-us, de-de or da. it is important to choose the right locale code, or the spell checker will not be able to match the language of your dictionary against the language of a web page in order to select the right dictionary to use. if you are creating a ...
...ip file which contains the following files and folders: my-dictionary.xpi install.rdf dictionaries/ locale-code.dic locale-code.aff the .dic and .aff files must be placed in a subfolder named dictionaries within the zip file. both files must have the locale code as their file name. you also have to add a file named install.rdf to the root of the zip file. this file contains in
formation about your add-on such as name and version number (see below). in addition to these required files, you may add optional files, for example to give your add-on an icon or to describe the license of the dictionary. here is an example of the install.rdf file. you can create and edit it with a plain text editor such as notepad. <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-r...
...must keep the existing em:id, or your users will not be updated to the latest version. the em:version should follow the rules of mozilla add-on version numbers, and if you update an existing dictionary add-on, the new version number must be greater than the old one. 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. although the restartless
format for dictionary add-ons were introduced in gecko 10, dictionary updates only works starting from gecko 18. the em:minversion should therefore be the same as in the example above (or greater). if you set em:minversion to a lower value, gecko 10-17 will not be able to update your dictionary add-on once th...
Debugging JavaScript
o set the pref browser.dom.window.dump.enabled to true, e.g. in about:config (add new pref, it doesn't exist per default). under microsoft windows you additionally need to start firefox via the following command to have a native console : firefox.exe -console using normal javascript object inspection, you can write a function that dumps a whole object, similar to this ddumpobject(). log.jsm (
formerly log4moz) this is a partial implementation of the log4* interfaces (for example, see log4j or log4net). components.utils.import("resource://gre/modules/log.jsm"); "debugger" keyword you can halt venkman or chromebug at a line using the keyword debugger. in debug builds this also dumps a stack trace to the console, even when the debugger is not running. in extensions you can print the calls...
... ...
... ...
Debugging Table Reflow
d col dump** ***end table dump*** the en stands for entrance (ex for leaving a routine). the first line of the data dump shows that no width has yet been assigned to the columns mcolwidths=-1 -1 -1 -1, -1 stands for: #define width_not_set -1 this is followed by a reference to the column frame pointers: col frame cache -> 0=00b93138 1=00b931f0 2=024dd728 3=024dd780 this is followed by the in
formation which width has been set for each column. the index of the column, whether it is anonymous and what kind of constrained has been appliedcolindex=0 isanonymous=0 constraint=0. the following constraint types are known: enoconstraint = 0, epixelconstraint = 1, // pixel width epercentconstraint = 2, // percent width eproportionconstraint = 3, // 1*, 2*, etc. c...
... has been appliedcolindex=0 isanonymous=0 constraint=0. the following constraint types are known: enoconstraint = 0, epixelconstraint = 1, // pixel width epercentconstraint = 2, // percent width eproportionconstraint = 3, // 1*, 2*, etc. ...
...constraint=3 widths=360 540 -1 -1 -1 -1 -1 -1 540 465 **end col dump** **start col dump** colindex=3 isanonymous=0 constraint=0 widths=360 540 -1 -1 -1 -1 -1 -1 -1 465 **end col dump** ***end table dump*** the column dump is implemented in nstablecolframe.cpp in the routine:void nstablecolframe::dump(print32 aindent). debug_table_reflow_timing needs to be written original document in
formation author(s): bernd mielke other contributors: bernd mielke, josh soref last updated date: november 20, 2005 ...
Debugging a hang on OS X (Archived)
warning: the content of this article may be out of date. this article contains historical in
formation about older versions of os x. see how to report a hung firefox instead. if you find a hang in an application, it is very useful for the developer to know where in the code this hang happens, especially if he or she can't reproduce it. below are steps you can use to attach so-called "samples" to bug reports. creating the sample on mac os x 10.5 (xcode < 4.2) when the application is still hung, open up spin control.app (it’s in your <tt>/developer/applications/per
formance tools/</tt> folder; if it is missing, install the latest computer hardware understanding development (chud) tools from apple). by default, sampling of any hanging application will begin automatically. aft...
...sample text, copy it into your favorite text editor, and save as a plain-text file. for a more detailed view of the sample data, make sure the sample you just recorded is selected in the “detected hangs” window and click on the “open…” button. creating the sample on mac os x 10.4 when the application is still hung, open up sampler.app (it’s in your <tt>/developer/applications/per
formance tools/</tt> folder; if it is missing, install the latest computer hardware understanding development (chud) tools from apple.). choose file > attach... select "firefox-bin" or the hung application you want a sample from. now, click "start recording". note that only 3-4 seconds usually suffice, note that this will quickly hog up a lot of memory if you leave it on for too long! when it's do...
...e from. now, click "start recording". note that only 3-4 seconds usually suffice, note that this will quickly hog up a lot of memory if you leave it on for too long! when it's done parsing the data, you should now have a couple of rows with stacktraces for all the threads in the sampled application. when you have the raw sample data, you can't just save that and attach it to a bug, because the
format is not very usable (unless the developer is a mac hacker). export it using tools > generate report, and attach this as a text file to the bug report. the final data will show where the application spent all its time when it was hung, and hopefully your bug will be easier to fix now! see also debugging on mac os x ...
Building Firefox with Debug Symbols
this is enabled by default so unless you have explcitly disabled it your build you should include symbols. ac_add_options --enable-debug-symbols this can optionally take an argument for the type of symbols that need to be produced (like "-g3"). by default it uses "-g" on linux and macos. ...
...this is enabled by default so unless you have explcitly disabled it your build you should include symbols. ac_add_options --enable-debug-symbols this can optionally take an argument for the type of symbols that need to be produced (like "-g3"). by default it uses "-g" on linux and macos. ...
...ill override the values provided for cflags and cxxflags. breakpad symbol files after the build is complete, run the following command to generate an archive of breakpad symbol files: mach buildsymbols the tinderbox uses an additional uploadsymbols target to upload symbols to a socorro server. see https://dxr.mozilla.org/mozilla/source/toolkit/crashreporter/tools/upload_symbols.sh for more in
formation about the environment variables used by this target. make package if you use make package to package your build, symbols will be stripped. if you want to keep the symbols in the patches, you need to add this to your mozconfig: ac_add_options --disable-install-strip ...
Configuring Build Options
able-application=suite calendar (lightning extension, uses thunderbird) ac_add_options --enable-application=comm/mail ac_add_options --enable-calendar selecting build options the build options you choose depends on what application you are building and what you will be using the build for. if you want to use the build regularly, you will want a release build without extra debugging in
formation; if you are a developer who wants to hack the source code, you probably want a non-optimized build with extra debugging macros. there are many options recognized by the configure script which are special-purpose options intended for embedders or other special situations, and should not be used to build the full suite/xul applications. the full list of options can be obtained by running ./co...
...nerally use this option. ac_add_options --disable-optimize disables compiler optimization. this makes it much easier to step through code in a debugger. ac_add_options --enable-debug-js-modules enable only javascript assertions. this is useful when working locally on javascript-powered components like the devtools. this will help catch any errors introduced into the js code, with less of a per
formance impact compared to the --enable-debug option. you can make an optimized build with debugging symbols. see building firefox with debug symbols. extensions ac_add_options --enable-extensions=default|all|ext1,ext2,-skipext3 there are many optional pieces of code that live in extensions/. many of these extensions are now considered an integral part of the browsing experience. there is a de...
... ...
Simple Thunderbird build
hardware requirements at least 4 gb of ram. 8 gb or more is recommended. while you can build thunderbird on older hardware it can take quite a bit of time to compile on slower machines with less ram. good internet connection for the initial source download. ...
...134.0 is needed to compile thunderbird. assuming standard installation locations, copy these 17 files to c:\program files (x86)\windows kits\10\include\10.0.17134.0\shared. ...
...a.org/ if the trunk is broken (i.e. closed), you may wish to consider building one of the branches (to pull the source code from a branch, just replace the url to the repository in the hg clone instruction). check to make sure that the path in which you placed the source code has no spaces, and is not too long. searched the bug database for issues relating to your problem (e.g., plat
form-specific issues). try asking in mozilla.dev.builds - include details of what is in your mozconfig, and what the actual error is. check if your mozilla/ is a symlink. a symlink there is not supported. check for @topsrcdir@ or relative paths in your mozconfig. those have caused several problems historically and tend to be poorly tested when the build system changes. if on windows you get link e...
Obsolete Build Caveats and Tips
r the past few years. this has resulted in many caveats and tips being added to the mdn documentation for building older versions of the code base or dealing with older build tools. these tips, while helpful, are jarring and superfluous to the majority of new mozilla builders who are mainly interested in building the latest version of firefox. therefore, instead of deleting all these nuggets of in
formation, it's best to collect them all here and remove them from the majority happy path documentation. each piece of in
formation should mention the page and the section it originally came from. you can copy in the original text and bold out what has been removed. obsolete caveats and tips from simple_firefox_build install a version of visual studio that supports c++ development: vs 2012 for wind...
... sample code and documentation to save space and download time. if you are using windows xp, you must have windows xp service pack 2 and .net framework 2.0 installed before installing the vista sdk. use visual studio 2008 professional. gecko 1.9.2 through 11: if you would like to use this sdk, add ac_add_options --with-windows-version=600 to your .mozconfig. windows server 2003 r2 plat
form sdk obsolete since gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this is your only option if you're on windows 2000. this also used to be necessary for building a default gecko 1.9.2 through 8 with visual c++ express editions...
...studio 9). delete the vcvars32.bat file and repair your visual studio installation with the setup program. edit vcvars32.bat to correct the problem (see http://blogs.msdn.com/windowssdk/arc...vironment.aspx "workaround: repair the vs2008 command line build environment by editing c:\program files\microsoft visual studio 9.0\vc\bin\vcvars32.bat manually"). sdks older than the server 2003 r2 plat
form sdk aren't supported either. from windows build prerequisites [en-us] microsoft visual c++ (msvc) depending on what you're building, you will need to use one of several available versions of microsoft visual c++ (msvc) and/or microsoft visual studio. see the chart at the top of this page to ensure that the version you've selected is compatible with the branch you want to build. if you wan...
Listening to events on all tabs
bprogress the progress instance responsible for handling the events. arequest the nsirequest object representing the associated request. alocation an nsiuri object indicating the tab's new uri. aflags optional: this is a value which explains the situation or the reason why the location has changed. optional from gecko 10 onprogresschange called when updated progress in
formation for the download of a document is available. void onprogresschange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsirequest arequest, print32 acurselfprogress, print32 amaxselfprogress, print32 acurtotalprogress, print32 amaxtotalprogress ); parameters abrowser the browser representing the tab for which updated progress in
formation is being provided. aw...
...onstatechange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsirequest arequest, unsigned long astateflags, nsresult astatus ); parameters abrowser the browser that fired the notification. awebprogress the nsiwebprogress instance that fired the notification. arequest the nsirequest that has changed state. this parameter may be null. need more in
formation on what null means. astateflags flags indicating the new state. this value is a combination of one of the state transition flags and one or more of the state type flags defined in the nsiwebprogresslistener documentation. any undefined bits are reserved for future use. astatus error status code associated with the state change; this indicates whether or not the request was su...
...se. astatus error status code associated with the state change; this indicates whether or not the request was successful. this parameter should be ignored unless astateflags includes the state_stop bit. note: astatus may be a success code even for server generated errors, such as the http 404 file not found error. in such cases, the request itself should be queried for extended error in
formation (e.g., for http requests see nsihttpchannel). onstatuschange notification that the status of a request has changed. the status message is intended to be displayed to the user (e.g., in the status bar of the browser). void onstatuschange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsirequest arequest, nsresult astatus, prunichar *amessage ); parameters abrowser ...
Reviewer Checklist
de steps to reproduce (str). quality if you can unit-test it, you should unit-test it. if it's js, try to design and build so that xpcshell can exercise most functionality. it's quicker. make sure the patch doesn't create any unused code (e.g., remove strings when removing a feature) all caught exceptions should be logged at the appropriate level, bearing in mind personally identifiable in
formation, but also considering the expense of computing and recording log output. [fennec: checking for log levels is expensive unless you're using logger.] style follow the style guide for the language and module in question. follow local style for the surrounding code, even if that local style isn't
formally documented. new files have license declarations and modelines. new js files should ...
... this, as does hg with the color extension enabled). whitespace can be fixed easily in mercurial using the checkfiles extension. in git, you can use git rebase --whitespace=fix. security issues there should be no writing to arbitrary files outside the profile folder. be careful when reading user input, network input, or files on disk. assume that inputs will be too big, too short, empty, mal
formed, or malicious. tag for sec review if unsure. if you're writing code that uses jsapi, chances are you got it wrong. try hard to avoid doing that. privacy issues there should be no logging of urls or content from which urls may be inferred. [fennec: android services has logger.pii() for this purpose (e.g., logging profile dir)]. tag for privacy review if needed. resource leaks in ja...
...ct as needed. if javascript can see your object, it probably needs to be cycle-collected. [fennec: if your custom view does animations, it's better to clean up runnables in ondetachfromwindow().] ensure all file handles and other closeable resources are closed appropriately. [fennec: when writing tests that use paintedsurface, ensure the paintedsurface is closed when you're done with it.] per
formance impact check for main-thread io [fennec: android may warn about this with strictmode]. remove debug logging that is not needed in production. threading issues enormous: correct use of locking and volatility; livelock and deadlock; ownership. [fennec: all view methods should be touched only on ui thread.] [fennec: activity lifecycle awareness (works with "never keep activities"). al...
HTTP Cache
not be sufficient - use one of the two following ways: [preffered] add a new <your>storage method on nsicachestorageservice and if needed give it any arguments to specify the storage scope even more. implementation only should need to enhance the context key generation and parsing code and enhance current - or create new when needed - nsicachestorage implementations to carry any additional in
formation down to the cache service. [not preferred] add a new argument to nsiloadcontextinfo; be careful here, since some arguments on the context may not be known during the load time, what may lead to inter-context data leaking or implementation problems. adding more distinction to nsiloadcontextinfo also affects all existing storages which may not be always desirable. see context keying details...
...o the cache service. [not preferred] add a new argument to nsiloadcontextinfo; be careful here, since some arguments on the context may not be known during the load time, what may lead to inter-context data leaking or implementation problems. adding more distinction to nsiloadcontextinfo also affects all existing storages which may not be always desirable. see context keying details for more in
formation. code examples tbd opening an entry creating a new entry recreating an already open entry implementation threading the cache api is fully thread-safe. the cache is using a single background thread where any io operations like opening, reading, writing and erasing happen. also memory pool management, eviction, visiting loops happen on this thread. the thread supports several priori...
...pen level are first merged to the open_priority level. the eviction preparation operation - i.e. clearing of the internal io state - is then put to the end of the open_priority level. all this happens atomically. this functionality is currently pending in bug 976866. storage and entries scopes a scope key string used to map the storage scope is based on the arguments of nsiloadcontextinfo. ...
How to get a stacktrace for a bug report
cause. this article describes how to use the mozilla crash reporter (breakpad) to get a crash id, which our engineers can use to get a stacktrace, and alternative ways to get a stacktrace if you can't get a crash id. requirements you need a binary build of firefox from mozilla.org. seamonkey and thunderbird also support crash reporting. mozilla's crash report server currently only has debug in
formation for mozilla builds and thus the crash reporter cannot work if you use a build from a linux distribution or if you compile from source code. in these cases you will need to use one of the alternative methods listed below. note: when filing a crash report, it is important to know whether the crash occurs with firefox safe mode. this helps engineers determine whether a particular extension or ...
...important to know whether the crash occurs with firefox safe mode. this helps engineers determine whether a particular extension or plugin is the cause of the crash. how to get a crash id with the mozilla crash reporter 1. crash and submit a report to the system. the mozilla crash reporter window should automatically come up after firefox crashes. if you have any additional in
formation about the crash, such as additional detail on what you were doing at the time that may have triggered the crash, please enter it into the comments box. be sure that you check the "tell mozilla about this crash" checkbox and click the restart button. the crash reporter should now submit the crash report and firefox should open again. the "details" button gives additional data about the i...
...ch file in this folder contains one submitted crash report id. you can check the modified or creation time for each file to discern which crash reports are relevant to your bug report. alternative ways to get a stacktrace if the mozilla crash reporter doesn't come up or isn't available you will need to obtain a stacktrace manually: windows see the article create a stacktrace with windbg for in
formation on how to do this. for a full process dump, see how to get a process dump with windows task manager [en-us] os x run /applications/utilities/console.app. expand "~/library/logs" and "crashreporter", then look for logs for "firefox-bin". linux note that for most distros, the package you need to get symbols for will be something like "xulrunner", not "firefox". crash reports files on yo...
How to get a stacktrace with WinDbg
sh, go back to the debug menu and press go. once the browser crashes, you will see an error (such as "access violation") in the windbg command window. if firefox hangs and there is no command prompt available in the debugger, open the debug menu and choose break. once the browser has crashed or been stopped, continue with the steps below. ...
...ang you need to capture the debug in
formation to include in a bug comment or support request. enter these three commands, one at a time, to get the stacktrace, crash/hang analysis and log of loaded modules. (again, press enter after each command.) ~* kp !analyze -v -f lm after these steps are completed, find the file c:\temp\firefox-debug-(today's date).txt on your hard drive. to provide the in
formation to the development community, submit this file with a support request or attach it to a related bug on bugzilla. producing a minidump sometimes the stacktrace alone is not enough in
formation for a developer to figure out what went wrong. a developer may ask you for a "minidump" or a "full memory dump", which are files containing more in
formation about the process. you can easily produce mi...
...e?! a: you ran the application without the "debug child processes also" check box being checked. you need to detach the debugger and open the application again, this time with the check box being checked. q: windbg tells me that it is unable to verify checksum for firefox.exe. is this normal? a: yes, this is normal and can be ignored. q: should i click yes or no when windbg asks me to "save in
formation for workspace?" a: click yes and windbg will save you from having to enter in the symbol location for firefox.exe in the future. click no if you'd rather not having windbg save this in
formation. q: i'm seeing "wow64" on top of each thread, is that ok ? a: no, you are running a 64 bit version of windbg and trying to debug a 32 bit version of the mozilla software. redownload and install the...
How to implement a custom autocomplete search component
"/> the type="autocomplete" turns on the autocomplete mechanism and the autocompletesearch="history" sets the source for the autocomplete. there are more options and features, see xul:textbox_(firefox_autocomplete) for more details. the toolkit mechanism has built-in support for several autocomplete sources, including: history: search the browser's url history (firefox: 1.0+; seamonkey: 1.1+)
form-history: search the values that the user has entered into
form fields. (firefox: 1.0+; seamonkey: 2.0+) file: search file names (firefox: 2.0+; thunderbird: 2.0+; seamonkey: 1.1+; gtk builds only). the component uses the autocompletesearchparam attribute or searchparam property to allow the developer to define the default directory otherwise only paths beginning with / or ~/ will be autocomplete...
... define the default directory otherwise only paths beginning with / or ~/ will be autocompleted. building your custom autocomplete search components sometimes, you may want to build your own autocomplete source. to do so you need the following: create an xpcom component that implements the nsiautocompletesearch interface. make sure the contract id of your xpcom component follows the following
form: "@mozilla.org/autocomplete/search;1?name=xxx", where "xxx" is the name of your autocomplete source. implement the list of matched strings using the nsiautocompleteresult interface. the simplest way to make an xpcom component is to build an xpcom javascript component (this cannot be done with a javascript module). how to build an xpcom component in javascript will step you through the process. ...
...utocomplete" showcommentcolumn="true" autocompletesearchparam='[{"value":"mark","comment":"cool dude"},{"value":"mary","comment":"nice lady"},{"value":"jimmy","comment":"very uncool guy"},{"value":"jimbo","comment":null}]' /> the component uses the autocompletesearchparam attribute or searchparam property to allow the developer to define a set of data to use for autocompletion. note the
format of the json. the comment property is optional and may be omitted from the json. be sure to include it if you use the showcommentcolumn="true" textbox attribute. in case you do not like the standard tree layout of the autocomplete popup, you can also trigger the use of a richlistbox by linking a panel with the type attribute set to "autocomplete-richlistbox" like this: <panel id="richpopup" type...
How to Report a Hung Firefox
fox not responding? or are you regularly seeing the "firefox is running but is not responding..." dialog? this usually means that something in firefox is hung. this may be because of a code error within firefox itself, such as a deadlock or infinite loop, or it may be caused by 3rd-party software such as a firefox extension, antivirus software, or even malware or a virus on your computer. what in
formation to include in a bug report as usual, following bug writing guidelines will make your report much more likely to lead to a fix in firefox. check the cpu usage of the firefox process(es): is it idle, using 100% of a core (which may show up as 50%, 25% in your monitoring tool if you have a multi-core processor) or neither? (if you're experiencing high cpu usage and firefox eventually ...
...elines will make your report much more likely to lead to a fix in firefox. check the cpu usage of the firefox process(es): is it idle, using 100% of a core (which may show up as 50%, 25% in your monitoring tool if you have a multi-core processor) or neither? (if you're experiencing high cpu usage and firefox eventually recovers from a hang, you should try the instructions at reporting a per
formance problem instead.) is the rest of your system busy (high cpu or memory usage, or high disk activity)? if firefox is truly hung, please note the approximate amount of time you waited before forcing a crash (below) in the bug report. if you suspect a hang (as opposed to slow per
formance), wait one minute on an idle system before getting the stack trace. the crash report link for a hang, ...
...re getting the stack trace. the crash report link for a hang, obtained by following the steps below. submit a crash report for a hung firefox the easiest way to help the firefox stability team to debug these kinds of hangs is to make the hung firefox crash and submit a crash report. then file a bug report with the crash report id. the steps to induce a crash are slightly different on each plat
form: windows on windows, the stability team has written a utility which will inject a crash into firefox which will trigger the crash reporter: download crashfirefox.exe here (source code). running this tool will search for firefox.exe and inject crashing code into it. the tool also has command-line options to kill processes with other names or by process id. run the crashfirefox.exe tool. the ...
Integrated Authentication
with the browser. this list is intended to be configured by an it department prior to distributing mozilla to end-users. the preferences are: pref("network.negotiate-auth.trusted-uris", site-list); pref("network.negotiate-auth.delegation-uris", site-list); pref("network.automatic-ntlm-auth.trusted-uris", site-list); where, site-list is a comma-separated list of url prefixes or domains of the
form: site-list = "mydomain.com, https://myotherdomain.com" network.negotiate-auth.trusted-uris lists the sites that are permitted to engage in spnego authentication with the browser, and network.negotiate-auth.delegation-uris lists the sites for which the browser may delegate user authorization to the server. network.automatic-ntlm-auth.trusted-uris lists the trusted sites to use ntlm authentifica...
...twork.negotiate-auth.trusted-uris lists the sites that are permitted to engage in spnego authentication with the browser, and network.negotiate-auth.delegation-uris lists the sites for which the browser may delegate user authorization to the server. network.automatic-ntlm-auth.trusted-uris lists the trusted sites to use ntlm authentification. ...
...twork.automatic-ntlm-auth.trusted-uris lists the trusted sites to use ntlm authentification. if you wish to use non-fully-qualified entries of the
form mydomain.com in the above preferences for ntlm and spnego authentication, you will also need to set the preferences network.automatic-ntlm-auth.allow-non-fqdn and network.negotiate-auth.allow-non-fqdn (respectively) to true. original document in
formation author(s): darin fisher last updated date: december 27, 2005 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
UpdateInfo
each item in the array contains "id", "minversion", and "maxversion" properties. ...
...each item in the array contains "id", "minversion", and "maxversion" properties. ...
...er. attributes attribute type description version string the version of the update. updateurl string the updateurl that the update can be downloaded from. updatehash string a hash for the update's file. updateinfourl string a url containing simple release notes for the update. targetapplications object[] in
formation about what applications the update is compatible with. each item in the array contains "id", "minversion", and "maxversion" properties. ...
UpdateListener
an updatelistener receives messages from an update check for a single add-on, though it is possible to pass the same updatelistener to as many calls to findupdates() as you like. for each individual update check, the following methods will be called on the listener: either oncompatibilityupdateavailable() or onnocompatibilityupdateavailable(), depending on whether compatibility in
formation for the requested application version was seen. either onupdateavailable() or onnoupdateavailable(), depending on whether a newer version of the addon was found. onupdatefinished() to signal that the update check has completed. method overview void oncompatibilityupdateavailable(in addon addon) void onnocompatibilityupdateavailable(in addon addon) void onupdateavailable(in...
... oncompatibilityupdateavailable(in addon addon) void onnocompatibilityupdateavailable(in addon addon) void onupdateavailable(in addon addon, in addoninstall install) void onnoupdateavailable(in addon addon) void onupdatefinished(in addon addon, in integer error) methods oncompatibilityupdateavailable() called when the update check found compatibility in
formation for the application and plat
form version that the update check was being per
formed for. void oncompatibilityupdateavailable( in addon addon ) parameters addon the addon that was being checked for updates onnocompatibilityupdateavailable() called when the update check found no new compatibility in
formation for the application and plat
form version that the update check was being pe...
... void onnocompatibilityupdateavailable( in addon addon ) parameters addon the addon that was being checked for updates onupdateavailable() called when a new version of an add-on has been found for install. ...
OS.File.Error
ut whether the problem is due to a file that does not exist try { let file = os.file.open("myfile.txt"); // ... } catch (ex) { if (ex instanceof os.file.error && ex.becausenosuchfile) { // the file does not exist } } global object os.file.error methods overview the following functions are utility functions that may be used to construct instances of os.file.error, setting the plat
form-specific error number. error closed() error exists() methods os.file.error.closed() return an error representing the fact that a file is closed. os.file.error.exists() return an error representing the fact that a file exists. instances of os.file.error in case of any i/o error, the functions of os.file raise instances of os.file.error. these exceptions hold both a human-re...
...n an error representing the fact that a file is closed. os.file.error.exists() return an error representing the fact that a file exists. instances of os.file.error in case of any i/o error, the functions of os.file raise instances of os.file.error. these exceptions hold both a human-readable error message detailing the i/o error and attributes to help determining the cause of the error. cross-plat
form attributes operation the human-readable name of the failed operation. becauseexists true if the operation failed because a file or directory exists, false otherwise. becausenosuchfile true if the operation failed because a file or directory does not exist, false otherwise. becauseclosed true if the operation failed because a file or directory is clo...
... the human-readable name of the failed operation. becauseexists true if the operation failed because a file or directory exists, false otherwise. becausenosuchfile true if the operation failed because a file or directory does not exist, false otherwise. becauseclosed true if the operation failed because a file or directory is closed, false otherwise. plat
form-specific attributes unixerrno (defined under unix only) the system error number (errno) for the error. for more details, you may compare it with the error constants of os.constants.libc.e*. winlasterror (defined under windows only) the system error number (getlasterror) for the error. for more details, you may compare it with the error constants of os.constants.win.error_*...
Sqlite.jsm
worry about caching created statement instances, destroying them when you are done, etc. this translates to fewer lines of code to talk to sqlite. all operations are asynchronous. use of synchronous storage apis is discouraged because they block the main thread. all the functionality in sqlite.jsm is asynchronous. easier memory management. since sqlite.jsm manages statements for you, it can per
form intelligent actions like purging all cached statements not in use, freeing memory in the process. there is even a shrinkmemory api that will minimize memory usage of the connection automatically. simpler transactions. sqlite.jsm exposes a transaction api built on top of task.jsm that allows transactions to be written as procedural javascript functions (as opposed to a series of callback driven o...
... is a series of related statements treated as one functional unit. if the transaction succeeds, all the statements contained within it are committed as one unit. if the transaction fails, the database is rolled back to its state before the transaction started. this function receives the following arguments: func the function defining the transaction body. type the type of transaction to per
form. this must be one of the transaction_* constants on the opened connection instance. valid values are transaction_deferred, transaction_immediate, transaction_exclusive. see the sqlite documentation for their meaning. the default is transaction_deferred. the passed function is a task.jsm compatible generator function. when called, the function receives as its argument the current connection inst...
...ng the inserts proceed without error, of course). let's do an example where we want to force a transaction rollback. conn.executetransaction(async function complextransaction() { await conn.execute("insert into mytable values (?, ?)", ["foo", "bar"]); let data = await conn.execute("select * from mytable"); if (data.length < 5) { throw new error("we don't have the expected 5 rows to per
form the next operation!"); } // ... }); selecting and returning data these examples demonstrate how to access the data that is returned. this example shows multiple rows of a table being returned using the onrow function parameter. let accounts = []; let accountid, username; let statement = "select account_id, username from accounts order by username asc"; try { const result = await ...
Bootstrapping a new locale
active development of the upcoming release of firefox occurs) and then begin the necessary work for translation. hg allows localizers to work locally on their machines and then "push" changes to their official mozilla repository. installing mercurial depending on your operating system, you will need to install the correct version of hg on your machine. this document will give you the basic in
formation on how to do that. install the compare-locales utility the next step is to install compare-locales. $ sudo easy_install compare-locales this will download and install the utility. clone the source code the next step is to download a copy of the source code to your local system, using mercurial. you will need to "hg clone" the existing release branch for mozilla so you have all the f...
...thunderbird 3, seamonkey 2 or other mozilla projects based on gecko 1.9.1 you'll need to follow the instructions on getting the source-code of the comm-central repository. create a bare-bones localization next, create a base localization. this is done by cloning the en-us (united states english) files into your localization. first, you should specify your locale's language identifier in ab-cd
format, where "ab" is the iso 639 language code, and cd is the iso 3166 country code. the "-cd" part is only necessary to differentiate between versions of a language that are subtly different from country to country, such as in "en-us" and "en-gb" for united states english and british english. before you run the copy commands, you need to make the locale directory at the same level as the mozilla-1...
...help set up an experimental hg repository in bit bucket. you will need to create an account so you can access the service. once you have that account, send the l10n-drivers the details to be added as a "writer". with that level of authority, you will be able to push and pull and manage the repository remotely. it will be just like working on hg with mozilla, yet you will use the bit bucket plat
form to start. after your new bit bucket repository is created by the l10n-drivers, please visit the url for your repo. you can do this by entering the following url into your browser: $ https://bitbucket.org/mozillal10n/ab-cd/overview/ (where ab-cd will be replaced by your locale code) at that main page of your newly created bit bucket repo, you'll see the hg commands, $ hg clone http://bitbuc...
QA phase
if you're localizing mozilla websites, your work will display soon after you've committed it without needing a language pack. ...
...moz_objdir=@topsrcdir@/../firefox-build ac_add_options --disable-compile-environment ac_add_options --with-l10n-base=../l10n-central # path relative to moz_objdir ac_add_options --enable-application=[browser or mail] you will need to specify which application you're localizing in the fourth line (e.g., for firefox, that's browser, thunderbird would be mail). enter the following command to per
form the configuration: $ ./mach configure once your command-line finishes spitting out the config command's output, navigate to the newly created directory: $ cd ../firefox-build/browser/locales now you're ready to build! at this point you can choose between two build options. you can either: create a langpack, which is installed on top of your mozilla application, or repack the application's ...
...tral/x-testing searching for changes changeset: 0:7c543e8f3a6a tag: tip user: your name <email@example.com> date: mon nov 23 18:08:25 2009 +0100 summary: added search bar strings let's now push this changeset. enter the following command: hg push http://hg.mozilla.org/l10n-central/x-testing mercurial will connect to your repo and ask you to provide your account in
formation (i.e., the username and the password). real url is http://hg.mozilla.org/l10n-central/x-testing pushing to http://hg.mozilla.org/l10n-central/x-testing searching for changes http authorization required realm: hg.mozilla.org http user: your_id password: after you enter your account in
formation, the changeset will be pushed. adding changesets adding manifests adding file changes added 1 c...
Extras
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:rgb(255,255,255); stop-opacity:1;"/> <stop offset="100%" style="stop-color:rgb(255,0,0); stop-opacity:.8;"/> </radialgradient> </defs> <g trans
form="translate(15,15)"> <g> <animatetrans
form attributename="trans
form" attributetype="xml" type="rotate" from="360" to="0" dur="15s" repeatcount="indefinite"/> <g trans
form="translate(-15, -15)"> <path fill="url(#radgrad1)" d="m 15 0 l 20 10 l 30 15 l 20 20 l 15 30 ...
...y:1"/> <stop offset="100%" style="stop-color:rgb(255,255,0);stop-opacity:1"/> </lineargradient> <radialgradient 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 trans
form="translate(150,125)"> <g> <animatetrans
form attributename="trans
form" attributetype="xml" type="rotate" from="0" to="360" dur="6s" repeatcount="indefinite"/> <g trans
form="translate(-50,-35)"> <rect width="100" height="70" fill="url(#grad2)"/> <switch> <foreignobject width="100" height="70" requiredextensions="http://...
...mtr> <mtr> <mtd><mi>sin</mi><mi>θ</mi></mtd> <mtd><mi>cos</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"/> <animatetrans
form attributename="trans
form" attributetype="xml" type="scale" values="1;2;.5;1" keytimes="0;.25;.75;1" dur="20s" repeatcount="indefinite"/> <circle fill="url(#grad3)" r="30"/> <g trans
form="translate(-30,-30)"> <switch> <foreignobject width="60" height="60" requiredextensions="http://www.w3.org/1998/math/mathml"> <math display="block"> <mrow> <munderov...
Mozilla Web Services Security Model
please do not depend on anything in it being correct for security.) to prevent the browser from being used as a tool for web sites to obtain priveleges that belong to the browser's user (such as being behind a firewall or getting the benefits of the user's cookies), web browsers restrict what web pages can do when accessing things in other domains. these restrictions apply to web services. however, web services can be designed to be accessed from other domains, or even from any domain. ...
... root of the server that grants permission for other domains to access web services. for example, to determine what web sites can access a web service at http://www.example.com/dir1/dir2/service, mozilla would load the file http://www.example.com/web-scripts-access.xml, which may choose to delegate the decision to http://www.example.com/dir1/dir2/web...pts-access.xml. web-scripts-access.xml file
format the web-scripts-access.xml file is an xml document. any errors in xml syntax, as well as many failures to follow the
format, will cause the document to be ignored. the webscriptaccess element its root element must be a webscriptaccess element in the http://www.mozilla.org/2002/soap/security namespace. this element must have either one delegate element child or any number (0 or more) of allow...
...lns="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, including the security model, were first supported additional reading documentation of crossdomain.xml, a similar
format used by macromedia flash player ...
Mozilla Development Strategies
this article offers some strategies and suggestions to help developers stay productive. warning: the content of this article may be out of date. it has not been updated for usage of mercurial (instead of cvs). work on the most important bugs first everyone likes to check in. but keep in mind that your checkin rate isn't everything. it's better to fix one data loss bug, crasher, or per
formance bug that really affects the user than edge case bugs that are rarely seen or minor bugs. make sure documentation gets updated if the bug you're fixing is likely to require an update to developer documentation once it's fixed, be sure to add the dev-doc-needed keyword to the bug (or ask someone to do it, if you don't have editbugs privileges on bugzilla). this puts the bug on the radar of ou...
...ce a week and you've changed a lot of code, you'll most likely have conflicts. see mozilla\config\fast-update.pl for a fast way to update your tree. you can update your main mozilla tree (minus nsprpub, etc) in 1-2 minutes. work on multiple bugs in parallel you should be working on the most important bugs first. but those might be difficult bugs (hard to reproduce crashers, big rewrites for per
formance, etc.) which can take several days or weeks to complete, plus the time for reviews. in your other trees, work on smaller, easier bugs. pick bugs that won't cause conflicts with the work you're doing in your primary tree. pick bugs that should only take you a few hours or a day to fix. in theory, fixes for these bugs will be quick to review. if you have problems finding smaller, easier bugs t...
...disk cd mozilla find . -type d \! -name cvs | xargs -l -p10 cvs tag -l my_base_tag > & ../taglog1.txt find . -type d \! -name cvs | xargs -l -p10 cvs tag -b -l my_branch_tag > & ../taglog2.txt from your windows box: cvs co -r my_branch_tag mozilla/client.mak cd mozilla edit client.mak, putting my_branch_tag in the right places. cvs commit client.mak nmake -f client.mak original document in
formation author(s): seth spitzer and alec flett last updated date: september 3, 2006 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Mozilla Development Tools
mozilla source code (mercurial and cvs) "trunk" development for gecko 1.9.1/firefox 3.5 and beyond uses the mercurial source code version control system. earlier releases and other products use the cvs version control system. ...
...able names. bonsai bonsai is tree control (get it?). it is our home-grown web-based tool for watching the up-to-the-minute goings-on in our cvs repository (viewing checkins and log messages, reading diffs, etc.) tinderbox tinderbox is for knowing when the tree is in flames. it is our home-grown web-based tool for watching the progress of the continuous builds that we run on multiple plat
forms. it is how we are able to tell when a checkin has broken the build on some plat
form, and how we know which person needs to be viciously flogged. bugzilla bugzilla is where developers can report bugs in the mozilla source releases, and browse an online database of already-reported bugs. doctor doctor is a web interface to cvs. it lets developers and others edit pages on the mozilla.org ...
...-reported bugs. doctor doctor is a web interface to cvs. it lets developers and others edit pages on the mozilla.org web site without having to use cvs. doctor lets you edit pages in wysiwyg mode if the pages contain the <?doctor enable_wysiwyg_mode ?> processing instruction. access doctor by clicking the "edit this page" link at the bottom of any mozilla.org web page. original document in
formation author(s): myk melez last updated date: november 8, 2005 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Profiling with Instruments
instruments can be used for memory profiling and for statistical profiling. official apple documentation instruments user guide instruments user reference instruments help articles instruments help per
formance overview basic usage select "time profiler" from the "choose a profiling template for:" dialog. in the top left, next to the record and pause button, there will be a "[machine name] > all processes". click "all processes" and select "firefox" from the "running applications" section. ...
...og. in the top left, next to the record and pause button, there will be a "[machine name] > all processes". click "all processes" and select "firefox" from the "running applications" section. click the record button (red circle in top left) wait for the amount of time that you want to profile click the stop button command line tools there is instruments and iprofiler. how do we monitor per
formance counters (cache miss etc.)? instruments has a "counters" instrument that can do this. memory profiling instruments will record a call stack at each allocation point. the call tree view can be quite helpful here. switch from "statistics". this malloc profiling is done using the malloc_logger infrastructure (similar to mallocstacklogging). currently this means you need to build with jemalloc ...
...memory profiling instruments will record a call stack at each allocation point. the call tree view can be quite helpful here. switch from "statistics". this malloc profiling is done using the malloc_logger infrastructure (similar to mallocstacklogging). currently this means you need to build with jemalloc disabled (ac_add_options --disable-jemalloc). you also need the fix to bug 719427 the dtper
formancesession api can be used to control profiling from applications like the old chud api we use in shark builds. bug 667036 system trace might be useful. ...
about:memory
often good enough to diagnose problems. don't click "measure..." repeatedly, because that will cause the memory usage of about:memory itself to rise, due to it discarding and regenerating large numbers of dom nodes. note that in both cases the generated data contains privacy-sensitive details such as the full list of the web pages you have open in other tabs. if you do not wish to share this in
formation, you can select the "anonymize" checkbox before clicking on "measure and save..." or "measure...". this will cause the privacy-sensitive data to be stripped out, but it may also make it harder for others to investigate the memory usage. loading memory reports from file the easiest way to load memory reports from file is to use the "load..." button. you can also use the "load and diff..." b...
....99 mb ── resident 251.47 mb ── resident-unique 1,103.64 mb ── vsize some measurements of note are as follows. "resident". physical memory usage. if you want a single measurement to summarize memory usage, this is probably the best one. "vsize". virtual memory usage. this is often much higher than any other measurement (particularly on mac). it only really matters on 32-bit plat
forms such as win32. there is also "vsize-max-contiguous" (not measured on all plat
forms, and not shown in this example), which indicates the largest single chunk of available virtual address space. if this number is low, it's likely that memory allocations will fail due to lack of virtual address space quite soon. various graphics-related measurements ("gfx-*"). the measurements taken vary between p...
...uch as win32. there is also "vsize-max-contiguous" (not measured on all plat
forms, and not shown in this example), which indicates the largest single chunk of available virtual address space. if this number is low, it's likely that memory allocations will fail due to lack of virtual address space quite soon. various graphics-related measurements ("gfx-*"). the measurements taken vary between plat
forms. graphics is often a source of high memory usage, and so these measurements can be helpful for detecting such cases. ...
Preferences system
this document describes toolkit's preferences system. using this system it is possible to create preferences windows that display and operate appropriately on various plat
forms (windows, macos x and gnome). the system is implemented through a few xul elements and attributes. ...
... this document describes toolkit's preferences system. using this system it is possible to create preferences windows that display and operate appropriately on various plat
forms (windows, macos x and gnome). the system is implemented through a few xul elements and attributes. ...
... <checkbox id="check1" preference="pref1" label="&check1.label;" accesskey="&check1.accesskey;"/> </prefpane> <prefpane id="pane2" label="&pane2.title;" src="chrome://uri/to/pane.xul"/> </prefwindow> pane content can be specified inline or an external chrome uri supplied for pane content to be loaded in via a dynamic overlay. you should be careful to read the higs for the plat
forms you are targeting and use the xul preprocessor if necessary to set different window titles as appropriate. you should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted plat
form, as well as the height (in em) for plat
forms where the window size does not change as the selected panel is changed (e.g. windows). usage in xulrunner appli...
Research and prep
is one of the most customizable and localizable parts of the product l10n process, as it goes beyond string translation. we believe that localization teams are in the best position to provide recommendations on what local providers we can use for web services because you're in the market, work in the language, and know your users. ...
... if there's no existing collaboration with the site provider and mozilla, ask for permission from the site provider to include it. ...
...lla localizations>[your_locale] to request updates to your locale's productization preferences. if this is your first localization for a product, the l10n drivers will file this bug as part of the new product localization release process. it is your l10n team's responsibility to per
form research and identify the most appropriate web services for your region and present them in your bug as your in
formed recommendations. if there's no existing collaboration with the site provider and mozilla, ask for permission from the site provider to include it. ensure that your suggestions follow these parameters: search there are typically five search plug-ins listed for firefox desktop (only four for firefox mobile): generic search the default option should expose the quickest path to the best...
AsyncTestUtils extended framework
tests you need to wait for an operation to complete that does not occur synchronously (that is, it is not done when the function call you made to initiate the operation returns control to you). this is likely to happen when i/o is involved or a potentially expensive process wants to break itself up into smaller chunks (like a search operation) so that the ui stays responsive. in the mozilla plat
form, the "top level" of a program is the event loop. it is a never-ending loop that dequeues pending events and runs them. this is how asynchronous callbacks get their chance to run again. when i/o results in newly read data it places an event in the queue. when a timer fires because the requested duration is up, it also places an event in the queue. in order to give these events a chance to run we ...
...nctestutils is currently implemented by the first method (yielding control to the top-level event loop). mozmill is an example of a testing framework that uses a nested event loop. in the future we will probably move the asynctestutils framework to a nested event loop in a backwards-compatible fashion. how does this affect my tests? thanks to javascript enhancements available on the mozilla plat
form, it is possible for a function to yield control in such a way that the function stops running at the line where you use a yield statement and resumes execution on the next line when resumed. this allows you to write reasonably normal looking functions instead of having to chain together a whole bunch of functions and callbacks. your test functions need to agree to the following contract: the asy...
...stener: asynccopylistener. bringing messages into the picture synthetic set definitions most of the code involved in creating synthetic messages takes an object that defines how to generate the set. the following is a list of frequently used attributes where the default value is listed after the attribute name. there are more attributes you can specify; consult the documentation for more in
formation. (see the bottom of this page for links to the source files.) count: 10 the number of messages that should be in the set. note that the default is subject to change, so if you want 10, say 10, instead of relying on the default. msgsperthread: 1 how many messages should be in each thread? the default is that every message is its own thread; no message is a reply to any other message. if...
NSPR release procedure
ange the nspr version in mozilla/nsprpub/pr/tests/vercheck.c. change the nspr version in mozilla/nsprpub/admin/repackage.sh. source tarball binary distributions right now i use the mozilla/nsprpub/admin/repackage.sh script to generate the binary distributions published on ftp.mozilla.org. ...
...so on unix it repackages the jar files into gzipped tar files, and on windows it repackages the jar files into zip files. edit the repackage.sh script to customize it for your environment. ...
...so on unix it repackages the jar files into gzipped tar files, and on windows it repackages the jar files into zip files. edit the repackage.sh script to customize it for your environment. after you have run repackage.sh, follow the instructions in to upload the files to ftp.mozilla.org's staging server, so that they eventually show up on ftp.mozilla.org. ...
Date and Time
ides types and constants for both representations, and functions to convert time values between the two. absolute time representation treats time instants as points along the time line. a time instant is represented by its position on the time line relative to the origin, called the epoch. nspr defines the epoch to be midnight (00:00:00) 1 january 1970 utc (coordinated universal time). in this
form, time is just a point on the time line. there is no notion of time zone. clock/calendar time, used for human interfaces, represents time in the familiar year, month, day, hour, minute, second components. in this
form, the time zone in
formation is important. for example, without specifying the time zone, the time 8:00am 1 may 1998 is ambiguous. the nspr data type for clock/calendar time, calle...
... note that absolute and clock times are not normally used in timing operations. ...
...r_nsec_per_msec types and constants types and constants defined for nspr dates and times are: prtime prtimeparameters prexplodedtime time parameter callback functions in some geographic locations, use of daylight saving time (dst) and the rule for determining the dates on which dst starts and ends have changed a few times. therefore, a callback function is used to determine time zone in
formation. you can define your own time parameter callback functions, which must con
form to the definition prtimeparamfn. two often-used callback functions of this type are provided by nspr: prtimeparamfn pr_localtimeparameters and pr_gmtparameters functions the functions that create and manipulate time and date values are: pr_now pr_explodetime pr_implodetime pr_normalizetime ...
I/O Functions
functions that operate on pathnames functions that act on file descriptors directory i/o functions socket manipulation functions converting between host and network addresses memory-mapped i/o functions anonymous pipe function polling functions pollable events manipulating layers functions that operate on pathnames a file or directory in a file system is specified by its pathname. ...
...losedir pr_mkdir pr_rmdir socket manipulation functions the network programming interface presented here is a socket api modeled after the popular berkeley sockets. differences include the following: the blocking socket functions in nspr take a timeout parameter. two new functions, pr_transmitfile and pr_acceptread, can exploit the new system calls of some operating systems for higher per
formance. list of functions: pr_openudpsocket pr_newudpsocket pr_opentcpsocket pr_newtcpsocket pr_importtcpsocket pr_connect pr_connectcontinue pr_accept pr_bind pr_listen pr_shutdown pr_recv pr_send pr_recvfrom pr_sendto pr_transmitfile pr_acceptread pr_getsockname pr_getpeername pr_getsocketoption pr_setsocketoption converting between host and network addresses pr_n...
...nted for unix, linux, mac os x, and win32 only. pr_createfilemap pr_memmap pr_memunmap pr_closefilemap anonymous pipe function pr_createpipe polling functions this section describes two of the most important polling functions provided by nspr: pr_poll pr_getconnectstatus pollable events a pollable event is a special kind of file descriptor. the only i/o operation you can per
form on a pollable event is to poll it with the pr_poll_read flag. you cannot read from or write to a pollable event. the purpose of a pollable event is to combine event waiting with i/o waiting in a single pr_poll call. pollable events are implemented using a pipe or a pair of tcp sockets connected via the loopback address, therefore setting and/or waiting for pollable events are expensive operating...
Using JSS
ed the jss classes and the nspr, nss, and jss shared libraries. nspr and nss shared libraries jss uses the nspr and nss libraries for i/o and crypto. jss version 3.0 linked statically with nss, so it only required nspr. jss versions 3.1 and later link dynamically with nss, so they also require the nss shared libraries. the exact library names vary according to the convention for each plat
form. for example, the nspr library is called nspr4.dll or libnspr4.dll on windows and libnspr4.so on solaris. the following table gives the core names of the libraries, omitting the plat
form-specific prefix and suffix. jss dependencies core library name description binary release location nspr4 nspr os abstraction layer http://ftp.
...o, pkcs #11, and utilities http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases ssl3 nss ssl library smime3 nss s/mime functions and types nssckbi pkcs #11 module containing built-in root ca certificates. optional. freebl_* processor-specific optimized big-number arithmetic library. not present on all plat
forms. more in
formation... fort fortezza support. optional swft pkcs #11 module implementing fortezza in software. optional. if you built jss from source, you have these libraries in the mozilla/dist/<plat
form>/lib directory of your build tree. if you are downloading binaries, get them from the binary release locations in the above table. you need...
... 4.2 or 4.1.2 nss 3.4.2 jss 3.1.1 nspr 4.1.2 nss 3.3.1 jss 3.1 nspr 4.1.2 nss 3.3 jss 3.0 nspr 3.5.1 jss shared library the jss shared library is jss4.dll (windows) or libjss4.so (unix). if you built jss from source, it is in mozilla/dist/<plat
form>/lib. if you are downloading binaries, get it from http://ftp.mozilla.org/pub/mozilla.org/security/jss/releases/. jss classes if you built jss from source, the compiled jss classes are in mozilla/dist/classes[_dbg]. you can put this directory in your classpath to run applications locally; or, you can package the class files into a jar file for easier distribution: cd mozilla/dist/cl...
NSS_3.11.10_release_notes.html
nss 3.11.10 requires nspr 4.7.1. ...
... nss 3.11.10 requires nspr 4.7.1. see the documentation section for the build instructions. ...
...s 3.11.10 source and binary distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_11_10_rtm/src/. binary distributions: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_11_10_rtm/. both debug and optimized builds are provided. go to the subdirectory for your plat
form, dbg (debug) or opt (optimized), to get the tar.gz or zip file. the tar.gz or zip file expands to an nss-3.11.10 directory containing three subdirectories: include - nss header files lib - nss shared libraries bin - nss tools and test programs you also need to download the nspr 4.7.1 binary distributions to get the nspr 4.7.1 header files and shared libraries, which nss 3.11...
NSS 3.14.2 release notes
stems. note: the new assembly code requires gnu as version 2.19 or newer. on red hat enterprise linux 5.x systems, install the binutils220 package and add /usr/libexec/binutils220 to the beginning of your path environment variable. initial manual pages for some nss command line tools have been added. they are still under review, and contributions are welcome. the documentation is in the docbook
format and can be rendered as html and unix-style manual pages using an optional build target. new types: in certt.h cert_pi_useonlytrustanchors in secoidt.h sec_oid_ms_ext_key_usage_ctl_signing notable changes in nss 3.14.2 bug 805604 - support for aes-ni and avx accelerated aes-gcm was contributed by shay gueron of intel. if compiled on linux systems i...
...tional build target. new types: in certt.h cert_pi_useonlytrustanchors in secoidt.h sec_oid_ms_ext_key_usage_ctl_signing notable changes in nss 3.14.2 bug 805604 - support for aes-ni and avx accelerated aes-gcm was contributed by shay gueron of intel. if compiled on linux systems in 64-bit mode, nss will include runtime detection to check if the plat
form supports aes-ni and pclmulqdq. if so, nss uses the optimized code path, reducing the cpu cycles per byte to 1/20 of what was required before the patch (https://bugzilla.mozilla.org/show_bug.cgi?id=805604 and https://crypto.stanford.edu/realworldcrypto/slides/gueron.pdf). support for other plat
forms, such as windows, will follow in a future nss release. (https://bugzilla.mozilla.org/show_bug.cgi?i...
...8 - c_decrypt/c_decryptfinal now correctly validate the pkcs #7 padding when present. bug 807890 - added support for microsoft trust list signing eku. bug 822433 - fixed a crash in dtls_freehandshakemessages. bug 823336 - reject invalid ldap aia uris sooner. bugs fixed in nss 3.14.2 https://bugzilla.mozilla.org/buglist.cgi?list_id=5502456;resolution=fixed;classification=components;query_
format=advanced;target_milestone=3.14.2;product=nss compatibility nss 3.14.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.14.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will...
NSS 3.14.3 release notes
introduction network security services (nss) 3.14.3 is a patch release for nss 3.14. the bug fixes in nss 3.14.3 are described in the "bugs fixed" section below. distribution in
formation the cvs tag is nss_3_14_3_rtm. nss 3.14.3 requires nspr 4.9.5 or newer. nss 3.14.3 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_14_3_rtm/src/ new in nss 3.14.3 new functionality no new major functionality is introduced in this release. this release is a patch release to address cve-2013-1620. new functions in pk11pub.h pk11_signwithsymkey - similar to pk11_sign, per
forms a signing operation in a single operation. however, unlike pk11_sign, which uses a ...
...ases/nss_3_14_3_rtm/src/ new in nss 3.14.3 new functionality no new major functionality is introduced in this release. this release is a patch release to address cve-2013-1620. new functions in pk11pub.h pk11_signwithsymkey - similar to pk11_sign, per
forms a signing operation in a single operation. however, unlike pk11_sign, which uses a seckeyprivatekey, pk11_signwithsymkey per
forms the signature using a symmetric key, such as commonly used for generating macs. new types ck_nss_mac_constant_time_params - parameters for use with ckm_nss_hmac_constant_time and ckm_nss_ssl3_mac_constant_time. new pkcs #11 mechanisms ckm_nss_hmac_constant_time - constant-time hmac operation for use when verifying a padded, mac-then-encrypted block of data. ckm_nss_ssl3_mac_con...
...ce copies of their research. in addition, thanks to adam langley (google) for the development of a mitigation for the issues raised in the paper, along with emilia kasper and bodo möller (google) for assisting in the review and improvements to the initial patches. bugs fixed in nss 3.14.3 https://bugzilla.mozilla.org/buglist.cgi?list_id=5689256;resolution=fixed;classification=components;query_
format=advanced;target_milestone=3.14.3;product=nss compatibility nss 3.14.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.14.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will...
NSS 3.15 release notes
nss 3.15 requires nspr 4.10 or newer. nss 3.15 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_rtm/src/ new in nss 3.15 new functionality support for ocsp stapling (rfc 6066, certificate status request) has been added for both client and server sockets. ...
...ility functions to handle the allocation and deallocation of secitemarrays secitem_reallocitemv2 - replaces secitem_reallocitem, which is now obsolete. secitem_reallocitemv2 better matches caller expectations, in that it updates item->len on allocation. for more details of the issues with secitem_reallocitem, see bug 298649 and bug 298938. in pk11pub.h pk11_decrypt - per
forms decryption as a single pkcs#11 operation (eg: not multi-part). this is necessary for aes-gcm. pk11_encrypt - per
forms encryption as a single pkcs#11 operation (eg: not multi-part). this is necessary for aes-gcm. new types in secitem.h secitemarray - represents a variable-length array of secitems. new macros in ssl.h ssl_enable_ocsp_stapling - u...
... 341127: fix the invalid read in rc4_wordconv. ...
NSS 3.16 release notes
nss 3.16 requires nspr 4.10.3 or newer. nss 3.16 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_16_rtm/src/ new in nss 3.16 new functionality supports the linux x32 abi. (this requires nspr 4.10.4.) to build for the linux x32 target, set the environment variable use_x32=1 when building nss. ...
...r invalid keys. bug 974693: fix a memory corruption in sec_pkcs12_new_asafe. bug 956082: if the nss_sdb_use_cache environment variable is set, skip the runtime test sdb_measureaccess. the built-in roots module has been updated to version 1.97, which adds, removes, and distrusts several certificates. ...
... improved to automatically ignore lines of text that aren't in base64
format. the certutil utility has been improved to support creation of version 1 and version 2 certificates, in addition to the existing version 3 support. ...
NSS 3.17.2 release notes
nss 3.17.2 requires nspr 4.10.7 or newer. nss 3.17.2 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_17_2_rtm/src/ new in nss 3.17.2 new functionality no new functionality is introduced in this release. this is a patch release to fix a regression and other bugs. ...
...ble changes in nss 3.17.2 bug 1049435: change rsa_privatekeycheck to not require p > q. this fixes a regression introduced in nss 3.16.2 that prevented nss from importing some rsa private keys (such as in pkcs #12 files) generated by other crypto libraries. bug 1057161: check that an imported elliptic curve public key is valid. ...
...a program linked with older nss 3.x shared libraries will work with nss 3.17.2 shared libraries without recompiling or relinking. ...
NSS 3.18 release notes
introduction the nss team has released network security services (nss) 3.18, which is a minor release. distribution in
formation the hg tag is nss_3_18_rtm. nss 3.18 requires nspr 4.10.8 or newer. nss 3.18 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_18_rtm/src/ new in nss 3.18 new functionality when importing certificates and keys from a pkcs#12 source, it's now possible to override the nicknames, prior to importing them into the nss database, using new api sec_pkcs12decoderrenamecertnicknames. ...
...ss/releases/nss_3_18_rtm/src/ new in nss 3.18 new functionality when importing certificates and keys from a pkcs#12 source, it's now possible to override the nicknames, prior to importing them into the nss database, using new api sec_pkcs12decoderrenamecertnicknames. the tstclnt test utility program has new command-line options -c, -d, -b and -r. use -c one, two or three times to print in
formation about the certificates received from a server, and in
formation about the locally found and trusted issuer certificates, to diagnose server side configuration issues. it is possible to run tstclnt without providing a database (-d). a pkcs#11 library that contains root ca certificates can be loaded by tstclnt, which may either be the nssckbi library provided by nss (-b) or another compatible l...
...a program linked with older nss 3.x shared libraries will work with nss 3.18 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.19 release notes
nss 3.19 requires nspr 4.10.8 or newer. nss 3.19 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_19_rtm/src/ security fixes in nss 3.19 bug 1086145 / cve-2015-2721 - fixed a bug related to the ordering of tls handshake messages. this was also known as smack. ...
...qlite library. new functions in cert.h cert_getimposednameconstraints - check if any imposed constraints exist for the given certificate, and if found, return the constraints as encoded certificate extensions. notable changes in nss 3.19 the ssl 3 protocol has been disabled by default. ...
... compatibility nss 3.19 shared libraries are backward compatible with all older nss 3.x shared libraries. ...
NSS 3.23 release notes
introduction the nss team has released network security services (nss) 3.23, which is a minor release. distribution in
formation the hg tag is nss_3_23_rtm. nss 3.23 requires nspr 4.12 or newer. nss 3.23 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_23_rtm/src/ new in nss 3.23 new functionality chacha20/poly1305 cipher and tls cipher suites now supported (bug 917571, bug 1227905) experimental-only support tls 1.3 1-rtt mode (draft-11). this code is not ready for production use. ...
...nss_3_23_rtm/src/ new in nss 3.23 new functionality chacha20/poly1305 cipher and tls cipher suites now supported (bug 917571, bug 1227905) experimental-only support tls 1.3 1-rtt mode (draft-11). this code is not ready for production use. new functions in ssl.h ssl_setdowngradecheckversion - set maximum version for new serverrandom anti-downgrade mechanism. clients that per
form a version downgrade (which is a dangerous practice) call this with the highest version number that they possibly support. this gives them access to the version downgrade protection from tls 1.3. notable changes in nss 3.23 the copy of sqlite shipped with nss has been updated to version 3.10.2 (bug 1234698) the list of tls extensions sent in the tls handshake has been reordered to ...
...w related to the parsing of certain asn.1 structures. an attacker could create a specially-crafted certificate which, when parsed by nss, would cause a crash or execution of arbitrary code with the permissions of the user. bugs fixed in nss 3.23 this bugzilla query returns all the bugs fixed in nss 3.23: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.23 acknowledgements the nss development team would like to thank security researcher francis gabriel for responsibly disclosing the issue in bug 1245528. compatibility nss 3.23 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.23 shared libraries ...
NSS 3.28 release notes
nss 3.28 requires netscape portable runtime (nspr) 4.13.1 or newer. nss 3.28 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_28_rtm/src/ new in nss 3.28 new functionality nss includes support for tls 1.3 draft -18. this includes a number of improvements to tls 1.3: the signed certificate timestamp, used in certificate transparency, is supported in tls 1.3 (bug 1252745). ...
... changes in nss 3.28 nss can no longer be compiled with support for additional elliptic curves (the nss_ecc_more_than_suite_b option, bug 1253912). this was previously possible by replacing certain nss source files. nss will now detect the presence of tokens that support additional elliptic curves and enable those curves for use in tls (bug 1303648). note that this detection has a one-off per
formance cost, which can be avoided by using the ssl_namedgroupconfig function, to limit supported groups to those that nss provides. pkcs#11 bypass for tls is no longer supported and has been removed (bug 1303224). support for "export" grade ssl/tls cipher suites has been removed (bug 1252849). nss now uses the signature schemes definition in tls 1.3 (bug 1309446). this also affects tls 1.2. nss ...
...signature scheme. nss will now check if rsa-pss signing is supported by the token that holds the private key prior to using it for tls (bug 1311950). the certificate validation code contains checks to no longer trust certificates that are issued by old wosign and startcom cas, after october 21, 2016. this is equivalent to the behavior that mozilla will release with firefox 51. background in
formation can be found in mozilla's blog post. bugs fixed in nss 3.28 this bugzilla query returns all the bugs fixed in nss 3.28: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.28 compatibility nss 3.28 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with o...
NSS 3.30 release notes
nss 3.30 requires netscape portable runtime (nspr); 4.13.1 or newer. nss 3.30 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_30_rtm/src/ new in nss 3.30 new functionality in the pkcs#11 root ca module (nssckbi), cas with positive trust are marked with a new boolean attribute, cka_nss_mozilla_ca_policy, set to true. ...
...le (nssckbi), cas with positive trust are marked with a new boolean attribute, cka_nss_mozilla_ca_policy, set to true. applications that need to distinguish them from other other root cas, may use the exported function pk11_hasattributeset. support for callback functions that can be used to monitor ssl/tls alerts that are sent or received. new functions in cert.h cert_compareava - per
forms a comparison of two certava structures, and returns a seccomparison result. in pk11pub.h pk11_hasattributeset - allows to check if a pkcs#11 object in a given slot has a specific boolean attribute set. in ssl.h ssl_alertreceivedcallback - register a callback function, that will be called whenever an ssl/tls alert is received ssl_alertsentcallback - register a callback ...
...natures produced by key pairs with a modulus bit length that is not a multiple of 8 are now supported. the pk12util tool now supports importing and exporting data encrypted in the aes based schemes defined in pkcs#5 v2.1. bugs fixed in nss 3.30 this bugzilla query returns all the bugs fixed in nss 3.30: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.30 compatibility nss 3.30 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.30 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.31 release notes
nss 3.31 requires netscape portable runtime (nspr) 4.15 or newer. nss 3.31 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_31_rtm/src/ new in nss 3.31 new functionality allow certificates to be specified by rfc7512 pkcs#11 uris. allow querying a certificate object for its temporary or permanent storage status in a thread safe way. ...
...ieve the temporary storage status attribute of a certificate in a thread safe way. in pk11pub.h pk11_findcertfromuri - find a certificate identified by the given uri. pk11_findcertsfromuri - find a list of certificates identified by the given uri. pk11_getmoduleuri - retrieve the uri of the given module. pk11_gettokenuri - retrieve the uri of a token based on the given slot in
formation. in pkcs11uri.h pk11uri_createuri - create a new pk11uri object from a set of attributes. pk11uri_destroyuri - destroy a pk11uri object. pk11uri_
formaturi -
format a pk11uri object to a string. pk11uri_getpathattribute - retrieve a path attribute with the given name. pk11uri_getqueryattribute - retrieve a query attribute with the given name. pk11uri_parseuri - pars...
..._versionrangeget and ssl_versionrangegetdefault to query the tls version range that was effectively activated. corrected the encoding of domain name constraints extensions created by certutil nss supports a clean seeding mechanism for *nix systems now using only /dev/urandom. this is used only when seed_only_dev_urandom is set at compile time. cert_asciitoname can handle oids in dotted decimal
form now. bugs fixed in nss 3.31 this bugzilla query returns all the bugs fixed in nss 3.31: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.31 compatibility nss 3.31 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will wo...
NSS 3.32 release notes
nss 3.32 requires netscape portable runtime (nspr) 4.16, or newer. nss 3.32 source distributions are available on ftp.mozilla.org, for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_32_rtm/src/ notable changes in nss 3.32 various minor improvements and correctness fixes. the code signing trust bit was turned off for all, included root certificates. the websites (tls/ssl) trust bit was turned off for the following root certificates. ...
...rtificates were removed: cn = addtrust public ca root sha-256 fingerprint: 07:91:ca:07:49:b2:07:82:aa:d3:c7:d7:bd:0c:df:c9:48:58:35:84:3e:b2:d7:99:60:09:ce:43:ab:6c:69:27 cn = addtrust qualified ca root sha-256 fingerprint: 80:95:21:08:05:db:4b:bc:35:5e:44:28:d8:fd:6e:c2:cd:e3:ab:5f:b9:7a:99:42:98:8e:b8:f4:dc:d0:60:16 cn = china internet network in
formation center ev certificates root sha-256 fingerprint: 1c:01:c6:f4:db:b2:fe:fc:22:55:8b:2b:ca:32:56:3f:49:84:4a:cf:c3:2b:7b:e4:b0:ff:59:9f:9e:8c:7a:f7 cn = cnnic root sha-256 fingerprint: e2:83:93:77:3d:a8:45:a6:79:f2:08:0c:c7:fb:44:a3:b7:a1:c3:79:2c:b7:eb:77:29:fd:cb:6a:8d:99:ae:a7 cn = comsign secured ca sha-256 fingerprint: 50:79:41:c7:44:60...
...8:75:e5:8f bugs fixed in nss 3.32 nss versions 3.28.x, 3.29.x. 3.30.x and 3.31.x contained a bug in function cert_comparename, which caused the first rdn to be ignored. nss version 3.32 fixed this bug. (cve-2018-5149, bug 1361197) this bugzilla query returns all the bugs fixed in nss 3.32: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.32 compatibility nss 3.32 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.32 shared libraries, without recompiling, or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will re...
NSS 3.33 release notes
introduction the network security services (nss) team has released nss 3.33, which is a minor release. distribution in
formation the hg tag is nss_3_33_rtm. nss 3.33 requires netscape portable runtime (nspr) 4.17, or newer. nss 3.33 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_33_rtm/src/ notable changes in nss 3.33 tls compression is no longer supported. api calls that attempt to enable compression are accepted without failure. however, tls compression will remain disabled. this version of nss uses a
formally verified implementation of curve25519 on 64-bit systems. the compile time flag disable_ecc has been removed. when nss is compiled without nss_f...
... fixes cve-2017-7805, a potential use-after-free in tls 1.2 server, when verifying client authentication. various minor improvements and correctness fixes. ...
...o in constant time. port_zallocaligned - allocate aligned memory. port_zallocalignedoffset - allocate aligned memory for structs. in ssl.h ssl_getexperimentalapi - access experimental apis in libssl. bugs fixed in nss 3.33 this bugzilla query returns all the bugs fixed in nss 3.33: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.33 compatibility nss 3.33 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.33 shared libraries, without recompiling, or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will re...
NSS 3.43 release notes
nss 3.43 requires nspr 4.21 or newer. nss 3.43 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_43_rtm/src/ other releases are available in nss releases. ...
...ot ca 3 sha-256 fingerprint: 5a2fc03f0c83b090bbfa40604b0988446c7636183df9846e17101a447fb8efd6 the following ca certificates were removed: none bugs fixed in nss 3.43 bug 1528669 and bug 1529308 - improve gyp build system handling bug 1529950 and bug 1521174 - improve nss s/mime tests for thunderbird bug 1530134 - if docker isn't installed, try running a local clang-
format as a fallback bug 1531267 - enable fips mode automatically if the system fips mode flag is set bug 1528262 - add a -j option to the strsclnt command to specify sigschemes bug 1513909 - add manual for nss-policy-check bug 1531074 - fix a deref after a null check in seckey_setpublicvalue bug 1517714 - properly handle esni with hrr bug 1529813 - expose hkdf-expand-label with mechanism bug 1...
...ull check in seckey_setpublicvalue bug 1517714 - properly handle esni with hrr bug 1529813 - expose hkdf-expand-label with mechanism bug 1535122 - align tls 1.3 hkdf trace levels bug 1530102 - use getentropy on compatible versions of freebsd. this bugzilla query returns all the bugs fixed in nss 3.43: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.43 compatibility nss 3.43 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.43 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.46 release notes
introduction the nss team has released network security services (nss) 3.46 on 30 august 2019, which is a minor release. the nss team would like to recognize first-time contributors: giulio benetti louis dassy mike kaganski xhimanshuz distribution in
formation the hg tag is nss_3_46_rtm. nss 3.46 requires nspr 4.22 or newer. ...
...rtm. nss 3.46 requires nspr 4.22 or newer. nss 3.46 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_46_rtm/src/ other releases are available in nss releases. new in nss 3.46 this release contains no significant new functionality, but concentrates on providing improved per
formance, stability, and security. of particular note are significant improvements to aes-gcm per
formance on arm. notable changes in nss 3.46 certificate authority changes the following ca certificates were removed: bug 1574670 - remove expired class 2 primary root certificate sha-256 fingerprint: 0f993c8aef97baaf5687140ed59ad1821bb4afacf0aa9a58b5d57a338a3afbcb b...
... times out while fetching gpg key bug 1563786 - update hacl-star docker image to pull specific commit bug 1559012 - improve gcm perfomance using pmull2 bug 1528666 - correct resumption validation checks bug 1568803 - more tests for client certificate authentication bug 1564284 - support profile mobility across windows and linux bug 1573942 - gtest for pkcs11.txt with different breaking line
formats bug 1575968 - add strsclnt option to enforce the use of either ipv4 or ipv6 bug 1549847 - fix nss builds on ios bug 1485533 - enable nss_ssl_tests on taskcluster this bugzilla query returns all the bugs fixed in nss 3.46: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.46 compatibility nss 3.46 sha...
NSS 3.48 release notes
nss 3.48 requires nspr 4.24 or newer. ...
... add test for early key update bug 1597799 - fix a crash in nssckfwobject_getattributesize bug 1591178 - add entrust root certification authority - g4 certificate to nss bug 1590001 - prevent negotiation of versions lower than 1.3 after helloretryrequest bug 1596450 - added a simplified and unified mac implementation for hmac and cmac behind pkcs#11 bug 1522203 - remove an old pentium pro per
formance workaround bug 1592557 - fix prng known-answer-test scripts bug 1586176 - encryptupdate should use maxout not block size (cve-2019-11745) bug 1593141 - add `notbefore` or similar "beginning-of-validity-period" parameter to mozilla::pkix::trustdomain::checkrevocation bug 1591363 - fix a pbkdf2 memory leak in nsc_generatekey if key length > max_key_len (256) bug 1592869 - use arm neon for ...
...a program linked with older nss 3.x shared libraries will work with nss 3.48 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.49 release notes
nss 3.49 requires nspr 4.24 or newer. nss 3.49 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_49_rtm/src/ other releases are available in nss releases. ...
...ges in nss 3.49 the legacy dbm database, libnssdbm, is no longer built by default when using gyp builds. see bug 1594933 for details. bugs fixed in nss 3.49 bug 1513586 - set downgrade sentinel for client tls versions lower than 1.2. ...
...a program linked with older nss 3.x shared libraries will work with nss 3.49 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.50 release notes
introduction the nss team has released network security services (nss) 3.50 on 7 february 2020, which is a minor release. distribution in
formation the hg tag is nss_3_50_rtm. nss 3.50 requires nspr 4.25 or newer. nss 3.50 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_50_rtm/src/ other releases are available in nss releases. notable changes in nss 3.50 verified primitives from hacl* were updated, bringing per
formance improvements for several plat
forms. note that intel processors with sse4 but without avx are currently unable to use the improved chacha20/poly1305 due to a build issue; such plat
forms will fall-back to less optimized algorithms. see b...
... bug 1547639 - update zlib in nss to 1.2.11 bug 1609181 - detect arm (32-bit) cpu features on freebsd bug 1602386 - fix build on freebsd/powerpc* bug 1608151 - introduce nss_disable_altivec bug 1612623 - depend on nspr 4.25 bug 1609673 - fix a crash when nss is compiled without libnssdbm support, but the nssdbm shared object is avail...
...g 1602386 - fix build on freebsd/powerpc* bug 1608151 - introduce nss_disable_altivec bug 1612623 - depend on nspr 4.25 bug 1609673 - fix a crash when nss is compiled without libnssdbm support, but the nssdbm shared object is available anyway. this bugzilla query returns all the bugs fixed in nss 3.50: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.50 compatibility nss 3.50 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.50 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.52 release notes
nss 3.52 requires nspr 4.25 or newer. nss 3.52 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_52_rtm/src/ other releases are available in nss releases. ...
... note: this change modifies the ck_gcm_params struct to include the ulivbits field which, prior to pkcs #11 v3.0, was ambiguously defined and not included in the nss definition. if an application is recompiled with nss 3.52+, this field must be initialized to a value corresponding to ulivlen. alternatively, defining nss_pkcs11_2_0_compat will yield the old definition. see the bug for more in
formation. bug 1623374 - support new pkcs #11 v3.0 message interface for aes-gcm and chachapoly. bug 1612493 - integrate avx2 chacha20, poly1305, and chacha20poly1305 from hacl*. bugs fixed in nss 3.52 bug 1633498 - fix unused variable 'getauxval' error on ios compilation. bug 1630721 - add softoken functions for fips. bug 1630458 - fix problem of gyp msvc builds not producing debug symb...
...9 - properly handle multi-block seed ecb inputs. bug 1630925 - guard all instances of nsscmssigneddata.signerinfo to avoid a cms crash bug 1571677 - name constraints validation: cn treated as dns name even when syntactically invalid as dns name this bugzilla query returns all the bugs fixed in nss 3.52: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.52 compatibility nss 3.52 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.52 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.55 release notes
introduction the nss team has released network security services (nss) 3.55 on 24 july 2020, which is a minor release. the nss team would like to recognize first-time contributors: danh distribution in
formation the hg tag is nss_3_55_rtm. nss 3.55 requires nspr 4.27 or newer. nss 3.55 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_55_rtm/src/ other releases are available in nss releases. notable changes in nss 3.55 p384 and p521 elliptic curve implementations are replaced with verifiable implementations from fiat-crypto and ecckiila. special thanks to the network and in
formation security group (nisec) at tampere university. pk11_findcertinslot is a...
...are available in nss releases. notable changes in nss 3.55 p384 and p521 elliptic curve implementations are replaced with verifiable implementations from fiat-crypto and ecckiila. special thanks to the network and in
formation security group (nisec) at tampere university. pk11_findcertinslot is added. with this function, a given slot can be queried with a der-encoded certificate, providing per
formance and usability improvements over other mechanisms. see bug 1649633 for more details. dtls 1.3 implementation is updated to draft-38. see bug 1647752 for details. nspr dependency updated to 4.27. known issues on some plat
forms, using the makefile builds fails to locate seccomon.h; ensure you are using make all rather than just make. another potential workaround is to use the gyp-based b...
... rsa_checksignrecover. bug 1643528 - fix compilation error with -werror=strict-prototypes. bug 1646324 - advertise pkcs#1 schemes for certificates in the signature_algorithms extension. bug 1652331 - update nss 3.55 nspr version to 4.27. this bugzilla query returns all the bugs fixed in nss 3.55: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.55 compatibility nss 3.55 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.55 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS Developer Tutorial
nss coding style
formatting line length should not exceed 80 characters. indentation level is 4. tabs are used heavily in many nss source files. try to stay consistent when you modify existing code. the proper use of tabs has often been confusing for new nss developers, so in nss/lib/ssl, we're gradually removing the use of tabs. curly braces: both of the following styles are allowed: if (condition) { action1(); } else { action2(); } or: if (condition) { action1(); } else { action2(); } the
former style is more common. when modifying existing code, try to stay consistent. in new code, prefer the
former style, as it conserves vertical space. when a block of code consists of a single statement, nss doesn’t require curly braces, so both of these examples ar...
...ng existing code, try to stay consistent. in new code, prefer the
former style, as it conserves vertical space. when a block of code consists of a single statement, nss doesn’t require curly braces, so both of these examples are fine: if (condition) { action(); } or: if (condition) action(); although the use of curly braces is more common. multiple-line comments should be
formatted as follows: /* * line1 * line2 */ or /* ** line 1 ** line 2 */ the following styles are also common, because they conserve vertical space: /* line1 * line2 */ or /* line1 ** line2 */ or /* line1 * line2 */ naming public functions are named foo_dooneaction. global, but unexported functions, are usually named foo_dooneaction. variable, and function parameter names, always ...
... names, always start with a lowercase letter. the most common style is foobarbaz, although foobarbaz and foo_bar_baz are also used. miscellaneous goto can be used, to simplify resource deallocation, before returning from a function. a data buffer is usually represented as: unsigned char *data; unsigned int len; the buffer pointer is unsigned char *, as opposed to void *, so we can per
form pointer arithmetic without casting. use char * only if the data is interpreted as text characters. for historical reasons, the buffer length is unsigned int, as opposed to size_t. unfortunately, this can be a source of integer overflow bugs on 64-bit systems. c features nss requires c99. however, not all features from c99 are equally available. variables can be declared, at the point they ...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
...nd */ static void validategeneratecsrcommand(const char *progname, const char *dbdir, certname *subject, const char *subjectstr, const char *certreqfilename) { prbool validationfailed = pr_false; if (!subject) { pr_fprintf(pr_stderr, "%s -g -d %s -s: improperly
formatted name: \"%s\"\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (!certreqfilename) { pr_fprintf(pr_stderr, "%s -g -d %s -s %s -r: certificate request file name not found\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (validationfailed) { fprintf(stderr, "\nusage...
... pr_fprintf(pr_stderr, "unknown key or hash type\n"); rv = secfailure; goto cleanup; } rv = sec_dersigndata(arena, &result, encoding->data, encoding->len, privk, signalgtag); if (rv) { pr_fprintf(pr_stderr, "signing of data failed\n"); rv = secfailure; goto cleanup; } /* encode request in specified
format */ if (ascii) { char *obuf; char *name, *email, *org, *state, *country; secitem *it; int total; it = &result; obuf = btoa_convertitemtoascii(it); total = pl_strlen(obuf); name = cert_getcommonname(subject); if (!name) { name = strdup("(not specified)"); } email = cert_getcertemai...
sample2
2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
...e certificate to header file as sig verification [optional]\n\n", "-v"); exit(-1); } /* * validate the options used for generate csr command */ static void validategeneratecsrcommand(const char *progname, const char *dbdir, certname *subject, const char *subjectstr, const char *certreqfilename) { prbool validationfailed = pr_false; if (!subject) { pr_fprintf(pr_stderr, "%s -g -d %s -s: improperly
formatted name: \"%s\"\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (!certreqfilename) { pr_fprintf(pr_stderr, "%s -g -d %s -s %s -r: certificate request file name not found\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (validationfailed) { fprintf(stderr, "\nusage: %s %s \n\n", progname, "-g -d <dbdirpath> -s <subject> -r <csr> \n"); exit(-1); } } /* * valid...
...nalgtag = sec_getsignaturealgorithmoidtag(keytype, hashalgtag); if (signalgtag == sec_oid_unknown) { pr_fprintf(pr_stderr, "unknown key or hash type\n"); rv = secfailure; goto cleanup; } rv = sec_dersigndata(arena, &result, encoding->data, encoding->len, privk, signalgtag); if (rv) { pr_fprintf(pr_stderr, "signing of data failed\n"); rv = secfailure; goto cleanup; } /* encode request in specified
format */ if (ascii) { char *obuf; char *name, *email, *org, *state, *country; secitem *it; int total; it = &result; obuf = btoa_convertitemtoascii(it); total = pl_strlen(obuf); name = cert_getcommonname(subject); if (!name) { name = strdup("(not specified)"); } email = cert_getcertemailaddress(subject); if (!email) email = strdup("(not specified)"); org = cert_getorgname(subject); if (!org) org = str...
NSS sources building testing
rder to get started, anonymous read-only access is sufficient. create a new directory on your computer that you will use as your local work area, and run the following commands. hg clone https://hg.mozilla.org/projects/nspr hg clone https://hg.mozilla.org/projects/nss after the above commands complete, you should have two local directories, named nspr and nss, next to each other. (historical in
formation: nspr and nss source code have recently been re-organized into a new directory structure. in past versions, all files were located in a directory hierarchy that started with the "mozilla" prefix. the nspr base library was located in directory mozilla/nsprpub. the subdirectories dbm, security/dbm, security/coreconf, security/nss were part of the nss sources.) the nss directory contains the f...
...tructure. in past versions, all files were located in a directory hierarchy that started with the "mozilla" prefix. the nspr base library was located in directory mozilla/nsprpub. the subdirectories dbm, security/dbm, security/coreconf, security/nss were part of the nss sources.) the nss directory contains the following important subdirectories: nss/coreconf contains knowledge for cross plat
form building. nss/lib contains all the library code that is used to create the runtime libraries used by applications. nss/cmd contains a set of various tool programs that are built using nss. several tools are general purpose and can be used to inspect and manipulate the storage files that software using the nss library creates and modifies. other tools are only used for testing purposes. howe...
...ntained in .def files is strictly for private use within nss, and applications and test tools are not allowed to call them. for any functions that are listed in the .def files, nss promises that the binary function interface (abi) will remain stable. building nss nss is built using gyp and ninja, or with make on systems that don't have those tools. the complete build instructions include more in
formation. once the build is done, you can find the build output below directory dist/?, where ? will be a name dynamically derived from your system's architecture. exported header files for nss applications can be found in directory "include", library files in directory "lib", and the tools in directory "bin". in order to run the tools, you should set your system environment to use the libraries of ...
nss tech note4
also, this document does not attempt to be an exhaustive survey of all possible ways to do a certain task; it merely tries to show a certain way. ...
...getorgunitname(certname *name); char *cert_getdomaincomponentname(certname *name); char *cert_getcertuid(certname *name); example code to illustrate access to the info is given below. background on cert extensions an extension has the following attributes object id (oid) : a unique oid represents an algorithm, a mechanism, a piece of in
formation, etc. examples: x500 rsa encryption, certificate basic constraints, pkcs#7 digested data, etc. there is a long list of pre-defined oids, and new ones can be added dynamically by an application. the oid data structure contains an array of identifier bytes (each byte is a "level" in a hierarchical namespace), a text description, and some other things. c...
... secstatus cert_findkeyusageextension (certcertificate *cert, secitem *value); get decoded value of the subjectkeyid extension. this uses pr_alloc to allocate buffer for the decoded value, the caller should free up the storage allocated in value->data. ...
FC_GetSlotInfo
ckr_slot_id_invalid the specified slot number is out of the defined range of values. ...
... ckr_slot_id_invalid the specified slot number is out of the defined range of values. ...
...d slotid, ck_slot_info_ptr pinfo ); parameters fc_getslotinfo takes two parameters: slotid [in] pinfo [out] the address of a ck_slot_info structure. description fc_getslotinfo stores the in
formation about the slot in the ck_slot_info structure that pinfo points to. a user may call fc_getslotinfo without logging into the token (to assume the nss user role). return value ckr_ok slot in
formation was successfully copied. ckr_slot_id_invalid the specified slot number is out of the defined range of values. examples see also nsc_getslotinfo ...
The Necko HTTP module
asked questions. caching faq this document gives an overview of how http caching is implemented in necko. it answers some of the common questions concerning what is cached and for how long. ...
...aq this document gives an overview of how http caching is implemented in necko. it answers some of the common questions concerning what is cached and for how long. ...
... implemented in necko. it answers some of the common questions concerning what is cached and for how long. http cache (v2) describes in detail the api and the implementation details of the content (http, but not only) cache. ...
Necko Interfaces Overview
vice manages protocol handlers thin layer over protocol handlers provides interface for creating uri objects from uri strings maps uri scheme to appropriate nsiprotocolhandler impl nsiuri (nsiurl, nsifileurl, nsistandardurl) represents an uri, with getters and setters for various uri parts (eg. scheme, host, path, ...) per protocol implementation necko provides uri impl's for common uri
formats (see nsstandardurl, nssimpleuri) nsichannel : nsirequest represents a logical connection to the resource identified by a nsiuri per protocol implementation single use (ie. channel is used to download the resource once) download initiated via nsichannel::asyncopen method can be canceled via nsirequest::cancel method at anytime after invocation of asyncopen method nsiprotocolhandler ...
... ...
... ...
Multithreading in Necko
used to manage all i/o operations (with the exception of few cases). most simple protocol handlers (eg. file, finger, datetime) do not worry about threading issues. the internal i/o interfaces default to proxying all callbacks to the main thread. this keeps simple protocol handlers simple :-) more complex protocol handlers (eg. http, ftp) operate partially on the background threads to improve per
formance. for example, the http protocol handler has code that runs on the socket transport thread to kick off pending requests well before the main thread would get around to doing so. socket transport thread (1) socket connections are processed on a single background thread. this thread is controlled by the nssockettransportservice. it sits in a loop, polling a list of sockets. when a socket can ...
...te to a nsioutputstream) on a background thread. the implementation of the stream should be blocking; however, there is limited support for non-blocking streams. cached page loads, file url loads, and jar url loads all utilize the file transport service. the jar protocol handler, for rexample, passes a special nsiinputstream impl that does gzip decoding on the fly. dns thread (0-1) on most plat
forms dns requests a processed on a background thread. however, the details of the implementation are heavily plat
form dependent. for example, on xp_win an invisible window is created with a message pump on a background thread for processing wsa asynchronous dns events. in this way, necko takes advantage of the plat
forms specific routines for dns lookups. the default implementation does not spawn a wo...
...t. for example, on xp_win an invisible window is created with a message pump on a background thread for processing wsa asynchronous dns events. in this way, necko takes advantage of the plat
forms specific routines for dns lookups. the default implementation does not spawn a worker thread, and instead simply calls pr_getipnodebyname (essentially equivalent to gethostbyname). original document in
formation author(s): darin fisher last updated date: december 10, 2001 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Small Footprint
with various changes js.jar size can be reduced to 204,689 bytes corresponding to 424,774 bytes of uncompressed classes. tools most embeddings won't need any of the classes in org.mozilla.javascript.tools or any of its sub-packages. ...
...use policysecuritycontroller then you do not need rhino library for class file generation and you can remove all the classes from in org.mozilla.classfile package. regular expressions the package org.mozilla.javascript.regexp can be removed. rhino will continue to run, although it will not be able to execute any regular expression matches. this change saves 47,984 bytes of class files. debug in
formation debug in
formation in rhino classes consumes about 25% of code size and if you can live without that, you can recompile rhino to remove it. smalljs.jar ant build script in rhino supports smalljar target that will generate smalljs.jar that does not include tools, optimizer, javaadapter and class generation library, regular expressions, e4x implementataion and deprecated files. to build such...
...o classes consumes about 25% of code size and if you can live without that, you can recompile rhino to remove it. smalljs.jar ant build script in rhino supports smalljar target that will generate smalljs.jar that does not include tools, optimizer, javaadapter and class generation library, regular expressions, e4x implementataion and deprecated files. to build such minimalist jar without debug in
formation, run the following command from the top directory of rhino distribution: ant clean ant -ddebug=off -dno-regexp=true -dno-e4x=true smalljar if you omit -dno-regexp=true, then the resulting smalljs.jar will include regular expression support. similarly omitting -dno-e4x=true results in smalljs.jar that includes runtime support for e4x. ...
Rhino scopes and contexts
before using rhino in a concurrent environment, it is important to understand the distinction between contexts and scopes. both are required to execute scripts, but they play different roles. simple embeddings of rhino probably won't need any of the in
formation here, but more complicated embeddings can gain per
formance and flexibility from the techniques described below. contexts the rhino context object is used to store thread-specific in
formation about the execution environment. there should be one and only one context associated with each thread that will be executing javascript. to associate the current thread with a context, simply call the enter method of context: context cx = context.enter(); once you are done with execution, simply exit the context: context.exit(); the...
...s an easy way to share a set of read-only variables across multiple scopes. to do this we set an object's prototype. when accessing a property of an object in javascript, the object is first searched for a property with the given name. if none is found, the object's prototype is searched. this continues until either the object is found or the end of the prototype chain is reached. so to share in
formation across multiple scopes, we first create the object we wish to share. typically this object will have been created with initstandardobjects and may also have additional objects specific to the embedding. then all we need to do is create a new object and call its setprototypemethod to set the prototype to the shared object, and the parent of the new scope to null: scriptable newscope = cx.new...
... the function and then, if not found there, in the lexically enclosing scope. this causes problems if functions you define in your shared scope need access to variables you define in your instance scope. with rhino 1.6, it is possible to use dynamic scope. with dynamic scope, functions look at the top-level scope of the currently executed script rather than their lexical scope. so we can store in
formation that varies across scopes in the instance scope yet still share functions that manipulate that in
formation reside in the shared scope. the dynamicscopes example illustrates all the points discussed above. more on scopes the key things to determine in setting up scopes for your application are what scope should global variables be created in when your script executes an assignment to an...
Creating JavaScript tests
le have a look at the existing files and follow what they do. all tests, in both suite, can use the asserteq function. asserteq(v1, v2[, message]) check that v1 and v2 are the same value. if they're not, throw an exception (which will cause the test to fail). if you are writing a jstests, additional testing functionality is provided for you in shell.js files. you can read about them here. per
formance testing and general advice do not attempt to test the per
formance of engine features in the test suite. please keep in mind that the javascript test suite is run on a wide variety of wildly varying hardware pla
forms, from phones all the way up to servers. even tests that check for polynomial time complexity will start to fail in a few years when they have sped up enough to run faster than ...
... the per
formance of engine features in the test suite. please keep in mind that the javascript test suite is run on a wide variety of wildly varying hardware pla
forms, from phones all the way up to servers. even tests that check for polynomial time complexity will start to fail in a few years when they have sped up enough to run faster than the granularity of the os scheduler or when run on plat
forms with higher latencies than your development workstation. these tests will also show up as infrequent oranges on our heavily loaded test machines, lowering the value of our test suite for everyone. just don't do it, it's never worth it. do not add per
formance tests to the test suite. it is not generally even possible to tell if the speed of any particular feature is going to be important in the...
... focus on writing fast, light tests that cover a single feature. there is basically no cost to adding a new test, so add as many feature tests as needed to cover each feature orthogonally. ...
Exact Stack Rooting
s guide is intended for spidermonkey hackers! users of the spidermonkey api will want to read the gc rooting guide instead. introduction this guide explains the basics of interacting with the gc from spidermonkey. since the gc may move gcthings, it very important that spidermonkey know about each and every gcpointer in the system. the method you should use to keep the gc up-to-date with this in
formation will vary depending on where the gcpointer is being stored. gcpointers can be stored as a property of a gcthing, on the cheap, or in the cstack. these three storage regions have different lifetime and overhead characteristics and thus require different management strategies for efficient space and cpu utilization. since c++ does not reliably distinguish between storage classes, we have to pu...
... period exact stack rooting is not currently enabled by default: we are still using conservative scanning. until the system described above has 100% browser coverage, it is unsafe to enable it. in the meantime, the js::rootedt class holds an object live by storing its pointer on the stack so that the conservative scanner will find it. this distinction should not be noticable to the end user. ...
...vative scanning. until the system described above has 100% browser coverage, it is unsafe to enable it. in the meantime, the js::rootedt class holds an object live by storing its pointer on the stack so that the conservative scanner will find it. this distinction should not be noticable to the end user. per
formance tweaking in aggregate, exact and conservate stack rooting should have similar per
formance. the per
formance tradeoffs that these techniques make, however, are quite different. if the extra overhead of exact rooting does end up adding an unacceptable cost to a specific code path that is not mitigated by a faster gc, there are some tricks you can use to get better per
formance at the cost of more complex code. move js::rootedt declarations above loops. modern c++ compilers are not ...
JS_CompileFunctionForPrincipals
igned int lineno); name type description cx jscontext * the context in which to compile the function. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object with which the function is to be associated. principals jsprincipals * pointer to the structure holding the security in
formation for this function. name const char * name to assign the newly compiled function. nargs unsigned int number of arguments to pass to the function. argnames const char ** names to assign to the arguments passed to the function. body const char * or const jschar * string containing the source code of the function to compile. le...
...ine number. used to report the offending line in the file or url if an error occurs. description js_compilefunctionforprincipals compiles a security-enabled function from a text string, bytes, and associates it with a js object, obj. js_compileucfunctionforprincipals is the unicode version of the function. principals is a pointer to the jsprincipals structure that contains the security in
formation to associate with this function. name is the name to assign to the newly created function. nargs is the number of arguments the function takes, and argnames is a pointer to the first element of an array of names to assign each argument. the number of argument names should match the number of arguments specified in nargs. body is the string containing the source code of the function. length...
...f arguments the function takes, and argnames is a pointer to the first element of an array of names to assign each argument. the number of argument names should match the number of arguments specified in nargs. body is the string containing the source code of the function. length is the length of the string in characters. filename is the name of the file (or url) containing the function. this in
formation is passed in messages if an error occurs during compilation. similarly, lineno is used to report the line number of the function or file where an error occurred during compilation. on success, js_compilefunctionforprincipals and js_compileucfunctionforprincipals return a pointer to the newly compiled function. on error or exception, they return null. see also mxr id search for js_compil...
JS_ConvertArgumentsVA
obsolete since jsapi 38this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. 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 in
formation. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. args const js::callarg...
...equest. in a js_threadsafe build, the caller must be in a request on this jscontext. args const js::callargs & reference to the arguments to convert. added in spidermonkey 31 argc unsigned the number of arguments to convert. obsolete since jsapi 30 argv jsval * pointer to the vector of arguments to convert. obsolete since jsapi 30
format const char * character array containing the recognized
format to which to convert. ap va_list the list of pointers into which to store the converted types. there should be one pointer for each converted value. the type va_list is a standard feature of the c programming language. it is defined in <stdarg.h>. description js_convertargumentsva is to js_convertarguments...
... if js_convertargumentsva successfully converts all arguments, it returns true. otherwise it returns false. ...
JS_SuspendRequest
e is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. removed from spidermonkey at or prior to version 45. since then, a jsruntime is tied to the thread that created it; it may not be accessed by any other thread. suspends the calling thread's current request, if any, to allow the thread to block or per
form time-consuming calculations. syntax jsrefcount js_suspendrequest(jscontext *cx); void js_resumerequest(jscontext *cx, jsrefcount savedepth); name type description cx jscontext * the context whose current request is to be suspended or resumed. savedepth jsrefcount (only in js_resumerequest) the valued returned by the matching js_suspendrequest call...
...jsrefcount savedepth); name type description cx jscontext * the context whose current request is to be suspended or resumed. savedepth jsrefcount (only in js_resumerequest) the valued returned by the matching js_suspendrequest call. ...
...efcount (only in js_resumerequest) the valued returned by the matching js_suspendrequest call. description in js_threadsafe builds, when a multi-threaded application is in a request but needs to block or per
form lengthy computation that can race safely with the garbage collector, it should call js_suspendrequest before the time-consuming operation and js_resumerequest after. for more in
formation about thread safety and requests, see js_threadsafe. js_suspendrequest suspends any currently active requests associated with the context cx. this allows the runtime to per
form garbage collection if needed and allows other threads to access objects that the calling thread had locked. the return value is the number of nested requests that were suspended. it may be 0. js_resumerequest resume...
JS_THREADSAFE
changes to this feature. until recently, sharing objects among threads would mostly work, although scripts could easily make it crash. we have now completely removed that feature. each thread that uses the javascript engine must essentially operate in a totally separate region of memory. requests in a js_threadsafe build, the application must separate code that uses the jsapi from code that per
forms blocking i/o or time-consuming calculations. a request is a region of code that uses the jsapi. requests must be bracketed with calls to js_beginrequest() and js_endrequest(). js_beginrequest(cx); /* ... do jsapi stuff ... */ js_endrequest(cx); a request is always associated with a specific jscontext and runs from start to finish on a single thread. most jsapi functions require the caller t...
...eriodically call js_yieldrequest from an operation callback. sharing data among threads "data can be marshaled across the process boundary through a process known as smuggling." --mr. bunny's guide to activex even in js_threadsafe builds, threads cannot safely share objects or strings. instead, data must be copied when it is sent from one thread to another. use js_writestructuredclone to trans
form data into a flat array of bytes that can be safely written to disk, sent to another process or even another machine, or just passed to another thread. then use js_readstructuredclone on the other side to turn the serialized data back into javascript objects, strings, and so on. sharing native functions and private data among threads in a js_threadsafe build, spidermonkey's internal data structu...
...ractice safe threading. sharing contexts among threads ordinarily, a jscontext is created, used, and destroyed by a single thread. this makes sense, as a context can only be used by one thread at a time. however, there are a few cases where an application might need to share contexts across threads. for example: many worker threads need to share a "pool" of reusable contexts, to avoid the per
formance cost of constantly creating and destroying contexts. (this is analogous to a database connection pool.) the application has a jscontext that it needs to use each time some event happens. but the event could happen on any thread. for such cases, use js_clearcontextthread and js_setcontextthread to transfer the context safely from one thread to another. further info note: spidermonkey i...
JSAPI reference
compile javascript code into a function: struct jsfunction js::compilefunction added in spidermonkey 17 js_decompilefunction 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 jserror
formatstring added in spidermonkey 17 class jserrorreport class js::autosaveexceptionstate added in spidermonkey 31 enum jsexntype added in spidermonkey 17 js_reporterror js_reportwarning js_reporterrornumber js_reporterrornumberuc js_reporterrorflagsandnumber js_reporterrorflagsandnumberuc js_reporterrornumberucarray added in spidermonkey 24 js_reportoutofmemory js_reportallocationoverflo...
...ce jsapi 32 jsval_is_gcthing obsolete since jsapi 32 high-level type-conversion routines for packing and unpacking function arguments. js_convertarguments obsolete since jsapi 38 js_convertargumentsva obsolete since jsapi 38 js_pusharguments obsolete since javascript 1.8.5 js_pushargumentsva obsolete since javascript 1.8.5 js_poparguments obsolete since javascript 1.8.5 js_addargument
formatter obsolete since jsapi 18 js_removeargument
formatter obsolete since jsapi 18 the following functions convert js values to various types. they can be safely applied to jsvals of any type. they may return new objects. for example, js_valuetoobject(cx, s) where s is a string creates a new string wrapper object. these functions may call javascript methods. for example, js_valuetostring(cx, obj)...
...ack - used by js_setgccallback jsfinalizecallback added in spidermonkey 17 - used by js_addfinalizecallback added in spidermonkey 38 and js_setfinalizecallback added in spidermonkey 17 obsolete since jsapi 32 jsiteratecompartmentcallback - used by js_iteratecompartments added in spidermonkey 17 jsbranchcallback - used by js_setbranchcallback obsolete since javascript 1.8.1 jsargument
formatter - used by js_addargument
formatter obsolete since jsapi 18 jsfunctioncallback - used by js_setfunctioncallback obsolete since jsapi 37 jsgcrootmapfun - used by js_mapgcroots obsolete since jsapi 19 jsobjectprincipalsfinder - used by js_setobjectprincipalsfinder obsolete since javascript 1.8 jsprincipalstranscoder - used by js_setprincipalstranscoder obsolete since javascript 1.8...
Setting up CDT to work on SpiderMonkey
eclipse's cdt has some pretty decent features that make it an attractive environment to work in when you are interested in getting code hints, autocompletion, function, and field usage in
formation and general ide goodness for c/c++. there is a guide for setting up cdt to work with the mozilla codebase, but it does not cover setting things up for just spidermonkey instead of the whole mozilla codebase. hence, here is a short-ish guide for doing just that. step 1 - preparing a spidermonkey build for cdt to index all code, spidermonkey has to be built with debug in
formation. the full process of and requisites for doing so are described here. please follow those instructions up until the point of invoking configure. the initial build was in clang, so the modified build commands look like thi...
.../c++ developers" from the eclipse downloads page. start eclipse and create a workspace somewhere. select "new > makefile project with existing code" from the "file" menu. give the project a name that you like ("spidermonkey" has a nice ring to it) and use the "browser…" button to select your checkout's js/src folder for the "existing code location". choose the correct toolchain for your plat
form (i.e. macos x gcc on mac) and click "finish". at this point, the indexer starts running and already produces a pretty decent index of much of spidermonkey. still, there are a quite a few things that cdt does not pick up yet: for everything to be indexed, cdt has to be aware of the project's build details. step 3 - index all the code to let cdt know about the build, it has to invoke make itsel...
...e mozilla codebase on mdn, read a log of the build), which can be setup with these simple steps: open the project's properties by selecting its root and clicking "properties" in the "file" menu and select "c/c++ build". under the "builder settings" group tab, deactivate "use default build command". instead, change "build command" to read make -w (this is required because cdt needs detailed in
formation about which directories make operates on, which using -w causes make to provide). change the "build location" to the build directory configured in step 1. for me, that means changing "build directory" to read ${workspace_loc:/spidermonkey/_dbg.obj}. under "behavior", make sure that "enable parallel build" is deactivated, as cdt’s indexer will freak out otherwise. remove "all" from "buil...
Split object
s complicated. programs other than mozilla that embed spidermonkey should avoid using split objects. the window object split objects were introduced to resolve a problem posed by the window object. three interrelated requirements on the window object seemed to conflict. the window object is the global object for scripts in web pages. firefox has to maintain this for web compatibility. for per
formance, access to global properties must be fast. there is a glaring difference in the lifetime of the window object as seen from two different angles. suppose a script in page a, in tab ta, has a reference to the window object of page b in another tab tb. the window object for tab tb must persist as the user navigates from page to page in that tab. to the script in page a, the window must a...
...n, so security checks between them automatically succeed. this makes the problem resistant to a wrapper-based approach.) older versions of firefox accomplished this by blowing away all window properties every time a user navigated to another page, then reusing the window. each page, even on back, had to load from scratch. this was slow. circa firefox 1.5, the decision was made to cache layout in
formation and javascript state across navigation. a new approach for window was needed. security privileges are granted to js code on the basis of the scope chain of the executing code. spidermonkey walks up the scope chain to the nearest object that has jsprincipals attached. the end of the scope chain is the global object for the script. but what jsprincipals should be attached to a window o...
... it catalogues (and tries to explain) the subtle ways in which split objects affect spidermonkey's behavior. split objects are only useful for implementing objects that will be on the scope chain of functions. spidermonkey assumes that inner and outer objects are dangerous in two different and complementary ways. inner objects are dangerous because they have fast property accessors that do not per
form security checks. therefore, no function may be allowed to see an inner object that has different jsprincipals. apart from the security issue, if one page directly or indirectly gets a reference to another page's window object, that window object must appear to behave like the outer window and navigate from page to page. spidermonkey arranges this by not allowing js code to see inner objects at al...
compare-locales
rking against the gecko-strings cross-channel repository, the toml configuration files are in the _configs subdirectory, browser.toml, mobile_android.toml, mail.toml and calendar.toml, and suite.toml. options to get a brief list of available options, use the --help flag: $ compare-locales --help the output the output of compare-locales shows the missing and obsolete strings in a pseudo-diff
format. ab-cd browser chrome/browser browser.dtd +backforwardmenu.tooltip +fullzoomenlargecmd.commandkey3 +fullzoomreducecmd.commandkey2 +fullzoomresetcmd.commandkey2 +organizebookmarks.label -showallbookmarkscmd2.label migration/migration.dtd -importfromfile.accesskey -importfromfile.label +im...
...commandkey2 +organizebookmarks.label -showallbookmarkscmd2.label migration/migration.dtd -importfromfile.accesskey -importfromfile.label +importfromhtmlfile.accesskey +importfromhtmlfile.label you can assume changed strings when you see entities removed and added with a similar name. the file names will be shown in a hierarchical
form, so in the example above, your files are browser.dtd in ab-cd/browser/chrome/browser and migration.dtd in another directory level deeper. the output closes with a summary, giving the total counts of missing and obsolete strings and words, and some statistics on how many strings are changed or not, excluding access- and commandkeys. that gives localizers an idea on how thorough the localization i...
...vel deeper. the output closes with a summary, giving the total counts of missing and obsolete strings and words, and some statistics on how many strings are changed or not, excluding access- and commandkeys. that gives localizers an idea on how thorough the localization is. this number won't reach 100% in general, mid 80s should be the target, though. pass --json to get just the summary in json
format. ...
Gecko states
ated are described as role_graphic with the state property set to state_animated. this state is used to indicate that the object's location is changing. state_invisible the object is programmatically hidden. for example, menu itmes are programmatically hidden until a user activates the menu. because objects with this state are not available to users, client applications should not communicate in
formation about the object to users. however, if client applications find an object with this state, they should check to see if state_offscreen is also set. if this second state is defined, then clients can communicate the in
formation about the object to users. for example, a list box can have both state_invisible and state_offscreen set. in this case, the client application can communicate all items...
...hange the size of a window by clicking the border with a mouse and dragging the mouse. state_moveable indicates that the object can be moved. for example, a user can click on the titlebar for the object and drag the object to a new location. state_selfvoicing the object or child uses text-to-speech (tts) technology for description purposes. ...
...le indicates that the object can be moved. for example, a user can click on the titlebar for the object and drag the object to a new location. state_selfvoicing the object or child uses text-to-speech (tts) technology for description purposes. a speech-based accessibility aid does not announce in
formation when an object with this state has the focus because the object automatically announces in
formation. isn't used state_focusable the object can be focused. applied to: events: concomitant state: state_focused state_selectable the object can be selected. applied to: events: concomitant state: state_selected state_linked indicates that the object is
formatted as a hyperlink. the object role will usually be role_text_leaf. state_traversed the object is a hyperlink that ...
Places
places is the bookmarks and history management system introduced in firefox 3. it offers increased flexibility and complex querying to make handling the places the user goes easier and more convenient. it also includes new features including favicon storage and the ability to annotate pages with arbitrary in
formation. it also introduces new user interfaces for managing all this in
formation; see places on the mozilla wiki. places stores its data in an sqlite database using the mozstorage interfaces. documentation places migration guide migrating existing code to use the places api. manipulating bookmarks using places examples for how to work with bookmarks using the places api. using the places tagging service how to use the tagging service. ...
...e using the mozstorage interfaces. documentation places migration guide migrating existing code to use the places api. manipulating bookmarks using places examples for how to work with bookmarks using the places api. using the places tagging service how to use the tagging service. using the places history service how to access history in
formation using the places api. using the places favicon service how to manipulate favicons using the places api. using the places livemark service how to create and manage livemarks. using the places annotation service how to work with the annotation service. using the places keywords api how to manage places keywords querying places how to...
... using the places annotation service how to work with the annotation service. using the places keywords api how to manage places keywords querying places how to query the bookmarks and history system with specific parameters. retrieving part of the bookmarks tree how to fetch a section of the bookmarks tree using queries. displaying places in
formation using views how to use places views to display places data in your own applications or extensions. places utilities for javascript a library of convenient routines that make it easier to work with places. places database troubleshooting how to deal with a corrupt places.sqlite database. view all... design documents the places database...
XPCOM glue
application authors currently using internal linkage should read the guide on migrating from internal linkage to frozen linkage. sample compiler/linker flags code compiled using xpcom headers should always #include "xpcom-config.h" from the sdk, to ensure that xpcom #defines are correct. ...
... -l/path/to/sdk/lib -lxpcomglue notes never link against xpcomglue.lib and xpcomglue_s.lib at the same time. never link against xpcomglue.lib and xpcom.lib at the sam...
...never link against xpcomglue.lib and xpcomglue_s.lib at the same time. never link against xpcomglue.lib and xpcom.lib at the same time. for xulrunner 1.9, on linux you should use either the .pc files. for example: pkg-config --cflags --libs libxul.pc these instructions are for mozilla 1.8 and above. when using a sdk from mozilla 1.7 or earlier, you must define mozilla_strict_api when using any
form of the glue. linux and mac: make sure the gecko libraries are listed after your object (.o) files on the link line. linux and mac: write the linker options exactly as stated (just replacing the /path/to/sdk/), otherwise you get an undefined symbol: ...ns_tabledrivenqi...qitableentry... at runtime (not compile time) (in debug builds) or your module just won't load (in optimized builds). in prin...
Building the WebLock UI
in this chapter, however, we are going to be building a user interface for the weblock component that's meant to be added to the existing mozilla browser[other-mozlike-browsers]. ...
...as you can see, weblock is initialized as a global javascript variable, available in the scope of these functions and others: var weblock = components.classes["@dougt/weblock"] .getservice() .queryinterface(components.interfaces.iweblock); in addition to this basic setup, you must also write...
...opyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book
form is prohibited unless prior permission is obtained from the copyright holder. ...
Resources
« previous this last section of the book provides a list of resources referred to in the tutorial and other links that may be useful to the gecko developer. ...
...this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.
...opyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book
form is prohibited unless prior permission is obtained from the copyright holder. ...
Detailed XPCOM hashtable guide
what is a hashtable? a hashtable is a data construct that stores a set of items. each item has a key that identifies the item. items are found, added, and removed from the hashtable by using the key. hashtables may seem like arrays, but there are important differences: array hashtable keys: integer: arrays are always keyed on integers, and must be contiguous. any type: almost any datatype can be used as key, including strings, integers, xpcom interface pointers, iids, and almost anything else. keys can be disjunct (i.e. you can store entries with keys 1, 5, and 3000). ...
... entries stored in the table are very large (larger than 12 words). pldhash does not handle large entry structures efficiently. nsthashtable nsthashtable is a c++ template that wraps pldhash. it hides many of the complexities of pldhash (callback functions, the ops structure, etc). you should read xpcom/glue/nsthashtable.h. to use nsthashtable, you must declare an entry-class in a pre-defined
format. this entry class contains the key and the data that you are hashing (just like pldhash, above). it also declares functions that manipulate the key. in most cases, the functions of this entry class can be entirely inline. for examples of entry classes, see the declarations at xpcom/glue/nshashkeys.h. the template parameter is the entry class. you must use the init() function to initalize the t...
... nsastring hashstring() nsacstring nsid& nsidhashkey::hashkey() writing a good hash function is well beyond the scope of this document, and has been discussed extensively in computer-science circles for many years. there are many different types of hash functions. mozilla has tuned a good general-purpose hash algorithm for strings and nsid. original document in
formation author(s): benjamin smedberg <benjamin@smedbergs.us> ...
How to build a binary XPCOM component using Visual Studio
development setup the simplest way to get an xpcom component built is to use the gecko sdk. on windows, the sdk is built using a microsoft compiler, so you need to use one too. ...
... development setup the simplest way to get an xpcom component built is to use the gecko sdk. on windows, the sdk is built using a microsoft compiler, so you need to use one too. ...
...at to process the idl with mozilla toolset, not midl) vc++ express project: xpcom-test.zip note: the project uses xpcom_glue. it also uses frozen linkage (dependent on xpcom). i am not defining xpcom_glue and i am linking against xpcomglue_s.lib create an xpcom component a full tutorial of xpcom is beyond the scope of this posting. check out the resources at the end of the tutorial for more in
formation on the world of xpcom. ok then, on with the basic, oversimplified example. your xpcom component is made up of 3 parts: component interface described using idl. the interface defines the methods, including arguments and return types, of the component. component implementation using c++. the implementation is where the methods actually do the work. component factory module, also in c++. th...
Components.utils.Sandbox
ge principal. you can then use it with evalinsandbox() to make it the global scope object for the specified script. principal the security principal defined for a sandbox determines what code running in that sandbox will be allowed to do. the principal may be one of four types: the system principal, a content principal, an expanded principal, or a null principal. see security checks for more in
formation on security principals. system principal to specify the system principal, you can create it using code like: cc["@mozilla.org/systemprincipal;1"].createinstance(ci.nsiprincipal); content principal you can specify a content principal for a particular origin in one of three ways: as an nsiprincipal, for example by using the nodeprincipal property of a dom node as an nsidomwindow, suc...
... particular origin in one of three ways: as an nsiprincipal, for example by using the nodeprincipal property of a dom node as an nsidomwindow, such as that returned by the dom window property as a string uri like "http://www.example.com/" (discouraged) when possible, specify a window or an nsiprincipal object instead of using a string uri. window objects and nsiprincipal carry additional in
formation such as origin attributes and same-origin privilege changes caused by setting document.domain. example of obtaining content principal from the window: var principal = gbrowser.selectedtab.linkedbrowser.contentprincipal; var sandbox = components.utils.sandbox(principal); expanded principal an expanded principal is specified as an array of the principals it subsumes. each item in the arra...
...rather than an xray wrapper. however, sandboxes are often used when chrome wants to run script as another origin, possibly to interact with the page. in this case, same-origin xrays are desirable, and wantxrays should be set to true. see safely accessing content dom from chrome for more details. methods available on the sandbox object dump() - similar to window.dump(). debug() for more in
formation on the built-in sandbox functions, please consult the source code. importing functions or objects into the sandbox you can import functions or objects into the sandbox simply by assigning them to the sandbox object. for example: mysandbox.dosomething = function() { ... }; complex objects can be cloned into the sandbox using components.utils.cloneinto: mysandbox.someobject = components.u...
IAccessibleAction
the first action shou...
...) every accessible object that can be manipulated via the native gui beyond the methods available either in the msaa iaccessible interface or in the set of iaccessible2 interfaces (other than this iaccessibleaction interface) should support the iaccessibleaction interface in order to provide assistive technology access to all the actions that can be per
formed by the object. each action can be per
formed or queried for a name, description or associated key bindings. actions are needed more for ats that assist the mobility impaired, such as on-screen keyboards and voice command software. by providing actions directly, the at can present them to the user without the user having to per
form the extra steps to navigate a context menu. the first action should be equivalent to the msaa default action.
...] bstr description ); parameters actionindex 0 based index specifying which action's description to return. if it lies outside the valid range an empty string is returned. description the returned value is a localized string of the specified action. return value e_invalidarg if bad [in] passed, [out] value is null. s_false if there is nothing to return, [out] value is null. s_ok. doaction() per
forms the specified action on the object. hresult doaction( [in] long actionindex ); parameters actionindex 0 based index specifying the action to per
form. if it lies outside the valid range no action is per
formed. return value e_invalidarg if bad [in] passed. s_ok. keybinding() returns an array of bstrs describing one or more key bindings, if there are any, associated with the specified action. ...
mozIAsyncHistory
whether or not a given uri has been visited; you must implement a callback to receive the result of the request. void getplacesinfo( in jsval aplaceidentifiers, in mozivisitinfocallback acallback ); parameters aplaceidentifiers the uri for which to determine the visited status. acallback an object implementing the mozivisitedstatuscallback.isvisited() method. if there's no in
formation available for a given place, acallback is called with a stub place info object, containing just the provided data (guid or uri). isurivisited() starts an asynchronous request to determine whether or not a given uri has been visited; you must implement a callback to receive the result of the request. void isurivisited( in nsiuri auri, in mozivisitedstatuscallback acallback ); parameters...
...lled with a stub place info object, containing just the provided data (guid or uri). isurivisited() starts an asynchronous request to determine whether or not a given uri has been visited; you must implement a callback to receive the result of the request. void isurivisited( in nsiuri auri, in mozivisitedstatuscallback acallback ); parameters auri the places for which to retrieve in
formation, identified by either a single place guid, a single uri, or a js array of uris and/or guids. acallback an object implementing the mozivisitedstatuscallback.isvisited() method; this method will be called with the results once the request has been completed. updateplaces() adds a set of visits for one or more moziplaceinfo objects, and updates each moziplaceinfo's title or guid. note...
...einfo objects, and updates each moziplaceinfo's title or guid. note that this lets you add to history even in private browsing mode; if that's not desired you can first check whether the window is in private browsing mode. void updateplaces( in moziplaceinfo aplaceinfo, in mozivisitinfocallback acallback optional ); parameters aplaceinfo the moziplaceinfo object[s] containing the in
formation to store or update. this can be a single object, or an array of objects. acallback optional a mozivisitinfocallback object to be notified for each visit addition, title change, guid change, or error. if more than one operation is per
formed for a given visit, only one callback will be given (i.e. title change and add visit). exceptions thrown ns_error_invalid_arg passing...
mozITXTToHTMLConv
netwerk/streamconv/public/mozitxttohtmlconv.idlscriptable please add a summary to this article. ...
... netwerk/streamconv/public/mozitxttohtmlconv.idlscriptable please add a summary to this article. ...
...nd outputting html. wstring scantxt( in wstring text, in unsigned long whattodo ); parameters text the original, plain text to scan and convert into html. whattodo a bit field composed of the conversion control attributes indicating what conversions to apply. return value the html version of the specified string. scanhtml() scans the specified user-edited html, adding additional
formatting that the user may not have known to do. this should correct html that isn't entirely standards-compliant. warning: don't use the kglyphsubstitution conversion type with this method, as doing so generates html that is non-standard. wstring scanhtml( in wstring text, in unsigned long whattodo ); parameters text the original, user-edited html. whattodo a bit field composed of the...
mozIVisitInfoCallback
oziplaceinfo aplaceinfo); void oncomplete(in nsresult aresultcode, in moziplaceinfo aplaceinfo);obsolete since gecko 8.0 methods handleerror() called when a moziplaceinfo couldn't be processed. void handleerror( in nsresult aresultcode, in moziplaceinfo aplaceinfo ); parameters aresultcode nsresult indicating the reason why the change failed. ...
... oncomplete() obsolete since gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) called for each visit added, title change, or guid change when passed to moziasynchistory.updateplaces(). ...
...plete() obsolete since gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) called for each visit added, title change, or guid change when passed to moziasynchistory.updateplaces(). void oncomplete( in nsresult aresultcode, in moziplaceinfo aplaceinfo ); parameters aresultcode nsresult of the change indicating success or failure reason. aplaceinfo the in
formation that was being entered into the database. notes this method was replaced by the separate handleresult() and handleerror() methods in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5). see also mozivisitinfo moziasynchistory ...
nsIAccessNode
when accessibility is active in gecko, every dom node can have one nsiaccessnode. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) the nsiaccessnode implementations are instantiated lazily. the nsiaccessnode tree for a given dom window has a one to one relationship to the dom tree. if the dom node for this access node is "accessible", then a queryinterface to nsiaccessible will succeed. ...
...ssnode child. exceptions thrown ns_error_failure indicates that the access node is unattached from the accessible tree. getcomputedstylecssvalue() retrieve the computed style value as nsidomcssprimitivevalue for the dom node this access node is associated with. note: the meanings of width, height and other size measurements depend on the version of css being used. therefore, for bounds in
formation, it is better to use nsiaccessible.getbounds(). nsidomcssprimitivevalue getcomputedstylecssvalue( in domstring pseudoelt, in domstring propertyname ); parameters pseudoelt the pseudo element to retrieve style for, or empty string for general computed style in
formation for the node. propertyname retrieve the computed style value for this property name. return value the nsidomc...
...lue the nsidomcssprimitivevalue computed style value. exceptions thrown ns_error_failure indicates that the access node is unattached from the accessible tree. getcomputedstylevalue() retrieve the computed style value for this dom node, if it is a dom element. note: the meanings of width, height and other size measurements depend on the version of css being used. therefore, for bounds in
formation, it is better to use nsiaccessible.getbounds(). domstring getcomputedstylevalue( in domstring pseudoelt, in domstring propertyname ); parameters pseudoelt the pseudo element to retrieve style for, or null for general computed style in
formation for this node. propertyname retrieve the computed style value for this property name, for example "border-bottom". return value the co...
nsIAccessibleRelation
this object is interactive and controls some attribute of a target object. relation_label_for 0x03 this object is label for a target object. relation_labelled_by 0x04 this object is labelled by a target object. if the accessible has an nsiaccessible.name() , you can get the nsiaccessible that it was labelled by in order to get more
formatting in
formation. note: the label and description (see relation_described_by) relations may be used to prevent redundant in
formation from being presented by the screen reader, since the label and description can occur both on their own, and in the name or description fields of an nsiaccessible. relation_member_of 0x05 this object is a member ...
...tivated the target object doesn't lose focus. relation_parent_window_of 0x0d this object is a parent window of the target object. relation_described_by 0x0e this object is described by the target object. if the accessible has an nsiaccessible.description() , you can get the nsiaccessible that it was described by in order to get more
formatting in
formation. note: the label (see relation_labelled_by) and description relations may be used to prevent redundant in
formation from being presented by the screen reader, since the label and description can occur both on their own, and in the name or description fields of an nsiaccessible. relation_description_for 0x0f this object is describes the target o...
...it is used for msaa only, no for ia2 nor atk/at-spi. methods gettarget() returns accessible relation target at the given index. nsiaccessible gettarget( in unsigned long index ); parameters index zero-based index of relation target. ...
nsIAlertsService
heir downloads are complete or that they have new mail. 1.0 66 introduced gecko 1.7 inherits from: nsisupports last changed in gecko 22 (firefox 22 / thunderbird 22 / seamonkey 2.19) by default a message is displayed in a small window that slides up from the bottom of the screen, holds there for a few seconds, then slides down. the specific appearance varies from plat
form to plat
form. note: prior firefox 22, the alerts service was only supported on windows in gecko 1.7, had no effect on mac os x in gecko 1.8, but was fully supported in mac os x in gecko 1.9. note: since gecko 22, the notifications are provided by firefox and have become plat
form-independent. implemented by: @mozilla.org/alerts-service;1 as a service: var alertsservice = components.classes["@m...
...ring lang, optional in astring data, optional in nsiprincipal principal, optional in boolean inprivatebrowsing, optional ); parameters imageurl a url identifying the image to display in the notification alert. title the title for the alert. text the text to display in the alert, explaining the alert condition. the text must not be too long, otherwise it might be truncated to a plat
form-specific length. if the text is too long, try to use line returns in the text to have it split and displayed over multiple lines. textclickable optional if true, if the user clicks on it, the listener is notified; when hovered the notification background becomes lighter and the cursor turns to a pointer. prior to gecko 32 the text was made to look like a link. cookie optional a blind cookie ...
... a name for the notification; this is not displayed in the alert. however, certain notification systems (such as growl on mac os x) allow the user to disable alerts by name. this name is used in that configuration panel. on android the name is hashed and used as a notification id. dir optional bidi override for the title. valid values are "auto", "ltr" or "rtl". only available on supported plat
forms. lang optional language of title and text of the alert. only available on supported plat
forms. data optional the value of the cookie parameter passed to showalertnotification. principal optional the principal of the page that created the alert. used for ipc security checks, and to determine whether the alert is actionable. inprivatebrowsing optional controls the image loading behavior. ...
nsIAppShellService
note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindowinternal. attributes attribute type description applicationprovidedhiddenwindow boolean return true if the application hidden window was provided by the application. if it was not, the default hidden window was used. this will usually be false on all non-mac plat
forms. read only. hiddendomwindow nsidomwindow return the (singleton) application hidden window, automatically created and maintained by this appshellservice. read only. hiddenwindow nsixulwindow return the (singleton) application hidden window, automatically created and maintained by this appshellservice. read only. nativeappsupport nsinativeappsupport ge...
...rea() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) during application startup (and at other times!) we may temporarily encounter a situation where all application windows will be closed but we do not want to take this as a signal to quit the application. bracket the code where the last window could close with these. (and at application startup, on plat
forms that do not normally quit when the last window has closed, call enter once, but not exit) void enterlastwindowclosingsurvivalarea(); parameters none. exitlastwindowclosingsurvivalarea() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void exitlastwindowclosingsurvivalarea(); parameters none. native code only!gethiddenwindowandjscontext...
...run() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) runs an application event loop: normally the main event pump which defines the lifetime of the application. void run(); parameters none. toplevelwindowismodal() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) the appshell service needs to be in
formed of modal xul windows currently open. call this method as a window becomes modal or as it becomes nonmodal. void toplevelwindowismodal( in nsixulwindow awindow, in boolean amodal ); parameters awindow the window to register. amodal true if awindow is becoming modal or false if awindow is becoming nonmodal (or being closed). unregistertoplevelwindow() remove a window from the appl...
nsIBrowserHistory
openpage(in nsiuri auri); obsolete since gecko 9.0 note: the markpageasfollowedlink and markpageastyped methods were moved to nsinavhistoryservice in gecko 22.0 so that all markpageas* methods can be found in one interface. attributes attribute type description count obsolete since gecko 15.0 pruint32 indicates if there are entries in global history. for per
formance reasons this does not return the real number of entries. read only. lastpagevisited obsolete since gecko 10.0 autf8string the last page that was visited in a top-level window. read only. note: the count attribute was removed in gecko 15.0 because it was only used to determine if there were any entries at all anyway, so the nsinavhistoryservice.hashistoryentries attribute...
...ies at all anyway, so the nsinavhistoryservice.hashistoryentries attribute is better for this. methods addpagewithdetails() obsolete since gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) note: this method was removed in gecko 15.0. you should use moziasynchistory.updateplaces() instead. this method adds a page to the history with specific time stamp in
formation. it is called by history importing code and is used in the history migration tool. void addpagewithdetails( in nsiuri auri, in wstring atitle, in long long alastvisited ); parameters auri the page that will be added to the history. atitle the title of the page. alastvisited when the page was last visited, in microseconds since the unix epoch. markpageasfollowedlin...
...s a domain, and remove all pages from the entire domain. void removepagesfromhost( in autf8string ahost, in boolean aentiredomain ); parameters ahost the name of the host to be removed. an empty value for this parameter means local files and anything else without a hostname. you can also pass in the localized "(local files)" title given to you by a history query to remove all history in
formation for local files. aentiredomain if set to true, it will assume ahost is a domain, and remove all pages from the entire domain, including subdomains. set to false otherwise. removevisitsbytimeframe() removes all visits within the given timeframe, using a batch. any pages that become unvisited as a result are also deleted. void removevisitsbytimeframe( in long long abegintime, in long...
nsICRLInfo
security/manager/ssl/public/nsicrlinfo.idlscriptable in
formation on a certificate revocation list (crl) issued by a certificate authority (ca). inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description lastfetchurl autf8string the url this crl was last fetched from. read only. lastupdate prtime the time this crl was created at. read only. lastupdatelocale astring lastupdate
formatted as a human readable string
formatted according to the environment locale. read only. nameindb astring the key identifying the crl in the database. read only. nextupdate prtime the time the suggested next update for this crl. read only. ...
...read only. organization astring the issuing ca's organization. read only. ...
...read only. organization astring the issuing ca's organization. read only. ...
nsIContentSecurityPolicy
refinepolicy() updates the policy currently stored in the content security policy to be "refined" or tightened by the one specified in the string policystring. void refinepolicy( in astring policystring, in nsiuri selfuri ); parameters policystring selfuri scanrequestdata() called after the content security policy object is created to fill in the appropriate request and request header in
formation needed in case a report needs to be sent. void scanrequestdata( in nsihttpchannel achannel ); parameters achannel sendreports() manually triggers violation report sending given a uri and reason. the uri may be null, in which case "self" is sent. void sendreports( in astring blockeduri, in astring violateddirective ); parameters blockeduri the uri that violated the policy. violate...
...sending given a uri and reason. the uri may be null, in which case "self" is sent. void sendreports( in astring blockeduri, in astring violateddirective ); parameters blockeduri the uri that violated the policy. violateddirective the directive that was violated. shouldload() delegate method called by the service when sub-elements of the protected document are being loaded. given a bit of in
formation about the request, decides whether or not the policy is satisfied. calls to this may trigger violation reports when queried, so this value should not be cached. short shouldload( in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra ); parameters acontenttype acontentlocat...
...ontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra ); parameters acontenttype acontentlocation arequestorigin acontext amimetypeguess aextra return value shouldprocess() delegate method called by the service when sub-elements of the protected document are being processed. given a bit of in
formation about the request, decides whether or not the policy is satisfied. short shouldprocess( in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetype, in nsisupports aextra ); parameters acontenttype acontentlocation arequestorigin acontext amimetype aextra return value ...
nsIDirIndexListener
netwerk/streamconv/public/nsidirindexlistener.idlscriptable this interface is used to receive contents of directory index listings from a protocol. they can then be trans
formed into an output
format (such as rdf, html and so on) inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void onindexavailable(in nsirequest arequest, in nsisupports actxt, in nsidirindex aindex); void onin
formationavailable(in nsirequest arequest, in nsisupports actxt, in astring ainfo); methods onindexavailable() called for each directory entry. void onindexavailable( in nsirequest arequest, in nsisupports actxt, in nsidirindex aindex ); parameters arequest the request. actxt opaque parameter aindex new index to add. oninf...
...actxt opaque parameter ainfo new info to add. ...
...actxt opaque parameter ainfo new info to add. ...
getFile
« xpcom api reference called by the directory service to obtain an nsifile object corresponding for a given standard path location. the individual plat
form implementation of nsidirectoryserviceprovider maps the symbolic path location passed to this function and returns the appropriate nsifile. nsifile getfile( in string aname, out boolean apersistent ); parameters aname [in] the symbolic name for a file or directory location. see symbolic names below for a list of accepted values. xpcom file system aliases apersistent [out] this output parameter indicates to the caller whether or not the returned location is persistent. if true, this lets the directory service cache results to improve the per
formance of directory lookups. if false, then the directory service w...
... this lets the directory service cache results to improve the per
formance of directory lookups. if false, then the directory service will not cache the results of this method. symbolic names the list of symbolic names is subject to change, so be sure to take a look at the xpcom/io/nsdirectoryservicedefs.h file for the version of gecko you're working with for the latest list. available on all plat
forms these symbolic names are available on all plat
forms (although, of course, they may refer to different physical paths on the storage device). c constant string value notes ns_os_home_dir "home" ns_os_temp_dir "tmpd" ns_os_current_working_dir "curworkd" ns_os_desktop_dir "desk" otherwise same as home ns_o...
... note: on mac os x, up through firefox 34 this is the contents/macos directory within the application's bundle. starting with firefox 35, this is contents/resources. this change was required in order to comply with apple's new gatekeeper v2 rules; without this change, firefox would not work on any mac os x newer than 10.9.4. ns_gre_component_dir "grecomsd" plat
form-specific locations some symbolic names represent plat
form-specific locations. the following sections cover these. available on both mac and unix these locations are available on both mac os x and unix implementations of gecko. c constant string value notes ns_os_system_dir "sysd" available on mac os x only these locations are supported only on mac os x ve...
nsIFilePicker
specify it without a leading dot, for example "jpg". defaultstring astring the filename, including extension, that should...
... specify it without a leading dot, for example "jpg". ...
...orresponds to the *.jpe, *.jpg, *.jpeg, *.gif, *.png, *.bmp, *.ico, *.svg, *.svgz, *.tif, *.tiff, *.ai, *.drw, *.pct, *.psp, *.xcf, *.psd and *.raw filters for file extensions. filterxml 0x010 corresponds to the *.xml filter for file extensions. filterxul 0x020 corresponds to the *.xul filter for file extensions. filterapps 0x040 corresponds to the plat
form specific application filter for file extensions. application files for the user's plat
form will pass through the filter. filterallowurls 0x80 allow urls. filteraudio 0x100 corresponds to the *.aac, *.aif, *.flac, *.iff, *.m4a, *.m4b, *.mid, *.midi, *.mp3, *.mpa, *.mpc, *.oga, *.ogg, *.ra, *.ram, *.snd, *.wav and *.wma filters for file extensions. filtervid...
nsIHapticFeedback
longpress 1 specify as the action typ...
... m...
...lasses["@mozilla.org/widget/hapticfeedback;1"] .getservice(components.interfaces.nsihapticfeedback); once you have the service, you can initiate haptic feedback (that is, cause the device to vibrate, if it's supported) by calling per
formsimpleaction(): hapticfeedback.per
formsimpleaction(components.interfaces.nsihapticfeedback.longpress); method overview void per
formsimpleaction(in long islongpress); constants press length constants constant value description shortpress 0 specify as the action type to per
form a short vibration. longpress 1 specify as the action type to per
form a long vibration. methods per
formsimpleaction() per
form haptic feedback. void per
formsimpleaction( in long islongpress ...
nsIHttpChannel
thrown ns_error_not_available if called before the response has been received (before onstartrequest()). referrerpolicy read only unsigned long the referrer policy in use for this channel, indicated by one of the constants listed above methods getoriginalresponseheader() get the value of a particular original response header, that is, in the same
form as it came from the network. i.e. empty headers will have an empty string as value and multiple headers will not be merged as opposed to getresponseheader(). void getoriginalresponseheader( in acstring aheader, in nsihttpheadervisitor avisitor ); parameters aheader the case-insensitive name of the response header to query (for example "set-cookie"). avisitor an nsihttpheadervisitor...
...is an implementation detail. if this flag is false, then the header value will be replaced with the contents of avalue. exceptions thrown ns_error_in_progress if called after the channel has been opened. ns_error_failure if called during visitrequestheaders(). setresponseheader() set the value of a particular response header. this method allows, for example, the html content sink to in
form the http channel about http-equiv headers found in html <meta> tags. if value is empty and merge is false, the header will be cleared. void setresponseheader( in acstring header, in acstring value, in boolean merge ); parameters header the case-insensitive name of the response header to set(for example "cache-cookie"). value the response header value to set (for example "no-cache")...
... if called before the response has been received (before onstartrequest()). ns_error_illegal_value if changing the value of this response header is not allowed. ns_error_failure if called during visitresponseheaders(), visitoriginalresponseheaders() or getoriginalresponseheader(). visitoriginalresponseheaders() call this method to visit all original response headers, that is, in the same
form as they came from the network. i.e. empty headers will be have an empty string as value and multiple headers will not be merged as opposed to visitresponseheaders(). warning: calling setresponseheader() while visiting response headers will return a ns_error_failure. void visitoriginalresponseheaders( in nsihttpheadervisitor avisitor ); parameters avisitor an nsihttpheadervisitor insta...
nsIHttpChannelInternal
ean external handlers may set this to true to notify the channel that it is open on behalf of a download. documenturi nsiuri an http channel can own a reference to the document uri. forceallowthirdpartycookie boolean force relevant cookies to be sent with this load even if normally they would not be. localaddress autf8string the local ip address to which the channel is bound, in the same
format produced by pr_netaddrtostring(). this may be either an ipv4 or ipv6 address. note: if network address translation (nat) is in effect, this may not be the same address the remote host thinks it is talking to. this may throw an ns_error_not_available exception if accessed when the channel's endpoints haven't been determined yet, or any time the nsihttpactivityobserver.isactive attribute is false...
...eption if accessed when the channel's endpoints haven't been determined yet, or any time the nsihttpactivityobserver.isactive attribute is false. see bug 534698 and bug 526207. read only. proxyinfo nsiproxyinfo get the proxy info in use by the channel. read only. obsolete since gecko 1.9 remoteaddress autf8string the ip address of the remote host to which this channel is bound, in the same
format produced by pr_netaddrtostring(). this may throw an ns_error_not_available exception if accessed when the channel's endpoints haven't been determined yet, or any time the nsihttpactivityobserver.isactive attribute is false. see bug 534698 and bug 526207. read only. remoteport print32 the remote port number to which the channel is bound. this may throw an ns_error_not_available exception if ...
...ihttpupgradelistener.ontransportavailable() is delivered. void httpupgrade( in acstring aprotocolname, in nsihttpupgradelistener alistener ); parameters aprotocolname the value of the http upgrade request header. alistener the callback object used to handle a successful upgrade. setcookie() helper method to set a cookie with a consumer-provided cookie header, but using the channel's other in
formation (uri's, prompters, date headers and so on.). void setcookie( in string acookieheader ); parameters acookieheader the cookie header to be parsed. setupfallbackchannel() sets up this channel as an application cache fallback channel. void setupfallbackchannel( in string afallbackkey ); parameters afallbackkey the fallback key. see also nsihttpchannel nsichannel nsihttpupgradelistener...
nsILocale
intl/locale/idl/nsilocale.idlscriptable represents one locale, which can be used for things like sorting text strings and
formatting numbers, dates and times. inherits from: nsisupports last changed in gecko 1.0 method overview astring getcategory(in astring category); methods getcategory() retrieves a string with the current locale name. astring getcategory( in astring category ); parameters category a string representing the category to retrieve the locale for. valid strings are stored in nsilocale.idl. currently those are: nsilocale_collate - collation order. how strings are sorted. nsilocale_ctype - character classification and case conversion. nsilocale_monetary - monetary
formatting. nsilocale_numeric - numeric, non-monetary
formatting. nsilocale_time - date an...
...arameters category a string representing the category to retrieve the locale for. valid strings are stored in nsilocale.idl. currently those are: nsilocale_collate - collation order. how strings are sorted. nsilocale_ctype - character classification and case conversion. nsilocale_monetary - monetary
formatting. nsilocale_numeric - numeric, non-monetary
formatting. nsilocale_time - date and time
formats. nsilocale_messages - related to fonts, character encodings and so on. ...
...llation order. how strings are sorted. nsilocale_ctype - character classification and case conversion. nsilocale_monetary - monetary
formatting. nsilocale_numeric - numeric, non-monetary
formatting. nsilocale_time - date and time
formats. nsilocale_messages - related to fonts, character encodings and so on. return value the locale code to be used for the given category. a locale code is of the
form language[-country[-region]], where "language" is an iso 639 language code (two letter codes preferred over three letter codes when available), "country" is an iso 3166 two letter country code, and "region" is a string of up to 5 letters. see also stringbundle ...
nsIMessenger
ntype(); return value a long representing the type of the transaction. see #constants for available types. getredotransactiontype() gets the type of the next redo transaction. available types are defined as constants in nsimessenger. unsigned long getredotransactiontype(); return value a long representing the type of the transaction. see #constants for available types. undo() per
forms the next undo transaction. void undo(in nsimsgwindow msgwindow); parameters msgwindow the nsimsgwindow to per
form the undo transaction on. redo() per
forms the next redo transaction. void redo(in nsimsgwindow msgwindow); parameters msgwindow the nsimsgwindow to per
form the redo transaction on. sendunsentmessages() creates a nsimsgsendlater instance and sends all messages for...
...nt in the history. getfolderuriatnavigatepos() gets the folder url at a particular position in the navigation history. acstring getfolderuriatnavigatepos(in long apos); parameters apos the position to get the url from relative to the current history cursor. +1 is forward, -1 is back. return value the url of the folder at that point in the history. getnavigatehistory() returns in
formation about the current navigation history. if caller just wants the count and current pos, they can pass in null for ahistory, which will be more efficent. if they want a list suitable for display, they should pass in an ahistory pointer, and they'll get returned an array with strings containing something like subject and sender of the message - other possible info is the folder containing the me...
... ...
nsIMimeConverter
inherits from: nsisupports implemented by: @mozilla.org/messenger/mimeconverter;1. ...
...ring header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); parameters propertyname the name of the property to retrieve. return value the value of the property. encodemimepartiistr_utf8() encodes a string into a mime-encoded
form according to rfc 2047. string encodemimepartiistr_utf8(in autf8string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); parameters header the string to encode into the mime-encoded
form. s...
...ve been run on a message yet. return value the value of the property. qpencoderinit() void setuint32property(in string propertyname, in unsigned long propertyval); parameters propertyname the name of the property to set. propertyval the value of the property. encoderdestroy() marks this header as read. thunderbird provides a utility function which per
forms this for the currently selected message: markcurrentmessageasread(). void markread(in boolean read); parameters read if true, mark as read. if false mark as undread. encoderwrite() void markflagged(in boolean flagged); parameters flagged if true, mark as flagged. if false remove flag. ...
nsIPrincipal
n string the origin of this principal's codebase uri. an origin is defined as: scheme + host + port. read only. prettyname autf8string the pretty name for the certificate. this sort of (but not really) identifies the subject of the certificate (the entity that stands behind the certificate). note that this may be empty; prefer to get the certificate itself and get this in
formation from it, since that may provide more in
formation. throws if there is no certificate associated with this principal. read only. securitypolicy voidptr the domain security policy of the principal. native code only! subjectname autf8string the subject name for the certificate. this actually identifies the subject of the certificate. this may well not be a...
... securitypolicy voidptr the domain security policy of the principal. native code only! subjectname autf8string the subject name for the certificate. this actually identifies the subject of the certificate. this may well not be a string that would mean much to a typical user on its own (e.g. it may have a number of different names all concatenated together with some in
formation on what they mean in between). throws if there is no certificate associated with this principal. read only. uri nsiuri the codebase uri to which this principal pertains. this is generally the document uri. read only. note: this wasn't accessible by scripts prior to gecko 2.0. constants principal capability constants these values indicate the capab...
...te associated with this principal. read only. uri nsiuri the codebase uri to which this principal pertains. this is generally the document uri. read only. note: this wasn't accessible by scripts prior to gecko 2.0. constants principal capability constants these values indicate the capabilities of a principal. the order is significant; if an operation is per
formed on a set of capabilities, the minimum is computed. constant value description enable_denied 1 enable_unknown 2 enable_with_user_permission 3 enable_granted 4 methods native code only!canenablecapability short canenablecapability( in string capability ); parameters capability missing description ...
nsIPropertyBag
whose elements are nsiproperty objects. read only. methods getproperty() get a property value for the given name. nsivariant getproperty( in astring name ); parameters name the name to return the matching property. return value the property matching the given name. exceptions thrown ns_error_failure if a property with that name doesn't exist. examples get user agent in
formation (operating system specifics. the window scope is not always accessible so the window.navigator cannot be accessed. goodies obtained from window.navigator are: appcodename:"mozilla" appname:"netscape" appversion:"5.0 (windows)" battery:batterymanager buildid:"20140529161749" cookieenabled:true donottrack:"yes" geolocation:geolocation language:"en-us" mimetypes:mimetypearray mozalarms:null m...
...services.appinfo.os simply tells us winnt only, this is not helpful to differentiate between windows xp, vista, 7, etc. to do this use nsiproper...
...on android there is version and kernel_version). ...
nsIScriptableIO
file and stream guide: [ nsiscriptableio | accessing files | getting file in
formation | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the plat
form (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. nsiscriptableio provides a convenient api for cre...
... name is specified as "foo.txt", the file reference generated will refer to a file named "foo.txt" on the user's desktop. note: the filename may only be the name of a file. if you need to select a file in a subdirectory, you should get a reference to the directory, then use the file's append() method to navigate through the directory hierarchy to the file you really want. this properly allows plat
form-independent path construction. you may specify an empty filename string if you wish to get a reference to the directory itself. nsifile getfile( in astring alocation, in astring afilename ); parameters alocation a location key identifying a known standard directory. the afilename parameter is treated as being local to this directory. afilename the relative pa...
...y. afilename the relative path of the file to generate a reference for. return value returns an nsifile object referencing the specified file location. exceptions thrown ns_error_invalid_arg alocation was null. getfilewithpath() returns a file reference using an absolute file path to locate the file. note: you should avoid using this method, since file paths are plat
form-dependent and non-portable. instead, you should use getfile() and construct the path from the base location manually. nsifile getfilewithpath( in astring afilepath ); parameters afilepath the absolute pathname of the file to reference, or the value of a file's persistentdescriptor. return value returns an nsifile object referencing the specified file location. exceptions thr...
nsISyncJPAKE
this will compute the key and expand the key to two keys, an aes256 encryption key and a 256 bit hmac key. it returns a key confirmation value (sha256d of the key) and the encryption and hmac keys. void final( in acstring ab, in acstring agvb, in acstring arb, in acstring ahkdfinfo, out acstring aaes256key, out acstring ahmac256key ); parameters ...
... ahmac256key ); parameters ab schnorr signature value b, in hex representation. agvb schnorr signature value g^vb (vb is a random value), in hex representation. arb schnorr signature value rb = vb - xb * h, in hex representation. ahkdfinfo missing description aaes256key the aes 256 encryption key, in base64 representation. ahmac256key the 256 bit hmac key, in base64 representation. round1() per
form first round of the jpake exchange. void round1( in acstring asignerid, out acstring agx1, out acstring agv1, out acstring ar1, out acstring agx2, out acstring agv2, out acstring ar2 ); parameters asignerid string identifying the signer. agx1 schnorr signature value g^x1, in hex representation. agv1 schnorr signature value g^v1 (v1 is a random value), in hex representation. ar1 sch...
...g^x1, in hex representation. agv1 schnorr signature value g^v1 (v1 is a random value), in hex representation. ar1 schnorr signature value r1 = v1 - x1 * h, in hex representation. agx2 schnorr signature value g^x2, in hex representation. agv2 schnorr signature value g^v2 (v2 is a random value), in hex representation. ar2 schnorr signature value r2 = v2 - x2 * h, in hex representation. round2() per
form second round of the jpake exchange. void round2( in acstring apeerid, in acstring apin, in acstring agx3, in acstring agv3, in acstring ar3, in acstring agx4, in acstring agv4, in acstring ar4, out acstring aa, out acstring agva, out acstring ara ); parameters apeerid string identifying the peer. apin string containing the weak secret (pin). agx3 schnorr signature value g^...
nsITreeBoxObject
/layout/xul/base/src/tree/public/nsitreeboxobject.idlscriptable please add a summary to this article. ...
... /layout/xul/base/src/tree/public/nsitreeboxobject.idlscriptable please add a summary to this article. ...
...added or removed. for non-contiguous additions/removals, this method should be called multiple times. void rowcountchanged(in long index, in long count); parameters index the position at which the new rows were added or at which rows were removed. count the number of rows added or removed. use negative values for removed rows. example you deleted the row with index rowindex. in
form the tree about this change by calling rowcountchanged(rowindex+1, -1); beginupdatebatch() notify the tree that the view is about to per
form a batch update, that is, add, remove or invalidate several rows at once. this must be followed by calling endupdatebatch(), otherwise the tree will get out of sync. void beginupdatebatch(); endupdatebatch() notify the tree that the view has completed a bat...
nsIUpdate
that describes an object representing an available update to the current application - this update may have several available patches from which one must be selected to download and install, for example we might select a binary difference patch first and attempt to apply that, then if the application process fails fall back to downloading a complete file-replace patch. this object also contains in
formation about the update that the front end and other application services can use to learn more about what is going on. 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); ...
...e content of this update. ideally, this page is not the release notes but some other page that summarizes the differences between this update and the previous, which also links to the release notes. displayversion astring the string to display in the user interface for the version. if you want a real version number use appversion. errorcode long a numeric error code that conveys additional in
formation about the state of a failed update or failed certificate attribute check during an update check. if the update is not in the "failed" state, this value is zero. ok (0) no error. mem_error (1) a memory error occurred. usage_error (3) a usage error occurred; this needs to be described in more detail. crc_error (4) a checksum error occurred. parse_error (5) an error occurred while parsing the ...
... is a security update, a more seriously-worded user interface message is used to present the update to the user. licenseurl astring the url to an html fragment that contains a license for the update. if this is specified, the user is shown the license file after they choose to install the update, and they must agree to it before the download begins. name astring the name of the update, in the
form "application_name update_version" patchcount unsigned long the number of patches supplied by this update. read only. plat
formversion astring the toolkit version of this update. previousappversion astring the application version prior to the application being updated. selectedpatch nsiupdatepatch the currently selected patch for this update. read only. serviceurl astring the url to the...
nsIXULRuntime
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/xre/app-info;1. ...
...y. widgettoolkit autf8string a string tag identifying the target widget toolkit in use. this is taken from the moz_widget_toolkit configure variable. read only. xpcomabi autf8string a string tag identifying the binary abi of the current processor and compiler vtable. this is taken from the target_xpcom_abi configure variable. it may not be available on all plat
forms, especially unusual processor or compiler combinations. the result takes the
form <processor>-<compilerabi>, for example: x86-msvc ppc-gcc3. this value should almost always be used in combination with os. may throw ns_error_not_available. read only. constants process type constants constant value description process_type_default 0 the defa...
... registered and all fast load data to be re-created. void invalidatecachesonrestart(); parameters none. example display the user's operating system in an alert box: var xulruntime = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulruntime); alert(xulruntime.os); see also nsixulappinfo - a related interface providing in
formation about the host application, it's also implemented by xre/app-info. ...
nsIAbCard/Thunderbird3
axnumbertype pagernumber, pagernumbertype cellularnumber, cellularnumbertype jobtitle, department, company _aimscreenname dates: anniversaryyear, anniversarymonth, anniversaryday birthyear, birthmonth, birthday webpage1 (work), webpage2 (home) custom1, custom2, custom3, custom4 notes integral properties: lastmodifieddate popularityindex prefermail
format (see nsiabprefermail
format) boolean properties: allowremotecontent inherits from: nsiabitem method overview nsivariant getproperty(in autf8string name, in nsivariant defaultvalue); [noscript] astring getpropertyasastring(in string name); [noscript] autf8string getpropertyasautf8string(in string name); [noscript] pruint32 getpropertyasuint...
...in string name); returns a property for the given name. these functions convert values in the same manner as the default implementation of nsivariant. of particular note is that boolean variables are converted to integers as in c/c++ (true is a non-zero value), so that false will be converted to a string of 0 and not false<code>. these functions are marked <code>[noscript] since xpcconnect per
forms automatic type conversion on nsivariant such that they are not needed for scripts, only for c++ callers. parameters name the case-sensitive name of the property to get. return value the value of the attribute asked for. exceptions thrown ns_error_not_available<tt> if the named property does not exist. <tt>ns_error_cannot_convert_data if the property cannot be converted to the d...
...with the given name. some properties may not be deleted. however, the implementation will not check this constraint at this method. if such a property is deleted, an error may be thrown when the card is modified at the database level. void deleteproperty(in autf8string name); parameters name the case-sensitive name of the property to set. translateto() translates a card into a specific
format. the following types are supported: base64xml xml vcard autf8string translateto(in autf8string atype); parameters atype the type of item to translate the card into. return value a string containing the translated card. exceptions thrown ns_error_illegal_value type not recognized. copy() this function will copy all values from one card to another. void copy(in nsiabcard...
XPCOM tasks
to transition the primary apis toward the standard. p2 our various enumerator classes should be made compatible with the enumerators from the standard c library, so that we can apply the standard algorithms to our containers. this is probably best done with a c wrapper around an xpcom enumerator. p2 do we still require our own version of quicksort? and if so, can we narrow it to only those plat
forms that need it? p3 we need to check for aggregation in createinstance(). see bug 16763 p3 improve the per
formance of the registry. explore the idea of using a separate registry. 5.1 if the build hierarchy were fixed, the registry could exploit expat and dbm. it could avoid implementing its own file
format and io; and in many cases, possibly avoid calling into components for registration. in any...
...nk, be simplified. 5.1 should we provide type-safe templatized containers, e.g., over nsisupportsarray? 5.1 we want to provide some mechanism for user-specific components in a multi-user environment. 5.1 fix the shutdown issues that complicate life for embedding applications. things we need to evangelize we need to keep up-to-date documentation, samples, and have brown-bags to keep people in
formed. we've been doing this, but it should be in the plan. general xpcom guidelines. see, e.g., xpcom code faq, idl author's guide, and implementing queryinterface. writing and using components and modules. building ownership models that work (see xpcom ownership guidelines), using raw pointers, nscomptr (see the nscomptr user's manual), nsiweakreference (see nsiweakreference), nscweakreference,...
...nes. see, e.g., xpcom code faq, idl author's guide, and implementing queryinterface. writing and using components and modules. building ownership models that work (see xpcom ownership guidelines), using raw pointers, nscomptr (see the nscomptr user's manual), nsiweakreference (see nsiweakreference), nscweakreference, and (across threads) proxies (see nsisupports proxies). original document in
formation author(s): unknown last updated date: may 8, 2003 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
xpidl
pyxpidl has been used for some time now, but now this older tool has been fully retired. xpidl is based on the libidl idl compiler from the gnome project. the libidl compiler depends on glib, also from the gnome project. ...
...pyxpidl has been used for some time now, but now this older tool has been fully retired. xpidl is based on the libidl idl compiler from the gnome project. the libidl compiler depends on glib, also from the gnome project. ...
...gecko sdk. pyxpidl has been used for some time now, but now this older tool has been fully retired. xpidl is based on the libidl idl compiler from the gnome project. the libidl compiler depends on glib, also from the gnome project. the xpidl compiler is now part of the build process, allowing us to generate headers used by the xpcom components. please check the build documentation for further in
formation on where to get libidl and glib. using xpidl to add an idl file to the build, use the xpidlsrcs makefile variable. 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 ...
XPIDL
are used to describe interfaces in a language- and machine-independent way. idls make it possible to define interfaces which can then be processed by tools to autogenerate language-dependent interface specifications. xpidl is expected to converge towards webidl in the future. note: starting in gecko 9.0, the older xpidl utility, which was previously used to generate c++ header files, typelib in
formation, and so forth has been replaced with pyxpidl in the gecko sdk. pyxpidl has been used for some time now, but now the older tool has been fully retired. writing xpidl interface files xpidl closely resembles omg idl, with extended syntax to handle iids and additional types. some examples are in the xpcom/base and xpcom/ds directories of the mozilla tree. xpidl:syntax (now up to date again...
...xpidl closely resembles omg idl, with extended syntax to handle iids and additional types. some examples are in the xpcom/base and xpcom/ds directories of the mozilla tree. xpidl:syntax (now up to date again) xpidl syntax (out of date) xpidl author's guide (not as out of date) explanation of idl semantics a full guide to the syntax can be found at xpidl:syntax, which is written in an abnf
form. an xpidl file is essentially just a series of declarations. at the top level, we can define typedefs, native types, or interfaces. interfaces may furthermore contain typedefs, natives, methods, constants, or attributes. most declarations can have properties applied to them. types there are three ways to make types: a typedef, a native, or an interface. in addition, there are a few built-in na...
...ance. in addition, the jsval type is translated as the appropriate javascript value (since a jsval is the internal representation of all javascript values), and objects that are marked nsivariant have their types automatically boxed and unboxed as appropriate. the equivalent representations of all idl types in native code is given in the earlier tables; parameters of type inout follow their out
form. native code should pay particular attention to not passing in null values for out parameters (although some parts of the codebase are known to violate this, it is strictly enforced at the js<->native barrier), and also ensuring that boolean types only receive values of 0 (false) or 1 (true). representations of types additionally depend on some of the many types of properties they may have. the ...
Address book sync client design
warning: the content of this article may be out of date. it was imported from mozilla.org and last updated in 2000. by richard h. pizzarro <rhp@netscape.com> contents overview client side sync logic public interfaces overview there is an component available in the mozilla tree for per
forming synchronization operations against a server based address book. the general architecture for the sync component is the following: mozilla ui ab sync logic mork ab database sync protocol encoding sync protocol decoding http "post" api ...
... // // the client keeps a sync mapping table which holds the following: // // serverrecordid - unique id for a record provide...
... sync protocol encoding sync protocol decoding http "post" api mozilla networking client side sync logic the client synchronization logic defers to the server pe
forming some intelligence in handling duplicate entries for the sync process. the static in
formation that is held on the client for address book sync operations is stored in a file called absync.dat which is located in the root directory of the users profile in
formation. // // the client keeps a sync mapping table which holds the following: // // serverrecordid - unique id for a record provided by the // uab server. // localrecordid - local unique id, for mob...
Mail and RDF
lobal variables. in the document's onload= handler the datasources are attached to their respective widgets by setting the database property on each rdf template's parent element. reflecting data to rdf in order to have a dynamic ui that updates when the underlying content changes, a datasource must implement two key methods of reflecting data into rdf. answering queries: when rdf asks for in
formation about a resource, datasources answer with the results of the query. asynchronously notifying rdf when the data itself changes, rdf needs to be notified. the details answering queries mail uses rdf resource factories to attach mail-specific in
formation to rdf resources. (the details of rdf resource factories will be left to rdf documentation for now.) from an rdf resource, it is possible...
...synchronously notifying rdf when the data itself changes, rdf needs to be notified. the details answering queries mail uses rdf resource factories to attach mail-specific in
formation to rdf resources. (the details of rdf resource factories will be left to rdf documentation for now.) from an rdf resource, it is possible to queryinterface() to the appropriate mail/news object, and then access in
formation from there. for example, the folder pane needs to display the number of messages in the inbox. in
formation for this column is queried when the tree's rdf template calls the folder datasource's gettarget() method. the query's target is the resource named mailbox://alecf@pop.myisp.com/inbox and the property node is named http://home.netscape.com/nc-rdf#totalmessages. this is basically what ha...
....getliteral(msgcount.tostring()); return result; } } asynchronously notifying rdf when a mail object's data changes and the data is reflected in rdf by notifying all of the observers that rdf has registered with the datasource. in the example of mail folders, each folder datasource first registers itself with the mail session as a nsifolderlistener because it wants in
formation about when a folder changes. each template registers itself as an rdf observer. when a folder's contents or properties change, it tells the mail session to notify the folder listeners that the data has changed. the folder datasource then translates these property changes into onassert() or onunassert() calls to the observers. the calling chain essentially looks like this: registration: ...
Building a Thunderbird extension 3: install manifest
warning: this content is for older versions of thunderbird. much of it may no longer be relevant. see developer.thunderbird.net for newer in
formation. the install.rdf file is an xml file that provides general in
formation about the extension. open the file called install.rdf that you created at the top of your extension's directory hierarchy and paste the following text into the 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>myfirstext@jen.zed</em:id> <em:name>my first extension</em:name> <em:version>1.0</em:version> <em:creator>jenzed</em:creator> <em:targetapplication> <description> <em:id>{3550f7...
...f> the following items (shown in bold) should be customized for your application: <em:id>myfirstext@jen.zed</em:id>: this is the id of the extension. the first portion is the short name of the extension and must be in lowercase; the last portion is a two-part period-delimited value such as your first and last name or the top-level domain of your website. while this value is in email address
format, it is not an email address. it should, however, be a unique value so that it does not conflict with other extensions. <em:name>my first extension</em:name>: the extension name is displayed in the thunderbird add-on manager. <em:version>1.0</em:version>: this is the version number of your extension. it must be updated each time you release a new version of your extension. it is not the thund...
...of valid application ids can be found here. normally the id does not change and is always the same even for different versions of thunderbird. <em:minversion>1.5</em:minversion>: this element indicates the earliest version of thunderbird for which the extension is intended to work. do not use a wildcard (such as "*"). see valid application versions for a list of the supported version numbers and
formats. <em:maxversion>5.0.*</em:maxversion>: this element indicates the most recent version of thunderbird for which the extension is intended to work. this cannot be higher than the currently available version. "5.0.*" indicates that the extension works with thunderbird 5.0 and any subsequent 5.0.x releases. see valid application versions for a list of the supported version numbers and
formats. ...
Demo Addon
overview this demo add-on has been created by jonathan protzenko for his presentation at mozcamp 2011. it shows how to achieve various goals in a working live example, such as working with gloda. you can download it at the bottom of the page. how to use after installing the demo add-on in thunderbird, right click on the toolbar and choose "customize". drag the "demo" button into the toolbar. afterwards, just click that button to show the demo overview. ...
...re shown, it's recommended that you download the add-on and have a look at its files. the basics the interesting parts covered in this article are in the content folder. the toolbar button and its functionality are defined in overlay.xul and overlay.js. we make use of fixiterator(). it is a handy library that keeps your code cleaner and simpler. it lets you iterate over any collection and trans
forms your collection elements in the given objects, to use fixiterator, you have to import it with cu.import("resource:///modules/iteratorutils.jsm");. demo 1 - iterate over all the accounts this demo is implemented in demo1.html in the content folder. it lists all your email accounts with their account type - either pop3 or imap - and the associated email addresses. let data = []; for each (let a...
...ver name, we access the incomingserver property of our account, which is a nsimsgincomingserver object. 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. demo 2 - find the inbox this demo shows various in
formation: it lists all folders of an account (in this case the first one) and marks the inbox folder with a *. furthermore, it shows some messages in the inbox and lists a random attachment. we start with listing all folders and marking the inbox: let server = accounts[0].incomingserver; let folder = server.rootfolder; // ... let inbox; let print = function (indent, folder) { let isinbox = fold...
Standard OS Libraries
ith all installations of windows operating systems since win98. it's also known as winapi32 or just winapi. a list of all the functions available through this api can be found at the msdn winapi index. for finding out the values and types of arguments and returns of the functions you want to use from this api, you must visit the functions page on this linked msdn site; it will give you all that in
formation. example: getcursorpos i wanted to get the mouse cursor position without using a mousemove listener, as this is a high overhead event listener. so i went to the msdn winapi index page and then went to the "cursors" category and came across getcursorpos. i then searched it on msdn and saw that it needed the user32.dll. (msdn - getcursorpos) this example was created on windows xp sp2. it is...
... the gtk+ toolkit can also be used. the list of the exposed symbols/functions can be found here: gnome developer :: gtk+ reference manual. example: ... // placeholder - example soon to come x11 x11 runs primarily on unix® and unix-like operating systems like linux, all of the bsd variants, sun solaris both native 32 and 64 bit support, solaris x86, mac os x (via darwin) as well as other plat
forms like os/2 and cygwin. there are updates that happen to x11; at the time of this writing, the latest version is 4.4.0. in
formation on all releases can be found on its official page x11 resources. syntax and variable types are found on the documentation pages linked from this page. for example the documentation for v4.4.0 is seen here: x11 manual pages: section 3. example: xquerypointer get mous...
...documentation on this function is found at xfree86 :: xquerypointer(3x11) manual page. ...
Working with data
creating cdata objects data types for use with js-ctypes are represented by ctype objects. these are javascript constructors; as such, they're callable functions that you can use to create new cdata objects of that type. there are several ways you can go about creating new cdata objects. 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. note: if type.size is undefined, creating a new object this way will throw a typeerror exception. creating initialized cdata objects si...
...string and returns a new javascript string object representing that string. note: the source c string is assumed to be utf-8, and is assumed to be null terminated. if you need to convert a string that doesn't meet these requirements, you'll need to do it yourself. for example: var jsstring = timestr.readstring(); converting javascript strings to c happily, converting javascript strings to c
formatted strings is easy; just create a character array containing the javascript string: var myutf8string = ctypes.char.array()("original string."); this creates a utf-8
format null-terminated string in the character array named myutf8string. if you need a utf-16 string, you can do this: var myutf16string = ctypes.jschar.array()("original string."); note: at this time, there's no way to speci...
..., you can use this technique with both decimal and hexadecimal source strings. creating a 64-bit value using join() the join() method offered by the int64 and uint64 objects provides another way to construct 64-bit integers. it accepts as its input parameters the high and low 32-bit values and returns a new 64-bit integer. for example: var num = ctypes.int64.join(-0x12345678, 0x90abcdef); per
forming arithmetic with 64-bit values the int64 and uint64 objects don't provide any methods for per
forming arithmetic, which means you'll have to do it yourself by pulling out the high and low 32-bit portions and doing math on them, then joining them back together if necessary to get the complete result. you'll also have to handle carry from the low to high word and back as appropriate. for example...
Plug-in Side Plug-in API - Plugins
ug-in structure sections in the introduction. plugin method summary npp_destroy deletes a specific instance of a plug-in. npp_destroystream tells the plug-in that a stream is about to be closed or destroyed. np_getentrypoints undocumented. np_getmimedescription registers the mime types supported by the plug-in (unix, mac os). ...
... npp_destroy deletes a specific instance of a plug-in. npp_destroystream tells the plug-in that a stream is about to be closed or destroyed. np_getentrypoints undocumented. np_getmimedescription registers the mime types supported by the plug-in (unix, mac os). npp_getvalue allows the browser to query the plug-in for in
formation. np_getvalue allows the browser to query the plug-in for in
formation. ...
... a plug-in. npp_destroystream tells the plug-in that a stream is about to be closed or destroyed. np_getentrypoints undocumented. np_getmimedescription registers the mime types supported by the plug-in (unix, mac os). npp_getvalue allows the browser to query the plug-in for in
formation. np_getvalue allows the browser to query the plug-in for in
formation. npp_handleevent delivers a plat
form-specific window event to the instance. np_initialize provides global initialization for a plug-in. npp_new creates a new instance of a plug-in. npp_newstream notifies a plug-in instance of a new data stream. npp_print requests a plat
form-specific print operation for an embedded or full-screen plug-in. npp_setvalue sets in
formation about the plug-in. npp_setwindow tells the plug-in whe...
Preferences System
this document describes toolkit's preferences system. using this system it is possible to create preferences windows that display and operate appropriately on various plat
forms (windows, macos x and gnome). the system is implemented through a few xul elements and attributes. ...
... this document describes toolkit's preferences system. using this system it is possible to create preferences windows that display and operate appropriately on various plat
forms (windows, macos x and gnome). the system is implemented through a few xul elements and attributes. ...
... <checkbox id="check1" preference="pref1" label="&check1.label;" accesskey="&check1.accesskey;"/> </prefpane> <prefpane id="pane2" label="&pane2.title;" src="chrome://uri/to/pane.xul"/> </prefwindow> pane content can be specified inline or an external chrome uri supplied for pane content to be loaded in via a dynamic overlay. you should be careful to read the higs for the plat
forms you are targeting and use the xul preprocessor if necessary to set different window titles as appropriate. you should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted plat
form, as well as the height (in em) for plat
forms where the window size does not change as the selected panel is changed (e.g. windows). usage in xulrunner appli...
Debugging service workers - Firefox Developer Tools
web console giving you a hint as to what's wrong, which depends on what exactly is wrong with the code. if this is not enough to help you figure out the problem, you could also try going to the javascript debugger and stepping through your code to pinpoint exactly where it is going wrong. debugging your service worker in any case, when the service worker is successfully registered, you'll see in
formation about it displayed in the application > service workers view (along with any other service workers registered on the same domain): this gives you a variety of in
formation about your service worker: the url that the service worker is registered on. that last time the service worker was updated (if the service has not been updated, this is when it was first installed). the path to the ...
...kground, but not yet activated. it is only activated when there are no longer any pages loaded that are still using the old service worker. as soon as there are no more such pages still loaded, the new service worker activates. debug important: the debug button is currently enabled only in firefox nightly. when your service worker is running, a debug button is available next to the source in
formation (it is disabled when the service worker is stopped). when pressed, this takes you straight to the javascript debugger view of your service worker code, and you can use the full power of the debugger to debug it — stepping through code, etc. testing a service worker cache if you are using your service worker to store your site assets in cache storage (using the cache api), which is esse...
...mn. note: there is currently a bug whereby the network monitor cannot show network requests from a service worker running in a different process to the application (bug 1432311). finding registered service workers on other domains as mentioned above, the service worker view of the application panel shows all the service workers registered on the current domain. if you want to see a list of in
formation concerning all the service workers registered on your browser, you can visit about:debugging#/runtime/this-firefox. below the list of installed extensions you'll find a list of all the service workers you have registered. ...
Browser Console - Firefox Developer Tools
if you also want to use the other web developer tools in the regular web toolbox with add-on or browser code, consider using the browser toolbox. ...
... if you also want to use the other web developer tools in the regular web toolbox with add-on or browser code, consider using the browser toolbox. ...
... if you also want to use the other web developer tools in the regular web toolbox with add-on or browser code, consider using the browser toolbox. ...
Debugger.Memory - Firefox Developer Tools
must be either a function or undefined; otherwise a typeerror is thrown. handler functions run in the same thread in which the event occurred. they run in the compartment to which they belong, not in a debuggee compartment. ongarbagecollection(statistics) a garbage collection cycle spanning one or more debuggees has just been completed. the statistics parameter is an object containing in
formation about the gc cycle. it has the following properties: collections the collections property’s value is an array. because spidermonkey’s collector is incremental, a full collection cycle may consist of multiple discrete collection slices with the js mutator running interleaved. for each collection slice that occurred, there is an entry in the collections array with the following f...
... memory consumption. web developers need to know their pages’ actual memory consumption on real browsers, so it is correct for the tool to expose these behaviors, as long as it is done in a way that helps developers make decisions about their own code. this section covers some areas where firefox’s actual behavior deviates from what one might expect from the specified behavior of the web plat
form. objects spidermonkey objects usually use less memory than the naïve “table of properties with attributes” model would suggest. for example, it is typical for many objects to have identical sets of properties, with only the properties’ values varying from one object to the next. to take advantage of this regularity, spidermonkey objects with identical sets of properties may share their p...
...rmonkey includes several just-in-time compilers, each of which translates javascript source or bytecode to machine code. heuristics determine which code to compile, and which compiler to use. machine code may be dropped in response to memory pressure, and regenerated as needed. furthermore, spidermonkey tracks which types of values have appeared in variables and object properties. this type in
formation can be large. in a census, all the various
forms of javascript code are placed in the "script" category. type in
formation is accounted to the "types" category. source metadata generated from file: js/src/doc/debugger/debugger.memory.md watermark: sha256:2c1529d6932efec8c624a6f1f366b09cb7fce625a6468657fab81788240bc7ae changeset: e91b2c85aacd ...
Debugger - Firefox Developer Tools
this is an accessor property with a getter and setter. it is initially false in a freshly created debugger instance. setting this flag to true is intended for uses of subsystems of the debugger api (e.g, debugger.source) for purposes other than step debugging a target javascript program. allowwasmbinarysource a boolean value indicating whether webassembly sources will be available in binary
form. the webassembly text generation will be disabled. collectcoverageinfo a boolean value indicating whether code coverage should be enabled inside each debuggee of this debugger instance. changing this flag value will recompile all jit code to add or remove code coverage instrumentation. changing this flag when any frame of the debuggee is currently active on the stack will produce an exception...
...ce. changing this flag value will recompile all jit code to add or remove code coverage instrumentation. changing this flag when any frame of the debuggee is currently active on the stack will produce an exception. setting this to true enables code coverage instrumentation, which can be accessed via the debugger.script getoffsetscoverage function. in some cases, the code coverage might expose in
formation which pre-date the modification of this flag. code coverage reports are monotone, thus one can take a snapshot when the debugger is enabled, and output the difference. setting this to false prevents this debugger instance from requiring any code coverage instrumentation, but it does not guarantee that the instrumentation is not present. uncaughtexceptionhook either null or a function...
...n over-recursion or out-of-memory exception. sourcehandler(asuffusionofyellow) this method is never called. if it is ever called, a contradiction has been proven, and the debugger is free to assume that everything is true. onerror(frame,report) spidermonkey is about to report an error inframe.report is an object describing the error, with the following properties: message the fully
formatted error message. file if present, the source file name, url, etc. (if this property is present, theline property will be too, and vice versa.) line if present, the source line number at which the error occurred. linetext if present, this is the source code of the offending line. offset the index of the character within linetext at which the error occurred. warning present a...
Network Monitor - Firefox Developer Tools
l + shift + e ( command + option + e on a mac). select "network" from the web developer menu, (which is a submenu of the tools menu on os x and linux). click the wrench icon (), which is in the main toolbar or under the hamburger menu (), then select "network". the network monitor will appear at the bottom of the browser window. when it first opens, the network monitor does not show request in
formation. the just opened tool looks like this: either action causes the network monitor to begin monitoring network activity. once the tool is monitoring network requests, the display looks like this: when it is actively monitoring activity, the network monitor records network requests any time the toolbox is open, even if the network monitor itself is not selected. this means you can start de...
...pen, even if the network monitor itself is not selected. this means you can start debugging a page in, for example, the web console, then switch to the network monitor to see network activity without having to reload the page. ...
...s divided into four main pieces: the main screen contains the toolbar, the network request list, and the network request details pane: the per
formance analysis view is a separate screen: working with the network monitor the following articles cover different aspects of using the network monitor: toolbar network request list network request details network traffic recording per
formance analysis throttling ...
UI Tour - Firefox Developer Tools
note that if you do this, you lose any recordings you have not saved. filter the markers that are displayed in the waterfall view switch the active tool in the details pane. access the settings popup recordings pane the recordings pane lists all the recordings you have loaded, including any you have made in this session and any you have imported. ...
...hat drop in the frame rate, and can see the long-running paint operation in more detail: details pane the details pane shows whichever tool is currently selected. to switch to a different tool, use the buttons in the toolbar. waterfall the waterfall presents a view of the work the browser is doing during the recording: executing javascript, updating the css, updating the page layout, and per
forming repaints. the x-axis represents time, and the recorded operations are laid out as a waterfall, reflecting the serial nature of the browser's execution. to learn much more about the waterfall, see the separate waterfall page. call tree the call tree is a sampling profiler for javascript running in the page. it periodically samples the state of the javascript engine, and records the stack f...
...: to learn much more about the flame chart, see the separate flame chart page. allocations the allocations view is new in firefox 46. the allocations view is like the call tree view, but for allocations: it shows you which functions in your page are allocating the most memory over the course of the profile. the allocations view only appears if you checked "record allocations" in the per
formance tool settings, before recording a profile: to learn much more about the allocations view, see the separate allocations page. ...
Responsive Design Mode - Firefox Developer Tools
m the keyboard: press ctrl + shift + m (or cmd + opt + m on macos). controlling responsive design mode with responsive design mode enabled, the content area for web pages is set to the screen size for a mobile device. initially, it's set to 320 x 480 pixels. note: the device you select when in responsive design mode and the orientation (portrait or landscape) is saved between sessions. in
formation for the selected device is centered over the display. from left to right, the display includes: name of the selected device - a drop-down list that includes whatever devices you have selected from the device settings screen. screen size - you can edit the width and height values to change the device size by editing a number directly or using the up and down keys to increase or decrease t...
...you are not interested in examining such features (maybe you are just checking the overall layout at different sizes), these reloads can waste time and possibly result in the loss of productive work, so it is useful to be able to control these reloads. now when you change such settings for the first time, you are given a warning message that tells you these reloads are no longer automatic, and in
formed about how you can make them automatic. for example: developer toolbox with rdm you can show or hide the developer tools toolbox independently of toggling responsive design mode itself: while responsive design mode is enabled, you can continue browsing as you normally would in the resized content area. device selection just above the viewport there is a label "no device selected"; click t...
... site if they are using a slower connection. 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 per
formance measurements; it's intended to give an approximate idea of the user experience in different conditions. selection download speed upload speed minimum latency (ms) gprs 50 kb/s 20 kb/s 500 regular 2g 250 kb/s 50 kb/s 300 good 2g 450 kb/s 150 kb/s 150 regular 3g 750 kb/s 250 kb/s 100 good 3g ...
Web Console Helpers - Firefox Developer Tools
tually, in a delightful example of recursion, it brings you to this page. inspect() given an object, generates rich output for that object. once you select the object in the output area, you can use the arrow keys to navigate the object. keys() given an object, returns a list of the keys (or property names) on that object. this is a shortcut for object.keys. ...
... a list of the keys (or property names) on that object. this is a shortcut for object.keys. pprint() obsolete since gecko 74
formats the specified value in a readable way; this is useful for dumping the contents of objects and arrays. :screenshot creates a screenshot of the current page with the supplied filename. if you don't supply a filename, the image file will be named with the following
format: screen shot yyy-mm-dd at hh.mm.ss.png 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. --delay number the number of seconds to delay before taking the screenshot. --dpr number ...
... (starting in firefox 80) followed by an unquoted string, removes blocking for urls containing that string. in the network monitor, the string is removed from the request blocking sidebar. no error is given if the string was not previously blocked. values() given an object, returns a list of the values on that object; serves as a companion to keys(). please refer to the console api for more in
formation about logging from content. variables tempn the "use in console" option in the inspector generates a variable for a node named temp0, temp1, temp2, etc. referencing the node. examples looking at the contents of a dom node let's say you have a dom node with the id "title". in fact, this page you're reading right now has one, so you can open up the web console and try this right now. ...
Web Console remoting - Firefox Developer Tools
n0.console9", "type": "evaluatejs", "text": "document", "bindobjectactor": null, "frameactor": null, "url": null, "selectednodeactor": null, } the bindobjectactor property is an optional objectactor id that points to a debugger.object. this option allows you to bind _self to the debugger.object of the given object actor, during string evaluation. see evalinglobalwithbindings() for in
formation about bindings. the variable view needs to update objects and it does so by binding _self to the debugger.object of the objectactor that is being viewed. as such, variable view sends strings like these for evaluation: _self["prop"] = value; the frameactor property is an optional frameactor id. the fa holds a reference to a debugger.frame. this option allows you to evaluate the string...
...for each request a new networkeventactor instance is created. the isxhr flag indicates if the request was initiated via an xmlhttprequest instance, that is: the nsihttpchannel's notification is of an nsixmlhttprequest interface. the private flag tells if the network request comes from a private window/tab (added in firefox 24). the networkeventactor the ...
...w networkeventactor instance is created. the isxhr flag indicates if the request was initiated via an xmlhttprequest instance, that is: the nsihttpchannel's notification is of an nsixmlhttprequest interface. the private flag tells if the network request comes from a private window/tab (added in firefox 24). the networkeventactor the new network event actor stores further request and response in
formation. the networkeventupdate packet the web console ui needs to be kept up-to-date when changes happen, when new stuff is added. the new networkeventupdate packet is sent for this purpose. examples: { "from": "conn0.netevent14", "type": "networkeventupdate", "updatetype": "requestheaders", "headers": 10, "headerssize": 425 }, { "from": "conn0.netevent14", "type": "networkeventupd...
Firefox Developer Tools
if you have any feedback on devtools, or want to contribute to the project, you can join the devtools community. ...
...he web and what are browser developer tools? for good starting points. the core tools you can open the firefox developer tools from the menu by selecting tools > web developer > toggle tools or use the keyboard shortcut ctrl + shift + i or f12 on windows and linux, or cmd + opt + i on macos. the ellipsis menu on the right-hand side of developer tools contains several commands that let you per
form actions or change tool settings. this button only appears when there are multiple iframes on a page. click it to display a list of the iframes on the current page and select the one with which you want to work. click this button to take a screenshot of the current page. (note: this feature is not turned on by default and must be enabled in settings before the icon wil...
...it page content and layout. visualise many aspects of the page including the box model, animations, and grid layouts. web console see messages logged by a web page and interact with the page using javascript. javascript debugger stop, step through, examine, and modify the javascript running in a page. network monitor see the network requests made when a page is loaded. per
formance tools analyze your site's general responsiveness, javascript, and layout per
formance. responsive design mode see how your website or app will look and behave on different devices and network types. accessibility inspector provides a means to access the page's accessibility tree, allowing you to check what's missing or otherwise needs attention. application panel provide...
AbstractRange - Web APIs
tcontainer. methods the abstractrange interface offers no methods. usage notes range types all ranges of content within a document are described using instances of interfaces based on abstractrange. there are two such interfaces: range the range interface has been around for a long time and has only recently been redefined to be based upon abstractrange as the need arose to define other
forms of range data. range provides methods that allow you to alter the range's endpoints, as well as methods to compare ranges, detect intersections beween ranges, and so forth. staticrange a staticrange is a basic range which cannot be changed once it's been created. specifically, as the node tree mutates and changes, the range does not. this is useful when you need to specify a range that will on...
...that allow you to alter the range's endpoints, as well as methods to compare ranges, detect intersections beween ranges, and so forth. staticrange a staticrange is a basic range which cannot be changed once it's been created. specifically, as the node tree mutates and changes, the range does not. this is useful when you need to specify a range that will only be used once, since it avoids the per
formance and resource impact of the more complex range interface. contents of elements when trying to access the contents of an element, keep in mind that the element itself is a node, but so is any text inside it. in order to set a range endpoint within the text of an element, be sure to find the text node inside the element: let startelem = document.queryselector("p"); let endelem = startelem.qu...
...content even as nodes are added to, removed from, or moved around within the dom tree—within reason. there are fairly obvious limitations (such as if a node is moved to be after the endpoint of a range, or if the content of a node is heavily altered), but it's far better than nothing. third, using node-relative positions to define the start and end positions will generally be easier to make per
form well. rather than having to negotiate the dom figuring out what your global offset refers to, the user agent (browser) can instead go directly to the node indicated by the starting position and start from there, working its way forward until it reaches the given offset into the ending node. to illustrate this, consider the html below: <div class="container"> <div class="header"> <img src=...
AddressErrors - Web APIs
dling address changes for a description of how this code works. complete example here we'll see a complete, working version of the example above (except of course that it's not connected to an actual payment handler, so no payments are actually processed). in the example, we're handling a donation to an organization that will be sending a "thank you" gift to the donor, so it requests shipping in
formation along with allowing the donation payment itself. javascript payment request data first, we declare the variables supportedhandlers, which is compatible with paymentmethoddata, and defaultpaymentdetails, which is a paymentdetailsupdate object. let supportedhandlers = [ { supportedmethods: "basic-card", data: { supportednetworks: ["visa", "mastercard", "amex", "discover"], ...
... // do something with the error from request.show(). console.error(`error from show(): ${err}`); }); } catch (e) { // catch any errors from trying to create the paymentrequest object. } } this code creates a new paymentrequest, providing the supported handlers and payment options we set up above, as well as additional options (in this case, that we want to ask for shipping in
formation). after that, we set up the handler for the shippingaddresschange event so we can validate address in
formation and call the request's show() method to start running the payment ui. handling address changes the handleaddresschange() method, called when shippingaddresschange events occur, is where we'll look to see if the country is one of those we allow as shipping destinations. function ...
...he address. setting up the donate now button this code creates a handler for the load event on the window which in turn adds the needed click event handler to the "donate now" button so that clicking it starts the payment process. window.addeventlistener("load", function(ev) { document.getelementbyid("pay").addeventlistener("click", process, false); }, false); see addeventlistener() for in
formation about event handlers and how they work. html here's the simple html for this example. <p>donate us $65 to our worthwhile cause and we will send you a totally not-useless gift as a token of our thanks!</p> <button id="pay">donate now</button> result the final product is below. note: if you have content blocking features enabled in your browser, the example may not work inline below. in...
AudioNodeOptions - Web APIs
or example analysernode.analysernode or gainnode.gainnode. syntax var audionodeoptions = { "channelcount" : 2, "channelcountmode" : "max", "channelinterpretation" : "discrete" } properties channelcount optional represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any inputs to the node. ...
...ed when up-mixing and down-mixing connections to any inputs to the node. (see audionode.channelcount for more in
formation.) its usage and precise definition depend on the value of audionodeoptions.channelcountmode. channelcountmode optional represents an enumerated value describing the way channels must be matched between the node's inputs and outputs. (see audionode.channelcountmode for more in
formation including default values.) channelinterpretation optional represents an enumerated value describing the meaning of the channels. this interpretation will define how audio up-mixing and down-mixing will happen. the possible values are "speakers" or "discrete". ...
...d between the node's inputs and outputs. (see audionode.channelcountmode for more in
formation including default values.) channelinterpretation optional represents an enumerated value describing the meaning of the channels. this interpretation will define how audio up-mixing and down-mixing will happen. the possible values are "speakers" or "discrete". (see audionode.channelcountmode for more in
formation including default values.) specifications specification status comment web audio apithe definition of 'audionodeoptions' in that specification. working draft initial definition. ...
BaseAudioContext.createPeriodicWave() - Web APIs
syntax var wave = audiocontext.createperiodicwave(real, imag[, constraints]); returns a periodicwave. parameters real an array of cosine terms (traditionally the a terms). imag an array of sine terms (traditionally the b terms). the real and imag arrays have to have the same length, otherwise an error is thrown. ...
...ins only a fundamental tone is by definition a sine wave here, we create a periodicwave with two values. the first value is the dc offset, which is the value at which the oscillator starts. 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range. the second and subsequent values are sine and cosine components. ...
...the value at which the oscillator starts. 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range. the second and subsequent values are sine and cosine components. you can think of it as the result of a fourier trans
form, where you get frequency domain values from time domain value. here, with createperiodicwave(), you specify the frequencies, and the browser per
forms an inverse fourier trans
form to get a time domain buffer for the frequency of the oscillator. here, we only set one component at full volume (1.0) on the fundamental tone, so we get a sine wave. the coefficients of the fourier trans
form should be given in ascending order (i.e. (a+bi)ei,(c+di)e2i,(f+gi)e3i\left(a+bi\right)e^{i} , \left(c+di\right)e^{2i} , \left(f+gi\right)e^{3i} etc.) and can ...
BasicCardRequest - Web APIs
. basiccardrequest.supportedtypes optional secure context this obsolete property was used to provide an optional array of domstrings representing the card types that the retailer supports (e.g. credit, debit, prepaid). if the property is missing, it implies that all the card types are supported. instead of using this property, it is up to the server to check support for the card given the in
formation coded into the account number. card network identifiers the w3c maintains an official list of approved card network identifier strings, which may be used in the supportednetworks list. those are: amex cartebancaire diners discover jcb mastercard mir unionpay visa examples in the following example, the paymentrequest() constructor is used to create a new payment request, wh...
...rameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object that describes what data is needed to fullfil the payment (e.g., a shipping address). the first of these three (supportedinstruments in the example below) contains a data property that has to con
form to the structure defined by the basiccardrequest dictionary. var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'] } }]; var details = { total: {label: 'donation', amount: {currency: 'usd', value: '65.00'}}, displayitems: [ { label: '...
.../ do something with the error from request.show(). }); } catch (e) { // catch any other errors. } once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details. this has to con
form to the structure defined by the basiccardresponse dictionary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'mr dick straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification ...
BeforeInstallPromptEvent - Web APIs
font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">beforeinstallpromptevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor beforeinstallpromptevent() creates a new beforeinstallpromptevent. properties inherits properties from its parent, event. beforeinstallpromptevent.plat
forms read only returns an array of domstring items containing the plat
forms on which the event was dispatched. this is provided for user agents that want to present a choice of versions to the user such as, for example, "web" or "play" which would allow the user to chose between a web version or an android version. beforeinstallpromptevent.userchoice read only returns a promise that resolves to ...
... version. beforeinstallpromptevent.userchoice read only returns a promise that resolves to a domstring containing either "accepted" or "dismissed". ...
...a promise that resolves to a domstring containing either "accepted" or "dismissed". methods beforeinstallpromptevent.prompt() allows a developer to show the install prompt at a time of their own choosing. this method returns a promise. ...
characteristic - Web APIs
ternetcharacteristic experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ...
...notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). full support ≤79notes notes windows 10.firefox no support noie no support noopera full support 44notes full support 44not...
...rt noopera full support 44notes full support 44notes notes macos only. full support 44notes disabled notes linux and versions of windows earlier than 10.disabled from version 44: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). full support 57notes notes windows 10.safari no support nowebview android no support nochrome android full support 57firefox android no support ...
readValue() - Web APIs
ng internetreadvalue experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ...
...notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). full support ≤79notes notes windows 10.firefox no support noie no support noopera full support 44notes full support 44not...
...rt noopera full support 44notes full support 44notes notes macos only. full support 44notes disabled notes linux and versions of windows earlier than 10.disabled from version 44: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). full support 57notes notes windows 10.safari no support nowebview android no support nochrome android full support 57firefox android no support ...
uuid - Web APIs
samsung internetuuid experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ...
...notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). full support ≤79notes notes windows 10.firefox no support noie no support noopera full support 44notes full support 44not...
...rt noopera full support 44notes full support 44notes notes macos only. full support 44notes disabled notes linux and versions of windows earlier than 10.disabled from version 44: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). full support 57notes notes windows 10.safari no support nowebview android no support nochrome android full support 57firefox android no support ...
value - Web APIs
amsung internetvalue experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ...
...notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). full support ≤79notes notes windows 10.firefox no support noie no support noopera full support 44notes full support 44not...
...rt noopera full support 44notes full support 44notes notes macos only. full support 44notes disabled notes linux and versions of windows earlier than 10.disabled from version 44: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). full support 57notes notes windows 10.safari no support nowebview android no support nochrome android full support 57firefox android no support ...
writeValue() - Web APIs
g internetwritevalue experimentalchrome full support 57notes full support 57notes notes macos only. full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags. full support 70notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ...
...notes notes windows 10.edge full support ≤79notes full support ≤79notes notes macos only. full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). full support ≤79notes notes windows 10.firefox no support noie no support noopera full support 44notes full support 44not...
...rt noopera full support 44notes full support 44notes notes macos only. full support 44notes disabled notes linux and versions of windows earlier than 10.disabled from version 44: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). full support 57notes notes windows 10.safari no support nowebview android no support nochrome android full support 57firefox android no support ...
CanvasRenderingContext2D.rotate() - Web APIs
the canvasrenderingcontext2d.rotate() method of the canvas 2d api adds a rotation to the trans
formation matrix. syntax void ctx.rotate(angle); parameters angle the rotation angle, clockwise in radians. you can use degree * math.pi / 180 to calculate a radian from a degree. the rotation center point is always the canvas origin. to change the center point, you will need to move the canvas by using the translate() method. examples rotating a shape this example rotates a rectangle by 45°. note that the center of rotation is the top-left corner of the canvas, and not a location relative to any shape. ...
...ll need to move the canvas by using the translate() method. examples rotating a shape this example rotates a rectangle by 45°. note that the center of rotation is the top-left corner of the canvas, and not a location relative to any shape. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // point of trans
form origin ctx.arc(0, 0, 5, 0, 2 * math.pi); ctx.fillstyle = 'blue'; ctx.fill(); // non-rotated rectangle ctx.fillstyle = 'gray'; ctx.fillrect(100, 0, 80, 20); // rotated rectangle ctx.rotate(45 * math.pi / 180); ctx.fillstyle = 'red'; ctx.fillrect(100, 0, 80, 20); // reset trans
formation matrix to the identity matrix ctx.settrans
form(1, 0, 0, 1, 0, 0); result the center of rotation is blue. th...
...s a rectangle with its corner at (80, 60), a width of 140, a height of 30. its horizontal center is at (80 + 140 / 2), or 150. its vertical center is at (60 + 30 / 2), or 75. thus, the center point is at (150, 75). const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // non-rotated rectangle ctx.fillstyle = 'gray'; ctx.fillrect(80, 60, 140, 30); // matrix trans
formation ctx.translate(150, 75); ctx.rotate(math.pi / 2); ctx.translate(-150, -75); // rotated rectangle ctx.fillstyle = 'red'; ctx.fillrect(80, 60, 140, 30); result the non-rotated rectangle is gray, and the rotated rectangle is red. specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.rotate' in that specificatio...
Pixel manipulation with canvas - Web APIs
the height of the image in pixels. data a uint8clampedarray representing a one-dimensional array containing the data in the rgba order, with integer values between 0 and 255 (included). the data property returns a uint8clampedarray which can be accessed to look at the raw pixel data; each pixel is represented by four one-byte values (red, green, blue, and alpha, in that order; that is, "rgba"
format). each color component is represented by an integer between 0 and 255. each component is assigned a consecutive index within the array, with the top left pixel's red component being at index 0 within the array. pixels then proceed from left to right, then downward, throughout the array. the uint8clampedarray contains height × width × 4 bytes of data, with index values ranging from 0 to (heig...
...edata(myimagedata, 0, 0); grayscaling and inverting colors in this example we iterate over all pixels to change their values, then we put the modified pixel array back to the canvas using putimagedata(). the invert function simply subtracts each color from the max value 255. the grayscale function simply uses the average of red, green and blue. you can also use a weighted average, given by the
formula x = 0.299r + 0.587g + 0.114b, for example. see grayscale on wikipedia for more in
formation. <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() { dra...
...h - 10), math.min(math.max(0, y - 5), img.height - 10), 10, 10, 0, 0, 200, 200); }; canvas.addeventlistener('mousemove', zoom); } saving images the htmlcanvaselement provides a todataurl() method, which is useful when saving images. it returns a data uri containing a representation of the image in the
format specified by the type parameter (defaults to png). the returned image is in a resolution of 96 dpi. note: be aware that if the canvas contains any pixels that were obtained from another origin without using cors, the canvas is tainted and its contents can no longer be read and saved. see security and tainted canvases in allowing cross-origin use of images and canvas canvas.todataurl('image/...
Using images - Web APIs
« previousnext » until now we have created our own shapes and applied styles to them. one of the more exciting features of <canvas> is the ability to use images. these can be used to do dynamic photo compositing or as backdrops of graphs, for sprites in games, and so forth. external images can be used in any
format supported by the browser, such as png, gif, or jpeg. you can even use the image produced by other canvas elements on the same page as the source! importing images into a canvas is basically a two step process: get a reference to an htmlimageelement object or to another canvas element as a source. it is also possible to use images by providing a url. draw the image on the canvas using the drawimage() function. let's take a look at how to do this. getting...
...('myvideo'); } } this returns the htmlvideoelement object for the video, which, as covered earlier, is one of the objects that can be used as a canvasimagesource. drawing images once we have a reference to our source image object we can use the drawimage() method to render it to the canvas. as we will see later the drawimage() method is overloaded and has several variants. in its most basic
form it looks like this: drawimage(image, x, y) draws the canvasimagesource specified by the image parameter at the coordinates (x, y). svg images must specify a width and height in the root <svg> element. example: a simple line graph in the following example, we will use an external image as the backdrop for a small line graph. using backdrops can make your script considerably smaller becau...
...could have all elements in a single image file and use this method to composite a complete drawing. for instance, if you want to make a chart you could have a png image containing all the necessary text in a single file and depending on your data could change the scale of your chart fairly easily. another advantage is that you don't need to load every image individually, which can improve load per
formance. example: framing an image in this example, we'll use the same rhino as in the previous example, but we'll slice out its head and composite it into a picture frame. the picture frame image is a 24-bit png which includes a drop shadow. because 24-bit png images include a full 8-bit alpha channel, unlike gif and 8-bit png images, it can be placed onto any background without worrying about a m...
Using channel messaging - Web APIs
choices from the audio player onto the game? such things are not so easy using conventional web technology, because of the security models the web uses. you have to think about whether the origins trust one another, and how the messages are passed. message channels on the other hand can provide a secure channel that allows you to pass data between different browsing contexts. note: for more in
formation and ideas, the ports as the basis of an object-capability model on the web section of the spec is a useful read. simple examples to get your started, we have published a couple of demos on github. first up, check out our channel messaging basic demo (run it live too), which shows a really simple single message transfer between a page and an embedded <iframe>. secondly, have a look at our...
...y simple single message transfer between a page and an embedded <iframe>. secondly, have a look at our multimessaging demo (run this live), which shows a slightly more complex setup that can send multiple messages between the main page and an iframe. we'll be focusing on the latter example in this article. it looks like so: creating the channel in the main page of the demo, we have a simple
form with a text input for entering messages to be sent to an <iframe>. we also have a paragraph which we will use later on to display confirmation messages that we will receive back from the <iframe>. var input = document.getelementbyid('message-input'); var output = document.getelementbyid('message-output'); var button = document.queryselector('button'); var iframe = document.queryselector('iframe'...
...ing this message could be an empty string but in this example it is set to 'init'. the origin the message is to be sent to. * means "any origin". an object, the ownership of which is transferred to the receiving browsing context. in this case, we are transferring messagechannel.port2 to the iframe, so it can be used to communicate with the main page. when our button is clicked, we prevent the
form from submitting as normal and then send the value entered in our text input to the iframe via the messagechannel. receiving the port and message in the iframe over in the iframe, we have the following javascript: var list = document.queryselector('ul'); var port2; // listen for the initial port transfer message window.addeventlistener('message', initport); // setup the transferred port funct...
Credential Management API - Web APIs
eve user, federated, and public key credentials. these capabilities allow users to sign in without typing passwords, see the federated account they used to sign in to a site, and resume a session without the explicit sign-in flow of an expired session. credential management concepts and usage this api lets websites interact with a user agent’s password system so that websites can deal in a uni
form way with site credentials and user agents can provide better assistance with the management of their credentials. for example, user agents have a particularly hard time dealing with federated identity providers or esoteric sign-in mechanisms that use more than just a username and password. to address these problems, the credential management api provides ways for a website to store and retrieve d...
...in to www.example.com. to take advantage of this, a password must be explicitly stored by calling credentialscontainer.store(). this is sometimes referred to as public suffix list (psl) matching; however the spec only recommends using psl to determine the effective scope of a credential. it does not require it. hence browsers may vary in their implementation. ...
...ence browsers may vary in their implementation. interfaces credential provides in
formation about an entity as a prerequisite to a trust decision. credentialscontainer exposes methods to request credentials and notify the user agent when interesting events occur such as successful sign in or sign out. this interfaces is accessible from navigator.credentials. federatedcredential provides in
formation about credentials from a federated identity provider, which is an entity that a website trusts to correctly authenticate a user, and which provides an api for that purpose. openid connect is an example of such a framework. passwordcredential provides in
formation about a username/password pair. publickeycredential provides a credential for logging in using an un-phishable and data-breach ...
DOMPoint - Web APIs
int.w the perspective value of the dompoint. examples in the webxr device api, dompointreadonly values are used to represent positions and orientations. ...
...etrieved by calling using xrframe.getviewerpose() during an xrsession animation frame, then accessing the resulting xrpose's trans
form property, which contains two dompointreadonly attributes: position as a vector and orientation as a quaternion. ...
...ing an xrsession animation frame, then accessing the resulting xrpose's trans
form property, which contains two dompointreadonly attributes: position as a vector and orientation as a quaternion. ...
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. this method does not remove files from the drag operation, so it's possible for there still to be an entry with the type "files" left in the object's datatransfer.types list if there are any files included in the drag. this method can only be used in the handler for the dragstart event, because that's the only time the drag operation's data store is writeable. syntax datatransfer.cleardata([
format]); parameters
format optional a string which specifies the type of data to remove. if this parameter is an em...
..., drophandler); function dragstarthandler (event) { status.innerhtml = 'drag in process'; // change target element's border to signify drag has started event.currenttarget.style.border = '1px dashed blue'; // start by clearing existing clipboards; this will affect all types since we // don't give a specific type. ...
... function dragoverhandler (event) { status.innerhtml = 'drop available'; event.preventdefault(); } function dragleavehandler (event) { status.innerhtml = 'drag in process (drop was available)'; event.preventdefault(); } function drophandler (event) { dropped = true; status.innerhtml = 'drop done'; event.preventdefault(); // get data linked to event
format « text » var _data = event.datatransfer.getdata('text/plain'); var element = document.getelementbyid(_data); // append drag source element to event's target element event.target.appendchild(element); // change css styles and displayed text element.style.csstext = 'border: 1px solid black;display: block; color: red'; element.innerhtml = "i'm in the drop zone!"; ...
DataTransfer.setData() - Web APIs
oes 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. that is, the order of the types list is not changed when replacing data of the same type. example data types are text/plain and text/uri-list. syntax void datatransfer.setdata(
format, data); arguments
format a domstring representing the type of the drag data to add to the drag object. data a domstring representing the data to add to the drag object. return value void example this example shows the use of the datatransfer object's getdata(), setdata() and cleardata() methods. <!doctype html> <html lang=en> <title>examples of datatransfer's setdata(), getdata...
...use the event target's id for the data ev.datatransfer.setdata("text/plain", ev.target.id); } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); // get the data, which is the id of the drop target var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getele...
...datatransfer.setdata("text/plain", ev.target.id); } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); // get the data, which is the id of the drop target var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); // clear the drag data cache (for all
formats/types) ev.datatransfer.cleardata(); } </script> <body> <h1>examples of <code>datatransfer</code>: <code>setdata()</code>, <code>getdata()</code>, <code>cleardata()</code></h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ond...
Document.cookie - Web APIs
e above allcookies is a string containing a semicolon-separated list of all cookies (i.e. key=value pairs). note that each key and value may be surrounded by whitespace (space and tab characters): in fact, rfc 6265 mandates a single space after each semicolon, but some user agents may not abide by this. write a new cookie document.cookie = newcookie; in the code above, newcookie is a string of
form key=value. note that you can only set/update a single cookie at a time using this method. consider also that: any of the following cookie attribute values can optionally follow the key-value pair, specifying the cookie to set/update, and preceded by a semi-colon separator: ;path=path (e.g., '/', '/mydir') if not specified, defaults to the current path of the current document locatio...
...ing dots in domain names are ignored, but browsers may decline to set the cookie containing such dots. if a domain is specified, subdomains are always included. note: the domain must match the domain of the javascript origin. setting cookies to foreign domains will be silently ignored. ;max-age=max-age-in-seconds (e.g., 60*60*24*365 or 31536000 for a year) ;expires=date-in-gmtstring-
format if neither expires nor max-age specified it will expire at the end of session. when user privacy is a concern, it's important that any web app implementation invalidate cookie data after a certain timeout instead of relying on the browser to do it. many browsers let users specify that cookies should never expire, which is not necessarily safe. see date.toutcstring() for...
...neither expires nor max-age specified it will expire at the end of session. when user privacy is a concern, it's important that any web app implementation invalidate cookie data after a certain timeout instead of relying on the browser to do it. many browsers let users specify that cookies should never expire, which is not necessarily safe. see date.toutcstring() for help
formatting this value. ;secure cookie to only be transmitted over secure protocol as https. before chrome 52, this flag could appear with cookies from http domains. ;samesite samesite prevents the browser from sending this cookie along with cross-site requests. possible values are lax, strict or none. the lax value value will send the cookie for all same-site requests and top-...
Document.querySelectorAll() - Web APIs
. note: this method is implemented based on the parentnode mixin's queryselectorall() method. syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. ...
... return value a non-live nodelist containing one element object for each element that matches at least one of the specified selectors or an empty nodelist in case of no matches. note: if the specified selectors include a css pseudo-element, the returned list is always empty. exceptions syntaxerror the syntax of the specified selectors string is not valid. ...
...by default, queryselectorall() only verifies that the last element in the selector is within the search scope. the :scope pseudo-class restores the expected behavior, only matching selectors on descendants of the base element: var select = document.queryselector('.select'); var inner = select.queryselectorall(':scope .outer .inner'); inner.length; // 0 specifications sp...
DocumentOrShadowRoot.activeElement - Web APIs
onend properties. other times the focused element might be a <select> element (menu) or an <input> element, of type "button", "checkbox", or "radio". typically a user can press the tab key to move the focus around the page among focusable elements, and use the space bar to activate one (that is, to press a button or toggle a radio button). which elements are focusable varies depending on the plat
form and the browser's current configuration. for example, on macos systems, elements that aren't text input elements are not typically focusable by default. note: focus (which element is receiving user input events) is not the same thing as selection (the currently highlighted part of the document). you can get the current selection using window.getselection(). syntax element = documentorshadowr...
...ceiving user input events) is not the same thing as selection (the currently highlighted part of the document). you can get the current selection using window.getselection(). syntax element = documentorshadowroot.activeelement value the element which currently has focus, <body> or null if there is no focused element. example html <p>select some text from one of the text areas below:</p> <
form> <textarea name="ta-example-one" id="ta-example-one" rows="7" cols="40">this is text area one. lorem ipsum dolor sit amet, consectetur adipiscing elit. donec tincidunt, lorem a porttitor molestie, odio nibh iaculis libero, et accumsan nunc orci eu dui.</textarea> <textarea name="ta-example-two" id="ta-example-two" rows="7" cols="40">this is text area two. fusce ullamcorper, nisl ac porttitor ...
...lor sit amet, consectetur adipiscing elit. donec tincidunt, lorem a porttitor molestie, odio nibh iaculis libero, et accumsan nunc orci eu dui.</textarea> <textarea name="ta-example-two" id="ta-example-two" rows="7" cols="40">this is text area two. fusce ullamcorper, nisl ac porttitor adipiscing, urna orci egestas libero, ut accumsan orci lacus laoreet diam. ...
Examples of web and XML development using the DOM - Web APIs
html> example 2: image attributes <!doctype html> <html lang="en"> <head> <title>modifying an image border</title> <script> function setborderwidth(width) { document.getelementbyid("img1").style.borderwidth = width + "px"; } </script> </head> <body> <p> <img id="img1" src="image1.gif" style="border: 5px solid green;" width="100" height="100" alt="border test"> </p> <
form name="
formname"> <input type="button" value="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 cs...
...e stylesheets and their rules to change styles for whole documents. <!doctype html> <html lang="en"> <head> <title>changing color and font-size example</title> <script> function changetext() { var p = document.getelementbyid("pid"); p.style.color = "blue" p.style.fontsize = "18pt" } </script> </head> <body> <p id="pid" onclick="window.location.href = 'http://www.cnn.com/';">linker</p> <
form> <p><input value="rec" type="button" onclick="changetext();" /></p> </
form> </body> </html> example 4: using stylesheets the stylesheets property on the document object returns a list of the stylesheets that have been loaded on that document. you can access these stylesheets and their rules individually using the stylesheet, style, and cssrule objects, as demonstrated in this example, which...
...alue = w_style; var txtbackgroundcolor = document.getelementbyid("t3"); var b_style = document.defaultview.getcomputedstyle(refdiv, null).getpropertyvalue("background-color"); txtbackgroundcolor.value = b_style; } </script> <style> #d1 { margin-left: 10px; background-color: rgb(173, 216, 230); height: 20px; max-width: 20px; } </style> </head> <body> <div id="d1"> </div> <
form action=""> <p> <button type="button" onclick="cstyles();">getcomputedstyle</button> height<input id="t1" type="text" value="1" /> max-width<input id="t2" type="text" value="2" /> bg-color<input id="t3" type="text" value="3" /> </p> </
form> </body> </html> example 7: displaying event object properties this example uses dom methods to display all the properties of the window...
Using the W3C DOM Level 1 Core - Web APIs
// the body (which is the parent of para) para.parentnode.appendchild(newelement); } you can see this script as a complete example. how can i learn more? now that you are familiar with the basic concepts of the dom, you may want to learn about the dom level 1 fundamental methods. see also the dom level 1 core specification from the w3c. ...
... with the basic concepts of the dom, you may want to learn about the dom level 1 fundamental methods. see also the dom level 1 core specification from the w3c. it's a reasonably clear spec, although it is
formal. the main thing that's useful to authors is the description of the different dom objects and all their properties and methods. also see our other dom documentation. ...
...1 fundamental methods. see also the dom level 1 core specification from the w3c. it's a reasonably clear spec, although it is
formal. the main thing that's useful to authors is the description of the different dom objects and all their properties and methods. also see our other dom documentation. original document in
formation author(s): l. ...
EXT_disjoint_timer_query - Web APIs
availability: this extension should be available in webgl1 contexts only. ext_disjoint_timer_query_webgl2 is available in webgl 2 contexts . ...
...ery object, which is the currently active query for the given target. ext.query_result_ext a gluint64ext containing the query result. ext.query_result_available_ext a glboolean indicating whether or not a query result is available. ext.time_elapsed_ext elapsed time (in nanoseconds). ext.timestamp_ext the current time. ext.gpu_disjoint_ext a glboolean indicating whether or not the gpu per
formed any disjoint operation. methods this extension exposes eight new methods. ext.createqueryext() creates a new webglquery. ext.deletequeryext() deletes a given webglquery. ext.isqueryext() returns true if a given object is a webglquery. ext.beginqueryext() the timer starts when all commands prior to beginqueryext have been fully executed. ext.endqueryext() the timer sto...
... ext.isqueryext() returns true if a given object is a webglquery. ext.beginqueryext() the timer starts when all commands prior to beginqueryext have been fully executed. ext.endqueryext() the timer stops when all commands prior to endqueryext have been fully executed. ext.querycounterext() records the current time into the corresponding query object. ext.getqueryext() returns in
formation about a query target. ext.getqueryobjectext() return the state of a query object. examples var ext = gl.getextension('ext_disjoint_timer_query'); specifications specification status comment ext_disjoint_timer_querythe definition of 'ext_disjoint_timer_query' in that specification. working draft initial definition. ...
Element.attributes - Web APIs
the element.attributes property returns a live collection of all attribute nodes registered to the specified node. it is a namednodemap, not an array, so it has no array methods and the attr nodes' indexes may differ among browsers. to be more specific, attributes is a key/value pair of strings that represents any in
formation regarding that attribute. syntax var attr = element.attributes; example basic examples // get the first <p> element in the document var para = document.getelementsbytagname("p")[0]; var atts = para.attributes; enumerating elements attributes numerical indexing is useful for going through all of an element's attributes. the following example runs through the attribute nodes for the element in the document with id "paragraph", and prints each attribute's value. <...
... living standard from document object model (dom) level 3...
...trs[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. living standard from document object model (dom) level 3 core specification, moved from node to element document object model (dom) level 3 core specificationthe definition of 'element.attributes' in that specification. obsol...
Element.classList - Web APIs
document.documentelement.firstchild.appendchild(document.createelement('style')).stylesheet.csstext=( '_*{x-uclp:expression(!this.hasownproperty("classlist")&&window[" ucl"](this))}' +...
...epancy between the polyfilled version of classlist and the w3 specs is that for ie6-8, there is no way to create an immutable object (an object whose properties cannot be directly modified). in ie9, however, it is possible through extending the prototype, freezing the visible object, and overwritting native property methods. ...
...in all polyfilled browsers (ie6-9), an additional element[" uclp"] property is added to element to ensure standards compliant prototyping, and a domtokenlist[" ucl"] property is added to each element["classlist"] object to ensure that the domtokenlist is bounded to its own element. ...
Element: focusin event - Web APIs
s when an element is about to receive focus. the main difference between this event and focus is that focusin bubbles while focus does not. the opposite of focusin is focusout. ...
... element is about to receive focus. the main difference between this event and focus is that focusin bubbles while focus does not. the opposite of focusin is focusout. ...
...les while focus does not. the opposite of focusin is focusout. bubbles yes cancelable no interface focusevent event handler property onfocusin sync / async sync composed yes examples live example html <
form id="
form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </
form> javascript const
form = document.getelementbyid('
form');
form.addeventlistener('focusin', (event) => { event.target.style.background = 'pink'; });
form.addeventlistener('focusout', (event) => { event.target.style.background = ''; }); result specifications specification status comment ui events working draft added info that this event is composed. ...
Element: focusout event - Web APIs
ires when an element is about to lose focus. the main difference between this event and blur is that focusout bubbles while blur does not. the opposite of focusout is focusin. ...
... an element is about to lose focus. the main difference between this event and blur is that focusout bubbles while blur does not. the opposite of focusout is focusin. ...
...les while blur does not. the opposite of focusout is focusin. bubbles yes cancelable no interface focusevent event handler property onfocusout sync / async sync composed yes examples live example html <
form id="
form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </
form> javascript const
form = document.getelementbyid('
form');
form.addeventlistener('focusin', (event) => { event.target.style.background = 'pink'; });
form.addeventlistener('focusout', (event) => { event.target.style.background = ''; }); result specifications specification status comment ui events working draft added info that this event is composed. ...
Element.querySelectorAll() - Web APIs
. note: this method is implemented based on the parentnode mixin's queryselectorall() method. syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. ...
... return value a non-live nodelist containing one element object for each descendant node that matches at least one of the specified selectors. note: if the specified selectors include a css pseudo-element, the returned list is always empty. exceptions syntaxerror the syntax of the specified selectors string is not valid. ...
...by default, queryselectorall() only verifies that the last element in the selector is within the search scope. the :scope pseudo-class restores the expected behavior, only matching selectors on descendants of the base element: var select = document.queryselector('.select'); var inner = select.queryselectorall(':scope .outer .inner'); inner.length; // 0 specifications ...
Event.preventDefault() - Web APIs
n a checkbox. this example demonstrates how to prevent that from happening: javascript document.queryselector("#id-checkbox").addeventlistener("click", function(event) { document.getelementbyid("output-box").innerhtml += "sorry! <code>preventdefault()</code> won't let you check this!<br>"; event.preventdefault(); }, false); html <p>please click on the checkbox control.</p> <
form> <label for="id-checkbox">checkbox:</label> <input type="checkbox" id="id-checkbox"/> </
form> <div id="output-box"></div> result stopping keystrokes from reaching an edit field the following example demonstrates how invalid text input can be stopped from reaching the input field with preventdefault(). nowadays, you should usually use native html
form validation instead. html here's th...
... <label for="id-checkbox">checkbox:</label> <input type="checkbox" id="id-checkbox"/> </
form> <div id="output-box"></div> result stopping keystrokes from reaching an edit field the following example demonstrates how invalid text input can be stopped from reaching the input field with preventdefault(). nowadays, you should usually use native html
form validation instead. ...
... <div id="output-box"></div> result stopping keystrokes from reaching an edit field the following example demonstrates how invalid text input can be stopped from reaching the input field with preventdefault(). nowadays, you should usually use native html
form validation instead. html here's the
form: <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. first, listen for keypres...
EventSource - Web APIs
if there is an event field in the incoming message, the triggered event is the same as the event field value. if no event field is present, then a generic message event is fired. ...
...if there is an event field in the incoming message, the triggered event is the same as the event field value. if no event field is present, then a generic message event is fired. ...
...event is the same as the event field value. if no event field is present, then a generic message event is fired. unlike websockets, server-sent events are unidirectional; that is, data messages are delivered in one direction, from the server to the client (such as a user's web browser). that makes them an excellent choice when there's no need to send data from the client to the server in message
form. for example, eventsource is a useful approach for handling things like social media status updates, news feeds, or delivering data into a client-side storage mechanism like indexeddb or web storage. when not used over http/2, sse suffers from a limitation to the maximum number of open connections, which can be specially painful when opening various tabs as the limit is per browser and set to a...
Introduction to the File and Directory Entries API - Web APIs
sed in cases where you don't want an outstanding operation to block the ui. the synchronous api, on the other hand, allows for simpler programming model, but it must be used with webworkers. usefulness of the api the file and directory entries api is an important api for the following reasons: it lets apps have offline and storage features that involve large binary blobs. it can improve per
formance by letting an app pre-fetch assets in the background and cache locally. it lets users of your web app directly edit a binary file that's in their local file directory. it provides a storage api that is already familiar to your users, who are used to working with file systems. for examples of features you can create with this app, see the sample use cases section. the file and director...
... the computer getting shut down. video game or other apps with lots of media assets the app downloads one or several large tarballs and expands them locally into a directory structure. the app pre-fetches assets in the background, so the user can go to the next task or game level without waiting for a download. audio or photo editor with offline access or local cache (great for per
formance and speed) the app can write to files in place (for example, overwriting just the id3/exif tags and not the entire file). offline video viewer the app can download large files (>1gb) for later viewing. the app can access partially downloaded files (so that you can watch the first chapter of your dvd, even if the app is still downloading the rest of the content or if the app did...
...rror callbacks for the methods are optional parameters, they are not optional for your sanity. you want to know why your calls failed. at minimum, handle the errors to provide error messages, so you'll have an idea of what's going on. the file and directory entries api interacts with other apis the file and directory entries api is designed to be used with other apis and elements on the web plat
form. for example, you are likely to use one of the following: xmlhttprequest (such as the send() method for file and blob objects) drag and drop api web workers (for the synchronous version of the file and directory entries api) the input element (to programmatically obtain a list of files from the element) the file and directory entries api is case sensitive the filesystem api is case-sensi...
Gamepad - Web APIs
a gamepad object can be returned in one of two ways: via the gamepad property of the gamepadconnected and gamepaddisconnected events, or by grabbing any position in the array returned by the navigator.getgamepads() method. properties gamepad.axes read only an array representing the controls with axes present on the device (e.g. analog thumb sticks). gamepad.buttons read only an array of gamepadbutton objects representing the buttons present on the device. ...
... gamepad.axes read only an array representing the controls with axes present on the device (e.g. analog thumb sticks). gamepad.buttons read only an array of gamepadbutton objects representing the buttons present on the device. gamepad.connected read only a boolean indicating whether the gamepad is still connected to the system. gamepad.id read only a domstring containing identifying in
formation about the controller. gamepad.index read only an integer that is auto-incremented to be unique for each device currently connected to the system. gamepad.mapping read only a string indicating whether the browser has remapped the controls on the device to a known layout. gamepad.timestamp read only a domhighrestimestamp representing the last time the data for this gamepad was updated...
... the browser has remapped the controls on the device to a known layout. gamepad.timestamp read only a domhighrestimestamp representing the last time the data for this gamepad was updated. experimental extensions to gamepad the following interfaces are defined in the gamepad extensions specification, and provide access to experimental features like haptic feedback and webvr controller pose in
formation. gamepad.hand read only an enum defining what hand the controller is being held in, or is most likely to be held in. gamepad.hapticactuators read only an array containing gamepadhapticactuator objects, each of which represents haptic feedback hardware available on the controller. example window.addeventlistener("gamepadconnected", function(e) { console.log("gamepad connected at ...
Using the Geolocation API - Web APIs
for the presence of geolocation thusly: if('geolocation' in navigator) { /* geolocation is available */ } else { /* geolocation is not available */ } getting the current position to obtain the user's current location, you can call the getcurrentposition() method. this initiates an asynchronous request to detect the user's position, and queries the positioning hardware to get up-to-date in
formation. when the position is determined, the defined callback function is executed. you can optionally provide a second callback function to be executed if an error occurs. a third, optional, parameter is an options object where you can set the maximum age of the position returned, the time to wait for a request, and if you want high accuracy for the position. note: by default, getcurrentposition...
...ation or wifi) may be returned to getcurrentposition(). navigator.geolocation.getcurrentposition((position) => { dosomething(position.coords.latitude, position.coords.longitude); }); the above example will cause the dosomething() function to execute when the location is obtained. watching the current position if the position data changes (either by device movement or if more accurate geo in
formation arrives), you can set up a callback function that is called with that updated position in
formation. this is done using the watchposition() function, which has the same input parameters as getcurrentposition(). the callback function is called multiple times, allowing the browser to either update your location as you move, or provide a more accurate location as different techniques are used to...
...two you'll use most commonly are latitude and longitude, which are what you need to draw your position on a map. hence many geolocation success callbacks look fairly simple: function success(position) { const latitude = position.coords.latitude; const longitude = position.coords.longitude; // do something with your latitude and longitude } you can however get a number of other bits of in
formation from a geolocationcoordinates object, including altitude, speed, what direction the device is facing, and an accuracy measure of the altitude, longitude, and latitude data. handling errors the error callback function, if provided when calling getcurrentposition() or watchposition(), expects a geolocationpositionerror object instance as its first parameter. this object type contains two pro...
GlobalEventHandlers.onwheel - Web APIs
elevent object as its sole argument. examples this example shows how to scale an element using the mouse (or other pointing device) wheel. ...
... living standard ...
... living standard ...
HTMLElement: transitioncancel event - Web APIs
the transitioncancel event is fired when a css transition is canceled. see globaleventhandlers.ontransitioncancel for more in
formation. bubbles yes cancelable no interface transitionevent event handler property globaleventhandlers.ontransitioncancel examples this code gets an element that has a transition defined and adds a listener to the transitioncancel event: const transition = document.queryselector('.transition'); transition.addeventlistener('transitioncancel', () => { console.log('transition canceled'); }); the same, but using the ontransitioncancel property instead of addeventlistener(): const transition = document.queryselector('.transition'); transition.ontransitioncancel = () => { console.log('transition c...
...in this example, to cancel the transition, stop hovering over the transitioning box before the transition ends. for...
...in this example, to cancel the transition, stop hovering over the transitioning box before the transition ends. for the transition end event to fire, stay hovered over the transition until the transition ends. co...
HTMLFontElement.color - Web APIs
the obsolete htmlfontelement.color property is a domstring that reflects the color html attribute, containing either a named color or a color specified in the hexadecimal #rrggbb
format. ...
... the obsolete htmlfontelement.color property is a domstring that reflects the color html attribute, containing either a named color or a color specified in the hexadecimal #rrggbb
format. ...
...g that reflects the color html attribute, containing either a named color or a color specified in the hexadecimal #rrggbb
format. ...
HTMLIFrameElement.referrerPolicy - Web APIs
the htmliframeelement.referrerpolicy property reflects the html referrerpolicy attribute of the <iframe> element defining which referrer is sent when fetching the resource. syntax refstr = iframeelt.referrerpolicy; iframeelt.referrerpolicy = refstr; values no-referrer the referer header will be omitted entirely. no referrer in
formation is sent along with requests. no-referrer-when-downgrade (default) this is the user agent's default behavior if no policy is specified. the url is sent as a referrer when the protocol security level stays the same (http→http, https→https), but isn't sent to a less secure destination (https→http). origin only send the origin of the document as the referrer in all cases. the document https://example.com/page.html will send the referrer https://ex...
...y is specified. the url is sent as a referrer when the protocol security level stays the same (http→http, https→https), but isn't sent to a less secure destination (https→http). origin only send the origin of the document as the referrer in all cases. the document https://example.com/page.html will send the referrer https://example.com/. origin-when-cross-origin send a full url when per
forming a same-origin request, but only send the origin of the document for other cases. same-origin a referrer will be sent for same-site origins, but cross-origin requests will contain no referrer in
formation. strict-origin only send the origin of the document as the referrer when the protocol security level stays the same (https→https), but don't send it to a less secure destination (https→...
...nt for other cases. same-origin a referrer will be sent for same-site origins, but cross-origin requests will contain no referrer in
formation. strict-origin only send the origin of the document as the referrer when the protocol security level stays the same (https→https), but don't send it to a less secure destination (https→http). strict-origin-when-cross-origin send a full url when per
forming a same-origin request, only send the origin when the protocol security level stays the same (https→https), and send no header to a less secure destination (https→http). unsafe-url send a full url when per
forming a same-origin or cross-origin request. this policy will leak origins and paths from tls-protected resources to insecure origins. carefully consider the impact of this setting. ...
HTMLImageElement.sizes - Web APIs
the htmlimageelement property sizes allows you to specify the layout width of the image for each of a list of media conditions. this provides the ability to automatically select among different images—even images of different orientations or aspect ratios—as the document state changes to match different media conditions. each condition is specified using the same conditional
format used by media queries. syntax let sizes = htmlimageelement.sizes; htmlimageelement.sizes = sizes; value a usvstring containing a comma-separated list of source size descriptors followed by an optional fallback size. each source size descriptor is comprised of a media condition, then at least one whitespace character, then the source size value to use for the image when the media condition evaluates to true...
...en the source size value to use for the image when the media condition evaluates to true. media conditions each source size descriptor consists of a media condition as defined by the media queries standard. because a source size descriptor is used to specify the width to use for the image during layout of the page, the media condition is typically (but not necessarily) based entirely on width in
formation. see syntax in using media queries for details on how to construct a media condition. source size values the source size value is a css length. it may be specified using font-relative units (such as em or ex), absolute units (such as px or cm), or the vw unit, which lets you specify the width as a percentage of the viewport width (1vw being 1% of the viewport width). note: the source siz...
... 50% or 100% are not allowed, as there would be uncertainty as to what the specified value is a percentage of. example in this example, a blog-like layout is created, displaying some text and an image which for which three size points are specified, depending on the width of the window. three versions of the image are also available, with their widths specified. the browser takes all of this in
formation and selects an image and width that best meets the specified values. how exactly the images are used may depend upon the browser and what the pixel density of the user's display is. buttons at the bottom of the example let you actually modify the sizes property slightly, switching the largest of the three widths for the image between 40em and 50em. html <article> <h1>an amazing headlin...
HTMLImageElement - Web APIs
rrer to use in order to fetch the image. read this article for details on the possible values of this string. htmlimageelement.sizes a domstring reflecting the sizes html attribute. this string specifies a list of comma-separated conditional sizes for the image; that is, for a given viewport size, a particular image size is to be used. read the documentation on the sizes page for details on the
format of this string. htmlimageelement.src a usvstring that reflects the src html attribute, which contains the full url of the image including base uri. you can load a different image into the element by changing the url in the src attribute. htmlimageelement.srcset a usvstring reflecting the srcset html attribute. this specifies a list of candidate images, separated by commas (',', u+002c comma...
...ml attribute, which contains the full url of the image including base uri. you can load a different image into the element by changing the url in the src attribute. htmlimageelement.srcset a usvstring reflecting the srcset html attribute. this specifies a list of candidate images, separated by commas (',', u+002c comma). each candidate image is a url followed by a space, followed by a specially-
formatted string indicating the size of the image. the size may be specified either the width or a size multiple. read the srcset page for specifics on the
format of the size substring. htmlimageelement.usemap a domstring reflecting the usemap html attribute, containing the page-local url of the <map> element describing the image map to use. the page-local url is a pound (hash) symbol (#) followed b...
... attribute is empty or null. the specified src url is the same as the url of the page the user is currently on. the specified image is corrupted in some way that prevents it from being loaded. the specified image's metadata is corrupted in such a way that it's impossible to retrieve its dimensions, and no dimensions were specified in the <img> element's attributes. the specified image is in a
format not supported by the user agent. example var img1 = new image(); // image constructor img1.src = 'image1.png'; img1.alt = 'alt'; document.body.appendchild(img1); var img2 = document.createelement('img'); // use dom htmlimageelement img2.src = 'image2.jpg'; img2.alt = 'alt text'; document.body.appendchild(img2); // using first image in the document alert(document.images[0].src); specifica...
HTMLInputElement.stepUp() - Web APIs
the default value for the parameter, if no value is passed, is 1. the method will not cause the value to exceed the set max value, or defy the constraints set by the step attribute. if the value before invoking the stepup() method is invalid—for example, if it ...
...the default value for the parameter, if no value is passed, is 1. ...
...control. the default value for the parameter, if no value is passed, is 1. the method will not cause the value to exceed the set max value, or defy the constraints set by the step attribute. if the value before invoking the stepup() method is invalid—for example, if it doesn't match the constraints set by the step attribute—invoking the stepup() method will return a value that does match the
form controls constraints. if the
form control is non time, date, or numeric in nature, and therefore does not support the step attribute (see the list of supported input types in the the table above), or if the step value is set to any, an invalidstateerror exception is thrown. syntax element.stepup( [ stepincrement ] ); parameters stepincrement the optional stepincrement paremet...
HTMLMediaElement - Web APIs
that reflects the autoplay html attribute, indicating whether playback should automatically begin as soon as enough media is available to do so without interruption. note: automatically playing audio when the user doesn't expect or desire it is a poor user experience and should be avoided in most cases, though there are exceptions. see the autoplay guide for media and web audio apis for more in
formation. keep in mind that browsers may ignore autoplay requests, so you should ensure that your code isn't dependent on autoplay working. htmlmediaelement.buffered read only returns a timeranges object that indicates the ranges of the media source that the browser has buffered (if any) at the moment the buffered property is accessed. htmlmediaelement.controller is a mediacontroller object th...
...adds a text track (such as a track for subtitles) to a media element. htmlmediaelement.capturestream() returns mediastream, captures a stream of the media content. htmlmediaelement.canplaytype() given a string specifying a mime media type (potentially with the codecs parameter included), canplaytype() returns the string probably if the media should be playable, maybe if there's not enough in
formation to determine whether the media will play or not, or an empty string if the media cannot be played. htmlmediaelement.fastseek() directly seeks to the given time. htmlmediaelement.load() resets the media to the beginning and selects the best available source from the sources provided using the src attribute or the <source> element. htmlmediaelement.mozcapturestream() [enter description...
...ter the loadedmetadata event fires. htmlmediaelement.pause() pauses the media playback. htmlmediaelement.play() begins playback of the media. htmlmediaelement.seektonextframe() seeks to the next frame in the media. this non-standard, experimental method makes it possible to manually drive reading and rendering of media at a custom speed, or to move through the media frame-by-frame to per
form filtering or other operations. htmlmediaelement.setmediakeys() returns promise. sets the mediakeys keys to use when decrypting media during playback. htmlmediaelement.setsinkid() sets the id of the audio device to use for output and returns a promise. this only works when the application is authorized to use the specified device. obsolete methods these methods are obsolete and should n...
HTMLOrForeignElement.dataset - Web APIs
similar: in html, the name of a custom data attribute begins with data-. it must contain only letters, numbers, and the following characters: dash (-), dot (.), colon (:), underscore (_)—but not any ascii capital letters (a to z). in javascript, the name of a custom data attribute is the name of the same html attribute, but in camelcase and with no dashes, dots, etc. ...
...ii capital letters (a to z). in javascript, the name of a custom data attribute is the name of the same html attribute, but in camelcase and with no dashes, dots, etc. in addition to the in
formation below, you'll find a how-to guide for using html data attributes in our article using data attributes. name conversion dash-style to camelcase conversion a custom data attribute name is trans
formed to a key for the domstringmap entry with the following rules the prefix data- is removed (including the dash); for any dash (u+002d) followed by an ascii lowercase letter a to z, the dash is removed, and the letter is trans
formed into its uppercase counterpart; other characters (including other dashes) are left unchanged. camelcase to dash-style conversion the opposite transfor...
... the dash); for any dash (u+002d) followed by an ascii lowercase letter a to z, the dash is removed, and the letter is trans
formed into its uppercase counterpart; other characters (including other dashes) are left unchanged. camelcase to dash-style conversion the opposite trans
formation, which maps a key to an attribute name, uses the following rules: restriction: before the trans
formation, a dash must not be immediately followed by an ascii lowercase letter a to z; the prefix data- is added; any ascii uppercase letter a to z is trans
formed into a dash, followed by its lowercase counterpart; other characters are left unchanged. the restriction in the rules above ensures that the two trans
formations are the inverse one of the other. for example, the attribute named...
HTMLScriptElement.referrerPolicy - Web APIs
policy property of the htmlscriptelement interface reflects the html referrerpolicy of the <script> element and fetches made by that script, defining which referrer is sent when fetching the resource. syntax refstr = scriptelem.referrerpolicy; scriptelem.referrerpolicy = refstr; value a domstring; one of the following: no-referrer the referer header will be omitted entirely. no referrer in
formation is sent along with requests. no-referrer-when-downgrade (default) this is the user agent's default behavior if no policy is specified. the url is sent as a referrer when the protocol security level stays the same (e.g.http→http, https→https), but isn't sent to a less secure destination (e.g. https→http). origin only send the origin of the document as the referrer in all cases. the...
...ified. the url is sent as a referrer when the protocol security level stays the same (e.g.http→http, https→https), but isn't sent to a less secure destination (e.g. https→http). origin only send the origin of the document as the referrer in all cases. the document https://example.com/page.html will send the referrer https://example.com/. origin-when-cross-origin send a full url when per
forming a same-origin request, but only send the origin of the document for other cases. same-origin a referrer will be sent for same-site origins, but cross-origin requests will contain no referrer in
formation. strict-origin only send the origin of the document as the referrer when the protocol security level stays the same (e.g. https→https), but don't send it to a less secure destination (e.g...
...er cases. same-origin a referrer will be sent for same-site origins, but cross-origin requests will contain no referrer in
formation. strict-origin only send the origin of the document as the referrer when the protocol security level stays the same (e.g. https→https), but don't send it to a less secure destination (e.g. https→http). strict-origin-when-cross-origin send a full url when per
forming a same-origin request, only send the origin when the protocol security level stays the same (e.g. https→https), and send no header to a less secure destination (e.g. https→http). unsafe-url send a full url when per
forming a same-origin or cross-origin request. this policy will leak origins and paths from tls-protected resources to insecure origins. carefully consider the impact of this s...
HTMLVideoElement.videoHeight - Web APIs
imple terms, this is the height of the media in its natural size. see about intrinsic width and height for more details. syntax height = htmlvideoelement.videoheight; value an integer value specifying the intrinsic height of the video in css pixels. if the element's readystate is htmlmediaelement.have_nothing, then the value of this property is 0, because neither video nor poster frame size in
formation is yet available. about intrinsic width and height a user agent calculates the intrinsic width and height of the element's media by starting with the media's raw pixel width and height, then taking into account factors including: the media's aspect ratio. the media's clean aperture (the sub-rectangle centered within the media that matches the target aspect ratio). the target device's ...
...ight a user agent calculates the intrinsic width and height of the element's media by starting with the media's raw pixel width and height, then taking into account factors including: the media's aspect ratio. the media's clean aperture (the sub-rectangle centered within the media that matches the target aspect ratio). the target device's resolution. any other factors required by the media
format. if the element is currently displaying the poster frame rather than rendered video, the poster frame's intrinsic size is considered to be the size of the <video> element. if at any time the intrinsic size of the media changes and the element's readystate isn't have_nothing, a resize event will be sent to the <video> element. this can happen when the element switches from displaying the post...
...ntrinsic size of its contents. let v = document.getelementbyid("myvideo"); v.addeventlistener("resize", ev => { let w = v.videowidth; let h = v.videoheight; if (w && h) { v.style.width = w; v.style.height = h; } }, false); note that this only applies the change if both the videowidth and the videoheight are non-zero. this avoids applying invalid changes when there's no true in
formation available yet for dimensions. specifications specification status comment html living standardthe definition of 'htmlvideoelement.videoheight' in that specification. living standard html5the definition of 'htmlvideoelement.videoheight' in that specification. recommendation initial definition. ...
HTMLVideoElement.videoWidth - Web APIs
in simple terms, this is the width of the media in its natural size. see about intrinsic width and height for more details. syntax width = htmlvideoelement.videowidth; value an integer value specifying the intrinsic width of the video in css pixels. if the element's readystate is htmlmediaelement.have_nothing, then the value of this property is 0, because neither video nor poster frame size in
formation is yet available. about intrinsic width and height a user agent calculates the intrinsic width and height of the element's media by starting with the media's raw pixel width and height, then taking into account factors including: the media's aspect ratio. the media's clean aperture (the sub-rectangle centered within the media that matches the target aspect ratio). the target device's ...
...ight a user agent calculates the intrinsic width and height of the element's media by starting with the media's raw pixel width and height, then taking into account factors including: the media's aspect ratio. the media's clean aperture (the sub-rectangle centered within the media that matches the target aspect ratio). the target device's resolution. any other factors required by the media
format. if the element is currently displaying the poster frame rather than rendered video, the poster frame's intrinsic size is considered to be the size of the <video> element. if at any time the intrinsic size of the media changes and the element's readystate isn't have_nothing, a resize event will be sent to the <video> element. this can happen when the element switches from displaying the post...
...ntrinsic size of its contents. let v = document.getelementbyid("myvideo"); v.addeventlistener("resize", ev => { let w = v.videowidth; let h = v.videoheight; if (w && h) { v.style.width = w; v.style.height = h; } }, false); note that this only applies the change if both the videowidth and the videoheight are non-zero. this avoids applying invalid changes when there's no true in
formation available yet for dimensions. specifications specification status comment html living standardthe definition of 'htmlvideoelement.videowidth' in that specification. living standard html5the definition of 'htmlvideoelement.videowidth' in that specification. recommendation initial definition. ...
Using microtasks in JavaScript with queueMicrotask() - Web APIs
y libraries, frameworks, and polyfills, the queuemicrotask() method is exposed on the window and worker interfaces through the windoworworkerglobalscope mixin. tasks vs microtasks to properly discuss microtasks, it's first useful to know what a javascript task is and how microtasks differ from tasks. this is a quick, simplified explanation, but if you would like more details, you can read the in
formation in the article in depth: microtasks and the javascript runtime environment. tasks a task is any javascript code which is scheduled to be run by the standard mechanisms such as initially starting to run a program, an event callback being run, or an interval or timeout being fired. these all get scheduled on the task queue. tasks get added to the task queue when: a new javascript program...
.... using microtasks before getting farther into this, it's important to note again that most developers won't use microtasks much, if at all. they're a highly specialized feature of modern browser-based javascript development, allowing you to schedule code to jump in front of other things in the long set of things waiting to happen on the user's computer. abusing this capability will lead to per
formance problems. enqueueing microtasks as such, you should typically use microtasks only when there's no other solution, or when creating frameworks or libraries that need to use microtasks in order to create the functionality they're implementing. while there have been tricks available that made it possible to enqueue microtasks in the past (such as by creating a promise that resolves immediately...
...indow or worker interface, depending on the current execution context. queuemicrotask(() => { /* code to run in the microtask here */ }); the microtask function itself takes no parameters, and does not return a value. when to use microtasks in this section, we'll take a look at scenarios in which microtasks are particularly useful. generally, it's about capturing or checking results, or per
forming cleanup, after the main body of a javascript execution context exits, but before any event handlers, timeouts and intervals, or other callbacks are processed. when is that useful? the main reason to use microtasks is simply that: to ensure consistent ordering of tasks, even when results or data is available synchronously, but while simultaneously reducing the risk of user-discernible delays ...
Basic concepts - Web APIs
for an overview of the design and structure of indexeddb, see big concepts. to learn more about indexeddb terms, see the definitions section. for a detailed tutorial on how to use the api, see using indexeddb. 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. for more in
formation on how the browser handles storing your data in the background, read browser storage limits and eviction criteria. overview of indexeddb indexeddb lets you store and retrieve objects that are indexed with a "key." all changes that you make to the database happen within transactions. like most web storage solutions, indexeddb follows a same-origin policy. so while you can access stored dat...
...om/dir/ (different protocol), because they have different origins. note: third party window content (e.g. <iframe> content) can access the indexeddb store for the origin it is embedded into, unless the browser is set to never accept third party cookies (see bug 1147821.) definitions this section defines and explains terms used in the indexeddb api. database database a repository of in
formation, typically comprising one or more object stores. each database must have the following: name. this identifies the database within a specific origin and stays constant throughout its lifetime. the name can be any string value (including an empty string). current version. when a database is first created, its version is the integer 1 if not specified otherwise. each database can have...
...n is the integer 1 if not specified otherwise. each database can have only one version at any given time. durable in firefox, indexeddb used to be durable, meaning that in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase per
formance (see bug 1112702), which is the same behaviour as other indexeddb-supporting browsers. in this case the complete event is fired after the os has been told to write the data but potentially before that data has actually been flushed to disk. the event may thus be delivered quicker than before, however, there exists a small chance that the entire transaction will be lost if the os crashes or th...
IndexedDB API - Web APIs
while web storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. indexeddb provides a solution. this is the main landing page for mdn's indexeddb coverage — here we provide links to the full api reference and usage guides, browser support details, and some explanation of key concepts. note: this feature is available in web workers. ...
...dexeddb guide. combine indexeddb for storing data offline with service workers for storing assets offline, as outlined in making pwas work offline with service workers. note: like most web storage solutions, indexeddb follows a same-origin policy. so while you can access stored data within a domain, you cannot access data across different domains. synchronous and asynchronous operations per
formed using indexeddb are done asynchronously, so as not to block applications. indexeddb originally included both synchronous and asynchronous apis. the synchronous api was intended for use only with web workers but was removed from the spec because it was unclear whether it was needed. however, the synchronous api may be reintroduced if there is enough demand from web developers. storage limits an...
...erequest represents a request to change the version of a database. the way to change the version of the database has since changed (by calling idbfactory.open without also calling idbdatabase.setversion), and the interface idbopendbrequest now has the functionality of the removed idbversionchangerequest. idbdatabaseexception represents exception conditions that can be encountered while per
forming database operations. idbtransactionsync sync version of idbtransaction. idbobjectstoresync sync version of idbobjectstore. idbindexsync sync version of idbindex. idbfactorysync sync version of idbfactory. idbenvironmentsync sync version of idbenvironment. idbdatabasesync sync version of idbdatabase. idbcursorsync sync version of idbcursor. examples elibri: a po...
KeyboardEvent.getModifierState() - Web APIs
all modifiers (except "fnlock", "hyper", "super" and "symbol" which are defined after gecko implements this) are always ...
...ogo key) not supported "scrolllock" during led for scroll lock turned on during led for scroll lock turned on, but typically this isn't supported by plat
form not supported while scrolllock is locked "shift" ⇧ shift key pressed "super" not supported "symbol" not supported "symbollock" not supported on the other plat
forms, "alt", "control" and "shift" may be supported. all modifiers (except "fnlock", "hyper", "super" and "symbol" which are defined after gecko implements this) are always supported for untrusted events on gecko. this doesn't depend on the plat
form. "accel" virtual modifier note: the "accel" virtual modifier has been effectively deprecated in current drafts of the dom3 events specification. get...
...vent.ctrlkey or keyboardevent.metakey is true. in old implementations and outdated specifications, it returned true when a modifier which is the typical modifier key for the shortcut key is pressed. for example, on windows, pressing ctrl key may make it return true. however, on mac, pressing ⌘ command key may make it return true. note that which modifier key makes it return true depends on plat
forms, browsers, and user settings. for example, firefox users can customize this with a pref, "ui.key.accelkey". example // ignore if following modifier is active. if (event.getmodifierstate("fn") || event.getmodifierstate("hyper") || event.getmodifierstate("os") || event.getmodifierstate("super") || event.getmodifierstate("win") /* hack for ie */) { return; } // also ignore if t...
MediaCapabilitiesInfo - Web APIs
the mediacapabilitiesinfo interface of the media capabilities api is made available when the promise returned by the mediacapabilities.encodinginfo() or mediacapabilities.decodinginfo() methods of the mediacapabilities interface fulfills, providing in
formation as to whether the media type is supported, and whether encoding or decoding such media would be smooth and power efficient. properties the mediacapabilitiesinfo interface contains three boolean attribues: supported: given the properties defined in the mediaconfiguration, can the specified piece of media content be encoded (if mediaencodingconfiguration is set) or decode (if mediadecodingconfiguration is set) at all? if yes, supported is true. otherwise, it is false. smooth: given the properties defined in the mediaconfiguration, w...
...a configuration as smooth and powerefficient until stats on this device have been recorded. all supported audio codecs are reported to be power efficient. ...
...eported to be power efficient. ...
MediaSession.setActionHandler() - Web APIs
er media session actions. callback a function to call when the specified action type is invoked. the callback receives no input parameters, and should not return a value. return value undefined. description to remove a previously-established action handler, call setactionhandler() again, specifying null as the callback. the action handler receives as input a single parameter: an object con
forming to the mediasessionactiondetails dictionary, which provides both the action type (so the same function can handle multiple action types), as well as data needed in order to per
form the action. media session actions a media session action's type is specified using a string from the mediasessionaction enumerated type. values each of the actions is a common media session control request. impl...
...the following strings identify the currently available types of media session action: nexttrack advances playback to the next track. pause pauses playback of the media. play begins (or resumes) playback of the media. previoustrack moves back to the previous track. ...
...strack moves back to the previous track. seekbackward seeks backward through the media from the current position. seekforward seeks forward from the current position through the media. seekto moves the playback position to the specified time within the media. skipad skips past the currently playing advertisement or commercial. this action may or may not be available, depending on the plat
form and user agent, or may be disabled due to subscription level or other circumstances. stop halts playback entirely. examples adding action handlers this example implements seek forward and backward actions for an audio player by setting up the seekforward and seekbackward action handlers. let skiptime = 10; // time to skip in seconds navigator.mediasession.setactionhandler('seekforward', e...
MediaSession.setPositionState() - Web APIs
for presentation by user's device in any kind of interface that provides details about ongoing media. this can be particularly useful if your code implements a player for type of media not directly supported by the browser. call this method on the navigator object's mediasession object. syntax navigator.mediasession.setpositionstate(statedict); parameters statedict optional an object con
forming to the mediapositionstate dictionary, providing updated in
formation about the playback position and speed of the document's ongoing media. if the object is empty, the existing playback state in
formation is cleared. return value undefined. exceptions typeerror this error can occur in an array of circumstances: the specified mediapositionstate object's duration is missing, negativ...
...if the media is still playing when the interval is fired, setpositionstate() is called with an object that specifies the duration, playback rate, and position as reported by a mymedia object that describes the track being played. ...
...ances: the specified mediapositionstate object's duration is missing, negative, or null. position is missing or null, or is either negative or greater than duration. the playbackrate is zero. example in this example, a player for a non-standard media file
format, written in javascript, uses setinterval() to establish a callback which fires once per second to refresh the position in
formation by calling setpositionstate(). if the media is still playing when the interval is fired, setpositionstate() is called with an object that specifies the duration, playback rate, and position as reported by a mymedia object that describes the track being played. if the media is not playing, clearinterval() is used to remove the interval handler. let positioninterval = window.setinterval(() =...
Media Session action types - Web APIs
pe of media session action to be handled on a mediasession is identified using a string from the mediasessionaction enumerated type. syntax a media session action's type is specified using a string from the mediasessionaction enumerated type. values each of the actions is a common media session control request. implement support for each of these in order to allow that type of action to be per
formed. the following strings identify the currently available types of media session action: nexttrack advances playback to the next track. pause pauses playback of the media. play begins (or resumes) playback of the media. previoustrack moves back to the previous track. seekbackward seeks backward through the media from the current position. the mediasessionactiondetails property seekof...
...ifies the amount of time to seek backward. seekforward seeks forward from the current position through the media. the mediasessionactiondetails property seekoffset specifies the amount of time to seek forward. seekto moves the playback position to the specified time within the media. the time to which to seek is specified in the mediasessionactiondetails property seektime. if you intend to per
form multiple seekto operations in rapid succession, you can also specify the mediasessionactiondetails property fastseek property with a value of true. this lets the browser know it can take steps to optimize repeated operations, and is likely to result in improved per
formance. skipad skips past the currently playing advertisement or commercial. this action may or may not be available, depending on...
... stop halts playback entirely. ...
MediaStream Recording API - Web APIs
ream or htmlmediaelement object for analysis, processing, or saving to disk. it's also surprisingly easy to work with. basic concepts the mediastream recording api is comprised of a single major interface, mediarecorder, which does all the work of taking the data from a mediastream and delivering it to you for processing. the data is delivered by a series of dataavailable events, already in the
format you specify when creating the mediarecorder. you can then process the data further or write it to file as desired. overview of the recording process the process of recording a stream is simple: set up a mediastream or htmlmediaelement (in the
form of an <audio> or <video> element) to serve as the source of the media data. create a mediarecorder object, specifying the source stream and any...
...foreach(function(device) { let menu = document.getelementbyid("inputdevices"); if (device.kind == "audioinput") { let item = document.createelement("option"); item.innerhtml = device.label; item.value = device.deviceid; menu.appendchild(item); } }); }); code similar to this can be used to let the user restrict the set of devices they wish to use. for more in
formation to learn more about using the mediastream recording api, see using the mediastream recording api, which shows how to use the api to record audio clips. a second article, recording a media element, describes how to receive a stream from an <audio> or <video> element and use the captured stream (in this case, recording it and saving it to a local disk). reference blobevent each time a ch...
...astream recording api, which shows how to use the api to record audio clips. a second article, recording a media element, describes how to receive a stream from an <audio> or <video> element and use the captured stream (in this case, recording it and saving it to a local disk). reference blobevent each time a chunk of media data is finished being recorded, it's delivered to consumers in blob
form using a blobevent of type dataavailable. mediarecorder the primary interface that implements the mediastream recording api. mediarecordererrorevent the interface that represents errors thrown by the mediastream recording api. its error property is a domexception that specifies that error occurred. specifications specification status comment mediastream recording ...
MediaTrackSettings.groupId - Web APIs
u provided when calling either getusermedia(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.groupid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this in
formation, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var groupid = mediatracksettings.groupid; value a domstring whose value is a browsing-session unique identifier for a group of devices which includes the source of the track's contents. two devices share the same group id if they belong to the same physical hardware device. for example, a headset...
...contents. two devices share the same group id if they belong to the same physical hardware device. for example, a headset has two devices on it: a microphone which can serve as a source for audio tracks and a speaker which can serve as an output for audio. the group id is not usable across multiple browsing sessions. however, it can be used to ensure that audio input and output are both being per
formed on the same headset, for example, or to ensure that the built-in camera and microphone on a phone are being used for video conferencing purposes. the actual value of the string, however, is determined by the source of the track, and there is no guarantee what
form it will take, although the specification does recommend it be a guid. since this property isn't stable across browsing sessions, i...
... on a phone are being used for video conferencing purposes. the actual value of the string, however, is determined by the source of the track, and there is no guarantee what
form it will take, although the specification does recommend it be a guid. since this property isn't stable across browsing sessions, its usefulness when calling getusermedia() is generally limited to ensuring that tasks per
formed during the same browsing session use devices from the same group (or that they don't use devices from the same group). there is no situation in which the groupid is useful when calling applyconstraints(), since the value can't be changed. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status co...
Transcoding assets for Media Source Extensions - Web APIs
the creative commons attribution 3.0 license. throughout this tutorial, you'll see the filename trailer_1080p.mov which is the download. [0] (c) copyright 2008, blender foundation / www.bigbuckbunny.org / https://peach.blender.org/about/ tools required when working with mse, the following tools are a must have: ffmpeg — a command-line utility for transcoding your media into the required
formats. you can download a version for your system at the download ffmpeg page. extract the executable from the archive file and add it's location to your path statement. osx users can also use homebrew to install ffmpeg. bento4 — a set of command-line utilities for getting asset metadata and creating content for dash. to install, you'll need to build/compile the application yourself from the prov...
... worked here. note: the prebuilt ffmpeg does not include libfdk_aac due to licensing reasons. bento4 uses this by default, so you need to compile ffmpeg if necessary. if you don't need it, add --audio-codec=aac to the mp4-dash-encode.py command line. container and codec support as specified in section 1.1 of the mse spec: goals, mse is designed not to require support for any particular media
format or codec. while this is true on paper, browser support varies for specific container/codec combinations. to check if the browser supports a particular container, you can pass a string of the mime type to the mediasource.istypesupported method: mediasource.istypesupported('audio/mp3'); // false mediasource.istypesupported('video/mp4'); // true mediasource.istypesupported('video/mp4; codecs="a...
...n get the codec string using the mp4info utility. currently, mp4 containers with h.264 video and aac audio codecs have support across all modern browsers, while others don't. to convert our sample media from a quicktime mov container to an mp4 container, we can use ffmpeg. because the audio codec in the mov container is already aac and the video codec is h.264, we can instruct ffmpeg not to per
form transcoding. instead, it will just copy the audio and video tracks over without per
forming any transcoding, which is relatively faster than having to transcode. $ ffmpeg -i trailer_1080p.mov -c:v copy -c:a copy bunny.mp4 $ ls bunny.mp4 trailer_1080p.mov checking fragmentation in order to properly stream mp4, we need the asset to be an iso bmf
format mp4. without proper fragmentation, a...
Media Capture and Streams API (Media Stream) - Web APIs
the media capture and streams api, often called the media streams api or simply mediastream api, is an api related to webrtc which provides support for streaming audio and video data. it provides the interfaces and methods for working with the streams and their constituent tracks, the constraints associated with data
formats, the success and error callbacks when using the data asynchronously, and the events that are fired during the process. concepts and usage the api is based on the manipulation of a mediastream object representing a flux of audio- or video-related data. see an example in get the video. a mediastream consists of zero or more mediastreamtrack objects, representing various audio or video tracks. each mediastreamtrack may have one or more channels. the channel represents the...
...network, and obtained via the webrtc rtcpeerconnection api, or a stream created using the web audio api mediastreamaudiosourcenode. the output of the mediastream object is linked to a consumer. it can be a media elements, like <audio> or <video>, the webrtc rtcpeerconnection api or a web audio api mediastreamaudiosourcenode. interfaces in these reference articles, you'll find the fundamental in
formation you'll need to know about each of the interfaces that make up the media capture and streams api. blobevent canvascapturemediastreamtrack inputdeviceinfo mediadevicekind mediadeviceinfo mediadevices mediastream mediastreamconstraints mediastreamevent mediastreamtrack mediastreamtrackevent mediatrackconstraints mediatracksettings mediatracksupportedconstraints overconst...
...udiostreamtrack and videostreamtrack interfaces—each based upon mediastreamtrack—which represented streams of those types. these no longer exist, and you should update any existing code to instead use mediastreamtrack directly. events addtrack ended muted overconstrained removetrack started unmuted guides and tutorials the articles below provide additional guidance and how-to in
formation that will help you learn to use the api, and how to per
form specific tasks that you may wish to handle. capabilities, constraints, and settingsthe twin concepts of constraints and capabilities let the browser and web site or app exchange in
formation about what constrainable properties the browser's implementation supports and what values it supports for each one. this article disc...
Microdata DOM API - Web APIs
the document.getitems(typenames) method provides access to the top-level microdata items. ...
...the document.getitems(typenames) method provides access to the top-level microdata items. ...
...the document.getitems(typenames) method provides access to the top-level microdata items. ...
OffscreenCanvas.getContext() - Web APIs
vailable on browsers that implement webgl version 2 (opengl es 3.0). "bitmaprenderer" creates a imagebitmaprenderingcontext which only provides functionality to replace the content of the canvas with a given imagebitmap. note: the identifiers "experimental-webgl" or "experimental-webgl2" are also used in implementations of webgl. these implementations have not reached test suite con
formance, or the graphic drivers situation on the plat
form is not yet stable. the khronos group certifies webgl implementations under certain con
formance rules. contextattributes you can use several context attributes when creating your rendering context, for example: offscreen.getcontext("webgl", { antialias: false, depth: false }); 2d context attributes: ...
... storage is used ("persistent" by default). webgl context attributes: alpha: boolean that indicates if the canvas contains an alpha buffer. depth: boolean that indicates that the drawing buffer has a depth buffer of at least 16 bits. stencil: boolean that indicates that the drawing buffer has a stencil buffer of at least 8 bits. ...
...bits. antialias: boolean that indicates whether or not to per
form anti-aliasing. premultipliedalpha: boolean that indicates that the page compositor will assume the drawing buffer contains colors with pre-multiplied alpha. preservedrawingbuffer: if the value is true the buffers will not be cleared and will preserve their values until cleared or overwritten by the author. failifmajorper
formancecaveat: boolean that indicates if a context will be created if the system per
formance is low. return value a renderingcontext which is either a canvasrenderingcontext2d for "2d", webglrenderingcontext for "webgl" and "experimental-webgl", webgl2renderingcontext for "webgl2" and "experimental-webgl2" , or imagebitmaprenderingcontext for "bitmaprenderer". if the contexttype do...
OscillatorNode.setPeriodicWave() - Web APIs
returns undefined example the following example illustrates simple usage of createperiodicwave(), recreating a sine wave from a periodic wave. ...
... returns undefined example the following example illustrates simple usage of createperiodicwave(), recreating a sine wave from a periodic wave. ...
... only a fundamental tone is by definition a sine wave. here, we create a periodicwave with two values. the first value is the dc offset, which is the value at which the oscillator starts. 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range. the second and subsequent values are sine and cosine components. you can think of it as the result of a fourier trans
form, where you get frequency domain values from time domain value. here, with createperiodicwave(), you specify the frequencies, and the browser per
forms a an inverse fourier trans
form to get a time domain buffer for the frequency of the oscillator. here, we only set one component at full volume (1.0) on the fundamental tone, so we get a sine wave. specifications specification status ...
OscillatorNode - Web APIs
it is an audioscheduledsourcenode audio-processing module that causes a specified frequency of a given wave to be created—in effect, a constant tone. an oscillatornode is created using the baseaudiocontext.createoscillator() method. it always has exactly one output and no inputs. ...
... (though the audioparam returned is read-only, the value it represents is not). the default value is 440 hz (a standard middle-a note). oscillatornode.detune an a-rate audioparam representing detuning of oscillation in cents (though the audioparam returned is read-only, the value it represents is not). the default value is 0. oscillatornode.type a string which specifies the shape of wave
form to play; this can be one of a number of standard values, or custom to use a periodicwave to describe a custom wave
form. different waves will produce different tones. standard values are "sine", "square", "sawtooth", "triangle" and "custom". the default is "sine". event handlers oscillatornode.onended sets the event handler for the ended event, which fires when the tone has stopped playing. ...
...are "sine", "square", "sawtooth", "triangle" and "custom". the default is "sine". event handlers oscillatornode.onended sets the event handler for the ended event, which fires when the tone has stopped playing. methods inherits methods from its parent, audioscheduledsourcenode, and adds the following: oscillatornode.setperiodicwave() sets a periodicwave which describes a periodic wave
form to be used instead of one of the standard wave
forms; calling this sets the type to custom. this replaces the now-obsolete oscillatornode.setwavetable() method. oscillatornode.start() specifies the exact time to start playing the tone. oscillatornode.stop() specifies the time to stop playing the tone. examples the following example shows basic usage of an audiocontext to create an oscillato...
ParentNode.querySelectorAll() - Web APIs
lement.queryselectorall(), document.queryselectorall(), and documentfragment.queryselectorall() syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. ...
... return value a non-live nodelist containing one element object for each descendant node that matches at least one of the specified selectors. note: if the specified selectors include a css pseudo-element, the returned list is always empty. exceptions syntaxerror the syntax of the specified selectors string is not valid. ...
...by default, queryselectorall() only verifies that the last element in the selector is within the search scope. the :scope pseudo-class restores the expected behavior, only matching selectors on descendants of the base element: var select = document.queryselector('.select'); var inner = select.queryselectorall(':scope .outer .inner'); inner.length; // 0 specifications spe...
PasswordCredential.additionalData - Web APIs
the additionaldata property of the passwordcredential interface takes one of a
formdata instance, a urlsearchparams instance, or null. the data in the objects will be added to the request body and sent to the remote endpoint with the credentials. syntax passwordcredential.additionaldata =
formdata
formdata = passwordcredential.additionaldata passwordcredential.additionaldata = urlsearchparams ulrsearchparams = passwordcredential.additionaldata value one of a
formdata instance, a urlsearchparams instance, or null. example the following example creates a
formdata object with an appended csrf token. it then stores the
form object in the additionaldata parameter, before sending it to server in a call to fetch. //the options object was previously created. navigator.credentials.get(optio...
...ormdata instance, a urlsearchparams instance, or null. example the following example creates a
formdata object with an appended csrf token. it then stores the
form object in the additionaldata parameter, before sending it to server in a call to fetch. //the options object was previously created. ...
...tance, a urlsearchparams instance, or null. example the following example creates a
formdata object with an appended csrf token. it then stores the
form object in the additionaldata parameter, before sending it to server in a call to fetch. //the options object was previously created. navigator.credentials.get(options).then(function(creds) { if (creds.type == 'password') { var
form = new
formdata(); var csrf_token = document.queryselector('csrf_token').value;
form.append('csrf_token', csrf_token); creds.additionaldata =
form; fetch('https://www.example.com', { method: 'post', credentials: creds }); }; }); specifications specification status comment credential management level 1 working draft initial definition. ...
PaymentRequest.PaymentRequest() - Web APIs
s for payment methods that the merchant website accepts. starting with more recent browsers, this parameter is more generic than credit cards, it is a single domstring, and the meaning of the data parameter changes with the supportedmethods. for example, the basic card payment method is selected by specifying the string basic-card here. data a json-serializable object that provides optional in
formation that might be needed by the supported payment methods. this has to con
form to the type expected by the payment handler indicated by supportedmethods. for basic credit card services, this structure should match the basiccardrequest dictionary. details provides in
formation about the requested transaction. this parameter contains the following fields: total the total amount of the p...
...if a value is not supplied, the browser will construct one. displayitems an array of optional line items for the payment request that the user agent may display, such as product details, tax, and shipping. shippingoptions the shipping options the user may choose from. ...
...adjusting the total amount based on the payment method. this parameter contains the following fields: additionaldisplayitems an array of items to be appended to the details.displayitems property. this property is commonly used to add a discount or surcharge line item indicating the different amount in details.modifiers.total. data a json-serializable object that provides optional in
formation that might be needed by the supported payment methods. this has to con
form to the structure defined in the basiccardrequest dictionary. total a total amount for the payment request that overrides value in details.total. this is typically used when details.modifiers.additionalitems adds a discount or a surchase to the request. options optional lets you set options that contr...
PaymentResponse.retry() - Web APIs
ns such as invalid shipping addresses or declined credit cards. syntax retrypromise = paymentrequest.retry(errorfields); parameters errorfields a paymentvalidationerrors object, with the following properties: error optional a general description of a payment error from which the user may attempt to recover by retrying the payment, possibly after correcting mistakes in the payment in
formation. error can be provided all by itself to provide only a generic error message, or in concert with the other properties to serve as an overview while other properties' values gude the user to errors in specific fields in the payment
form. payer optional a payererrors compliant object which provides appropriate error messages for any of the fields describing the payer which failed validation.
... loop or recursive function that checks the paymentresponse for errors or other reasons to retry the payment request. if a retry is needed, the loop calls retry(), then loops back to check the response when it comes in. the loop exits only when the user either cancels the payment request or the request is successful. see the example below for a thorough example, but the basic concept, in outline
form, is: create a new paymentrequest (new paymentrequest()) display the payment request (paymentrequest.show() if show() resolves, the returned paymentresponse describes the requested payment and the options chosen by the user. continue by... validate the returned reponse; if there are any fields whose values are not acceptable, call the response's complete() method with a value of "fail" ...
...ayment methods, or because of a security issue. see the list of exceptions for show() for further details. call complete("fail") to close the payment request. async function handlepayment() { const payrequest = new paymentrequest(methoddata, details, options); try { let payresponse = await payrequest.show(); while (payresponse has errors) { /* let the user edit the payment in
formation, wait until they submit */ await response.retry(); } await payresponse.complete("success"); } catch(err) { /* handle the exception */ } } examples try { await paymentrequest.retry(errorfields); } catch (domexception err) { ... } async function dopaymentrequest() { const request = new paymentrequest(methoddata, details, options); const response = await r...
PeriodicWave - Web APIs
periodicwave has no inputs or outputs; it is used to define custom oscillators when calling oscillatornode.setperiodicwave(). the periodicwave itself is created/returned by audiocontext.createperiodicwave(). constructor periodicwave.periodicwave() creates a new periodicwave object instance using the default values for all properties. if you wish to establish custom property values at the outset, use the audiocontext.createperiodicwave() factory method instead. properties none; also, periodicwave doesn't inherit any properties. methods none; also, periodicwave doesn't inherit any methods. ...
...ins only a fundamental tone is by definition a sine wave here, we create a periodicwave with two values. the first value is the dc offset, which is the value at which the oscillator starts. 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range. the second and subsequent values are sine and cosine components. ...
...the value at which the oscillator starts. 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range. the second and subsequent values are sine and cosine components. you can think of it as the result of a fourier trans
form, where you get frequency domain values from time domain value. here, with createperiodicwave(), you specify the frequencies, and the browser per
forms an inverse fourier trans
form to get a time domain buffer for the frequency of the oscillator. here, we only set one component at full volume (1.0) on the fundamental tone, so we get a sine wave. the coefficients of the fourier trans
form should be given in ascending order (i.e. (a+bi)ei,(c+di)e2i,(f+gi)e3i\left(a+bi\right)e^{i} , \left(c+di\right)e^{2i} , \left(f+gi\right)e^{3i} etc.) and can ...
Pointer events - Web APIs
the events needed to handle generic pointer input are analogous to mouse events (mousedown/pointerdown, mousemove/pointermove, etc.). consequently, pointer event types are intentionally similar to mouse event types. additionally, a pointer event contains the usual properties present in mouse events (client coordinates, target element, button states, etc.) in addition to new properties for other
forms of input: pressure, contact geometry, tilt, etc. in fact, the pointerevent interface inherits all of the mouseevent properties, thus facilitating the migration of content from mouse events to pointer events. terminology active buttons state the condition when a pointer has a non-zero value for the buttons property. for example, in the case of a pen, when the pen has physical contact with th...
... if a browser supports pointer events, the browser must still process mouse events so content that assumes mouse-only input will work as is without direct modification. ideally, a pointer enabled application does not need to explicitly handle mouse input. however, because the browser must process mouse events, there may be some compatibility issues that need to be handled. this section contains in
formation about pointer event and mouse event interaction and the ramifications for application developers. the browser may map generic pointer input to mouse events for compatibility with mouse-based content. this mapping of events is called compatibility mouse events. authors can prevent the production of certain compatibility mouse events by canceling the pointerdown event but note that: mouse ...
...hat: mouse events can only be prevented when the pointer is down. hovering pointers (e.g. a mouse with no buttons pressed) cannot have their mouse events prevented. the mouseover, mouseout, mouseenter, and mouseleave events are never prevented (even if the pointer is down). best practices here are some best practices to consider when using pointer events: minimize the amount of work per
formed in event handlers. add the event handlers to a specific target element (rather than the entire document or nodes higher up in the document tree). the target element (node) should be large enough to accommodate the largest contact surface area (typically a finger touch). if the target area is too small, touching it could result in firing other events for adjacent elements. specifications ...
PublicKeyCredentialCreationOptions - Web APIs
optional an object with several client extensions' inputs. those extensions are used to request additional processing (e.g. dealing with legacy fido apis credentials, prompting a specific text on the authenticator, etc.). methods none. ...
...: "example corp", id: "login.example.com", icon: "https://login.example.com/login.ico" }, // cryptographic challenge from the server challenge: new uint8array(26), // user user: { id: new uint8array(16), name: "john.p.smith@example.com", displayname: "john p. ...
...g_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-plat
form", 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: "publ...
Push API - Web APIs
is in the foreground, or even currently loaded, on a user agent. this lets developers deliver asynchronous notifications and updates to users that opt in, resulting in better engagement with timely new content. push concepts and usage when implementing pushmanager subscriptions, it is vitally important that you protect against csrf/xsrf issues in your app. ...
... the service worker will be started as necessary to handle incoming push messages, which are delivered to the serviceworkerglobalscope.onpush event handler. ...
... note: chrome versions earlier than 52 require you to set up a project on google cloud messaging to send push messages, and use the associated project number and api key when sending push notifications. it also requires an app manifest, with some special parameters to use this service. interfaces pushevent represents a push action, sent to the global scope of a serviceworker. it contains in
formation sent from an application to a pushsubscription. pushmanager provides a way to receive notifications from third-party servers, as well as request urls for push notifications. this interface has replaced the functionality offered by the obsolete pushregistrationmanager interface. pushmessagedata provides access to push data sent by a server, and includes methods to manipulate the received ...
RTCConfiguration - Web APIs
s used to provide configuration options for an rtcpeerconnection. it may be passed into the constructor when instantiating a connection, or used with the rtcpeerconnection.getconfiguration() and rtcpeerconnection.setconfiguration() methods, which allow inspecting and changing the configuration while a connection is established. the options include ice server and transport settings and identity in
formation. properties bundlepolicy optional specifies how to handle negotiation of candidates when the remote peer is not compatible with the sdp bundle standard. this must be one of the values from the enum rtcbundlepolicy. if this value isn't included in the dictionary, "balanced" is assumed. certificates optional an array of objects of type rtccertificate which are used by the connection for...
...e which are used by the connection for authentication. if this property isn't specified, a set of certificates is generated automatically for each rtcpeerconnection instance. although only one certificate is used by a given connection, providing certificates for multiple algorithms may improve the odds of successfully connecting in some circumstances. see using certificates below for additional in
formation. this configuration option cannot be changed after it is first specified; once the certificates have been set, this property is ignored in future calls to rtcpeerconnection.setconfiguration(). icecandidatepoolsize optional an unsigned 16-bit integer value which specifies the size of the prefetched ice candidate pool. the default value is 0 (meaning no candidate prefetching will occur). ...
...algorithms it and the remote peer support, as determined during dtls handshake. if you don't provide certificates, new ones are generated automatically. one obvious benefit to providing your own is identity key continuity—if you use the same certificate for subsequent calls, the remote peer can tell you're the same caller. this also avoids the cost of generating new keys. <<<--- add link to in
formation about identity --->>> example the configuration below establishes two ice servers. the first one, stun:stun.services.mozilla.com, requires authentication, so the username and password are provided. the second server has two urls: stun:stun.example.com and stun:stun-1.example.com. var configuration = { iceservers: [{ urls: "stun:stun.services.mozilla.com", ...
RTCDataChannel: error event - Web APIs
code); } 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); } break; } // add source file name and line in
formation console.error(" error in file ", err.filename, " at line ", err.linenumber, ", column ", err.columnnumber); }, false); the received event provides details in an rtcerror object called error; rtcerror is an extension of the domexception interface. the error's name is rtcerror and the message is an error string specified by the webrtc layer. error in
formation is output...
...er, ", column ", err.columnnumber); }, false); the received event provides details in an rtcerror object called error; rtcerror is an extension of the domexception interface. the error's name is rtcerror and the message is an error string specified by the webrtc layer. error in
formation is output to the console using console.error(). the message string is always output, as is in
formation about the source file's name, line number, and column number at which the error occurred. in addition, however, depending on the value of errordetail, additional in
formation may be output. each error type has a different set of in
formation output. for example, an sdp syntax error displays the line number of the error within the sdp, and an sctp error displays a message corresponding to the ...
... you can also set up an event handler for error events using the rtcdatachannel interface's onerror event handler property: dc.onerror = ev => { const err = ev.error; /* ... */ } note: since rtcerror is not one of the legacy errors, the value of rtcerror.code is always 0. ...
RTCDtlsTransport - Web APIs
the rtcdtlstransport interface provides access to in
formation about the datagram transport layer security (dtls) transport over which a rtcpeerconnection's rtp and rtcp packets are sent and received by its rtcrtpsender and rtcrtpreceiver objects. a dtls transport is also used to provide in
formation about sctp packets transmitted and received by an connection's data channels. features of the dtls transport include the addition of security to the underlying transport; the rtcdtlstransport interface can be used to obtain in
formation about the underlying transport and the security added to it by the dtls layer. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style=...
... description allocation of dtls transports rtcdtlstransport objects are created when an app calls either setlocaldescription() or setremotedescription(). the number of dtls transports created and how they're used depends on the bundling mode used when creating the rtcpeerconnect...
...ng will be used. some non-browser legacy endpoints, however, may not support bundle. to be able to negotiate with such endpoints (or to exclude them entirely), the rtcconfiguration property bundlepolicy may be provided when creating the connection. the bundlepolicy lets you control how to negotiate with these legacy endpoints. the default policy is "balanced", which provides a balance between per
formance and compatibility. for example, to create the connection using the highest level of bundling: const rtcconfig = { bundlepolicy: "max-bundle" }; const pc = new rtcpeerconnection(rtcconfig); bundling lets you use one rtcdtlstransport to carry the data for multiple higher-level transports, such as multiple rtcrtptransceivers. when not using bundle when the connection is created without ...
RTCIceCandidate - Web APIs
structor rtcicecandidate() creates an rtcicecandidate object to represent a single ice candidate, optionally configured based on an object based on the rtcicecandidateinit dictionary. note: for backward compatibility, the constructor also accepts as input a string containing the value of the candidate property instead of a rtcicecandidateinit object, since the candidate includes all of the in
formation that rtcicecandidateinit does and more. properties candidate read only a domstring representing the transport address for the candidate that can be used for connectivity checks. the
format of this address is a candidate-attribute as defined in rfc 5245. this string is empty ("") if the rtcicecandidate is an "end of candidates" indicator. component read only a domstring which indi...
...nent-id" field in the candidate a-line string. 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. this is used to help optimize ice per
formance while prioritizing and correlating candidates that appear on multiple rtcicetransport objects. ip read only a domstring containing the ip address of the candidate. port read only an integer value indicating the candidate's port number. priority read only a long integer value indicating the candidate's priority. protocol read only a string indicating whether the candidate's protoco...
...age integrity along with a randomly-generated password ("ice-pwd"). you can use this string to verify generations of ice generation; each generation of the same ice process will use the same usernamefragment, even across ice restarts. methods tojson() given the rtcicecandidate's current configuration, tojson() returns a domstring containing a json representation of that configuration in the
form of a rtcicecandidateinit object. examples for examples, see the article signaling and video calling, which demonstrates the entire process. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate' in that specification. candidate recommendation initial definition. ...
RTCPeerConnection.addIceCandidate() - Web APIs
e many candidates which you'll deliver to the ice agent in this way, allowing it to build up a list of potential connection methods. this is covered in more detail in the articles webrtc connectivity and signaling and video calling. syntax apromise = pc.addicecandidate(candidate); addicecandidate(candidate, successcallback, failurecallback); parameters candidate optional an object con
forming to the rtcicecandidateinit dictionary, or an rtcicecandidate object; the contents of the object should be constructed from a message received over the signaling channel, describing a newly received ice candidate that's ready to be delivered to the local ice agent. if no candidate object is specified, or its value is null, an end-of-candidates signal is sent to the remote peer using the end-o...
...idateinit dictionary, or an rtcicecandidate object; the contents of the object should be constructed from a message received over the signaling channel, describing a newly received ice candidate that's ready to be delivered to the local ice agent. ...
... successcallback a function to be called when the ice candidate has been successfully added. this function receives no input parameters and doesn't return a value. failurecallback a function to be called if attempting to add the ice candidate fails. ...
RTCPeerConnection.createAnswer() - Web APIs
the answer is delivered to the returned promise, and should then be sent to the source of the offer to continue the negotiation process. ...
...ect which contains options which customize the answer; this is based on the rtcansweroptions dictionary. deprecated parameters in older code and documentation, you may see a callback-based version of this function. this has been deprecated and its use is strongly discouraged. you should update any existing code to use the promise-based version of createanswer() instead. the parameters for this
form of createanswer() are described below, to aid in updating existing code. successcallback an rtcsessiondescriptioncallback which will be passed a single rtcsessiondescription object describing the newly-created answer. failurecallback an rtcpeerconnectionerrorcallback which will be passed a single domexception object explaining why the request to create an answer failed. options option...
...r failed. options optional an optional rtcofferoptions object providing options requested for the answer. exceptions notreadableerror the identity provider wasn't able to provide an identity assertion. operationerror generation of the sdp failed for some reason; this is a general failure catch-all exception. return value a promise whose fulfillment handler is called with an object con
forming to the rtcsessiondescriptioninit dictionary which contains the sdp answer to be delivered to the other peer. example here is a segment of code taken from the code that goes with the article signaling and video calling. this code comes from the handler for the message sent to carry an offer to another peer across the signaling channel. keep in mind that this is part of the signaling process...
RTCPeerConnection.setRemoteDescription() - Web APIs
the method takes a single parameter—the session description—and it returns a promise which is fulfilled once the description has been changed, asynchronously. this is typically called after receiving an offer or answer from another peer over the signaling server. ...
... would throw an exception if an offer was set outside a stable or have-remote-offer state. deprecated syntax in older code and documentation, you may see a callback-based version of this function used. this has been deprecated and its use is strongly discouraged. you should update any existing code to use the promise-based version of setremotedescription() instead. the parameters for the older
form of setremotedescription() are described below, to aid in updating existing code. pc.setremotedescription(sessiondescription, successcallback, errorcallback); parameters successcallback a javascript function which accepts no input parameters to be be called once the description has been successfully set. at that time, the offer can be sent to a remote peer via the signaling server. errorc...
...accepts no input parameters to be be called once the description has been successfully set. at that time, the offer can be sent to a remote peer via the signaling server. errorcallback a function matching the signautre rtcpeerconnectionerrorcallback which gets called if the description can't be set. it is passed a single domexception object explaining why the request failed. this deprecated
form of the method returns instantaneously without waiting for the actual setting to be done: in case of success, the successcallback will be called; in case of failure, the errorcallback will be called. exceptions when using the deprecated callback-based version of setremotedescription(), the following exceptions may occur: invalidstateerror the connection's signalingstate is "closed", indica...
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
des of the same set of data received by the local peer. usage notes you can think of the local and remote views of the same rtp stream as pairs, each of which has a reference back to the other one. thus, if an rtcstatsreport includes an remote-outbound-rtp statistics object (of type rtcremoteoutboundrtpstreamstats), it should also have a corresponding inbound-rtp object. both of these provide in
formation about the same batch of packets being transmitted from the remote peer to the local device. the difference is that remote-outbound-rtp describes statistics about the transmission(s) from the perspective of the remote peer, while inbound-rtp offers statistics about the incoming data from the local peer's perspective. you can examine, try out, and experiment with this example on glitch. exa...
...e remote peer, while inbound-rtp offers statistics about the incoming data from the local peer's perspective. you can examine, try out, and experiment with this example on glitch. example in this example, we have a pair of functions: the first, networkteststart(), captures an initial report, and the second, networkteststop(), captures a second report, then uses the two reports to output some in
formation about the network conditions... xxx ... networkteststart() this function simply calls the rtcpeerconnection method getstats() to request an rtcstatsreport and store it in the variable startreport. let startreport; async function networkteststart(pc) { if (pc) { startreport = await pc.getstats(); } } given an rtcpeerconnection, pc, this calls its getstats() method to obtain a sta...
...rtp statistics that correspond to these two remote-outbound-rtp records by finding the remoteid property within them whose value is the id of the remote-outbound-rtp record. we use the findreportentry() function described in the previous section for that, storing the located inbound-rtp records in startinboundstats and endinboundstats. now we have all the raw statistics needed to calculate the in
formation we want to display, so we do so: we calculate the amount of time—elapsedtime—that elapsed between the two reports being sent by subtracting the timestamp startreport from that of endreport. we then divide by 1000 to convert the result from milliseconds to seconds. we compute the number of packets sent during this interval—packetssent—by subtracting the two reports' values for the...
ReadableStream.pipeThrough() - Web APIs
the pipethrough() method of the readablestream interface provides a chainable way of piping the current stream through a trans
form stream or any other writable/readable pair. piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. syntax var trans
formedstream = readablestream.pipethrough(trans
formstream[, options]); parameters trans
formstream a trans
formstream (or an object with the structure {writable, readable}) consisting of a readable stream and a writable stream working together to trans
form some data from one
form to another. data writen to the writable stream can be read in some trans
formed state by the readable stream. for example, a textdecoder, has bytes written to it and strings read from it, while a video dec...
...source readable stream will no longer be canceled. in this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. signal: if set to an abortsignal object, ongoing pipe operations can then be aborted via the corresponding abortcontroller. return value the readable side of the trans
formstream. exceptions typeerror the writable and/or readable property of trans
formstream are undefined. examples in the following example (see unpack chunks of a png for the full code running live, and png-trans
form-stream for the source code), an image is fetched and its body retrieved as a readablestream. next, we log the contents of the readable stream, use pipethrough() to send it to a ne...
...to send it to a new function that creates a gray-scaled version of the stream, then log the new stream's contents too. // fetch the original image fetch('png-logo.png') // retrieve its body as readablestream .then(response => response.body) .then(rs => logreadablestream('fetch response stream', rs)) // create a gray-scaled png stream out of the original .then(body => body.pipethrough(new pngtrans
formstream())) .then(rs => logreadablestream('png chunk stream', rs)) specifications specification status comment streamsthe definition of 'pipethrough()' in that specification. living standard initial definition. ...
Resize Observer API - Web APIs
concepts and usage there are a whole raft of use cases for responsive design techniques (and others besides) that respond to changes in an element's size, but previously their implementations have often been hacky and/or brittle. ...
... limited solution would be to listen to changes to a suitable event that hints at the element you are interested in changing size (e.g. the window resize event), then figure out what the new dimensions or other features of the element after a resize using element.getboundingclientrect or window.getcomputedstyle, for example. such a solution tends to only work for limited use cases, be bad for per
formance (continually calling the above methods would result in a big per
formance hit), and often won't work when the browser window size is not changed. the resize observer api provides a solution to exactly these kinds of problems, and more besides, allowing you to easily observe and respond to changes in the size of an element’s content or border box in a per
formant way. it provides a javascript...
...mance hit), and often won't work when the browser window size is not changed. the resize observer api provides a solution to exactly these kinds of problems, and more besides, allowing you to easily observe and respond to changes in the size of an element’s content or border box in a per
formant way. it provides a javascript solution to the often-discussed lack of element queries in the web plat
form. usage is simple, and pretty much the same as other observers, such as per
formance observer or intersection observer — you create a new resizeobserver object using the resizeobserver() constructor, then use resizeobserver.observe() to make it look for changes to a specific element's size. a callback function set up inside the constructor then runs every time the size changes, providing access ...
getBBox() - Web APIs
the smallest rectangle in which the object fits. the coordinates returned are with respect to the current svg space (after the application of all geometry attributes on all the elements contained in the target element). note: getbbox() must return the actual bounding box at the time the method was called—even in case the element has not yet been rendered. it also does not account for any trans
formation applied to the element or its parents. getbbox returns different values than getboundingclientrect(), as the latter returns value relative to the viewport syntax let bboxrect = object.getbbox(); return value the returned value is a svgrect object, which defines the bounding box. this value is irrespective of any trans
formation attribute applied to it or the parent elements. example ...
...urns value relative to the viewport syntax let bboxrect = object.getbbox(); return value the returned value is a svgrect object, which defines the bounding box. this value is irrespective of any trans
formation attribute applied to it or the parent elements. ...
...bbox(); return value the returned value is a svgrect object, which defines the bounding box. this value is irrespective of any trans
formation attribute applied to it or the parent elements. ...
SVGGraphicsElement - Web APIs
methods this interface also inherits methods from its parent, svgelement. svggraphicselem...
...fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svggraphicselement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} note: this interface was introduced in svg 2 and replaces the svglocatable and svgtrans
formable interfaces from svg 1.1. properties this interface also inherits properties from its parent, svgelement. svggraphicselement.trans
form read only an svganimatedtrans
formlist reflecting the computed value of the trans
form property and its corresponding trans
form attribute of the given element. methods this interface also inherits methods from its parent, svgelement. svggraphicselement.getbbox() returns a domrect representing the computed bounding box of the current element. svggraphicselement.getctm() returns a dommatri...
...list reflecting the computed value of the trans
form property and its corresponding trans
form attribute of the given element. methods this interface also inherits methods from its parent, svgelement. svggraphicselement.getbbox() returns a domrect representing the computed bounding box of the current element. svggraphicselement.getctm() returns a dommatrix representing the matrix that trans
forms the current element's coordinate system to its svg viewport's coordinate system. svggraphicselement.getscreenctm() returns a dommatrix representing the matrix that trans
forms the current element's coordinate system to the coordinate system of the svg viewport for the svg document fragment. specifications specification status comment scalable vector graphics (svg)...
ScrollToOptions.behavior - Web APIs
or happen instantly in a single jump. this is actually defined on the scrolloptions dictionary, which is implemented by scrolltooptions. syntax behavior: scrollbehavior value an enum, the value of which can be one of the following: smooth: the scrolling animates smoothly. auto: the scrolling happens in a single jump. ...
...the scrolling animates smoothly. auto: the scrolling happens in a single jump. examples in our scrolltooptions example (see it live) we include a
form that allows the user to enter three values — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. ...
...ues — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. when the
form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter:
form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: leftinput.value, top: topinput.value, behavior: scrollinput.checked ? 'smooth' : 'auto' } window.scrollto(scrolloptions); }); specifications specification status comment css object model (cssom) view modulethe definition of 'behavior' in that specification. working...
ScrollToOptions.left - Web APIs
the left property of the scrolltooptions dictionary specifies the number of pixels along the x axis to scroll the window or element. syntax left: double value a double. examples in our scrolltooptions example (see it live) we include a
form that allows the user to enter three values — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. ...
...x axis to scroll the window or element. syntax left: double value a double. examples in our scrolltooptions example (see it live) we include a
form that allows the user to enter three values — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. ...
...ues — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. when the
form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter:
form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: leftinput.value, top: topinput.value, behavior: scrollinput.checked ? 'smooth' : 'auto' } window.scrollto(scrolloptions); }); specifications specification status comment css object model (cssom) view modulethe definition of 'left' in that specification. working dra...
ScrollToOptions.top - Web APIs
the top property of the scrolltooptions dictionary specifies the number of pixels along the y axis to scroll the window or element. syntax top: double value a double. examples in our scrolltooptions example (see it live) we include a
form that allows the user to enter three values — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. ...
... y axis to scroll the window or element. syntax top: double value a double. examples in our scrolltooptions example (see it live) we include a
form that allows the user to enter three values — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. ...
...ues — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. when the
form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter:
form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: leftinput.value, top: topinput.value, behavior: scrollinput.checked ? 'smooth' : 'auto' } window.scrollto(scrolloptions); }); specifications specification status comment css object model (cssom) view modulethe definition of 'top' in that specification. working draf...
ScrollToOptions - Web APIs
ent. scrolltooptions.left specifies the number of pixels along the x axis to scroll the window or element. scrolltooptions.behavior specifies whether the scrolling should animate smoothly, or happen instantly in a single jump. this is actually defined on the scrolloptions dictionary, which is implemented by scrolltooptions. ...
...fined on the scrolloptions dictionary, which is implemented by scrolltooptions. examples in our scrolltooptions example (see it live) we include a
form that allows the user to enter three values — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. ...
...ues — two numbers representing the left and top properties (i.e. the positions to scroll to along the x and y axes), and a checkbox indicating whether they want smooth scrolling enabled or not. when the
form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter:
form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: leftinput.value, top: topinput.value, behavior: scrollinput.checked ? 'smooth' : 'auto' } window.scrollto(scrolloptions); }); specifications specification status comment css object model (cssom) view modulethe definition of 'scrolltooptions' in that specification. ...
Using server-sent events - Web APIs
when not used over http/2, sse suffers from a limitation to the maximum number of open connections, which can be especially painful when opening multiple tabs, as the limit is per browser and is set to a very low number (6). the issue has been marked as "won't fix" in chrome and firefox. this limit is per browser + domain, which means that you can open 6 sse connections across all of the ...
...ww.example2.com (per stackoverflow). when using http/2, the maximum number of simultaneous http streams is negotiated between the server and the client (defaults to 100). sending events from the server the server-side script that sends events needs to respond using the mime type text/event-stream. each notification is sent as a block of text terminated by a pair of newlines. for details on the
format of the event stream, see event stream
format. 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. echo "event: ping\n"; $curdate = date(date_iso8601); echo 'data: {"time": "' . $cu...
...an take action on this programmatically by implementing the onerror callback on the eventsource object: evtsource.onerror = function(err) { console.error("eventsource failed:", err); }; closing event streams by default, if the connection between the client and server closes, the connection is restarted. the connection is terminated with the .close() method. evtsource.close(); event stream
format the event stream is a simple stream of text data which must be encoded using utf-8. messages in the event stream are separated by a pair of newline characters. a colon as the first character of a line is in essence a comment, and is ignored. note: the comment line can be used to prevent connections from timing out; a server can send a comment periodically to keep the connection alive. each m...
ServiceWorkerGlobalScope: pushsubscriptionchange event - Web APIs
cation's control. this may occur if the subscription was refreshed by the browser, but it may also happen if the subscription has been revoked or lost. ...
...nchangeevent event handler property onpushsubscriptionchange usage notes although examples demonstrating how to share subscription related in
formation with the application server tend to use fetch(), this is not necessarily the best choice for real-world use, since it will not work if the app is offline, for example. consider using another method to synchronize subscription in
formation between your service worker and the app server, or make sure your code using fetch() is robust enough to handle cases where attempts to exchange data fail. note: in earlier drafts of the specification, this event was defined to be sent when a pushsubscription has expired. examples this example, run in the context of a service worker, listens for a pushsubscriptionchange event and re-sub...
....stringify({ endpoint: subscription.endpoint }) }); }) ); }, false); when a pushsubscriptionchange event arrives, indicating that the subscription has expired, we resubscribe by calling the push manager's subscribe() method. when the returned promise is resolved, we receive the new subscription. this is delivered to the app server using a fetch() call to post a json
formatted rendition of the subscription's endpoint to the app server. you can also use the onpushsubscriptionchange event handler property to set up the event handler: self.onpushsubscriptionchange = event => { event.waituntil(swregistration.pushmanager.subscribe(event.oldsubscription.options) .then(subscription => { /* ... */ ) }; specifications specification status ...
Service Worker API - Web APIs
ble the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server. they will also allow access to push notifications and background sync apis. service worker concepts and usage a service worker is an event-driven worker registered against an origin and a path. it takes the
form of a javascript file that can control the web-page/site that it is associated with, intercepting and modifying navigation and resource requests, and caching resources in a very granular fashion to give you complete control over how your app behaves in certain situations (the most obvious one being when the network is not available). a service worker is run in a worker context: it therefore has n...
...nding to resource requests from other origins. receiving centralized updates to expensive-to-calculate data such as geolocation or gyroscope, so multiple pages can make use of one set of data. client-side compiling and dependency management of coffeescript, less, cjs/amd modules, etc. for development purposes. hooks for background services. custom templating based on certain url patterns. per
formance enhancements, for example pre-fetching resources that the user is likely to need in the near future, such as the next few pictures in a photo album. in the future, service workers will be able to do a number of other useful things for the web plat
form that will bring it closer towards native app viability. interestingly, other specifications can and will start to make use of the service wor...
...e event object of a message event fired on a service worker (when a channel message is received on the serviceworkerglobalscope from another context) — extends the lifetime of such events. fetchevent the parameter passed into the serviceworkerglobalscope.onfetch handler, fetchevent represents a fetch action that is dispatched on the serviceworkerglobalscope of a serviceworker. it contains in
formation about the request and resulting response, and provides the fetchevent.respondwith() method, which allows us to provide an arbitrary response back to the controlled page. installevent the parameter passed into the oninstall handler, the installevent interface represents an install action that is dispatched on the serviceworkerglobalscope of a serviceworker. as a child of extendableevent, ...
SpeechRecognitionError.error - Web APIs
ce-not-allowed the user agent disallowed the requested speech recognition service, either because the user agent doesn't support it or because of reasons of security, privacy or user preference. in this case it would allow another more suitable speech recognition service to be used instead. ...
...r agent disallowed the requested speech recognition service, either because the user agent doesn't support it or because of reasons of security, privacy or user preference. in this case it would allow another more suitable speech recognition service to be used instead. ...
...d-grammar there was an error in the speech recognition grammar or semantic tags, or the chosen grammar
format or semantic tag
format was unsupported. language-not-supported the language was not supported. ...
SpeechRecognitionErrorEvent.error - Web APIs
ce-not-allowed the user agent disallowed the requested speech recognition service, either because the user agent doesn't support it or because of reasons of security, privacy or user preference. in this case it would allow another more suitable speech recognition service to be used instead. ...
...r agent disallowed the requested speech recognition service, either because the user agent doesn't support it or because of reasons of security, privacy or user preference. in this case it would allow another more suitable speech recognition service to be used instead. bad-grammar there was an error in the speech recognition grammar or semantic tags, or the chosen grammar
format or semantic tag
format was unsupported. ...
...d-grammar there was an error in the speech recognition grammar or semantic tags, or the chosen grammar
format or semantic tag
format was unsupported. language-not-supported the language was not supported. examples var recognition = new speechrecognition(); recognition.onerror = function(event) { console.log('speech recognition error detected: ' + event.error); console.log('additional in
formation: ' + event.message); } specifications specification status comment web speech apithe definition of 'error' in that specification. draft ...
SpeechSynthesisErrorEvent.error - Web APIs
navailable the voice set in speechsynthesisutterance.voice was not available. text-too-long the contents of the speechsynthesisutterance.text attribute was too long to synthesize. invalid-argument the content of the speechsynthesisutterance.rate, speechsynthesisutterance.pitch or speechsynthesisutterance.volume property was not valid. ...
...eechsynthesisutterance.voice was not available. text-too-long the contents of the speechsynthesisutterance.text attribute was too long to synthesize. invalid-argument the content of the speechsynthesisutterance.rate, speechsynthesisutterance.pitch or speechsynthesisutterance.volume property was not valid. ...
...nvalid-argument the content of the speechsynthesisutterance.rate, speechsynthesisutterance.pitch or speechsynthesisutterance.volume property was not valid. examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
SpeechSynthesisUtterance.SpeechSynthesisUtterance() - Web APIs
or of the speechsynthesisutterance interface returns a new speechsynthesisutterance object instance. syntax var utterthis = new speechsynthesisutterance(text); parameters text a domstring containing the text that will be synthesized when the utterance is spoken.. examples the following snippet is excerpted from our speech synthesizer demo. ...
...nce interface returns a new speechsynthesisutterance object instance. syntax var utterthis = new speechsynthesisutterance(text); parameters text a domstring containing the text that will be synthesized when the utterance is spoken.. examples the following snippet is excerpted from our speech synthesizer demo. ...
... domstring containing the text that will be synthesized when the utterance is spoken.. examples the following snippet is excerpted from our speech synthesizer demo. var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
SpeechSynthesisUtterance.lang - Web APIs
nce interface gets and sets the language of the utterance. if unset, the app's (i.e. the <html> lang value) lang will be used, or the user-agent default if that is unset too. syntax var mylang = speechsynthesisutteranceinstance.lang; speechsynthesisutteranceinstance.lang = 'en-us'; value a domstring representing a bcp 47 language tag. ...
... language of the utterance. if unset, the app's (i.e. the <html> lang value) lang will be used, or the user-agent default if that is unset too. syntax var mylang = speechsynthesisutteranceinstance.lang; speechsynthesisutteranceinstance.lang = 'en-us'; value a domstring representing a bcp 47 language tag. ...
...var mylang = speechsynthesisutteranceinstance.lang; speechsynthesisutteranceinstance.lang = 'en-us'; value a domstring representing a bcp 47 language tag. examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
SpeechSynthesisUtterance.onboundary - Web APIs
the onboundary property of the speechsynthesisutterance interface represents an event handler that will run when the spoken utterance reaches a word or sentence boundary (when the boundary event fires.) syntax speechsynthesisutteranceinstance.onboundary = function() { ... ...
... the onboundary property of the speechsynthesisutterance interface represents an event handler that will run when the spoken utterance reaches a word or sentence boundary (when the boundary event fires.) syntax speechsynthesisutteranceinstance.onboundary = function() { ... ...
...en utterance reaches a word or sentence boundary (when the boundary event fires.) syntax speechsynthesisutteranceinstance.onboundary = function() { ... }; examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
SpeechSynthesisUtterance.onend - Web APIs
the onend property of the speechsynthesisutterance interface represents an event handler that will run when the utterance has finished being spoken (when the end event fires.) syntax speechsynthesisutteranceinstance.onend = function() { ... ...
... the onend property of the speechsynthesisutterance interface represents an event handler that will run when the utterance has finished being spoken (when the end event fires.) syntax speechsynthesisutteranceinstance.onend = function() { ... ...
...that will run when the utterance has finished being spoken (when the end event fires.) syntax speechsynthesisutteranceinstance.onend = function() { ... }; examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
SpeechSynthesisUtterance.onerror - Web APIs
the onerror property of the speechsynthesisutterance interface represents an event handler that will run when an error occurs that prevents the utterance from being succesfully spoken (when the error event fires.) syntax speechsynthesisutteranceinstance.onerror = function() { ... ...
... the onerror property of the speechsynthesisutterance interface represents an event handler that will run when an error occurs that prevents the utterance from being succesfully spoken (when the error event fires.) syntax speechsynthesisutteranceinstance.onerror = function() { ... ...
...t prevents the utterance from being succesfully spoken (when the error event fires.) syntax speechsynthesisutteranceinstance.onerror = function() { ... }; examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
SpeechSynthesisUtterance.onmark - Web APIs
the onmark property of the speechsynthesisutterance interface represents an event handler that will run when the spoken utterance reaches a named ssml mark tag (when the mark event fires.) syntax speechsynthesisutteranceinstance.onmark = function() { ... ...
... the onmark property of the speechsynthesisutterance interface represents an event handler that will run when the spoken utterance reaches a named ssml mark tag (when the mark event fires.) syntax speechsynthesisutteranceinstance.onmark = function() { ... ...
... when the spoken utterance reaches a named ssml mark tag (when the mark event fires.) syntax speechsynthesisutteranceinstance.onmark = function() { ... }; examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
SpeechSynthesisUtterance.onpause - Web APIs
the onpause property of the speechsynthesisutterance interface represents an event handler that will run when the utterance is paused part way through (when the pause event fires.) this occurs when the speechsynthesis.pause() method is invoked. syntax speechsynthesisutteranceinstance.onpause = function() { ... ...
...ause property of the speechsynthesisutterance interface represents an event handler that will run when the utterance is paused part way through (when the pause event fires.) this occurs when the speechsynthesis.pause() method is invoked. syntax speechsynthesisutteranceinstance.onpause = function() { ... ...
...pause event fires.) this occurs when the speechsynthesis.pause() method is invoked. syntax speechsynthesisutteranceinstance.onpause = function() { ... }; examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
SpeechSynthesisUtterance.onresume - Web APIs
esume property of the speechsynthesisutterance interface represents an event handler that will run when a paused utterance is resumed (when the resume event fires.) this occurs when the speechsynthesis.resume() method is invoked on a paused speech synthesis instance. syntax speechsynthesisutteranceinstance.onresume = function() { ... ...
...thesisutterance interface represents an event handler that will run when a paused utterance is resumed (when the resume event fires.) this occurs when the speechsynthesis.resume() method is invoked on a paused speech synthesis instance. syntax speechsynthesisutteranceinstance.onresume = function() { ... ...
...e speechsynthesis.resume() method is invoked on a paused speech synthesis instance. syntax speechsynthesisutteranceinstance.onresume = function() { ... }; examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
SpeechSynthesisUtterance.onstart - Web APIs
the onstart property of the speechsynthesisutterance interface represents an event handler that will run when the utterance has begun to be spoken (when the start event fires.) this occurs when the speechsynthesis.speak() method is invoked. syntax speechsynthesisutteranceinstance.onstart = function() { ... ...
... onstart property of the speechsynthesisutterance interface represents an event handler that will run when the utterance has begun to be spoken (when the start event fires.) this occurs when the speechsynthesis.speak() method is invoked. syntax speechsynthesisutteranceinstance.onstart = function() { ... ...
...start event fires.) this occurs when the speechsynthesis.speak() method is invoked. syntax speechsynthesisutteranceinstance.onstart = function() { ... }; examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
SpeechSynthesisUtterance.pitch - Web APIs
the pitch property of the speechsynthesisutterance interface gets and sets the pitch at which the utterance will be spoken at. if unset, a default value of 1 will be used. syntax // default 1 speechsynthesisutteranceinstance.pitch = 1.5; value a float representing the pitch value. ...
...ch = 1.5; value a float representing the pitch value. it can range between 0 (lowest) and 2 (highest), with 1 being the default pitch for the current plat
form or voice. some speech synthesis engines or voices may constrain the minimum and maximum rates further. if ssml is used, this value will be overridden by prosody tags in the markup. examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
...ynthesis engines or voices may constrain the minimum and maximum rates further. if ssml is used, this value will be overridden by prosody tags in the markup. examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
SpeechSynthesisUtterance.voice - Web APIs
ynthesis.getvoices(). if not set by the time the utterance is spoken, the voice used will be the most suitable default voice available for the utterance's lang setting. syntax var myvoice = speechsynthesisutteranceinstance.voice; speechsynthesisutteranceinstance.voice = speechsynthesisvoiceinstance; value a speechsynthesisvoice object. ...
...t by the time the utterance is spoken, the voice used will be the most suitable default voice available for the utterance's lang setting. syntax var myvoice = speechsynthesisutteranceinstance.voice; speechsynthesisutteranceinstance.voice = speechsynthesisvoiceinstance; value a speechsynthesisvoice object. ...
...oice = speechsynthesisutteranceinstance.voice; speechsynthesisutteranceinstance.voice = speechsynthesisvoiceinstance; value a speechsynthesisvoice object. examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
SpeechSynthesisUtterance.volume - Web APIs
ill be spoken at. if not set, the default value 1 will be used. syntax var myvolume = speechsynthesisutteranceinstance.volume; speechsynthesisutteranceinstance.volume = 0.5; value a float that represents the volume value, between 0 (lowest) and 1 (highest.) if ssml is used, this value will be overridden by prosody tags in the markup. ...
...the default value 1 will be used. syntax var myvolume = speechsynthesisutteranceinstance.volume; speechsynthesisutteranceinstance.volume = 0.5; value a float that represents the volume value, between 0 (lowest) and 1 (highest.) if ssml is used, this value will be overridden by prosody tags in the markup. ...
... a float that represents the volume value, between 0 (lowest) and 1 (highest.) if ssml is used, this value will be overridden by prosody tags in the markup. examples var synth = window.speechsynthesis; var input
form = document.queryselector('
form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
SubmitEvent() - Web APIs
the submitevent() constructor creates and returns a new submitevent object, which is used to represent a submit event fired at an html
form. syntax let submitevent = new submitevent(type,eventinitdict); parameters type a domstring indicating the event which occurred. for submitevent, this is always submit. eventinitdict optional an optional dictionary of initial values for the event's properties. return value a submitevent object configured using the given inputs. examples this code snippet locates a
form in the current document, and then an html <button> within the
form with the class submit on it. ...
... the event's properties. return value a submitevent object configured using the given inputs. examples this code snippet locates a
form in the current document, and then an html <button> within the
form with the class submit on it. next, a new submitevent is created, configured with its submitter set to the identified button (or null if the button wasn't found). then the event is sent to the
form, telling the
form that it's been submitted by the button. ...
...ed using the given inputs. examples this code snippet locates a
form in the current document, and then an html <button> within the
form with the class submit on it. next, a new submitevent is created, configured with its submitter set to the identified button (or null if the button wasn't found). then the event is sent to the
form, telling the
form that it's been submitted by the button. const
form = document.queryselector("
form"); const
formtrigger =
form.queryselector("button.submit"); const submitevent = new submitevent("submit", { submitter:
formtrigger });
form.dispatchevent(submitevent); this is a somewhat contrived example, as you can do nearly all of this much more easily, but this gives you deep control over the process that can be useful. specifications specification ...
SubmitEvent - Web APIs
the submitevent interface defines the object used to represent an html
form's submit event. this event is fired at the <
form> when the
form's submit action is invoked. 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. properties in addition to the properties listed below, this interface inherits the properties of its parent interface, event. submitter read only an htmlelement object which identifies the button or other element which was invoked to trigger the
form being submitted. methods while submitevent offers no methods of its own, it inherits any specified by its parent interface, event. examples in this example, a shopping...
...cified by its parent interface, event. examples in this example, a shopping cart may have an assortment of different submit buttons depending on factors such as the user's settings, the shop's settings, and any minimum or maximum shopping card totals established by the payment processors. each of the submit elements' id is used to identify which payment processor the button corresponds to. 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. please try again.", "ok"); } }); the handler id is obtained by using the submit event's submitter property to get ...
... if (handler) { processorder(
form, handler); } else { showalertmessage("an unknown or unaccepted payment type was selected. please try again.", "ok"); } }); the handler id is obtained by using the submit event's submitter property to get the submit button, from which we then get the id. with that in hand, we can call a processorder() function to handle the order, passing along the
form and the handler id. specifications specification status comment html living standardthe definition of 'submitevent' in that specification. living standard ...
SubtleCrypto.exportKey() - Web APIs
the exportkey() method of the subtlecrypto interface exports a key: that is, it takes as input a cryptokey object and gives you the key in an external, portable
format. to export a key, the key must have cryptokey.extractable set to true. keys can be exported in several
formats: see supported
formats in the subtlecrypto.importkey() page for details. keys are not exported in an encrypted
format: to encrypt keys when exporting them use the subtlecrypto.wrapkey() api instead. syntax const result = crypto.subtle.exportkey(
format, key); parameters
format is a string value describing the data
format in which the key should be exported. it can be one of the following: raw: raw
format. pkcs8: pkcs #8
format. spki: subjectpublickeyinfo
format. jwk: json web key
format. ...
...tax const result = crypto.subtle.exportkey(
format, key); parameters
format is a string value describing the data
format in which the key should be exported. it can be one of the following: raw: raw
format. pkcs8: pkcs #8
format. spki: subjectpublickeyinfo
format. jwk: json web key
format. key is the cryptokey to export. return value result is a promise. if
format was jwk, then the promise fulfills with a json object containing the key. otherwise the promise fulfills with an arraybuffer containing the key. exceptions the promise is rejected when one of the following exceptions is encountered: invalidaccesserror raised when trying to export a non-extractable key. notsupported raised when trying to export in an unknown
format. typeerror ...
... with a json object containing the key. otherwise the promise fulfills with an arraybuffer containing the key. exceptions the promise is rejected when one of the following exceptions is encountered: invalidaccesserror raised when trying to export a non-extractable key. notsupported raised when trying to export in an unknown
format. typeerror raised when trying to use an invalid
format. examples note: you can try the working examples out on github. raw export this example exports an aes key as an arraybuffer containing the bytes for the key. see the complete code on github. /* export the given key and write it into the "exported-key" space. */ async function exportcryptokey(key) { const exported = await window.crypto.subtle.exportkey( "raw", key ); const...
TaskAttributionTiming - Web APIs
the taskattributiontiming interface of the long tasks api returns in
formation about the work involved in a long task and its associate frame context. the frame context, also called the container, is the iframe, embed or object that is being implicated, on the whole, for a long task. ...
...ect that is being implicated, on the whole, for a long task. ...
...n: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/per
formanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">per
formanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/taskattributiontiming" target="_top"><rect x="201" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="306" y="30" font-size="12px" font-family="consolas,monaco,andale mono...
URL API - Web APIs
url concepts and usage the majority of the url standard is taken up by the definition of a url and how it is structured and parsed. also covered are definitions of various terms related to addressing of computers on a network, and the algorithms for parsing ip addresses and dom addresses are specified. ...
... url concepts and usage the majority of the url standard is taken up by the definition of a url and how it is structured and parsed. also covered are definitions of various terms related to addressing of computers on a network, and the algorithms for parsing ip addresses and dom addresses are specified. ...
... url concepts and usage the majority of the url standard is taken up by the definition of a url and how it is structured and parsed. also covered are definitions of various terms related to addressing of computers on a network, and the algorithms for parsing ip addresses and dom addresses are specified. ...
ValidityState.typeMismatch - Web APIs
the email input type expects one or more valid email addresses, depending on whether the multiple attribute is present. a valid email address includes an email prefix and a domain, with or without a top level domain. ...
... the email input type expects one or more valid email addresses, depending on whether the multiple attribute is present. a valid email address includes an email prefix and a domain, with or without a top level domain. ...
...lid email urls, depending on whether the multiple attribute is present. a valid url includes a protocol, optionally with an ip address, or an optional subdomain, domain, and top level domain combination. if the value of the url input is not an empty string, a single valid url, or one or more comma separated urls if the multiple attribute is present, there is a typemismatch. ...
Visual Viewport API - Web APIs
n elements relative to the visual viewport that would normally be anchored to the layout viewport. accessing the api window.visualviewport read only a read-only reference to the window's visualviewport object. if this property doesn't exist, the api is unsupported. interfaces visualviewport represents the visual viewport for a given window. a window's visualviewport object provides in
formation about the viewport's position and size, and receives the resize and event:visualviewport:scroll events you can onitor to know when chances occur to the window's viewport. example the code below is based on the sample the specification, though it adds a few things that make it function better. it shows a function called viewporthandler(). when called it queries the offsetleft and height pr...
...nslate() method. you invoke this function by passing it to both event calls. one thing that may not be clear in this example is the use of the pendingupdate flag and the call to requestanimationframe(). the pendingupdate flag serves to prevent multiple invocations of the transfrom that can occur when onresize and onscroll fire at the same time. using requestanimationframe() ensures that the trans
form ocurrs before the next render. let pendingupdate = false; function viewporthandler(event) { if (pendingupdate) return; pendingupdate = true; requestanimationframe(() => { pendingupdate = false; var layoutviewport = document.getelementbyid('layoutviewport'); // since the bar is position: fixed we need to offset it by the // visual viewport's offset from the layout viewpor...
...sual viewport's offset from the layout viewport origin. var viewport = event.target; var offsetleft = viewport.offsetleft; var offsettop = viewport.height - layoutviewport.getboundingclientrect().height + viewport.offsettop; // you could also do this by setting style.left and style.top if you // use width: 100% instead. ...
WEBGL_compressed_texture_astc - Web APIs
availability: astc compression is typically available on mali arm gpus, intel gpus, and nividia tegra chips. this extension is available to both, webgl1 and webgl2 contexts. methods this extension exposes one new methods. ...
... availability: astc compression is typically available on mali arm gpus, intel gpus, and nividia tegra chips. this extension is available to both, webgl1 and webgl2 contexts. methods this extension exposes one new methods. ...
...availability: astc compression is typically available on mali arm gpus, intel gpus, and nividia tegra chips. this extension is available to both, webgl1 and webgl2 contexts. methods this extension exposes one new methods. ext.getsupportedprofiles() returns an array of strings containing the names of the astc profiles supported by the implementation. constants the compressed texture
formats are exposed by 28 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d(). constants blocks bits per pixel arraybuffer bytelength bytes if height and width are 512 ext.compressed_rgba_astc_4x4_khr ext.compressed_srgb8_alpha8_astc_4x4_khr 4x4 8.00 floor((width + 3) / 4) * floor((height + 3) / 4) * 16 262144 ...
WEBGL_compressed_texture_pvrtc - Web APIs
availability: pvrtc is typically only available on mobile devices with powervr chipsets. it is used in all generations of the iphone, ipod touch and ipad and supported on certain android devices that use a powervr gpu. ...
... availability: pvrtc is typically only available on mobile devices with powervr chipsets. it is used in all generations of the iphone, ipod touch and ipad and supported on certain android devices that use a powervr gpu. ...
...ility: pvrtc is typically only available on mobile devices with powervr chipsets. it is used in all generations of the iphone, ipod touch and ipad and supported on certain android devices that use a powervr gpu. this extension is available to both, webgl1 and webgl2 contexts. note: on ios devices, this extension is named webkit_webgl_compressed_texture_pvrtc. constants the compressed texture
formats are exposed by four constants and can be used in two functions: compressedteximage2d() (where the height and width parameters must be powers of 2) and compressedtexsubimage2d() (where the the height and width parameters must equal the current values of the existing texture and the xoffset and yoffset parameters must be 0). ext.compressed_rgb_pvrtc_4bppv1_img rgb compression in 4-bit mode. ...
WEBGL_debug_renderer_info - Web APIs
the webgl_debug_renderer_info extension is part of the webgl api and exposes two constants with in
formation about the graphics driver for debugging purposes. depending on the privacy settings of the browser, this extension might only be available to privileged contexts. generally, the graphics driver in
formation should only be used in edge cases to optimize your webgl content or to debug gpu problems. the webglrenderingcontext.getparameter() method can help you to detect which features are supported and the failifmajorper
formancecaveat context attribute lets you control if a context should be returned at all, if the per
formance would be dramatically slow. ...
... availability: depending on the privacy settings of the browser, this extension might only be available to privileged contexts or not work at all. ...
...firefox, if privacy.resistfingerprinting is set to true, this extensions is disabled. this extension is available to both, webgl1 and webgl2 contexts. constants ext.unmasked_vendor_webgl vendor string of the graphics driver. ext.unmasked_renderer_webgl renderer string of the graphics driver. ...
WebGLActiveInfo - Web APIs
the webglactiveinfo interface is part of the webgl api and represents the in
formation returned by calling the webglrenderingcontext.getactiveattrib() and webglrenderingcontext.getactiveuni
form() methods. properties webglactiveinfo.name the read-only name of the requested variable. webglactiveinfo.size the read-only size of the requested variable. webglactiveinfo.type the read-only type of the requested variable. ...
...bglrenderingcontext.getactiveuni
form() methods. properties webglactiveinfo.name the read-only name of the requested variable. webglactiveinfo.size the read-only size of the requested variable. webglactiveinfo.type the read-only type of the requested variable. ...
...hods. properties webglactiveinfo.name the read-only name of the requested variable. webglactiveinfo.size the read-only size of the requested variable. webglactiveinfo.type the read-only type of the requested variable. examples a webglactiveinfo object is returned by: webglrenderingcontext.getactiveattrib() webglrenderingcontext.getactiveuni
form() or webgl2renderingcontext.gettrans
formfeedbackvarying() webglactiveinfo? getactiveattrib(webglprogram? program, gluint index); webglactiveinfo? getactiveuni
form(webglprogram? program, gluint index); webglactiveinfo? gettrans
formfeedbackvarying(webglprogram? program, gluint index) specifications specification status comment webgl 1.0the definition of 'webglactiveinfo' in that specification. recommendatio...
WebGLContextEvent.statusMessage - Web APIs
this can occur, for example, if the webglcontextcreationerror event is fired. ...
...this can occur, for example, if the webglcontextcreationerror event is fired. ...
...this can occur, for example, if the webglcontextcreationerror event is fired. ...
WebGLRenderingContext.bufferData() - Web APIs
attributes, such as vertex coordinates, texture coordinate data, or vertex color data. gl.element_array_buffer: buffer used for element indices. when using a webgl 2 context, the following values are available additionally: gl.copy_read_buffer: buffer for copying from one buffer object to another. gl.copy_write_buffer: buffer for copying from one buffer object to another. gl.trans
form_feedback_buffer: buffer for trans
form feedback operations. gl.uni
form_buffer: buffer used for storing uni
form blocks. gl.pixel_pack_buffer: buffer used for pixel transfer operations. gl.pixel_unpack_buffer: buffer used for pixel transfer operations. size a glsizeiptr setting the size in bytes of the buffer object's data store. srcdata optional an arraybuffer, sharedarraybuf...
....invalid_value error is thrown if size is negative. a gl.invalid_enum error is thrown if target or usage are not one of the allowed enums. examples using bufferdata var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, 1024, gl.static_draw); getting buffer in
formation to check the current buffer usage and buffer size, use the webglrenderingcontext.getbufferparameter() method. 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. var dataarray = new float32array([1, 2, 3, 4]); var sizeinbytes = dataarray.length * dat...
...fication. recommendation initial definition. opengl es 2.0the definition of 'glbufferdata' in that specification. standard man page of the opengl api. opengl es 3.0the definition of 'glbufferdata' in that specification. standard man page of the (similar) opengl es 3 api. adds new target buffers: gl.copy_read_buffer, gl.copy_write_buffer, gl.trans
form_feedback_buffer, gl.uni
form_buffer, gl.pixel_pack_buffer, gl.pixel_unpack_buffer adds new usage hints: gl.static_read, gl.dynamic_read, gl.stream_read, gl.static_copy, gl.dynamic_copy, gl.stream_copy. ...
WebGLRenderingContext.getTexParameter() - Web APIs
the webglrenderingcontext.gettexparameter() method of the webgl api returns in
formation about the given texture. syntax any gl.gettexparameter(target, pname); parameters target a glenum specifying the binding point (target). possible values: gl.texture_2d: a two-dimensional texture. gl.texture_cube_map: a cube-mapped texture. when using a webgl 2 context, the following values are available additionally: gl.texture_3d: a three-dimensional texture. gl.texture_2d_array: a two-dimensional array texture. pname a glenum specifying the in
formation to query. possible values: pname return type description possible return values available in a webgl 1 context gl.texture_mag_filter glenum texture magn...
...el glint texture mipmap level any int values. gl.texture_compare_func glenum comparison function gl.lequal (default value), gl.gequal, gl.less, gl.greater, gl.equal, gl.notequal, gl.always, gl.never. gl.texture_compare_mode glenum texture comparison mode gl.none (default value), gl.compare_ref_to_texture. gl.texture_immutable_
format glboolean immutability of the texture
format and size true or false. gl.texture_immutable_levels gluint ? any uint values. gl.texture_max_level glint maximum texture mipmap array level any int values. gl.texture_max_lod glfloat texture maximum level-of-detail value any float values. gl.texture_min_lo...
... glfloat texture maximum level-of-detail value any float values. gl.texture_min_lod glfloat texture minimum level-of-detail value any float values. gl.texture_wrap_r glenum wrapping function for texture coordinate r gl.repeat (default value), gl.clamp_to_edge, gl.mirrored_repeat. return value returns the requested texture in
formation (as specified with pname). if an error occurs, null is returned. examples gl.gettexparameter(gl.texture_2d, gl.texture_mag_filter); specifications specification status comment webgl 1.0the definition of 'gettexparameter' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgettexparameter' in that sp...
WebGLRenderingContext.readPixels() - Web APIs
the webglrenderingcontext.readpixels() method of the webgl api reads a block of pixels from a specified rectangle of the current color framebuffer into an arraybufferview object. 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. y a glint specifying the first vertical pixel that is read from the lower left corner of a rectangular block of pixels. width a glsizei specifying the width of the rectangle. height a glsizei specifying the height o...
...s, 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. y a glint specifying the first vertical pixel that is read from the lower left corner of a rectangular block of pixels. width a glsizei specifying the width of the rectangle. height a glsizei specifying the height of the rectangle.
format a glenum specifying the
format of the pixel data. possible values: gl.alpha: discards the red, green and blue components and reads the alpha component. gl.rgb: discards the alpha components and reads the red, green and blue components. gl.rgba: red, green, blue and alpha components are read from the color buffer. webgl2 adds gl.red gl.rg gl.red_integer gl.rg_integer gl...
... pixels an arraybufferview object to read data into. the array type must match the type of the type parameter. uint8array for gl.unsigned_byte. uint16array for gl.unsigned_short_5_6_5, gl.unsigned_short_4_4_4_4, or gl.unsigned_short_5_5_5_1. float32array for gl.float. dstoffset optional offset. defaults to 0. return value none. exceptions a gl.invalid_enum error is thrown if
format or type is not an accepted value. a gl.invalid_operation error is thrown if type is gl.unsigned_short_5_6_5 and
format is not gl.rgb. type is gl.unsigned_short_4_4_4_4 and
format is not gl.rgba. type does not match the typed array type of pixels. a gl.invalid_framebuffer_operation error is thrown if the currently bound framebuffer is not framebuffer complete. examples var ...
Taking still photos with WebRTC - Web APIs
calling htmlmediaelement.play() on the <video>, there's a (hopefully brief) period of time that elapses before the stream of video begins to flow. to avoid blocking until that happens, we add an event listener to video for the canplay event, which is delivered when the video playback actually begins. at that point, all the properties in the video object have been configured based on the stream's
format. video.addeventlistener('canplay', function(ev){ if (!streaming) { height = video.videoheight / (video.videowidth/width); video.setattribute('width', width); video.setattribute('height', height); canvas.setattribute('width', width); canvas.setattribute('height', height); streaming = true; } }, false); this callback does noth...
...eceived event to prevent the click from being handled more than once. wrapping up the startup() method there are only two more lines of code in the startup() method: clearphoto(); } this is where we call the clearphoto() method we'll describe below in the section clearing the photo box. clearing the photo box clearing the photo box involves creating an image, then converting it into a
format usable by the <img> element that displays the most recently captured frame. that code looks like this: function clearphoto() { var context = canvas.getcontext('2d'); context.fillstyle = "#aaa"; context.fillrect(0, 0, canvas.width, canvas.height); var data = canvas.todataurl('image/png'); photo.setattribute('src', data); } we start by getting a reference to the hidden ...
... the current frame of the video into the context, filling the entire canvas with the frame image. note: this takes advantage of the fact that the htmlvideoelement interface looks like an htmlimageelement to any api that accepts an htmlimageelement as a parameter, with the video's current frame presented as the image's contents. once the canvas contains the captured image, we convert it to png
format by calling htmlcanvaselement.todataurl() on it; finally, we call photo.setattribute() to make our captured still box display the image. if there isn't a valid image available (that is, the width and height are both 0), we clear the contents of the captured frame box by calling clearphoto(). fun with filters since we're capturing images from the user's webcam by grabbing frames from a <video>...
Using WebRTC data channels - Web APIs
once you've established a webrtc peer connection using the rtcpeerconnection interface, you're able to send and receive media data between the two peers on the connection. but there's a lot more you can do with webrtc. in this guide, we'll examine how to add a data channel to a peer connection, which can then be used to securely exchange arbitrary data; that is, any kind of data we wish, in any
format we choose. since all webrtc components are required to use encryption, any data transmitted on an rtcdatachannel is automatically secured using datagram transport layer security (dtls). see security below for more in
formation. creating a data channel the underlying data transport used by the rtcdatachannel can be created in one of two ways: let webrtc create the transport and announce i...
...arger, the delays can become untenable unless you are certain of your operational conditions. in order to resolve this issue, a new system of stream schedulers (usually referred to as the "sctp ndata specification") has been designed to make it possible to interleave messages sent on different streams, including streams used to implement webrtc data channels. this proposal is still in ietf draft
form, but once implemented, it will make it possible to send messages with essentially no size limitations, since the sctp layer will automatically interleave the underlying sub-messages to ensure that every channel's data has the opportunity to get through. firefox support for ndata is in the process of being implemented; see bug 1381145 to track it becoming available for general use. the chrome tea...
...ze limitations, since the sctp layer will automatically interleave the underlying sub-messages to ensure that every channel's data has the opportunity to get through. firefox support for ndata is in the process of being implemented; see bug 1381145 to track it becoming available for general use. the chrome team is tracking their implementation of ndata support in chrome bug 5696. much of the in
formation in this section is based in part on the blog post demystifyijng webrtc's data channel message size limitations, written by lennart grahl. he goes into a bit more detail there, but as browsers have been updated since then some of it may be out-of-date. in addition, as time goes by, it will become more so, especially once eor and ndata support are fully integrated in the major browsers. secu...
Fundamentals of WebXR - Web APIs
appropriate session mode string for the kind of session you want to create. virtual reality in a vr environment, the entire image is digitally created by your app or site, from foreground objects all the way to the background or skybox. your frame drawing code will have to redraw every pixel of each view during each frame in order to avoid the potential of artifacts being left behind. ...
...tual reality in a vr environment, the entire image is digitally created by your app or site, from foreground objects all the way to the background or skybox. your frame drawing code will have to redraw every pixel of each view during each frame in order to avoid the potential of artifacts being left behind. some plat
forms may provide previously-cleared frames to you, while others may optimize per
formance by not erasing the framebuffers in order to avoid having to touch each pixel twice per frame. there are two vr session modes available in webxr: inline and immersive. the
former, specified by the session mode string inline, presents the rendered scene within the context of a document in a web browser, and doesn't require special xr hardware to view. the immersive session mode is indicated us...
...op the scene. the user is, thus, directly viewing the real world instead of a series of digital photos of it. both types of device should be capable of also presenting vr sessions. webxr doesn't generally care which type of device you're using, and the rendering process is almost exactly the same as for vr, except you don't erase the background or skybox before rendering each frame. for more in
formation about using webxr to create augmented reality experiences, see augmented reality with webxr. types of webxr hardware the simplest xr presentation involves rendering the scene directly to the user's screen, either in the context of a web document, or in full screen mode. this is most common when the user either doesn't have a dedicated xr device, or when the user is viewing the ar or vr app...
Advanced techniques: Creating and sequencing audio - Web APIs
context: // for cross browser compatibility const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); the "sweep" — oscillators, periodic waves, and envelopes for what we will call the "sweep" sound, that first noise you hear when you dial up, we're going to create an oscillator to generate the sound. the oscillatornode comes with basic wave
forms out of the box — sine, square, triangle or sawtooth. however, instead of using the standard waves that come by default, we're going to create our own using the periodicwave interface and values set in a wavetable. we can use the baseaudiocontext.createperiodicwave method to use this custom wave with an oscillator. the periodic wave first of all, we'll create our periodic wave. to do so, we n...
... a bandpass biquad filter for the job. note: the web audio api comes with two types of filter nodes: biquadfilternode and iirfilternode. for the most part a biquad filter will be good enough — it comes with different types such as lowpass, highpass, and bandpass. if you're looking to do something more bespoke, however, the iir filter might be a good option — see using iir filters for more in
formation. wiring this up is the same as we've seen before. we create the biquadfilternode, configure the properties we want for it and connect it through our graph. different types of biquad filters have different properties — for instance setting the frequency on a bandpass type adjusts the middle frequency, however on a lowpass it would set the top frequency. let bandpass = audioctx.createbiqu...
... response.arraybuffer(); const audiobuffer = await audiocontext.decodeaudiodata(arraybuffer); return audiobuffer; } we can then use the await operator when calling this function, which ensures that we can only run subsequent code when it has finished executing. let's create another async function to set up the sample — we can combine the two async functions in a nice promise pattern to per
form further actions when this file is loaded and buffered: async function setupsample() { const filepath = 'dtmf.mp3'; const sample = await getfile(audioctx, filepath); return sample; } note: you can easily modify the above function to take an array of files and loop over them to load more than one sample. this would be very handy for more complex instruments, or gaming. we can now u...
Web Audio API best practices - Web APIs
there's no strict right or wrong way when writing creative code. as long as you consider security, per
formance, and accessibility, you can adapt to your own style. in this article, we'll share a number of best practices — guidelines, tips, and tricks for working with the web audio api. loading sounds/files there are four main ways to load sound with the web audio api and it can be a little confusing as to which one you should use. when working with files, you are looking at either the grabbing the file from an htmlmediaelement (i.e. an <audio> or <video> element), or you're looking to fetch the file and decode it into a buffer. ...
...re are four main ways to load sound with the web audio api and it can be a little confusing as to which one you should use. when working with files, you are looking at either the grabbing the file from an htmlmediaelement (i.e. an <audio> or <video> element), or you're looking to fetch the file and decode it into a buffer. both are legitimate ways of working, however, it's more common to use the
former when you are working with full-length tracks, and the latter when working with shorter, more sample-like tracks. media elements have streaming support out of the box. the audio will start playing when the browser determines it can load the rest of the file before playing finishes. you can see an example of how to use this with the web audio api in the using the web audio api tutorial. you wil...
...access it via the media stream api and the mediastreamaudiosourcenode interface. this is good for webrtc and situations where you might want to record or possibly analyse audio. the last way is to generate your own sound, which can be done with either an oscillatornode or by creating a buffer and populating it with your own data. check out the tutorial here for creating your own instrument for in
formation on creating sounds with oscillators and buffers. cross browser & legacy support the web audio api specification is constantly evolving and like most things on the web, there are some issues with it working consistently across browsers. here we'll look at options for getting around cross-browser problems. there's the standardised-audio-context npm package, which creates api functionality c...
XRPermissionDescriptor.requiredFeatures - Web APIs
st. syntax xrpermissiondescriptor = { mode: xrsessionmode, requiredfeatures: reqfeaturelist, optionalfeatures: optfeaturelist }; xrpermissiondescriptor.requiredfeatures = reqfeaturelist; reqfeaturelist = xrpermissiondescriptor.requiredfeatures; value an array of strings indicating the webxr features which must be available for use by the app or site. the permissions check will be per
formed in such a manner as to verify that all features in the list are available for use with the user's permission. currently, all features are members of the xrreferencespacetype enumerated type, indicating the reference space types that your app would like permission to use, but can operate without. future editions of webxr may add more recognized features. the permitted values are: the types of...
...t are available for use with the user's permission. currently, all features are members of the xrreferencespacetype enumerated type, indicating the reference space types that your app would like permission to use, but can operate without. future editions of webxr may add more recognized features. the permitted values are: the types of reference space are listed in the table below, with brief in
formation about their use cases and which interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native or...
...rface 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. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying plat
form and implementation. the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case. for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment. xrreferencespace local-floor similar to the local type, except the starting position is...
XRReferenceSpace: reset event - Web APIs
ation frames which make use of the new origin are executed. bubbles yes cancelable no interface xrreferencespaceevent event handler property onreset usage notes the reset event indicates that the coordinate system has been reset or reconfigured by changing the reference space's origin, moving and rotating it as indicated by the event's trans
form property. the event is sent before any animation frame callbacks are executed to render the pending frame, to ensure that those callbacks have the updated coordinate system available. there are a number of reasons why a reset might occur. most common among them are the following: the user has manually reset the coordinate system, such as by requesting that the headset recalibrate itself to en...
...ordinate system). the tracking system has temporarily lost the user, then regained them, but not until after they had moved enough to leave the immediate vicinity of the last-known position. primarily an issue for unbounded reference spaces. the user is in an unbounded reference space and has moved far enough from the starting position (the reference space's origin) that floating-point or other
forms of error or drift are problematic. the coordinate system is thus reset with its new origin at or near the user's current position. the webxr infrastructure or hardware drivers detected that the device had temporarily lost tracking, causing the hardware and software to be out of sync on position and orientation. note: a reset event will not occur if the reference space is able to regain track...
... unbounded reference space as it makes small adjustments to its native origin over time to maintain the space's stability in the vicinity of the user; only large discontinuities will trigger a reset. examples to add a handler for the reset event, you can use either of two approaches. first, you can use the addeventlistener() method: viewerrefspace.addeventlistener("reset", (event) => { /* per
form reset related tasks */ }); the second option is to set the xrreferencespace object's onreset event handler property: viewerrefspace.onreset = (event) => { /* per
form reset related tasks */ }; specifications specification status comment webxr device apithe definition of 'reset event' in that specification. working draft initial definition. ...
XRSession: selectend event - Web APIs
the webxr event selectend is sent to an xrsession when one of its input sources ends its primary action or when an input source that's in the process of handling an ongoing primary action is disconnected without successfully completing the action. primary actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or per
forming a recognizable gesture when using a video tracking system or handheld controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onselectend for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources. examples the followin...
... 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. the mybegintracking() function would presumably start the presentation of the object-dragging process, using the trans
form to per
form a hit test, determining which object to pick up. mybegintracking() returns an object representing the object the user has begun to drag. upon receiving a select event, the mydropobject() function is called with the target object and the current target ray pose trans
form as inputs. this places the object into its new position in the world and triggers any effects that may arise from do...
...ed with the target object and the current target ray pose trans
form as inputs. this places the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the selectend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's trans
form. xrsession.addeventlistener("selectstart", onselectionevent); xrsession.addeventlistener("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.targetra...
XRSession: selectstart event - Web APIs
the webxr event selectstart is sent to an xrsession when the user begins a primary action on one of its input sources. primary actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or per
forming a recognizable gesture when using a video tracking system or handheld controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onselectstart for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources. examples the following example uses addeventlistener() to establish handlers for the selection events: selectstart, selectend, and select. this snip...
... 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. the mybegintracking() function would presumably start the presentation of the object-dragging process, using the trans
form to per
form a hit test, determining which object to pick up. mybegintracking() returns an object representing the object the user has begun to drag. upon receiving a select event, the mydropobject() function is called with the target object and the current target ray pose trans
form as inputs. this places the object into its new position in the world and triggers any effects that may arise from do...
...ed with the target object and the current target ray pose trans
form as inputs. this places the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the selectend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's trans
form. xrsession.addeventlistener("selectstart", onselectionevent); xrsession.addeventlistener("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.targetra...
XRSession: squeezeend event - Web APIs
the webxr event squeezeend is sent to an xrsession when one of its input sources ends its primary action or when an input source that's in the process of handling an ongoing primary action is disconnected without successfully completing the action. primary squeeze actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or per
forming a recognizable gesture when using a video tracking system or handheld controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onsqueezeend for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources. e...
...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. the mybegintracking() function would presumably start the presentation of the object-dragging process, using the trans
form to per
form a hit test, determining which object to pick up. mybegintracking() returns an object representing the object the user has begun to drag. upon receiving a squeeze event, the mydropobject() function is called with the target object and the current target ray pose trans
form as inputs. this places the object into its new position in the world and triggers any effects that may arise from d...
...d with the target object and the current target ray pose trans
form as inputs. this places the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the squeezeend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's trans
form. xrsession.addeventlistener("squeezestart", onsqueezeevent); xrsession.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.targetrayspac...
XRSession - Web APIs
the webxr device api's xrsession interface represents an ongoing xr session, providing methods and properties used to interact with and control the session. to open a webxr session, use the xrsystem interface's requestsession() method. with xrsession methods, you can poll the viewer's position and orientation (the xrviewerpose), gather in
formation about the user's environment, and present imagery to the user. xrsession supports both inline and immersive virtual and augmented reality modes. properties in addition to the properties listed below, xrsession inherits properties from its parent interface, eventtarget. environmentblendmode read only returns this session's blend mode which denotes how much of the real-world environment is visible through the xr device and how t...
...st of this session's xrinputsources, each representing an input device used to control the camera and/or scene. renderstate read only an xrrenderstate object which contains options affecting how the imagery is rendered. this includes things such as the near and far clipping planes (distances defining how close and how far away objects can be and still get rendered), as well as field of view in
formation. 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. methods xrsession provides the following methods in addition to those inherited from its parent interface, eventtarget. ...
...n the list of active xr input sources has changed. also available through the oninputsourceschange event handler property. select an event of type xrinputsourceevent which is sent to the session when one of the session's input sources has successfully completed a primary action. this generally corresponds to the user pressing a trigger, touchpad, or button, speaks a command, or per
forms a recognizable gesture. the select event is sent after the selectstart event is sent and immediately before the selectend event is sent. if select is not sent, then the select action was aborted before being completed. also available through the onselect event handler property. selectend an event of type xrinputsourceevent which gets sent to the session object when one of its inp...
Using the article role - Accessibility
examples of an article include web log posts, newspaper or magazine articles and use-submitted comments. it is independent in that its contents could stand alone, for example in syndication. articles can be nested; for example, a web log entry on a site that accepts user-submitted comments could represent the comments as articles nested within the article for the web log entry. the aria article role is similar to the html5 article element; however the article element should still be given the aria role of article, since not all assistive technologies support html5 yet. ...
...e, assistive technologies that typically intercept standard keyboard events should switch to document browsing mode, as opposed to passing keyboard events through to the web application. assistive technologies may provide a feature allowing the user to navigate the hierarchy of any nested article elements. note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples <article role="article"> <header> <h2>blog post</h2> </header> <section class="content"> <p>a very interesting post</p> </section> <section class="comments"> <div class="comment" role="article"> <p>meaningful comment</p> </div> <div class="comment" role="article"> <p>posi...
...ontent"> <p>a very interesting post</p> </section> <section class="comments"> <div class="comment" role="article"> <p>meaningful comment</p> </div> <div class="comment" role="article"> <p>positive comment</p> </div> </section> </article> notes aria attributes used related aria techniques aria techniques - list of roles compatibility tbd: add support in
formation for common ua and at product combinations additional resources wai-aria specification for the article role ...
Using the group role - Accessibility
ed in a table of contents or a page summary (such as the structures that are dynamically created by a script or assistive technologies); a group should not be considered a major perceivable section on a page. when the role is added to an element, the browser will send out an accessible group event to assistive technology products which can then notify the user about it. a group should be used to
form a logical collection of items with related functionality, such as children in a tree widget
forming a collection of siblings in a hierarchy, or a collection of items having the same container in a directory. however, when a group is used in the context of list, authors must limit its children to listitem elements. group elements may be nested. proper handling of a group by assistive technologies...
...en for such an event and notify the user accordingly: screen readers should announce the group when focus first lands on a control inside it, and if aria-describedby has been set, the description may be spoken. following this the focused control may be announced. screen magnifiers may enlarge the group. note: opinons may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: using the group role with a html tree view the snippet below shows how the group role is added directly into the html source code. <div id="tree1" role="tree" tabindex="-1"> <div id="animals" class="groupheader" role="presentation" aria-owns="animalgroup" aria-expanded="true"> <img role="prese...
... file directory treeview example using computed properties navigation treeview example using declared properties notes group members that are outside of the dom subtree of the group need to have explicit relationships assigned to them in order to participate in the group. aria attributes used group related aria techniques region role compatibility tbd: add support in
formation for common ua and at product combinations additional resources aria authoring practices – accessible name guidance by role – group ...
Using the log role - Accessibility
description this technique demonstrates how to use the log role and describes the effect it has on browsers and assistive technology. the log role is used to identify an element that creates a live region where new in
formation is added in a meaningful order and old in
formation may disappear. for example, chat logs, messaging history or an error log. in contrast to other types of live region, this role is sequentially ordered and new in
formation is only added to the end of the log. when this role is added to an element, the browser will send out an accessible log event to assistive technology products which can then notify the user about it. by default updates contain only the changes to the live region and these are announced when the user is idle. where the user needs to hear the e...
...should listen for such an event and notify the user accordingly: screen readers should announce changes inside a log when the user is idle, unless aria-live=”assertive” has been set and in which case the user may be interrupted. screen magnifiers may visually indicate that a log update has occurred. note: opinons may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: adding the role in the html code the snippet below shows how the log role is added directly into the html source code. <div id="liveregion" class="region" role="log"></div> example 2: snippet from an example application this snippet creates the chat log in an ajax chat application. <div id="chata...
...> </div> working examples: http://websiteaccessibility.donaldevans.com/2011/07/12/aria-log/ notes using the log role on an element implies that element has aria-live="polite". ...
Using the slider role - Accessibility
is used for markup that allows a user to select a value from within a given range. the slider role is assigned to the "thumb," the control that is adjusted to change the value. as the user interacts with the thumb, the application must programmatically adjust the slider's aria-valuenow (and possible aria-valuetext) attribute to reflect the current value. see the examples section below for more in
formation. keyboard and focus the slider should be keyboard focusable and operable. when the user tabs focus to the slider, it should land on the thumb: the control a mouse user would drag. arrow keys should operate as follows (localization for right-to-left languages should reverse the direction of the arrows): key(s) action right and up arrows increase the selected val...
...ight and up arrows increase the selected value left and down arrows decrease the selected value page up and page down optionally increase and decrease the value by a set amount (e.g. by 10 on a range from 0 to 100) possible effects on user agents and assistive technology note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: simple numerical range in the example below, a simple slider is used to select a value between 1 and 100. the current volume is 50. the application will programmatically update the value of aria-valuenow in response to user input. <label for="fader">volume</label> <input type="range" id="fader" m...
... var handle = document.getelementbyid("day-handle"); handle.setattribute("aria-valuenow", newvalue.tostring()); handle.setattribute("aria-valuetext", daynames[newvalue]); }; working examples: slider example notes aria attributes used aria-valuemin aria-valuemax aria-valuenow aria-valuetext aria-orientation related aria techniques compatibility tbd: add support in
formation for common ua and at product combinations additional resources wai-aria specification for the slider role ...
Using the status role - Accessibility
description this technique demonstrates how to use the status role and describes the effect it has on browsers and assistive technology. the status role is a type of live region and a container whose content is advisory in
formation for the user that is not important enough to justify an alert, and is often presented as a status bar. when the role is added to an element, the browser will send out an accessible status event to assistive technology products which can then notify the user about it. status in
formation content must be provided within a status object, and it should be ensured that this object does not receive focus. if another part of the page controls what appears in the status, the relationship should be made explicit via the aria-controls attribute. assistive technolog...
... may provide a special key to announce the current status, and this should present the contents of any status live region. these should be announced when the user is idle, unless aria-live=”assertive” has been set and in which case the user may be interrupted. screen magnifiers may enlarge the status. note: opinons may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: adding the status role in html the snippet below shows how the status role is added directly into the html source code. <p role="status">your changes were automatically saved.</p> working examples: notes aria attributes used status related aria techniques alert role live region rol...
...rce code. ...
ARIA: alert role - Accessibility
role can be used to tell the user an element has been dynamically updated. screen readers will instantly start reading out the updated content when the role is added. if the user is expected to close the alert, then the alertdialog role should be used instead. description one of the five live region roles, the alert role is used to provide the user with important, and usually time-sensitive, in
formation, and often to tell the user an element has been dynamically updated. the alert role is added to the node containing an alert message, not the element causing the alert to be triggered. alerts are assertive live regions. setting role="alert" is equivalent to setting aria-live="assertive" and aria-atomic="true". they don't receive focus, and therefore focus does not need to be managed and no ...
...ed. alerts are assertive live regions. setting role="alert" is equivalent to setting aria-live="assertive" and aria-atomic="true". they don't receive focus, and therefore focus does not need to be managed and no user interaction should be required. the most important thing to know about the alert role is that it is for dynamic content. it is perfect for situations such as when a user fills out a
form and javascript is used to add an error message - the alert would immediately read out the message. it should not be used on html where the user hasn't interacted with it. for example, if a page loads with multiple visible alerts scattered throughout, none would be read because they are not dynamically triggered. examples the most basic way to trigger an alert is by adding role="alert" to an el...
...ically trigger the screen reader to read out the content. <p role="alert" style="display: none;">the alert will trigger when the element becomes visible.</p> while triggering an alert via css alone is possible, it is better to rely on javascript because it has more browser/screen reader support and is often more appropriate as part of a larger user interaction such as inside an event handler or
form validation. with javascript, developers control the adding and removing of alerts as appropriate. <button type="button" onclick="triggeralert">trigger alert</button> <p class="alert">the alert will trigger when the button is pressed.</p> function triggeralert() { var alertel = document.queryselector('.alert'); alertel.addattribute("role", "alert"); } accessibility concerns the alert ro...
ARIA: checkbox role - Accessibility
if a native html element or attribute has the semantics and behavior you require, use it instead of re-purposing an element and adding aria. instead use the native html checkbox of <input type="checkbox">, which natively provides all the functionality required: <input type="checkbox" id="chk1-label"> <label for="chk1-label">remember my preferences</label> description the native html checkbox
form control can only have two checked states ("checked" or "not checked"), with an indeterminate state settable via javascript. similarly, an element with role="checkbox" can expose three states through the aria-checked attribute: true, false, or mixed. since a checkbox is an interactive control, it must be focusable and keyboard accessible. if the role is applied to a non-focusable element, use th...
...ox role in the operating system's accessibility api. when the aria-checked value changes, send an accessible state changed event. assistive technology products should do the following: screen readers should announce the element as a checkbox, and optionally provide instructions on how to activate it. note: opinions may differ on how assistive technology should handle this technique. ...
...his technique. the in
formation provided above is one of those opinions and therefore not normative. best practices the first rule of aria is: if a native html element or attribute has the semantics and behavior you require, use it instead of re-purposing an element and adding an aria role, state or property to make it accessible. as such, it is recommended to use the native html checkbox using
form control instead of recreating a checkbox's functionality with javascript and aria. ...
ARIA - Accessibility
at define ways to make web content and web applications (especially those developed with javascript) more accessible to people with disabilities. it supplements html so that interactions and widgets commonly used in applications can be passed to assistive technologies when there is not otherwise a mechanism. for example, aria enables accessible navigation landmarks in html4, javascript widgets,
form hints and error messages, live content updates, and more. many of these widgets were later incorporated into html5, and developers should prefer using the correct semantic html element over using aria, if such an element exists. for instance, native elements have built-in keyboard accessibility, roles and states. however, if you choose to use aria, you are responsible for mimicking (the equiva...
...ded" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"> </div> this progress bar is built using a <div>, which has no meaning. unfortunately, there isn't a more semantic tag available to developers in html 4, so we need to include aria roles and properties. these are specified by adding attributes to the element. in this example, the role="progressbar" attribute in
forms the browser that this element is actually a javascript-powered progress bar widget. the aria-valuemin and aria-valuemax attributes specify the minimum and maximum values for the progress bar, and the aria-valuenow describes the current state of it and therefore must be kept updated with javascript. along with placing them directly in the markup, aria attributes can be added to the element and u...
...evelopers. it suggests what aria attributes to use on html elements. suggestions are based on implementation realities. simple aria enhancements enhancing page navigation with aria landmarks a nice intro to using aria landmarks to improve web page navigation for screen reader users. see also, aria landmark implementation notes and examples on real sites (updated as of july 2011). improving
form accessibility aria is not just for dynamic content! learn how to improve accessibility of html
forms using additional aria attributes. aria for scripted widgets writing keyboard-navigable javascript widgets built-in elements like <input>, <button> etc have built-in keyboard accessibility. if you 'fake' these with <div>s and aria, you must ensure your widgets are keyboard accessible. live ...
Mobile accessibility checklist - Accessibility
nt provides a concise checklist of accessibility requirements for mobile app developers. it is intended to continuously evolve as more patterns arise. colour colour contrast must comply with wcag 2.1 aa level requirements: contrast ratio of 4.5:1 for normal text (less than 18 point or 14 point bold.) contrast ratio of 3:1 for large text (at least 18 point or 14 point bold.) in
formation conveyed via colour must be also available by other means too (underlined text for links, etc.) visibility content hiding techniques such as zero opacity, z-index order and off-screen placement must not be used exclusively to handle visibility. everything other than the currently visible screen must be truly invisible (especially relevant for single page apps with multiple cards): ...
...erything other than the currently visible screen must be truly invisible (especially relevant for single page apps with multiple cards): use the hidden attribute or visibility or display style properties. unless absolutely unavoidable, aria-hidden attribute should not be used. focus all activatable elements must be focusable: standard controls such as links, buttons, and
form fields are focusable by default. non-standard controls must have an appropriate aria role assigned to them, such as button, link, or checkbox. focus should be handled in a logical order and consistent manner. text equivalents text equivalent must be provided for every non-strictly presentational non-text element within the app. use alt and title where appropriate (see steve f...
...attribute for a good guide.) if the above attributes are not applicable, use appropriate aria states and properties such as aria-label, aria-labelledby, or aria-describedby. images of text must be avoided. all user interface components with visible text (or image of text) as labels must have the same text available in the programmatic name of the component. wcag 2.1: label in name. all
form controls must have labels (<label> elements) for the benefit of screen reader users. handling state standard controls such as radio buttons and checkboxes are handled by the operating system. however, for other custom controls state changes must be provided via aria states such as aria-checked, aria-disabled, aria-selected, aria-expanded, and aria-pressed. orientation content should not...
Robust - Accessibility
robust states that content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies. this can generally be achieved by following web standards and testing rigorously. note: to read the w3c definitions for robust and its guidelines and success criteria, see principle 4: robust — content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies. ...
...preted reliably by a wide variety of user agents, including assistive technologies. guideline 4.1 — compatible: maximize compatibility with current and future user agents, including assistive technologies this guideline focuses on making content as compatible as possible, not only with current user agents (e.g. browsers), but also with future ones too. success criteria how to con
form to the criteria practical resource 4.1.1 parsing (a) content should be well-
formed so it can be parsed successfully by browsers and other user agents such as screenreaders. to pass this criterion, make sure that your html is as valid as possible. use the w3c validator to validate your markup. see debugging html for a practical guide. 4.1.2 name, role, ...
... when using semantic elements correctly for their intended purpose, this criterion should be passed automatically. when scripting custom components, you will need to use wai-aria roles and other features to make sure your controls will be interpreted and are able to be used as intended, e.g. ...
-moz-image-region - CSS: Cascading Style Sheets
for certain xul elements and pseudo-elements that use an image from the list-style-image property, this property specifies a region of the image that is used in place of the whole image. this allows elements to use different pieces of the same image to improve per
formance. /* keyword value */ -moz-image-region: auto; /* <shape> value */ -moz-image-region: rect(0, 8px, 4px, 4px); /* global values */ -moz-image-region: inherit; -moz-image-region: initial; -moz-image-region: unset; the syntax is similar to the clip property. all four values are relative to the upper left corner of the image. note: for a system that works on any background, see -moz-image-rect(). syntax values auto automatically defines the region of the image to use. <shape> a shape defining the part of ...
...eft corner of the image. note: for a system that works on any background, see -moz-image-rect(). syntax values auto automatically defines the region of the image to use. <shape> a shape defining the part of the image to use. the rect() function defines a rectangle to use as shape. its parameters define the top, right, bottom, and left offsets of the edges of the image, in this order. ...
...es of the image, in this order.
formal definition initial valueautoapplies toxul <image> elements and :-moz-tree-image, :-moz-tree-twisty, and :-moz-tree-checkbox pseudo-elements. note: -moz-image-region only works with <image> elements where the icon is specified using list-style-image. ...
-webkit-text-security - CSS: Cascading Style Sheets
if your browser supports this property, the characters should be visually replaced with squares. ...
...if your browser supports this property, the characters should be visually replaced with squares. ...
...if your browser supports this property, the characters should be visually replaced with squares. ...
:enabled - CSS: Cascading Style Sheets
nto, etc.) or accept focus. the element also has a disabled state, in which it can't be activated or accept focus. /* selects any enabled <input> */ input:enabled { color: blue; } syntax :enabled examples the following example makes the color of text and button <input>s green when enabled, and gray when disabled. this helps the user understand which elements can be interacted with. ...
... focus. the element also has a disabled state, in which it can't be activated or accept focus. /* selects any enabled <input> */ input:enabled { color: blue; } syntax :enabled examples the following example makes the color of text and button <input>s green when enabled, and gray when disabled. this helps the user understand which elements can be interacted with. ...
.... this helps the user understand which elements can be interacted with. html <
form action="url_of_
form"> <label for="firstfield">first field (enabled):</label> <input type="text" id="firstfield" value="lorem"><br> <label for="secondfield">second field (disabled):</label> <input type="text" id="secondfield" value="ipsum" disabled="disabled"><br> <input type="button" value="submit"> </
form> css input:enabled { color: #2b2; } input:disabled { color: #aaa; } result specifications specification status comment html living standardthe definition of ':enabled' in that specification. living standard no change. html5the definition of ':enabled' in that specification. recommendation defines the semantics for html and
forms. ...
:in-range - CSS: Cascading Style Sheets
ackground-color: rgba(0, 255, 0, 0.25); } this pseudo-class is useful for giving the user a visual indication that a field's current value is within the permitted limits. note: this pseudo-class only applies to elements that have (and can take) a range limitation. ...
...ba(0, 255, 0, 0.25); } this pseudo-class is useful for giving the user a visual indication that a field's current value is within the permitted limits. note: this pseudo-class only applies to elements that have (and can take) a range limitation. ...
...ange limitation. in the absence of such a limitation, the element can neither be "in-range" nor "out-of-range." syntax :in-range examples html <
form action="" id="
form1"> <ul>values between 1 and 10 are valid. ...
:out-of-range - CSS: Cascading Style Sheets
ound-color: rgba(255, 0, 0, 0.25); } this pseudo-class is useful for giving the user a visual indication that a field's current value is outside the permitted limits. note: this pseudo-class only applies to elements that have (and can take) a range limitation. ...
...5, 0, 0, 0.25); } this pseudo-class is useful for giving the user a visual indication that a field's current value is outside the permitted limits. note: this pseudo-class only applies to elements that have (and can take) a range limitation. ...
...on. ...
:placeholder-shown - CSS: Cascading Style Sheets
border: 2px solid silver; } syntax :placeholder-shown examples basic example this example applies special font and border styles when the placeholder is shown. 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. you can use the text-overflow property to alter the way overflowing text is displayed. html <input id="input1" placeholder="name, rank, and serial number"> <br><br> <input id="input2" placeholder="name, rank, and serial number"> css #input2:placeholder-shown { text-overflow: ellipsis; } result customized input...
...overflow property to alter the way overflowing text is displayed. html <input id="input1" placeholder="name, rank, and serial number"> <br><br> <input id="input2" placeholder="name, rank, and serial number"> css #input2:placeholder-shown { text-overflow: ellipsis; } result customized input field the following example highlights the branch and id code fields with a custom style. ...
... working draft initial definition. ...
:valid - CSS: Cascading Style Sheets
the :valid css pseudo-class represents any <input> or other <
form> element whose contents validate successfully. this allows to easily make valid fields adopt an appearance that helps the user confirm that their data is
formatted properly. /* selects any valid <input> */ input:valid { background-color: powderblue; } this pseudo-class is useful for highlighting correct fields for the user. ...
...r other <
form> element whose contents validate successfully. this allows to easily make valid fields adopt an appearance that helps the user confirm that their data is
formatted properly. /* selects any valid <input> */ input:valid { background-color: powderblue; } this pseudo-class is useful for highlighting correct fields for the user. ...
...olute; 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 <span>s to position: relative so that we can position the generated content relative to them. we then absolutely position different generated content depending on whether the
form's data is valid or invalid — a green check or a red cross, respectively. to add a bit of extra urgency to the invalid data, we've also given the inputs a thick red border when invalid. note: we've used ::before to add these labels, as we were already using ::after for the "required" labels. you can try it below: notice how the required text inputs are invalid when empty, but valid when t...
font-display - CSS: Cascading Style Sheets
f the font face successfully loads during this period, it is used normally. font swap period if the font face is not loaded, any element attempting to use it must render a fallback font face. if the font face successfully loads during this period, it is used normally. font failure period if the font face is not loaded, the user agent treats it as a failed load causing normal font fallback. ...
...riod if the font face is not loaded, any element attempting to use it must render a fallback font face. if the font face successfully loads during this period, it is used normally. font failure period if the font face is not loaded, the user agent treats it as a failed load causing normal font fallback. ...
...ilure period if the font face is not loaded, the user agent treats it as a failed load causing normal font fallback.
formal definition related at-rule@font-faceinitial valueautocomputed valueas specified
formal syntax [ auto | block | swap | fallback | optional ] examples specifying fallback font-display @font-face { font-family: examplefont; src: url(/path/to/fonts/examplefont.woff)
format('woff'), url(/path/to/fonts/examplefont.eot)
format('eot'); font-weight: 400; font-style: normal; font-display: fallback; } specifications specification status comment css fonts module level 4the definition of 'font-display' in that specification. working draft initial definition ...
font-stretch - CSS: Cascading Style Sheets
ntype variable fonts, the "wdth" variation is used to implement varying glyph widths. accessibility concerns people with dyslexia and other cognitive conditions may have difficulty reading fonts that are too condensed, especially if the font has a low contrast color ratio. ...
...ssibility concerns people with dyslexia and other cognitive conditions may have difficulty reading fonts that are too condensed, especially if the font has a low contrast color ratio. ...
... | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> examples setting a percentage range for font-stretch the following find a local open sans font or import it, and allow using the font for normal, semi-condensed and semi-expanded states. @font-face { font-family: "open sans"; src: local("open sans")
format("woff2"), url("/fonts/opensans-regular-webfont.woff")
format("woff"); font-stretch: 87.5% 112.5%; } specifications specification status comment css fonts module level 4the definition of 'font-stretch' in that specification. working draft css fonts module level 3the definition of 'font-stretch' in that specification. candidate recommend...
font-style - CSS: Cascading Style Sheets
oblique with angle selects a font classified as oblique, and additionally specifies an angle for the slant of the text. oblique with angle range selects a font classified as oblique, and additionally specifies a range of allowable angle for the slant of the text. note that a range is only supported when the font-style is oblique; for font-style: normal or italic, no second value is allowed. ...
...gle for the slant of the text. oblique with angle range selects a font classified as oblique, and additionally specifies a range of allowable angle for the slant of the text. note that a range is only supported when the font-style is oblique; for font-style: normal or italic, no second value is allowed. ...
...t of the text. note that a range is only supported when the font-style is oblique; for font-style: normal or italic, no second value is allowed.
formal definition related at-rule@font-faceinitial valuenormalcomputed valueas specified
formal syntax normal | italic | oblique <angle>{0,2} examples specifying an italic font style as an example, consider the garamond font family, in its normal
form, we get the following result: @font-face { font-family: garamond; src: url('garamond.ttf'); } the italicized version of this text uses the same glyphs present in the unstyled version, but they are artificially sloped by a few degrees. on the other hand, if a true italicized version of the font family exists, we can include it in the src descriptor and specify the font style as italic, ...
font-variation-settings - CSS: Cascading Style Sheets
t, the list of opentype axis names is passed to the text layout engine to enable or disable font features. each setting is always a <string> of 4 ascii characters, followed by a <number> indicating the axis value. if the <string> has more or fewer characters or contains characters outside the u+20 - u+7e codepoint range, the whole property is invalid. the <number> can be fractional or negative. ...
... font features. each setting is always a <string> of 4 ascii characters, followed by a <number> indicating the axis value. if the <string> has more or fewer characters or contains characters outside the u+20 - u+7e codepoint range, the whole property is invalid. the <number> can be fractional or negative. ...
...outside the u+20 - u+7e codepoint range, the whole property is invalid. the <number> can be fractional or negative.
formal definition related at-rule@font-faceinitial valuenormalcomputed valueas specified
formal syntax normal | [ <string> <number> ]# examples setting font weight and stretch in a @font-face rule @font-face { font-family: 'opentypefont'; src: url('open_type_font.woff2')
format('woff2'); font-weight: normal; font-style: normal; font-variation-settings: 'wght' 400, 'wdth' 300; } specifications specification status comment css fonts module level 4the definition of 'font-variation-settings' in that specification. working draft initial definition ...
@font-feature-values - CSS: Cascading Style Sheets
e that values higher than 99 are valid, but don't map to any opentype values and are ignored. @character-variant specifies a feature name that will work with the character-variant() functional notation of font-variant-alternates. a character-variant feature value definition allows either one or two values: ident1: 3 maps to cv03=1, and ident2: 2 4 maps to cv02=4, but ident2: 2 4 5 is invalid. ...
...1: 3 maps to cv03=1, and ident2: 2 4 maps to cv02=4, but ident2: 2 4 5 is invalid. ...
...rsion 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). ...
Coordinate systems - CSS: Cascading Style Sheets
ositive y-coordinate values being above the origin. when drawing 3d graphics, or using a third dimension to layer objects from front to back, the z-coordinate is also used. this specifies the distance away from the viewer if positive and toward the viewer if negative. it's actually possible to change the definitions and orientations of these coordinate systems using css properties such as trans
form. however, we'll only talk about the standard coordinate system for now. standard cssom coordinate systems there are four standard coordinate systems used by the css object model, as described below. offset coordinates specified using the "offset" model use the top-left corner of the element being examined, or on which an event has occurred. for example, when a mouse event occurs, the positi...
...removing monitors to their system). the mouseevent.screenx and mouseevent.screeny properties give the coordinates of a mouse event's position relative to the screen's origin. example let's take a look at an example. this simple example creates a set of nested boxes. whenever the mouse enters, moves around inside, or exits the inner box, the corresponding event is handled by updating a set of in
formational messages within the box, listing out the current mouse coordinates in each of the four available coordinate systems. javascript let's look at the script in two sections. first, the code that logs the coordinates to the screen. this code will be called by the event handler for the various mouse events we watch. displaying the coordinates as we'll see in the html, the inner box (the one ...
...be reporting on. 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 in
formation is fetched into log. the setcoords() function is designed to accept as input a mouseevent and the name of the origin to use when obtaining the coordinates. the implementation is then quite simple. the variables idx and idy are set to strings with the names of the properties corresponding to the coordinates in the given coordinate system. for example, if the value of type is "page", then idx...
Detecting CSS animation support - CSS: Cascading Style Sheets
en-ation. animating using the correct syntax for different browsers now that you know if css animation is supported or not, we can animate. ...
...at you know if css animation is supported or not, we can animate. ...
...otherwise, we can use javascript to create the desired css animation effects. setting the animation property is easy; simply update its value in the style collection. however, adding keyframes is trickier, since they're not defined using traditional css syntax (which makes them more flexible, but harder to define from script). to define our keyframes using javascript, we need to ...
Using URL values for the cursor property - CSS: Cascading Style Sheets
syntax the basic (css 2.1) syntax for this property is: cursor: [ <url> , ]* <keyword> this means that zero or more urls may be specified (comma-separated), which must be followed by one of the keywords defined in the css specification, such as auto or pointer. ...
... { cursor: auto; cursor: url(cursor1.png) 4 12, auto; } .bar { cursor: pointer; cursor: url(cursor2.png) 2 2, pointer; } /* falls back onto 'auto' and 'pointer' in ie, but must be set separately */ the first number is the x-coordinate, and the second number is the y-coordinate. the example will set the hotspot to be the pixel at (4,12) from the top left (0,0). limitations all image
formats supported by gecko can be used. this means that you can use png, gif, jpg, bmp, cur, etc. images. ani is not supported. an animated png or gif will not create an animated cursor. note: starting with gecko 2.0, gecko also supports the svg image
format for cursors. however, the svg image must contain a length-valued (not percentage-valued) height and width on its root svg node. javascript, css...
...-valued) height and width on its root svg node. javascript, css animation, and declarative smil inside an svg image are ignored; you can't use svg to create an animated cursor, for example. in gecko (firefox) the limit of the cursor size is 128×128px. larger cursor images are ignored. however, you should limit yourself to the size 32×32 for maximum compatibility with operating systems and plat
forms. (due to a bug in gecko 1.9.2-1.9.2.6, firefox 3.6-3.6.6 on windows limits to 32×32px. this is fixed in later versions.) translucent cursors are not supported on windows releases earlier than xp. this is a limitation of the operating system. transparency works on all plat
forms. url values as cursors are supported in windows, os/2, and linux (when using gtk+ 2.4 or better) releases of mozilla...
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
create a flex container. browser support for the up-to-date version of the specification is excellent from this point forward. there are a few old articles in existence that refer to the older versions of flexbox, which are pretty easy to identify due to the change in the way that a flex container is created. if you find something referring to display: box or display: flexbox this is outdated in
formation. status in browsers browser support for flexbox is excellent, and the majority of browsers do not need a prefix at this point. safari was the last of the major browsers to remove prefixes, with the release of safari 9 in 2015. the two browsers you should still keep in mind for cross-browser compatibility are: internet explorer 10, which implemented the display: flexbox version of the sp...
...ion to the unprefixed version. this is becoming less and less of a requirement today as support is widespread. .wrapper { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; } autoprefixer online is a useful way to see which prefixes are recommended, depending on how many versions you wish to go back with browser support. you can also check can i use for in
formation about when prefixes were removed in browsers to make your decision. useful fallback techniques given that flexbox usage is initiated with value of the display property, when needing to support very old browsers which do not support flexbox at all, fallbacks can be created by overwriting one layout method with another. the specification defines what happens if you use other layout methods o...
...flexbox support. remember that if you want to include versions of browsers that had vendor-prefixed flexbox you would need to include the prefixed version in your feature query. the following feature query would include uc browser, which supports feature queries and old flexbox syntax, prefixed: @supports (display: flex) or (display: -webkit-box) { // code for supporting browsers } for more in
formation about using feature queries see using feature queries in css on the mozilla hacks blog. conclusion while i’ve spent some time in this guide going through potential issues and fallbacks, flexbox is very much ready for you to be using in production work. this guide will help you in those cases where you do come across an issue or have the requirement to support older browsers. ...
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
writing mode. see this article for a full description of writing modes and ways to use them, both for content in other languages and for creative reasons. ...
...however if you are planning on using writing modes in your layout, carefully testing the results is advisable — not least because it would be easy to make things hard to read! note that you would not normally use css and the writing-mode property to change an entire document to another writing mode. ...
...live example the child elements have been floated, and then their container has had display: flex added. if you remove display: flex, you should see that the .box element collapses as we have no clearing applied. this demonstrates that the float is happening. re-apply display: flex and the collapsing does not happen. this is because the items no longer have a float applied, as they have been trans
formed into flex items. flexbox and grid layout css grid layout and flexbox generally act in the same way with regards to overwriting other methods. you might however want to use flexbox as a fallback for grid layout, as there is better support for flexbox in older browsers. this approach works very well. if a flex item becomes a grid item, then the flex properties that may have been assigned to t...
CSS Fonts - CSS: Cascading Style Sheets
reference properties font font-family font-feature-settings font-kerning font-language-override font-optical-sizing font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-variation-setti...
...ize: 2rem; letter-spacing: 1px; } <p>three hundred years ago<br> i thought i might get some sleep<br> i stretched myself out onna antique bed<br> an' my spirit did a midnite creep</p> the result is as follows: variable fonts examples you can find a number of variable fonts examples at v-fonts.com and axis-praxis.org; see also our variable fonts guide for more in
formation and usage in
formation. reference properties font font-family font-feature-settings font-kerning font-language-override font-optical-sizing font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-variation-settings font-weight line...
... weight, family and style, font shorthand, text alignment and other effects, and line and letter spacing. opentype font features guide font features or variants refer to different glyphs or character styles contained within an opentype font. these include things like ligatures (special glyphs that combine characters like 'fi' or 'ffl'), kerning (adjustments to the spacing between specific letter
form pairings), fractions, numeral styles, and a number of others. these are all referred to as opentype features, and are made available to use on the web via specific properties and a low-level control property — font-feature-settings. this article provides you with all you need to know about using opentype font features in css. variable fonts guide variable fonts are an evolution of the opentyp...
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
css grid layout implements the specification box alignment level 3 which is the same standard flexbox uses for aligning items in its flex container. this specification details how alignment should work in all the different layout methods. layout methods will con
form to the specification where possible and implement individual behavior based on their differences (features and constraints). while the specification currently specifies alignment details for all layout methods, browsers have not fully implemented all of the specification; however, the css grid layout method has been widely adopted. this guide presents demonstrations of how box alignment in grid layout works. you will see many similarities in how these properties and values work in flexbox. due to grid being two-dimensional...
...apper"> <div class="item1">item 1</div> </div> aligning the grid tracks on the block axis if you have a situation where your grid tracks use an area that is smaller than the grid container, then you can align the grid tracks themselves, inside that container. once again, this operates on the block and inline axes, with align-content aligning tracks on the block axis, and justify-content per
forming alignment on the inline axis. the place-content property is shorthand for align-content and justify-content. the values for align-content, justify-content and place-content are: normal start end center stretch space-around space-between space-evenly baseline first baseline last baseline in the below example i have a grid container of 500 pixels by 500 pixels. i have defined 3 ro...
...image i have placed the grid with align-content, with a value of start alongside the grid when align-content has a value of space-between. you can see how items 1 and 2, which span two row tracks have taken on extra height as they gain the additional space added to the gap between those two tracks: justifying the grid tracks on the row axis on the inline axis, we can use justify-content to per
form the same type of alignment that we used align-content for in the block axis. using the same example, i am setting justify-content to space-around. this once again causes tracks which span more than one column track to gain extra space: * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2...
Mozilla CSS extensions - CSS: Cascading Style Sheets
once a given property is standardized and implemented without the prefix, the prefixed version is typically dropped after a while. a -moz-animation [prefixed version still accepted] -moz-anima...
...efixed version still accepted] -moz-perspective-origin [prefixed version still accepted] pointer-events [applying to more than svg] t–u -moz-tab-size -moz-text-align-lastobsolete since gecko 53 -moz-text-decoration-colorobsolete since gecko 39 -moz-text-decoration-lineobsolete since gecko 39 -moz-text-decoration-styleobsolete since gecko 39 -moz-text-size-adjust -moz-trans
form [prefixed version still accepted] -moz-trans
form-origin [prefixed version still accepted] -moz-trans
form-style [prefixed version still accepted] -moz-transition [prefixed version still accepted] -moz-transition-delay [prefixed version still accepted] -moz-transition-duration [prefixed version still accepted] -moz-transition-property [prefixed version still accepted] -moz-tran...
... image-rendering -moz-crisp-edges <length> -moz-calc list-style-type -moz-arabic-indic -moz-bengali -moz-cjk-earthly-branch -moz-cjk-heavenly-stem -moz-devanagari -moz-ethiopic-halehame -moz-ethiopic-halehame-am -moz-ethiopic-halehame-ti-er -moz-ethiopic-halehame-ti-et -moz-ethiopic-numeric -moz-gujarati -moz-gurmukhi -moz-hangul -moz-hangul-consonant -moz-japanese-
formal -moz-japanese-in
formal -moz-kannada -moz-khmer -moz-lao -moz-malayalam -moz-myanmar -moz-oriya -moz-persian -moz-simp-chinese-
formal -moz-simp-chinese-in
formal -moz-tamil -moz-telugu -moz-thai -moz-trad-chinese-
formal -moz-trad-chinese-in
formal -moz-urdu overflow -moz-scrollbars-none -moz-scrollbars-horizontal -moz-scrollbars-vertical -moz-hidden-unscrollable ...
Replaced elements - CSS: Cascading Style Sheets
in css, a replaced element is an element whose representation is outside the scope of css; they're external objects whose representation is independent of the css
formatting model. put in simpler terms, they're elements whose contents are not affected by the current document's styles. the position of the replaced element can be affected using css, but not the contents of the replaced element itself. some replaced elements, such as <iframe> elements, may have stylesheets of their own, but they don't inherit the styles of the parent document. the only other impact css can have on a replaced element is that there are properties which support controlling the positioning of the element's content within its box. see controlling object position within the content box for further in
formation. repl...
... objects inserted using the css content property are anonymous replaced elements. they are "anonymous" because they don't exist in the html markup. ...
... objects inserted using the css content property are anonymous replaced elements. ...
Shorthand properties - CSS: Cascading Style Sheets
n that order, that is clock-wise starting at the top left. background properties a background with the following properties ... background-color: #000; background-image: url(images/bg.gif); background-repeat: no-repeat; background-position: left top; ... can be shortened to just one declaration: background: #000 url(images/bg.gif) no-repeat left top; (the shorthand
form is actually the equivalent of the longhand properties above plus background-attachment: scroll and, in css3, some additional properties.) see background for more detailed in
formation, including css3 properties. font properties the following declarations ... font-style: italic; font-weight: bold; font-size: .8em; line-height: 1.2; font-family: arial, sans-serif; ... can be shortened to the fo...
...y value applied to a selected element to the initial value of that property. unset resets the property to its natural value, which means that if the property is naturally inherited it acts like inherit, otherwise it acts like initial. note: there is also a newer value, revert, which has limited browser support. note: see origin of css declarations in introducing the css cascade for more in
formation on each of these and how they work. we can look at a list of links and explore how the universal values work. the live example below allows you to play with the css and see what happens when you make changes. playing with code really is the best way to get to grips with html and css. for example: the second list item has the class my-class-1 applied. this sets the color of the <a> elem...
...to inherit. if you remove the rule how does it change the color of the link? do you understand why the third and fourth links are the color that they are? check the description of the values above if not. which of the links will change color if you define a new color for the <a> element — for example a { color: red; }? see cascade and inheritance or introducing the css cascade for more in
formation about how inheritance works in css. see also css key concepts: css syntax, at-rule, comments, specificity and inheritance, the box, layout modes and visual
formatting models, and margin collapsing, or the initial, computed, resolved, specified, used, and actual values. definitions of value syntax, shorthand properties and replaced elements. shorthand properties: animat...
Syntax - CSS: Cascading Style Sheets
int elements of the page with specific features, like colors, positioning, or decorations. the css syntax reflects this goal and its basic building blocks are: the property which is an identifier, that is a human-readable name, that defines which feature is considered. the value which describe how the feature must be handled by the engine. each property has a set of valid values, defined by a
formal grammar, as well as a semantic meaning, implemented by the browser engine. css declarations setting css properties to specific values is the core function of the css language. a property and value pair is called a declaration, and any css engine calculates which declarations apply to every single element of a page in order to appropriately lay it out, and to style it. both properties and va...
...ity of the ruleset itself. this leads to an important consequence: if one single basic selector is invalid, like when using an unknown pseudo-element or pseudo-class, the whole selector is invalid and therefore the entire rule is ignored (as invalid too). css statements rulesets are the main building blocks of a style sheet, which often consists of only a big list of them. but there is other in
formation that a web author wants to convey in the style sheet, like the character set, other external style sheets to import, font face or list counter descriptions and many more. it will use other and specific kinds of statements to do that. a statement is a building block that begins with any non-space characters and ends at the first closing brace or semi-colon (outside a string, non-escaped and ...
...scribed by a selector. at-rules that start with an at sign, '@' (u+0040 commercial at), followed by an identifier and then continuing up to the end of the statement, that is up to the next semi-colon (;) outside of a block, or the end of the next block. each type of at-rules, defined by the identifier, may have its own internal syntax, and semantics of course. they are used to convey meta-data in
formation (like @charset or @import), conditional in
formation (like @media or @document), or descriptive in
formation (like @font-face). any statement which isn't a ruleset or an at-rule is invalid and ignored. there is another group of statements – the nested statements. these are statements that can be used in a specific subset of at-rules – the conditional group rules. these statements only a...
animation-delay - CSS: Cascading Style Sheets
the animation can start later, immediately from its beginning, or immediately and partway through the animation. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. it is often convenient to use the shorthand property animation to set all animation properties at once. ...
...ecify a negative value for the animation delay, but the starting value is implicit, the starting value is taken from the moment the animation is applied to the element. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more in
formation, see setting multiple animation property values.
formal definition initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax <time># examples see css animations for examples. specifications specification status comment css animationsthe definition of 'animation-dela...
... with the vendor prefix: -webkit-edge full support 12firefox full support 16notes full support 16notes notes before firefox 57, firefox does not repaint elements outside the viewport that are animated into the viewport with a delay. this bug affects only some plat
forms, such as windows. full support 49prefixed prefixed implemented with the vendor prefix: -webkit- full support 44prefixed disabled prefixed implemented with the vendor prefix: -webkit-disabled from version 44: this feature is behind the layout.css.prefixes.webkit preference (needs to be set to true). to chang...
background-color - CSS: Cascading Style Sheets
50, 33%, 25%); /* fully opaque */ background-color: hsla(50, 33%, 25%, 0.75); /* 75% transparent */ /* special keyword values */ background-color: currentcolor; background-color: transparent; /* global values */ background-color: inherit; background-color: initial; background-color: unset; the background-color property is specified as a single <color> value. values <color> the uni
form color of the background. it is rendered behind any background-image that is specified, although the color will still be visible through any transparency in the image. accessibility concerns it is important to ensure that the contrast ratio between the background color and the color of the text placed over it is high enough that people experiencing low vision conditions will be able to read the...
...olor values. in order to meet current web content accessibility guidelines (wcag), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. large text is defined as 18.66px and bold or larger, or 24px or larger. ...
...t is defined as 18.66px and bold or larger, or 24px or larger. webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0
formal definition initial valuetransparentapplies toall elements. ...
background-image - CSS: Cascading Style Sheets
near-gradient(to bottom, rgba(255,255,0,0.5), rgba(0,0,255,0.5)), url('https://mdn.mozillademos.org/files/7693/catfront.png'); values none is a keyword denoting the absence of images. <image> is an <image> denoting the image to display. there can be several of them, separated by commas, as multiple backgrounds are supported. accessibility concerns browsers do not provide any special in
formation on background images to assistive technology. this is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. if the image contains in
formation critical to understanding the page's overall purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations unders...
...ortant primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. if the image contains in
formation critical to understanding the page's overall purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0
formal definition initial valuenoneapplies toall elements. ...
...purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0
formal definition initial valuenoneapplies toall elements. ...
background-position - CSS: Cascading Style Sheets
x to the left of the container, in this example that puts the right edge of the 300px-wide image in the center of the container) it's worth mentioning that if your background-size is equal to the container size for a given axis, then a percentage position for that axis will have no effect because the "container-image difference" will be zero. you will need to offset using absolute values.
formal definition initial value0% 0%applies toall elements. it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the size of the background positioning area minus size of background image; size refers to the width for horizontal offsets and to the height for vertical offsetscomputed valuea list, each item consisting of two keywords representing the origin and two offsets ...
...] && [ center | [ top | bottom ] <length-percentage>? ] ]where <length-percentage> = <length> | <percentage> examples positioning backgro...
...s of <position> values, for example background-position: 10px 10px; and background-position: 20px 20px, 30px 30px; (see bug 1390446). firefox's new parallel css engine (also known as quantum css or stylo, planned for release in firefox 57) fixes this. see also background-position-x background-position-y background-position-inline background-position-block using multiple backgrounds trans
form-origin ...
background - CSS: Cascading Style Sheets
ay only be included in the last layer specified. values <attachment> see background-attachment <box> see background-clip and background-origin <background-color> see background-color <bg-image> see background-image <position> see background-position <repeat-style> see background-repeat <bg-size> see background-size. accessibility concerns browsers do not provide any special in
formation on background images to assistive technology. this is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. if the image contains in
formation critical to understanding the page's overall purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations unders...
...ortant primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. if the image contains in
formation critical to understanding the page's overall purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0
formal definition initial valueas each of the properties of the shorthand:background-image: nonebackground-position: 0% 0%background-size: auto autobackground-repeat: repeatbackground-origin: padding-boxbackground-clip: border-boxbackground-attachment: scrollbackground-color: transparentapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednopercentagesas each of the pro...
...| <repeat-style> | <attachment> | <box> | <box><final-bg-layer> = <'background-color'> | <bg-image> | <bg-position> [ / <bg-size> ]? | <repeat-style> | <attachment> | <box> | <box>where <bg-image> = none | <image><bg-position> = [ [ left | center | right | top | bottom | <length-percentage> ...
border-color - CSS: Cascading Style Sheets
he interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. each side can be set individually using border-top-color, border-right-color, border-bottom-color, and border-left-color; or using the writing mode-aware border-block-start-color, border-block-end-color, border-inline-start-color, and border-inline-end-color. you can find more in
formation about border colors in borders in applying color to html elements using css. constituent properties this property is a shorthand for the following css properties: border-bottom-color border-left-color border-right-color border-top-color syntax /* <color> values */ border-color: red; /* horizontal | vertical */ border-color: red #f015ca; /* top | vertical | bottom */ border-color...
...alues are specified, the first color applies to the top and bottom, the second to the left and right. when three values are specified, the first color applies to the top, the second to the left and right, the third to the bottom. when four values are specified, the colors apply to the top, right, bottom, and left in that order (clockwise). values <color> defines the color of the border.
formal definition initial valueas each of the properties of the shorthand:border-top-color: currentcolorborder-right-color: currentcolorborder-bottom-color: currentcolorborder-left-color: currentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-bottom-color: computed colorborder-left-color: computed colorborder-ri...
...) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <n...
border-image - CSS: Cascading Style Sheets
he border image from the element's outside edge. up to four values may be specified. see border-image-outset. <'border-image-repeat'> defines how the edge regions of the source image are adjusted to fit the dimensions of the border image. up to two values may be specified. see border-image-repeat. accessibility concerns assistive technology cannot parse border images. ...
... to two values may be specified. see border-image-repeat. accessibility concerns assistive technology cannot parse border images. if the image contains in
formation critical to understanding the page's overall purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | understanding wcag 2.0
formal definition initial valueas each of the properties of the shorthand:border-image-source: noneborder-image-slice: 100%border-image-width: 1border-image-outset: 0border-image-repeat: stretchapplies toall elements, except internal table elements when border-collapse is collapse. it also applies to ::first-letter.inheritednopercentagesas each of the properties of the shorthand:border-image-slice: r...
...the source for the border image is a ".png" file of 81 by 81 pixels, with three diamonds going vertically and horizontally: html <div...
border-left-color - CSS: Cascading Style Sheets
red; border-left-color: #ffbb00; border-left-color: rgb(255, 0, 0); border-left-color: hsla(100%, 50%, 25%, 0.75); border-left-color: currentcolor; border-left-color: transparent; /* global values */ border-left-color: inherit; border-left-color: initial; border-left-color: unset; the border-left-color property is specified as a single value. values <color> the color of the left border. ...
...r: transparent; /* global values */ border-left-color: inherit; border-left-color: initial; border-left-color: unset; the border-left-color property is specified as a single value. values <color> the color of the left border.
formal definition initial valuecurrentcolorapplies toall elements. ...
... css level 2 (revision 1)the definition of 'border-left-color' in that specification. recommendation initial definition ...
border-right-color - CSS: Cascading Style Sheets
r-right-color: #ffbb00; border-right-color: rgb(255, 0, 0); border-right-color: hsla(100%, 50%, 25%, 0.75); border-right-color: currentcolor; border-right-color: transparent; /* global values */ border-right-color: inherit; border-right-color: initial; border-right-color: unset; the border-right-color property is specified as a single value. values <color> the color of the right border. ...
...ansparent; /* global values */ border-right-color: inherit; border-right-color: initial; border-right-color: unset; the border-right-color property is specified as a single value. values <color> the color of the right border.
formal definition initial valuecurrentcolorapplies toall elements. ...
... css level 2 (revision 1)the definition of 'border-right-color' in that specification. recommendation initial definition ...
border-top-color - CSS: Cascading Style Sheets
top-color: red; border-top-color: #ffbb00; border-top-color: rgb(255, 0, 0); border-top-color: hsla(100%, 50%, 25%, 0.75); border-top-color: currentcolor; border-top-color: transparent; /* global values */ border-top-color: inherit; border-top-color: initial; border-top-color: unset; the border-top-color property is specified as a single value. values <color> the color of the top border. ...
...p-color: transparent; /* global values */ border-top-color: inherit; border-top-color: initial; border-top-color: unset; the border-top-color property is specified as a single value. values <color> the color of the top border.
formal definition initial valuecurrentcolorapplies toall elements. ...
... css level 2 (revision 1)the definition of 'border-top-color' in that specification. recommendation initial definition ...
box-align - CSS: Cascading Style Sheets
warning: this is a property of the original css flexible box layout module draft, and has been replaced by a newer standard. the box-align css property specifies how an element aligns its contents across its layout in a perpendicular direction. the effect of the property is only visible if there is extra space in the box. see flexbox for in
formation about the current standard. /* keyword values */ box-align: start; box-align: center; box-align: end; box-align: baseline; box-align: stretch; /* global values */ box-lines: inherit; box-lines: initial; box-lines: unset; the direction of layout depends on the element's orientation: horizontal or vertical. syntax the box-align property is specified as one of the keyword values listed below. values start the box aligns con...
...l. stretch the box stretches the contents so that there is no extra space in the box. notes the edge of the box designated the start for alignment purposes depends on the box's orientation: horizontal top vertical left the edge opposite to the start is designated the end. if the alignment is set using the element's align attribute, then the style is ignored. ...
...ends on the box's orientation: horizontal top vertical left the edge opposite to the start is designated the end. if the alignment is set using the element's align attribute, then the style is ignored. ...
box-direction - CSS: Cascading Style Sheets
the box-direction css property specifies whether a box lays out its contents normally (from the top or left edge), or in reverse (from the bottom or right edge). ...
... top edge). reverse the box lays out its contents from the end (the right or bottom edge). notes the edge of the box designated the start for layout purposes depends on the box's orientation: horizontal left vertical top the edge opposite to the start is designated the end. if the direction is set using the element's dir attribute, then the style is ignored. ...
...depends on the box's orientation: horizontal left vertical top the edge opposite to the start is designated the end. if the direction is set using the element's dir attribute, then the style is ignored.
formal definition initial valuenormalapplies toelements with a css display value of box or inline-boxinheritednocomputed valueas specifiedanimation typediscrete
formal syntax normal | reverse | inherit examples setting box direction .example { /* bottom-to-top layout */ -moz-box-direction: reverse; /* mozilla */ -webkit-box-direction: reverse; /* webkit */ box-direction: reverse; /* as specified */ } specifications not part of any standard. browser compatibility the compatibility table on this page is generated from structure...
box-flex-group - CSS: Cascading Style Sheets
the box-flex-group css property assigns the flexbox's child elements to a flex group. /* <integer> values */ box-flex-group: 1; box-flex-group: 5; /* global values */ box-flex-group: inherit; box-flex-group: initial; box-flex-group: unset; for flexible elements assigned to flex groups, the first flex group is 1 and higher values specify subsequent flex groups. the initial value is 1. ...
... preferred space of the children has been computed, then space is removed from flexible elements in a manner similar to that used when adding extra space. each flex group is examined in turn and space is removed according to the ratio of the flexibility of each element. elements do not shrink below their minimum widths. syntax the box-flex-group property is specified as any positive <integer>. ...
...dding extra space. each flex group is examined in turn and space is removed according to the ratio of the flexibility of each element. elements do not shrink below their minimum widths. syntax the box-flex-group property is specified as any positive <integer>. ...
box-flex - CSS: Cascading Style Sheets
the -moz-box-flex and -webkit-box-flex css properties specify how a -moz-box or -webkit-box grows to fill the box that contains it, in the direction of the containing box's layout. ...
...the style is ignored. to make xul elements in a containing box the same size, set the containing box's equalsize attribute to the value always. this attribute does not have a corresponding css property. a trick to make all content elements in a containing box the same size, is to give them all a fixed size (e.g. height: 0), and the same box-flex value greater than zero (e.g. -moz-box-flex: 1). ...
... a containing box the same size, is to give them all a fixed size (e.g. height: 0), and the same box-flex value greater than zero (e.g. -moz-box-flex: 1). ...
box-ordinal-group - CSS: Cascading Style Sheets
the box-ordinal-group css property assigns the flexbox's child elements to an ordinal group. /* <integer> values */ box-ordinal-group: 1; box-ordinal-group: 5; /* global values */ box-ordinal-group: inherit; box-ordinal-group: initial; box-ordinal-group: unset; ordinal groups may be used in conjunction with the box-direction property to control the order in which the direct children of a box appear. ...
...lements appear to the left (for horizontal boxes) or at the top (for vertical boxes) of the container. elements with the same ordinal group are flowed in the order they appear in the source document tree. in the reverse direction, the ordinal groups are examined in the same order, except the elements appear reversed. syntax the box-ordinal-group property is specified as any positive <integer>. ...
...dinal group are flowed in the order they appear in the source document tree. in the reverse direction, the ordinal groups are examined in the same order, except the elements appear reversed. syntax the box-ordinal-group property is specified as any positive <integer>. ...
box-orient - CSS: Cascading Style Sheets
the box-orient css property sets whether an element lays out its contents horizontally or vertically. /* keyword values */ box-orient: horizontal; box-orient: vertical; box-orient: inline-axis; box-orient: block-axis; /* global values */ box-orient: inherit; box-orient: initial; box-orient: unset; syntax the box-orient property is specified as one of the keyword values listed below. values horizontal the box lays out its contents horizontally. ...
...e axis. block-axis (html) the box displays its children along the block axis. the inline and block axes are the writing-mode dependent keywords which, in english, map to horizontal and vertical respectively. description html dom elements lay out their contents along the inline-axis by default. this css property will only apply to html elements with a css display value of box or inline-box. ...
... vertical respectively. description html dom elements lay out their contents along the inline-axis by default. this css property will only apply to html elements with a css display value of box or inline-box.
formal definition initial valueinline-axis (horizontal in xul)applies toelements with a css display value of box or inline-boxinheritednocomputed valueas specifiedanimation typediscrete
formal syntax horizontal | vertical | inline-axis | block-axis | inherit examples setting horizontal box orientation here, he box-orient property will cause the two <p> sections in the example to display in the same line. html <div class="example"> <p>i will be to the left of my sibling.</p> <p>i will be to the right of my sibling.</p> </div> css div.example { display: -moz-box; ...
box-pack - CSS: Cascading Style Sheets
the -moz-box-pack and -webkit-box-pack css properties specify how a -moz-box or -webkit-box packs its contents in the direction of its layout. the effect of this is only visible if there is extra space in the box. /* keyword values */ box-pack: start; box-pack: center; box-pack: end; box-pack: justify; /* global values */ box-pack: inherit; box-pack: initial; box-pack: unset; the direction of layout depends on the element's orientation: horizontal or vertical. ...
...e value as if it were start. notes the edge of the box designated the start for packing purposes depends on the box's orientation and direction: normal reverse horizontal left right vertical top bottom the edge opposite to the start is designated the end. if the packing is set using the element's pack attribute, then the style is ignored. ...
...ft right vertical top bottom the edge opposite to the start is designated the end. if the packing is set using the element's pack attribute, then the style is ignored. ...
break-after - CSS: Cascading Style Sheets
values should be aliased as follows: page-break-after break-after auto auto left left right right avoid avoid always page the always value of page-break-* was implemented by browsers as a page break, and not as a column break. therefore the aliasing is to page, rather than the always value in the level 4 spec. ...
... right right avoid avoid always page the always value of page-break-* was implemented by browsers as a page break, and not as a column break. therefore the aliasing is to page, rather than the always value in the level 4 spec.
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: 200px. by defa...
...n | 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: 200px. by default, the subheadings and paragraphs were laid out rather messily because the headings were not in a uni
form place. however, we used break-after: column on the <p> elements to force a column break after each one, meaning that you end up with an <h2> neatly at the top of each column. html <article> <h1>main heading</h1> <h2>subheading</h2> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. nulla vitae fringilla mauris. quisque commodo eget nisi sed pretium. mauris luctus nec lacus in u...
break-before - CSS: Cascading Style Sheets
alues should be aliased as follows: page-break-before break-before auto auto left left right right avoid avoid always page the always value of page-break-* was implemented by browsers as a page break, and not as a column break. therefore the aliasing is to page, rather than the always value in the level 4 spec. ...
... right right avoid avoid always page the always value of page-break-* was implemented by browsers as a page break, and not as a column break. therefore the aliasing is to page, rather than the always value in the level 4 spec.
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: 200px. by defa...
...n | 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: 200px. by default, the subheadings and paragraphs were laid out rather messily because the headings were not in a uni
form place. however, we used break-before: column on the <h2> elements to force a column break before each one, meaning that you end up with an <h2> neatly at the top of each column. html <article> <h1>main heading</h1> <h2>subheading</h2> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. nulla vitae fringilla mauris. quisque commodo eget nisi sed pretium. mauris luctus nec lacus i...
clip - CSS: Cascading Style Sheets
t is, elements with position:absolute or position:fixed. /* keyword value */ clip: auto; /* <shape> values */ clip: rect(1px 10em 3rem 2ch); clip: rect(1px, 10em, 3rem, 2ch); /* global values */ clip: inherit; clip: initial; clip: unset; syntax note: where possible, authors are encouraged to use the newer clip-path property instead. values <<shape>()> a rectangular <<shape>()> of the
form rect(<top> <right> <bottom> <left>). the <top> and <bottom> values are offsets from the inside top border edge of the box, while <right> and <left> are offsets from the inside left border edge of the box — that is, the extent of the padding box. the <top>, <right>, <bottom>, and <left> values may be either a <length> or auto. if any side's value is auto, the element is clipped to that side's i...
...inside left border edge of the box — that is, the extent of the padding box. the <top>, <right>, <bottom>, and <left> values may be either a <length> or auto. if any side's value is auto, the element is clipped to that side's inside border edge. auto the element does not clip (default). this is different from rect(auto, auto, auto, auto), which clips to the element’s inside border edges. ...
...es not clip (default). this is different from rect(auto, auto, auto, auto), which clips to the element’s inside border edges. ...
color - CSS: Cascading Style Sheets
a(34.6 12 64 / 30%); /* <hsl()> values */ color: hsl(30, 100%, 50%, 0.6); color: hsla(30, 100%, 50%, 0.6); color: hsl(30 100% 50% / 0.6); color: hsla(30 100% 50% / 0.6); color: hsl(30.0 100% 50% / 60%); color: hsla(30.2 100% 50% / 60%); /* global values */ color: inherit; color: initial; color: unset; the color property is specified as a single <color> value. note that the value must be a uni
form color. it can't be a <gradient>, which is actually a type of <image>. values <color> sets the color of the textual and decorative parts of the element. accessibility concerns it is important to ensure that the contrast ratio between the color of the text and the background the text is placed over is high enough that people experiencing low vision conditions will be able to read the conten...
...color values. in order to meet current web content accessibility guidelines (wcag), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. large text is defined as 18.66px and bold or larger, or 24px or larger. ...
...understanding wcag 2.0
formal definition initial valuevaries from one browser to anotherapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueif the value is translucent, the computed value will be the rgba() corresponding one. if it isn't, it will be the rgb() corresponding one. ...
contain - CSS: Cascading Style Sheets
the contain css property allows an author to indicate that an element and its contents are, as much as possible, independent of the rest of the document tree. this allows the browser to recalculate layout, style, paint, size, or any combination of them for a limited area of the dom and not the entire page, leading to obvious per
formance benefits. this property is useful on pages that contain a lot of widgets that are all independent, as it can be used to prevent each widget's internals from having side effects outside of the widget's bounding-box. note: if applied (with value: paint, strict or content), this property creates: a new containing block (for the descendants whose position property is absolute or fixed). a new stacking context. a new block
formatting context. syntax /* ...
... paint indicates that descendants of the element don't display outside its bounds. if the containing box is offscreen, the browser does not need to paint its contained elements — these must also be offscreen as they are contained completely by that box. and if a descendant overflows the containing element's bounds, then that descendant will be clipped to the containing element's border-box. ...
..., the browser does not need to paint its contained elements — these must also be offscreen as they are contained completely by that box. and if a descendant overflows the containing element's bounds, then that descendant will be clipped to the containing element's border-box. ...
counter-reset - CSS: Cascading Style Sheets
g the counter, followed optionally by an <integer>. you may specify as many counters to reset as you want, with each name or name-number pair separated by a space. the keyword value none. values <custom-ident> the name of the counter to reset. <integer> the value to reset the counter to on each occurrence of the element. defaults to 0 if not specified. ...
...reset as you want, with each name or name-number pair separated by a space. the keyword value none. values <custom-ident> the name of the counter to reset. <integer> the value to reset the counter to on each occurrence of the element. defaults to 0 if not specified. none no counter reset is to be per
formed. this can be used to override a counter-reset defined in a less specific rule. ...
...m-ident> the name of the counter to reset. <integer> the value to reset the counter to on each occurrence of the element. defaults to 0 if not specified. none no counter reset is to be per
formed. this can be used to override a counter-reset defined in a less specific rule.
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax [ <custom-ident> <integer>? ]+ | none examples resetting named counters h1 { counter-reset: chapter section 1 page; /* sets the chapter and page counters to 0, and the section counter to 1 */ } specifications specification status comment css lists module level 3the definition of 'counter-reset' in that specification. working draft no chang...
counter-set - CSS: Cascading Style Sheets
e counter to set. <integer> the value to set the counter to on each occurrence of the element. defaults to 0 if not specified. if there isn't currently a counter of the given name on the element, the element will create a new counter of the given name with a starting value of 0 (though it may then immediately set or increment that value to something different). ...
...e element. defaults to 0 if not specified. if there isn't currently a counter of the given name on the element, the element will create a new counter of the given name with a starting value of 0 (though it may then immediately set or increment that value to something different). none no counter set is to be per
formed. this can be used to override a counter-set defined in a less specific rule. ...
...ment will create a new counter of the given name with a starting value of 0 (though it may then immediately set or increment that value to something different). none no counter set is to be per
formed. this can be used to override a counter-set defined in a less specific rule.
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax [ <custom-ident> <integer>? ]+ | none examples setting named counters h1 { counter-set: chapter section 1 page; /* sets the chapter and page counters to 0, and the section counter to 1 */ } specifications specification status comment css lists module level 3the definition of 'counter-set' in that specification. working draft initial defin...
cursor - CSS: Cascading Style Sheets
nitless nonnegative numbers less than 32. keyword values move your mouse over values to see their live appearance in your browser: category css value example description general auto the ua will determine the cursor to display based on the current context. e.g., equivalent to text when hovering text. default the plat
form-dependent default cursor. typically an arrow. none no cursor is rendered. links & status context-menu a context menu is available. help help in
formation is available. pointer the cursor is a pointer that indicates a link. typically an image of a pointing hand. progress the program is busy ...
...omed (magnified) in or out. zoom-out usage notes although the specification does not define any size limitations for cursor, individual user agents may choose to do so. cursor changes using images which are outside the size range supported by the browser will generally just be ignored. check the browser compatibility table for any notes on cursor size limits. ...
...or, individual user agents may choose to do so. cursor changes using images which are outside the size range supported by the browser will generally just be ignored. check the browser compatibility table for any notes on cursor size limits. ...
flex-wrap - CSS: Cascading Style Sheets
onto one line or can wrap onto multiple lines. if wrapping is allowed, it sets the direction that lines are stacked. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. see using css flexible boxes for more properties and in
formation. syntax flex-wrap: nowrap; /* default value */ flex-wrap: wrap; flex-wrap: wrap-reverse; /* global values */ flex-wrap: inherit; flex-wrap: initial; flex-wrap: unset; the flex-wrap property is specified as a single keyword chosen from the list of values below. values the following values are accepted: nowrap the flex items are laid out in a single line which may cause the flex con...
...s-start is either equivalent to start or before depending on the flex-direction value. this is the default value. wrap the flex items break into multiple lines. the cross-start is either equivalent to start or before depending flex-direction value and the cross-end is the opposite of the specified cross-start. wrap-reverse behaves the same as wrap but cross-start and cross-end are permuted. ...
... flex items break into multiple lines. the cross-start is either equivalent to start or before depending flex-direction value and the cross-end is the opposite of the specified cross-start. wrap-reverse behaves the same as wrap but cross-start and cross-end are permuted. ...
font-family - CSS: Cascading Style Sheets
printed letterwork. e.g. "brush script mt", "brush script std", "lucida calligraphy", "lucida handwriting", "apple chancery", cursive. fantasy fantasy fonts are primarily decorative fonts that contain playful representations of characters. e.g. papyrus, herculanum, party let, curlz mt, harrington, fantasy. system-ui glyphs are taken from the default user interface font on a given plat
form. because typographic traditions vary widely across the world, this generic is provided for typefaces that don't map cleanly into the other generics. this is example system-ui text. ui-serif the default user interface serif font. this is example ui-serif text. ui-sans-serif the default user interface sans-serif font. this is example ui-sans-serif text. ui-monospace the default user int...
...: superscript and subscript, brackets that cross several lines, nesting expressions, and double struck glyphs with distinct meanings. this is some example math text: ax² + bx + c = 0. emoji fonts that are specifically designed to render emoji. this is some example emoji text: ✝♾. fangsong a particular style of chinese characters that are between serif-style song and cursive-style kai
forms. this style is often used for government documents. this is some example fangsong text with the chinese characters for "fangsong" in traditional and simple
forms, respectively: 仿宋體 仿宋体. valid family names font family names must either be given quoted as strings, or unquoted as a sequence of one or more identifiers. this means that punctuation characters and digits at the start...
...nt-family: gill sans extrabold, sans-serif; font-family: "goudy bookletter 1911", sans-serif; the following declarations are invalid: font-family: goudy bookletter 1911, sans-serif; font-family: red/black, sans-serif; font-family: "lucida" grande, sans-serif; font-family: ahem!, sans-serif; font-family: test@foo, sans-serif; font-family: #pound, sans-serif; font-family: hawaii 5-0, sans-serif;
formal definition initial valuedepends on user agentapplies toall elements. 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-feature-settings - CSS: Cascading Style Sheets
rs, or if it contains characters outside the u+20 – u+7e codepoint range, the whole property is invalid. the value is a positive integer. the two keywords on and off are synonyms for 1 and 0 respectively. if no value is set, the default is 1. for non-boolean opentype features (e.g. stylistic alternates), the value implies a particular glyph to be selected; for boolean values, it is a switch. ...
...nonyms for 1 and 0 respectively. if no value is set, the default is 1. for non-boolean opentype features (e.g. stylistic alternates), the value implies a particular glyph to be selected; for boolean values, it is a switch.
formal definition initial valuenormalapplies toall elements. ...
...mples enabling various font features /* use small-cap alternate glyphs */ .smallcaps { font-feature-settings: "smcp" on; } /* convert both upper and lowercase to small caps (affects punctuation also) */ .allsmallcaps { font-feature-settings: "c2sc", "smcp"; } /* use zeros with a slash through them to differentiate from "o" */ .nicezero { font-feature-settings: "zero"; } /* enable historical
forms */ .hist { font-feature-settings: "hist"; } /* disable common ligatures, usually on by default */ .noligs { font-feature-settings: "liga" 0; } /* enable tabular (monospaced) figures */ td.tabular { font-feature-settings: "tnum"; } /* enable automatic fractions */ .fractions { font-feature-settings: "frac"; } /* use the second available swash character */ .swash { font-feature-settings: "swsh...
font-language-override - CSS: Cascading Style Sheets
o display glyphs designed specifically for that language. 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 trans
form 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. for instance, if a typeface doesn't have proper rules for the azeri language, you can force the font to use turkish glyphs, which follow similar rules. syntax the ...
...ng>. values normal tells the browser to use font glyphs that are appropriate for the language specified by the lang attribute. this is the default value. <string> tells the browser to use font glyphs that are appropriate for the language specified by the string. the string must match a language tag found in the opentype language system. for example, "eng" is english, and "kor" is korean. ...
... the browser to use font glyphs that are appropriate for the language specified by the string. the string must match a language tag found in the opentype language system. for example, "eng" is english, and "kor" is korean.
formal definition initial valuenormalapplies toall elements. ...
font-size - CSS: Cascading Style Sheets
d. if you haven't set the font size anywhere on the page, then it is the browser default, which is often 16px. so, by default 1em = 16px, and 2em = 32px. if you set a font-size of 20px on the body element, then 1em = 20px and 2em = 40px. note that the value 2 is essentially a multiplier of the current em size. in order to calculate the em equivalent for any pixel value required, you can use this
formula: em = desired element pixel value / parent element font-size in pixels for example, suppose the font-size of the body of the page is set to 16px. if the font-size you want is 12px, then you should specify 0.75em (because 12/16 = 0.75). similarly, if you want a font size of 10px, then specify 0.625em (10/16 = 0.625); for 22px, specify 1.375em (22/16). the em is a very useful unit in css, sin...
... to rem. html { font-size: 62.5%; /* font-size 1em = 10px on default browser settings */ } span { font-size: 1.6rem; } then we apply this css to the same html, which looks like this: <span>outer <span>inner</span> outer</span> in this example, the words “outer inner outer” are all displayed at 16px (assuming that the browser's font-size has been left at the default value of 10px). ...
...r” are all displayed at 16px (assuming that the browser's font-size has been left at the default value of 10px).
formal definition initial valuemediumapplies toall elements. ...
font-synthesis - CSS: Cascading Style Sheets
he font-synthesis css property controls which missing typefaces, bold or italic, may be synthesized by the browser. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax this property can take any one of the following
forms: the keyword value none. either of the keyword values weight and style. both the keyword values weight and style. values none indicates that neither bold nor italic typeface may be synthesized. weight indicates that a bold typeface may be synthesized if needed. style indicates that an italic typeface may be synthesized if needed. description most standard western fonts include ...
...face may be synthesized if needed. description most standard western fonts include italic and bold variants, but many novelty fonts do not. fonts used for chinese, japanese, korean and other logographic scripts tend not to include these variants, and synthesizing them may impede the legibility of the text. in these cases, it may be desirable to switch off the browser's default font-synthesis. ...
...an and other logographic scripts tend not to include these variants, and synthesizing them may impede the legibility of the text. in these cases, it may be desirable to switch off the browser's default font-synthesis.
formal definition initial valueweight styleapplies toall elements. ...
font-variant-caps - CSS: Cascading Style Sheets
s: initial; font-variant-caps: unset; the font-variant-caps property is specified using a single keyword value from the list below. in each case, if the font doesn't support the opentype value, then it synthesizes the glyphs. values normal deactivates of the use of alternate glyphs. small-caps enables display of small capitals (opentype feature: smcp). small-caps glyphs typically use the
form of uppercase letters but are reduced to the size of lowercase letters. all-small-caps enables display of small capitals for both upper and lowercase letters (opentype features: c2sc, smcp). petite-caps enables display of petite capitals (opentype feature: pcap). all-petite-caps enables display of petite capitals for both upper and lowercase letters (opentype features: c2pc, pcap). unicase ...
...ll uppercase titling sequences they can appear too strong. titling capitals are designed specifically for this situation. accessibility concerns large sections of text set with a font-variant value of all-small-caps or all-petite-caps may be difficult for people with cognitive concerns such as dyslexia to read. ...
...with a font-variant value of all-small-caps or all-petite-caps may be difficult for people with cognitive concerns such as dyslexia to read. mdn understanding wcag, guideline 1.4 explanations w3c understanding wcag 2.1
formal definition initial valuenormalapplies toall elements. ...
font-variant-east-asian - CSS: Cascading Style Sheets
ast-asian: ruby full-width jis83; /* global values */ font-variant-east-asian: inherit; font-variant-east-asian: initial; font-variant-east-asian: unset; syntax values normal this keyword leads to the deactivation of the use of such alternate glyphs. ruby this keyword forces the use of special glyphs for ruby characters. as these are usually smaller, font creators often designs specific
forms, usually slightly bolder to improve the contrast. this keyword corresponds to the opentype values ruby. <east-asian-variant-values> these values specify a set of logographic glyph variants which should be used for display. possible values are: keyword standard defining the glyphs opentype equivalent jis78 jis x 0208:1978 jp78 jis83 jis x...
...s> these values control the sizing of figures used for east asian characters. two values are possible: proportional-width activating the set of east asian characters which vary in width. it corresponds to the opentype values pwid. full-width activating the set of east asian characters which are all of the same, roughly square, width metric. it corresponds to the opentype values fwid. ...
...h vary in width. it corresponds to the opentype values pwid. full-width activating the set of east asian characters which are all of the same, roughly square, width metric. it corresponds to the opentype values fwid.
formal definition initial valuenormalapplies toall elements. ...
font-variant-position - CSS: Cascading Style Sheets
erscript and subscript glyphs. sub activates subscript alternate glyphs. if, in a given run, one such glyph is not available for a character, all the characters in the run are rendered using synthesized glyphs. super activates superscript alternate glyphs. if, in a given run, one such glyph is not available for a character, all the characters in the run are rendered using synthesized glyphs. ...
...re rendered using synthesized glyphs. super activates superscript alternate glyphs. if, in a given run, one such glyph is not available for a character, all the characters in the run are rendered using synthesized glyphs.
formal definition initial valuenormalapplies toall elements. ...
...phs. if, in a given run, one such glyph is not available for a character, all the characters in the run are rendered using synthesized glyphs.
formal definition initial valuenormalapplies toall elements. ...
grid-area - CSS: Cascading Style Sheets
es auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement or a default span of 1. <custom-ident> if there is a named line with the name '<custom-ident>-start'/'<custom-ident>-end', it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this
form, so specifying grid-area: foo; will choose the start/end edge of that named grid area (unless another line named foo-start/foo-end was explicitly specified before it). otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it in...
... from the opposite edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. ...
...] | [ span && [ <integer> | <custom-ident> ] ] examples setting grid areas html <div id="grid"> <div id="item1"></div> <div id="item2"></div> <div id="item3"></div> </div> css #grid { display: grid; height: 100px; grid-template: repeat(4, 1fr) / 50px 100px; } #...
grid-auto-columns - CSS: Cascading Style Sheets
tion that defines a size range greater than or equal to min and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets the track’s flex factor. as a minimum, it is treated as zero (or minimal content, if the grid container is sized under a minimal content constraint). fit-content(argument) represents the
formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is greater than the auto minimum. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying th...
...s clamped at argument if it is greater than the auto minimum. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be streched by the align-content and justify-content properties. ...
...ight) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be streched by the align-content and justify-content properties. ...
grid-auto-flow - CSS: Cascading Style Sheets
interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword values */ grid-auto-flow: row; grid-auto-flow: column; grid-auto-flow: dense; grid-auto-flow: row dense; grid-auto-flow: column dense; /* global values */ grid-auto-flow: inherit; grid-auto-flow: initial; grid-auto-flow: unset; this property may take one of two
forms: a single keyword: one of row, column, or dense. two keywords: row dense or column dense. values row items are placed by filling each row in turn, adding new rows as necessary. if neither row nor column is provided, row is assumed. column items are placed by filling each column in turn, adding new columns as necessary. dense "dense" packing algorithm attempts to fill in holes earli...
... items to appear out-of-order, when doing so would fill in holes left by larger items. if it is omitted, a "sparse" algorithm is used, where the placement algorithm only ever moves "forward" in the grid when placing items, never backtracking to fill holes. this ensures that all of the auto-placed items appear "in order", even if this leaves holes that could have been filled by later items. ...
...gorithm is used, where the placement algorithm only ever moves "forward" in the grid when placing items, never backtracking to fill holes. this ensures that all of the auto-placed items appear "in order", even if this leaves holes that could have been filled by later items. ...
grid-column-end - CSS: Cascading Style Sheets
alues auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1. <custom-ident> if there is a named line with the name '<custom-ident>-end', it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this
form, so specifying grid-column-end: foo; will choose the end edge of that named grid area (unless another line named foo-end was explicitly specified before it). otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead coun...
... <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. the <custom-ident> cannot take the span value. ...
... are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. the <custom-ident> cannot take the span value. ...
grid-column-start - CSS: Cascading Style Sheets
values auto a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1. <custom-ident> if there is a named line with the name <custom-ident>-start, it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this
form, so specifying grid-column-start: foo; will choose the start edge of that named grid area (unless another line named foo-start was explicitly specified before it). otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it counts...
...<custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers and 0 are invalid. the <custom-ident> cannot take the span value. ...
...are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers and 0 are invalid. the <custom-ident> cannot take the span value. ...
grid-column - CSS: Cascading Style Sheets
word indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1. <custom-ident> if there is a named line with the name '<custom-ident>-start'/'<custom-ident>-end', it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this
form, so specifying grid-column: foo; will choose the start/end edge of that named grid area (unless another line named foo-start/foo-end was explicitly specified before it). otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it ...
...ose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. one can use a little javascript to enable automatic annotation: source repository. ...
...c annotation: source repository. ...
grid-row-end - CSS: Cascading Style Sheets
alues auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1. <custom-ident> if there is a named line with the name '<custom-ident>-end', it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this
form, so specifying grid-row-end: foo; will choose the end edge of that named grid area (unless another line named foo-end was explicitly specified before it). otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>. the <custom-ident> cannot take the span value. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. i...
...nes from the start edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. ...
...plicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. ...
grid-row-start - CSS: Cascading Style Sheets
s auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1. <custom-ident> if there is a named line with the name '<custom-ident>-start', it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this
form, so specifying grid-row-start: foo; will choose the start edge of that named grid area (unless another line named foo-start was explicitly specified before it). otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead c...
...custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid, corresponding to the search direction, are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. the <custom-ident> cannot take the span value. ...
... are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. the <custom-ident> cannot take the span value. ...
grid-row - CSS: Cascading Style Sheets
word indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1. <custom-ident> if there is a named line with the name '<custom-ident>-start'/'<custom-ident>-end', it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this
form, so specifying grid-row: foo; will choose the start/end edge of that named grid area (unless another line named foo-start/foo-end was explicitly specified before it). otherwise, this is treated as if the integer 1 had been specified along with the <custom-ident>. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it ins...
...ose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. one can use a little javascript to enable automatic annotation: source repository. ...
...ble automatic annotation: source repository. ...
grid-template-areas - CSS: Cascading Style Sheets
herit; grid-template-areas: initial; grid-template-areas: unset; values none the grid container doesn’t define any named grid areas. <string>+ a row is created for every separate string listed, and a column is created for each cell in the string. multiple named cell tokens within and between rows create a single named grid area that spans the corresponding grid cells. ...
...te-areas: unset; values none the grid container doesn’t define any named grid areas. <string>+ a row is created for every separate string listed, and a column is created for each cell in the string. multiple named cell tokens within and between rows create a single named grid area that spans the corresponding grid cells. unless those cells
form a rectangle, the declaration is invalid. ...
...for every separate string listed, and a column is created for each cell in the string. multiple named cell tokens within and between rows create a single named grid area that spans the corresponding grid cells. unless those cells
form a rectangle, the declaration is invalid. ...
hanging-punctuation - CSS: Cascading Style Sheets
ow. two-value syntax uses one of the following: first together with any one of last, allow-end, or force-end last together with any one of first, allow-end, or force-end three-value syntax uses one of the following: first, allow-end, and last first, force-end, and last values none no character hangs. ...
...llow-end, or force-end last together with any one of first, allow-end, or force-end three-value syntax uses one of the following: first, allow-end, and last first, force-end, and last values none no character hangs. first an opening bracket or quote at the start of the first
formatted line of an element hangs. last a closing bracket or quote at the end of the last
formatted line of an element hangs. force-end a stop or comma at the end of a line hangs. ...
... values none no character hangs. first an opening bracket or quote at the start of the first
formatted line of an element hangs. last a closing bracket or quote at the end of the last
formatted line of an element hangs. force-end a stop or comma at the end of a line hangs. allow-end a stop or comma at the end of a line hangs if it does not otherwise fit prior to justification.
formal definition initial valuenoneapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax none | [ first | [ force-end | allow-end ] | last ] examples setting opening and closing quotes to hang html <p>“lorem ipsum dolor sit amet, consectetur adipiscing elit. curabitur dignissim nunc mauris, et sollicitudin est scelerisque sed. praesent laoreet tortor...
justify-items - CSS: Cascading Style Sheets
baseline alignment: the baseline keyword, plus optionally one of first or last. positional alignment: one of: center, start, end, flex-start, flex-end, self-start, self-end, left, or right. plus optionally safe or unsafe. legacy alignment: the legacy keyword, followed by one of left or right. values auto the value u...
...s instead aligned as if the alignment mode were start. unsafe regardless of the relative sizes of the item and alignment container, the given alignment value is honored. legacy makes the value inherited by the box descendants. note that if a descendant has a justify-self: auto value, the legacy keyword is not considered by the descend, only the left, right, or center value associated to it. ...
...t container, the given alignment value is honored. legacy makes the value inherited by the box descendants. note that if a descendant has a justify-self: auto value, the legacy keyword is not considered by the descend, only the left, right, or center value associated to it. ...
justify-self - CSS: Cascading Style Sheets
baseline alignment: the baseline keyword, plus optionally one of first or last. positional alignment: one of: center, start, end, flex-start, flex-end, self-start, self-end, left, or right. plus optionally safe or unsafe. values auto the value used is the value of the justify-items property of the paren...
...cting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container. safe if the size of the item overflows the alignment container, the item is instead aligned as if the alignment mode were start. unsafe regardless of the relative sizes of the item and alignment container, the given alignment value is honored. ...
...of the item overflows the alignment container, the item is instead aligned as if the alignment mode were start. unsafe regardless of the relative sizes of the item and alignment container, the given alignment value is honored.
formal definition initial valueautoapplies toblock-level boxes, absolutely-positioned boxes, and grid itemsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax auto | normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ]where <baseline-position> = [ first | last ]? baseline<overflow-position> = unsafe | safe<self-position> = center | start | end | self-start | self-end | flex-start | flex-end examples simple demonstration in the following example we have a simple 2 x 2 grid layout. initially the gr...
list-style-position - CSS: Cascading Style Sheets
parent element (normally <ol> or <ul>) to let it apply to all list items. note that there is variance among browsers regarding behavior when a block element is placed first within a list element declared as list-style-position: inside. chrome and safari both place this element on the same line as the marker box, whereas firefox, internet explorer, and opera place it on the next line. for more in
formation on this, see bug 36854. syntax /* keyword values */ list-style-position: inside; list-style-position: outside; /* global values */ list-style-position: inherit; list-style-position: initial; list-style-position: unset; the list-style-position property is specified as one of the keyword values listed below. values inside the ::marker is the first element among the list item's conten...
...style-position: inside; list-style-position: outside; /* global values */ list-style-position: inherit; list-style-position: initial; list-style-position: unset; the list-style-position property is specified as one of the keyword values listed below. values inside the ::marker is the first element among the list item's contents. outside the ::marker is outside the principal block box. ...
...ion: initial; list-style-position: unset; the list-style-position property is specified as one of the keyword values listed below. values inside the ::marker is the first element among the list item's contents. outside the ::marker is outside the principal block box. ...
max-block-size - CSS: Cascading Style Sheets
s the max-width as an absolute value. <percentage> defines the max-width as a percentage of the containing block's width. auto the browser will calculate and select a max-width for the specified element. none no limit on the size of the box. max-content the intrinsic preferred max-width. min-content the intrinsic minimum max-width. fit-content(<length-percentage>) uses the fit-content
formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). how writing-mode affects directionality the values of writing-mode affect the mapping of max-block-size to max-width or max-height as follows: values of writing-mode max-block-size is equivalent to horizontal-tb, lr , lr-tb , rl , rb , rb-rl max-...
...ertical-rl, vertical-lr, sideways-rl , sideways-lr , tb , tb-rl max-width the writing-mode values sideways-lr and sideways-rl were removed from the css writing modes level 3 specification late in its design process. they may be restored in level 4. the writing modes lr, lr-tb, rl, rb, and rb-tl are no longer allowed in html contexts; they may only be used in svg 1.x contexts. ...
...its design process. they may be restored in level 4. the writing modes lr, lr-tb, rl, rb, and rb-tl are no longer allowed in html contexts; they may only be used in svg 1.x contexts.
formal definition initial value0applies tosame as width and heightinheritednopercentagesblock-size of containing blockcomputed valuesame as max-width and max-heightanimation typea length, percentage or calc();
formal syntax <'max-width'> examples setting max-block-size with horizontal and vertical text in this example, the same text (the opening sentences from herman melville's novel moby-dick) is presented in both the horizontal-tb and vertical-rl writing modes. everything else about the two boxes is identical, including the values used for max-block-size. html the html simply establishes the two <d...
max-width - CSS: Cascading Style Sheets
s the max-width as an absolute value. <percentage> defines the max-width as a percentage of the containing block's width. auto the browser will calculate and select a max-width for the specified element. none no limit on the size of the box. max-content the intrinsic preferred max-width. min-content the intrinsic minimum max-width. fit-content(<length-percentage>) uses the fit-content
formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). accessibility concerns ensure that elements set with a max-width are not truncated and/or do not obscure other content when the page is zoomed to increase text size. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wc...
...the available space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). accessibility concerns ensure that elements set with a max-width are not truncated and/or do not obscure other content when the page is zoomed to increase text size. ...
... html <div id="parent"> <div id="child"> fusce pulvinar vestibulum eros, sed luctus ...
mix-blend-mode - CSS: Cascading Style Sheets
-blend-mode: color-burn; mix-blend-mode: hard-light; mix-blend-mode: soft-light; mix-blend-mode: difference; mix-blend-mode: exclusion; mix-blend-mode: hue; mix-blend-mode: saturation; mix-blend-mode: color; mix-blend-mode: luminosity; /* global values */ mix-blend-mode: initial; mix-blend-mode: inherit; mix-blend-mode: unset; values <blend-mode> the blending mode that should be applied. ...
...de: hue; mix-blend-mode: saturation; mix-blend-mode: color; mix-blend-mode: luminosity; /* global values */ mix-blend-mode: initial; mix-blend-mode: inherit; mix-blend-mode: unset; values <blend-mode> the blending mode that should be applied. ...
...padding: 1em; margin: .5em .5em 0; font: .8em sans-serif; text-align: left; white-space: nowrap; } .note + .row .cell { margin-top: 0; } .container { position: relative; background: linear-gradient(to right, #000 0%, transparent 50%, #fff 100%), linear-gradient(to bottom, #ff0 0%, #f0f 50%, #0ff 100%); width: 150px; height: 150px; margin: 0 auto; } .r { trans
form-origin: center; trans
form: rotate(-30deg); fill: url(#red); } .g { trans
form-origin: center; trans
form: rotate(90deg); fill: url(#green); } .b { trans
form-origin: center; trans
form: rotate(210deg); fill: url(#blue); } .isolate .group { isolation: isolate; } .normal .item { mix-blend-mode: normal; } .multiply .item { mix-blend-mode: multiply; } .screen .item { mix-...
offset-distance - CSS: Cascading Style Sheets
ntax /* default value */ offset-distance: 0; /* the middle of the offset-path */ offset-distance: 50%; /* a fixed length positioned along the path */ offset-distance: 40px; <length-percentage> a length that specifies how far the element is along the path (defined with offset-path). 100% represents the total length of the path (when the offset-path is defined as a basic shape or path()). ...
...* the middle of the offset-path */ offset-distance: 50%; /* a fixed length positioned along the path */ offset-distance: 40px; <length-percentage> a length that specifies how far the element is along the path (defined with offset-path). 100% represents the total length of the path (when the offset-path is defined as a basic shape or path()). ...
...he element is along the path (defined with offset-path). 100% represents the total length of the path (when the offset-path is defined as a basic shape or path()).
formal definition initial value0applies totrans
formable elementsinheritednopercentagesrefer to the total path lengthcomputed valuefor <length> the absolute value, otherwise a percentageanimation typea length, percentage or calc();
formal syntax <length-percentage>where <length-percentage> = <length> | <percentage> examples using offset-distance in an animation the motion aspect in css motion path typically comes from animating the offset-distance property. if you want to animate an element along its full path, you would define its offset-path and then set up an animation that takes the offset-distance from 0% to 100%. html...
offset-position - CSS: Cascading Style Sheets
values. if two non-keyword values are used, the first value represents the horizontal position and the second represents the vertical position. if only one value is specified, the second value is assumed to be center. if three or four values are used, the length-percentage values are offsets for the preceding keyword value(s). for more explanation of these value types, see background-position. ...
...rst value represents the horizontal position and the second represents the vertical position. if only one value is specified, the second value is assumed to be center. if three or four values are used, the length-percentage values are offsets for the preceding keyword value(s). for more explanation of these value types, see background-position. ...
...nter. if three or four values are used, the length-percentage values are offsets for the preceding keyword value(s). for more explanation of these value types, see background-position. ...
outline-color - CSS: Cascading Style Sheets
olor: #f92525; outline-color: rgb(30,222,121); outline-color: blue; /* keyword value */ outline-color: invert; /* global values */ outline-color: inherit; outline-color: initial; outline-color: unset; the outline-color property is specified as any one of the values listed below. values <color> the color of the outline, specified as a <color>. invert to ensure the outline is visible, per
forms a color inversion of the background. note that browsers are not required to support this value; if they don't, this keyword is considered invalid. description an outline is a line that is drawn around an element, outside the border. unlike the element's border, the outline is drawn outside the element's frame, and may overlap other content. the border, on the other hand, will actually alter t...
...olor values. in order to meet current web content accessibility guidelines (wcag), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. large text is defined as 18.66px and bold or larger, or 24px or larger. webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0
formal definition initial valueinvert, for browsers supporting it, currentcolor for the otherapplies toall elementsinheritednocomputed valuefor the keyword invert, the computed value is invert. for the color value, if the value is translucent, the computed value will be the rgba() corresponding one. if it isn't, it will be the rgb() corresponding one. the transparent keyword maps to rgba(0,0,0,0).ani...
...al valueinvert, for browsers supporting it, currentcolor for the otherapplies toall elementsinheritednocomputed valuefor the keyword invert, the computed value is invert. for the color value, if the value is translucent, the computed value will be the rgba() corresponding one. if it isn't, it will be the rgb() corresponding one. ...
overflow-block - CSS: Cascading Style Sheets
ssary to fit in the block dimension in the padding box. browsers display scrollbars whether or not any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. ...
...ars whether or not any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. if content fits inside the padding box, it looks the same as visible, but still establishes a new block-
formatting context. desktop browsers provide scrollbars if content overflows. ...
...t still establishes a new block-
formatting context. desktop browsers provide scrollbars if content overflows.
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. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequ...
overflow-inline - CSS: Cascading Style Sheets
sary to fit in the padding box in the inline dimension. browsers display scrollbars whether or not any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. ...
...ars whether or not any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. if content fits inside the padding box, it looks the same as visible, but still establishes a new block-
formatting context. desktop browsers provide scrollbars if content overflows. ...
...t still establishes a new block-
formatting context. desktop browsers provide scrollbars if content overflows. ...
page-break-after - CSS: Cascading Style Sheets
k-after: unset; this property applies to block elements that generate a box. it won't apply on an empty <div> that won't generate a box. syntax values auto initial value. automatic page breaks (neither forced nor forbidden). always always force page breaks after the element. avoid avoid page breaks after the element. left force page breaks after the element so that the next page is
formatted as a left page. right force page breaks after the element so that the next page is
formatted as a right page. recto if pages progress left-to-right, then this acts like right. if pages progress right-to-left, then this acts like left. verso if pages progress left-to-right, then this acts like left. if pages progress right-to-left, then this acts like right. page break aliases t...
.... for compatibility reasons, page-break-after should be treated by browsers as an alias of break-after. this ensures that sites using page-break-after continue to work as designed. ...
... page-break-after break-after auto auto left left right right avoid avoid always page
formal definition initial valueautoapplies toblock-level elements in the normal flow of the root element. user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete
formal syntax auto | always | avoid | left | right | recto | verso examples setting a page break after footnotes /* move to a new page after footnotes */ div.footnotes { page-break-after: always; } specifications specification status comment css logical properties and values level 1the definition of 'recto and verso' in that specification. editor's draft adds...
page-break-before - CSS: Cascading Style Sheets
ecto; page-break-before: verso; /* global values */ page-break-before: inherit; page-break-before: initial; page-break-before: unset; syntax values auto initial value. automatic page breaks (neither forced nor forbidden). always always force page breaks before the element. avoid avoid page breaks before the element. left force page breaks before the element so that the next page is
formatted as a left page. right force page breaks before the element so that the next page is
formatted as a right page. recto if pages progress left-to-right, then this acts like right. if pages progress right-to-left, then this acts like left. verso if pages progress left-to-right, then this acts like left. if pages progress right-to-left, then this acts like right. page break aliases t...
...r compatibility reasons, page-break-before should be treated by browsers as an alias of break-before. this ensures that sites using page-break-before continue to work as designed. ...
...age-break-before break-before auto auto left left right right avoid avoid always page
formal definition initial valueautoapplies toblock-level elements in the normal flow of the root element. user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete
formal syntax auto | always | avoid | left | right | recto | verso examples avoid a page break before the dic /* avoid page break before the div */ div.note { page-break-before: avoid; } specifications specification status comment css logical properties and values level 1the definition of 'recto and verso' in that specification. editor's draft adds the valu...
scroll-snap-coordinate - CSS: Cascading Style Sheets
h respective axis. /* keyword value */ scroll-snap-coordinate: none; /* <position> values */ scroll-snap-coordinate: 50px 50px; /* single coordinate */ scroll-snap-coordinate: 100px 100px, 100px bottom; /* multiple coordinates */ /* global values */ scroll-snap-coordinate: inherit; scroll-snap-coordinate: initial; scroll-snap-coordinate: unset; if the element has been trans
formed, the snap coordinates are likewise trans
formed, thus aligning the snap points with the element as it is displayed. syntax values none specifies that the element does not contribute to a snap point. <position> specifies the offset of the snap coordinates from the start edge of the element’s border box. for each pairing, the first value gives the x coordinate of the snap coordinate, the...
...ise trans
formed, thus aligning the snap points with the element as it is displayed. syntax values none specifies that the element does not contribute to a snap point. <position> specifies the offset of the snap coordinates from the start edge of the element’s border box. for each pairing, the first value gives the x coordinate of the snap coordinate, the second value its y coordinate. ...
...ates from the start edge of the element’s border box. for each pairing, the first value gives the x coordinate of the snap coordinate, the second value its y coordinate. ...
scrollbar-width - CSS: Cascading Style Sheets
nimation 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. it must be one of the following values: auto the default scrollbar width for the plat
form. thin a thin scrollbar width variant on plat
forms that provide that option, or a thinner scrollbar than the default plat
form scrollbar width. none no scrollbar shown, however the element will still be scrollable. note: user agents must apply any scrollbar-width value set on the root element to the viewport. accessibility concerns use this proper...
...hat touch targets should be at least 44px in width and height (although the problem is compounded on high-resolution screens; thorough testing is advised). ...
...ns; thorough testing is advised). 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. gumbo beet greens corn soko endive gumbo gourd. parsley shallot cour...
text-decoration-line - CSS: Cascading Style Sheets
cified as none, or one or more space-separated values from the list below. values none produces no text decoration. underline each line of text has a decorative line beneath it. overline each line of text has a decorative line above it. line-through each line of text has a decorative line going through its middle. blink the text blinks (alternates between visible and invisible). ...
...xt decoration. underline each line of text has a decorative line beneath it. overline each line of text has a decorative line above it. line-through each line of text has a decorative line going through its middle. blink the text blinks (alternates between visible and invisible). con
forming user agents may simply not blink the text. this value is deprecated in favor of css animations.
formal definition initial valuenoneapplies toall elements. ...
... has a decorative line going through its middle. blink the text blinks (alternates between visible and invisible). con
forming user agents may simply not blink the text. this value is deprecated in favor of css animations.
formal definition initial valuenoneapplies toall elements. ...
text-decoration-skip - CSS: Cascading Style Sheets
me as spaces, except that only leading spaces are skipped. trailing-spaces the same as spaces, except that only trailing spaces are skipped. edges the start and end of the text decoration is inset slightly (e.g., by half of the line thickness) from the content edge of the decorating box. thus, adjacent elements receive separate underlines. ...
...s) from the content edge of the decorating box. thus, adjacent elements receive separate underlines. (this is important in chinese, where underlining is a
form of punctuation.) box-decoration the text decoration is skipped over the box's margin, border, and padding areas. this only has an effect on decorations imposed by an ancestor; a decorating box never draws over its own box decoration. ...
...chinese, where underlining is a
form of punctuation.) box-decoration the text decoration is skipped over the box's margin, border, and padding areas. this only has an effect on decorations imposed by an ancestor; a decorating box never draws over its own box decoration. ...
text-decoration-thickness - CSS: Cascading Style Sheets
s: from-font; /* length */ text-decoration-thickness: 0.1em; text-decoration-thickness: 3px; /* percentage */ text-decoration-thickness: 10%; /* global values */ text-decoration-thickness: inherit; text-decoration-thickness: initial; text-decoration-thickness: unset; values auto the browser chooses an appropriate width for the text decoration line. from-font if the font file includes in
formation about a preferred thickness, use that value. if the font file doesn't include this in
formation, behave as if auto was set, with the browser choosing an appropriate thickness. <length> specifies the thickness of the text decoration line as a <length>, overriding the font file suggestion or the browser default. <percentage> specifies the thickness of the text decoration line as a <percenta...
...he thickness of the text decoration line as a <percentage> of 1em in the current font. a percentage inherits as a relative value, and so therefore scales with changes in the font. the browser must use a minimum of 1 device pixel. for a given application of this property, the thickness is constant across the whole box it is applied to, even if there are child elements with a different font size. ...
... application of this property, the thickness is constant across the whole box it is applied to, even if there are child elements with a different font size.
formal definition initial valueautoapplies toall elements. ...
text-decoration - CSS: Cascading Style Sheets
various longhand text-decoration properties. values text-decoration-line sets the kind of decoration used, such as underline or line-through. text-decoration-color sets the color of the decoration. text-decoration-style sets the style of the line used for the decoration, such as solid, wavy, or dashed. text-decoration-thickness sets the thickness of the line used for the decoration.
formal definition initial valueas each of the properties of the shorthand:text-decoration-color: currentcolortext-decoration-style: solidtext-decoration-line: noneapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednocomputed valueas each of the properties of the shorthand:text-decoration-line: as specifiedtext-decoration-style: as specifiedtext-decoration-color: compu...
...omputed valueas each of the properties of the shorthand:text-decoration-line: as specifiedtext-decoration-style: as specifiedtext-decoration-color: computed colortext-decoration-thickness: as specifiedanimation typeas each of the properties of the shorthand:text-decoration-color: a colortext-decoration-style: discretetext-decoration-line: discretetext-decoration-thickness: by computed value type
formal syntax <'text-decoration-line'> | <'text-decoration-style'> | <'text-decoration-color'> | <'text-decoration-thickness'> examples .under { text-decoration: underline red; } .over { text-decoration: wavy overline lime; } .line { text-decoration: line-through; } .plain { text-decoration: none; } .underover { text-decoration: dashed underline overline; } .thick { text-decoration...
...se.</p> specifications specification status comment css text decoration module level 4 working draft adds text-decoration-thickness; note that this isn't yet officially part of the shorthand — this is as yet unspecified. css text decoration module level 3the definition of 'text-decoration' in that specification. candidate recommendation trans
formed into a shorthand property. added support for the value of text-decoration-style. css level 2 (revision 1)the definition of 'text-decoration' in that specification. recommendation no significant changes. css level 1the definition of 'text-decoration' in that specification. recommendation initial definition. ...
text-rendering - CSS: Cascading Style Sheets
the browser makes trade-offs among speed, legibility, and geometric precision. /* keyword values */ text-rendering: auto; text-rendering: optimizespeed; text-rendering: optimizelegibility; text-rendering: geometricprecision; /* global values */ text-rendering: inherit; text-rendering: initial; text-rendering: unset; note: the text-rendering property is an svg property that is not defined in any css standard. however, gecko and webkit browsers let you apply this property to html and xml content on windows, macos, and linux. ...
...s geometric precision over rendering speed and legibility. certain aspects of fonts — such as kerning — don't scale linearly. so this value can make text using those fonts look good. in svg, when text is scaled up or down, browsers calculate the final size of the text (which is determined by the specified font size and the applied scale) and request a font of that computed size from the plat
form's font system. but if you request a font size of, say, 9 with a scale of 140%, the resulting font size of 12.6 doesn't explicitly exist in the font system, so the browser rounds the font size to 12 instead. this results in stair-step scaling of text. but the geometricprecision property — when fully supported by the rendering engine — lets you scale your text fluidly. for large scale factors...
... when fully supported by the rendering engine — lets you scale your text fluidly. for large scale factors, you might see less-than-beautiful text rendering, but the size is what you would expect—neither rounded up nor down to the nearest font size supported by windows or linux. note: webkit precisely applies the specified value, but gecko treats the value the same as optimizelegibility.
formal definition initial valueautoapplies totext elementsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax auto | optimizespeed | optimizelegibility | geometricprecision examples automatic application of optimizelegibility this demonstrates how optimizelegibility is used by browsers automatically when the font-size is smaller than 20px. html <p class="small">lyowat - ...
scaleY() - CSS: Cascading Style Sheets
the scaley() css function defines a trans
formation that resizes an element along the y-axis (vertically). its result is a <trans
form-function> data type. it modifies the ordinate of each element point by a constant factor, except when the scale factor is 1, in which case the function is the identity trans
form. the scaling is not isotropic, and the angles of the element are not conserved. scaley(-1) defines an axial symmetry, with a horizontal axis passing through the origin (as specified by the trans
form-origin property). note: scaley(sy) is equivalent to scale(1, sy) or scale3d(1, sy, 1). trans
form: rotatex(180deg); === trans
form: scaley(-1); syntax scaley(s) values s is a <number> representing the scaling factor to apply on the ordinate of each point of the element. ...
... working draft initial definition ...
... working draft initial definition ...
skew() - CSS: Cascading Style Sheets
the coordinates of each point are modified by a value proportionate to the specified angle and the distance to the origin; thus, the farther from the origin a point is, the greater will be the value added it. ...
...the coordinates of each point are modified by a value proportionate to the specified angle and the distance to the origin; thus, the farther from the origin a point is, the greater will be the value added it. ...
...ates on ℝ3 homogeneous coordinates on ℝℙ3 1tan(ax)tan(ay)1 1tan(ax)0tan(ay)10001 1tan(ax)0tan(ay)10001 1tan(ax)00tan(ay)10000100001 [1 tan(ay) tan(ax) 1 0 0] examples using a single x-angle html <div>normal</div> <div class="skewed">skewed</div> css div { width: 80px; height: 80px; background-color: skyblue; } .skewed { trans
form: skew(10deg); /* equal to skewx(10deg) */ background-color: pink; } result using two angles html <div>normal</div> <div class="skewed">skewed</div> css div { width: 80px; height: 80px; background-color: skyblue; } .skewed { trans
form: skew(10deg, 10deg); background-color: pink; } result specifications specification status comment css transfo...
transition - CSS: Cascading Style Sheets
use zero, one, or two <time> values. the first value that can be parsed as a time is assigned to the transition-duration, and the second value that can be parsed as a time is assigned to transition-delay. see how things are handled when lists of property values aren't the same length. in short, extra transition descriptions beyond the number of properties actually being animated are ignored. ...
...he shorthand:transition-delay: 0stransition-duration: 0stransition-property: alltransition-timing-function: easeapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas each of the properties of the shorthand:transition-delay: as specifiedtransition-duration: as specifiedtransition-property: as specifiedtransition-timing-function: as specifiedanimation typediscrete
formal syntax <single-transition>#where <single-transition> = [ none | <single-transition-property> ] | <time> | <timing-function> | <time>where <single-transition-property> = all | <custom-ident><timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/docs/css/va...
...iming-function> | <time>where <single-transition-property> = all | <custom-ident><timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to trans
form them as a single component">[0,1]>, <number>, <number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to trans
form them as a single component">[0,1]>, <number>)<step-timing-function> = step-start | step-end | steps(<integer>[, <step-position>]?)where <step-position> = jump-start | jump-end | jump-none | jump-both | start...
unicode-bidi - CSS: Cascading Style Sheets
content and the override behavior of the bidi-override keyword to the inner content. plaintext this keyword makes the elements directionality calculated without considering its parent bidirectional state or the value of the direction property. the directionality is calculated using the p2 and p3 rules of the unicode bidirectional algorithm. ...
...ner content. plaintext this keyword makes the elements directionality calculated without considering its parent bidirectional state or the value of the direction property. the directionality is calculated using the p2 and p3 rules of the unicode bidirectional algorithm. this value allows the display of data that is already
formatted using a tool following the unicode bidirectional algorithm. ...
...irectionality is calculated using the p2 and p3 rules of the unicode bidirectional algorithm. this value allows the display of data that is already
formatted using a tool following the unicode bidirectional algorithm. ...
width - CSS: Cascading Style Sheets
a <length> or a <percentage>. values <length> defines the width as an absolute value. <percentage> defines the width as a percentage of the containing block's width. auto the browser will calculate and select a width for the specified element. max-content the intrinsic preferred width. min-content the intrinsic minimum width. fit-content(<length-percentage>) uses the fit-content
formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, <length-percentage>)). accessibility concerns ensure that elements set with a width aren't truncated and don't obscure other content when the page is zoomed to increase text size. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | understanding wc...
...the available space replaced by the specified argument, i.e. min(max-content, max(min-content, <length-percentage>)). accessibility concerns ensure that elements set with a width aren't truncated and don't obscure other content when the page is zoomed to increase text size. ...
...nderstanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | understanding wcag 2.0
formal definition initial valueautoapplies toall elements but non-replaced inline elements, table rows, and row groupsinheritednopercentagesrefer to the width of the containing blockcomputed valuea percentage or auto or the absolute lengthanimation typea length, percentage or calc();
formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples default width p.goldie { background: gold; } <p class="goldie">the mozilla community produces a lot of great software.</p> pixels and ems .px_length { width: 200px; background-color: red; color: white; border: 1px sol...
zoom - CSS: Cascading Style Sheets
/* keyword values */ zoom: normal; zoom: reset; /* <percentage> values */ zoom: 50%; zoom: 200%; /* <number> values */ zoom: 1.1; zoom: 0.7; /* global values */ zoom: inherit; zoom: initial; zoom: unset; syntax values normal render this element at its normal size. reset do not (de)magnify this element if the user applies non-pinch-based zooming (e.g. by pressing ctrl-- or ctrl++ keyboard shortcuts) to the document. ...
...g. by pressing ctrl-- or ctrl++ keyboard shortcuts) to the document. only supported by webkit (and possibly blink). <percentage> zoom factor. 100% is equivalent to normal. values larger than 100% zoom in. values smaller than 100% zoom out. <number> zoom factor. equivalent to the corresponding percentage (1.0 = 100% = normal). values larger than 1.0 zoom in. values smaller than 1.0 zoom out. ...
...ntage> zoom factor. 100% is equivalent to normal. values larger than 100% zoom in. values smaller than 100% zoom out. <number> zoom factor. equivalent to the corresponding percentage (1.0 = 100% = normal). values larger than 1.0 zoom in. values smaller than 1.0 zoom out. ...
CSS: Cascading Style Sheets
w to use it. css tutorials our css learning area contains a wealth of tutorials to take you from beginner level to proficiency, covering all the fundamentals. css reference our exhaustive css reference for seasoned web developers describes every property and concept of css. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started tutorials our css learning area features multiple modules that teach css from the ground up — no previous knowledge required. css first steps css (cascading style sheets) is used to style and layout web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animatio...
... some of the legacy techniques you might still want to know about. use css to solve common problems this module provides links to sections of content explaining how to use css to solve common problems when creating a web page. reference css reference: this exhaustive reference for seasoned web developers describes every property and concept of css. ...
... use css to solve common problems when creating a web page. reference css reference: this exhaustive reference for seasoned web developers describes every property and concept of css. css key concepts: the syntax and
forms of the language specificity, inheritance and the cascade css units and values box model and margin collapse the containing block stacking and block-
formatting contexts initial, computed, used, and actual values css shorthand properties css flexible box layout css grid layout media queries animation cookbook the css layout cookbook aims to bring together recipes for common layout patterns, things you might need to implement in your sites. in addition to providing code you can use as a starting point in your projects, thes...
EXSLT
exslt modules to use an exslt function, you need to declare the namespace the function is in, and then use the appropriate prefix when calling the function. for example, to use the regular expressions package: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.
...strings (str)the exslt strings package provides functions that allow the manipulation of strings. exslt modules to use an exslt function, you need to declare the namespace the function is in, and then use the appropriate prefix when calling the function. for example, to use the regular expressions package: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/trans
form" xmlns:regexp="http://exslt.org/regular-expressions"> <xsl:template match="/"> ... <xsl:value-of select="regexp:replace(/root/@value, 'before', 'gi', 'after')"/> ... </xsl:template> </xsl:stylesheet> common the exslt common package provides basic functions that expand upon the capabilities of xslt. the namespace for the common package is http://exslt.org/comm...
...ax() math:min() regular expressions the exslt regular expressions package provides functions that allow testing, matching, and replacing text using javascript style regular expressions. the exslt regular expressions namespace is http://exslt.org/regular-expressions. functions regexp:match() regexp:replace() regexp:test() sets the exslt sets package offers functions that let you per
form set manipulation. the namespace for these functions is http://exslt.org/sets. functions set:difference() set:distinct() set:intersection() set:has-same-node() set:leading() set:trailing() strings the exslt strings package provides functions that allow the manipulation of strings. the namespace for the strings package is http://exslt.org/strings. functions str:concat() str:split()...
Creating a cross-browser video player - Developer guides
tom control set, the controls attribute is still added to the <video> element, and the player's default control set is switched off later with javascript. doing things this way still allows users who have javascript turned off (for whatever reason) to still have access to the browser's native controls. a poster image is defined for the video, and the preload attribute is set to metadata, which in
forms the browser that it should initially only attempt to load the metadata from the video file rather than the entire video file. this provides the player with data such as video duration and
format. note: ie9 behaves differently than most other browsers when a poster attribute is set. most browsers interpret the presence of a poster attribute to mean that the specified image is to be displayed un...
...he presence of a poster attribute to mean that the specified image is to be displayed until the user chooses to play the video. ie9 will only use the specified poster image in this way if preload="none" is set; otherwise, it will take the first still of the video and display that instead. three different video sources are provided for the player: mp4, webm, and ogg. using these different source
formats gives the best chance of being supported across all browsers that support html5 video. for further in
formation on video
formats and browser compatibility, see supported media
formats. for browsers that do not support html5 video, a flash player is provided that will allow playback of the mp4 video source, provided the end user has flash installed. in addition a download link is displayed to a...
... value. this can be taken advantage of to set the progress element's max attribute if it is currently not set: video.addeventlistener('timeupdate', function() { if (!progress.getattribute('max')) progress.setattribute('max', video.duration); progress.value = video.currenttime; progressbar.style.width = math.floor((video.currenttime / video.duration) * 100) + '%'; }); note: for more in
formation and ideas on progress bars and buffering feedback, read media buffering, seeking, and time ranges. skip ahead another feature of most browser default video control sets is the ability to click on the video's progress bar to "skip ahead" to a different point in the video. this can also be achieved by adding a simple click event listener to the progress element: progress.addeventlistener('...
Media events - Developer guides
event name description abort sent when playback is aborted; for example, if the media is playing and is restarted from the beginning, this event is sent. canplay sent when enough data is available that the media can be played, at least for a couple of frames. this corresponds to the have_future_data readystate. ...
...the media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it. encrypted the user agent has encountered initialization data in the media data. ended sent when playback completes. error sent when an error occurs. the element's error attribute contains more in
formation. see htmlmediaelement.error for details. loadeddata the first frame of the media has finished loading. loadedmetadata the media's metadata has finished loading; all attributes now contain as much useful in
formation as they're going to. loadstart sent when loading of the media begins. mozaudioavailable sent when an audio buffer is provided to th...
... true). play sent when the playback state is no longer paused, as a result of the play method, or the autoplay attribute. playing sent when the media has enough data to start playing, after the play event, but also when recovering from being stalled, when looping media restarts, and after seeked, if it was playing before seeking. progress sent periodically to in
form interested parties of progress downloading the media. in
formation about the current amount of the media that has been downloaded is available in the media element's buffered attribute. ratechange sent when the playback speed changes. seeked sent when a seek operation completes. seeking sent when a seek operation begins. stalled sent when the user ag...
Using HTML sections and outlines - Developer guides
cle>, <section>, <aside>, and <nav> can have their own <header>. despite its name, the header is not necessarily positioned at the beginning of a page or section. html footer element (<footer>) defines a page footer, which typically contains copyright or legal notices and sometimes some links. in the context of a section, a footer might contain the sectioned content's publication date, license in
formation, etc. <article>, <section>, <aside>, and <nav> can have their own <footer>. despite its name, the footer is not necessarily positioned at the end of a page or section. how do sectional elements work? <body> <header> <nav> <ul> <li><a href="#">link</a></li> <li><a href="#">link</a></li> <li><a href="#">link</a></li> </ul> </nav...
... amazing quote from article </blockquote> </aside> <footer> <p> author info, publication date </p> </footer> </article> nesting articles and sections articles can be nested inside of sections and sections can be nested inside of articles. a book, for example, may be divided up into sections with related articles. each of these articles could contain sections of related in
formation. <section> <h1>getting involved</h1> <article> <header> <h2>how to become an mdn contributor</h2> <p>do you want to help protect the web?....</p> </header> <section> <h3>steps to editing an article</h3> </section> <footer> <p>author info</p> <p>publication date</p> </footer> </article> </section> section element the section eleme...
...text"></li> <li><img src="link" alt="descriptive text"></li> <li><img src="link" alt="descriptive text"></li> </ul> </section> aside element the <aside> element defines related content that has a different placement than the main content. it is often used for call-outs, blockquotes, and definitions. the <aside> element is often used for sidebars containing extra, but relevant, in
formation. <section> <h1>amazing mdn contributors</h1> <ul> <li><img src="link" alt="descriptive text"></li> <li><img src="link" alt="descriptive text"></li> <li><img src="link" alt="descriptive text"></li> </ul> <aside> <p>to get involved contact</p> </aside> </section> nesting aside elements the <aside> element can be nested inside of other sectional html ...
Mobile-friendliness - Developer guides
what is mobile friendliness? mobile friendliness can mean a multitude of things, depending on who you’re talking to. it can be helpful to think of it in terms of three goals for improving your site’s user experience: presentation, content, and per
formance. goal #1 (presentation) “make websites that work well on a variety of screen sizes.” these days, users can access the web on devices in a wide range of
form factors, including phones, tablets, and ereaders. needless to say, a fixed-width, three-column layout filled with complex javascript animations and mouse-over effects is not going to look or feel quite right on a phone with a 2-inch-wide screen and a diminutive processor. a slimmed-down, linearized page layout with elements sized for a touchscreen would be much more approp...
...our users want to do at your site if they are on a phone. a great example of this is alaska air’s website. their desktop site focuses on getting visitors to book trips. mobile users, however, are probably more interested in checking-in for a flight or seeing if their flight is delayed. they’ve adjusted their site’s content to reflect this, and it meets the needs of mobile users. goal #3 (per
formance) “give your users a smooth experience, even on a slow connection.” though things have been getting better in recent years, browsing the internet over a wireless data connection can still be pretty painful. this makes it more essential than ever to practice good per
formance practices, only sending the user the bits they will actually need. know your audience while not strictly a part of th...
... and smartphones with standards-friendly browsers. on the other hand, if many of your site’s users are on devices with less capable browsers, that may eliminate certain strategies as viable options. approaches to mobile web development the following approaches aim to achieve each of these goals by different means. separate sites responsive design a hybrid approach original document in
formation originally published on 4 may, 2011 on the mozilla webdev blog as "approaches to mobile web development part 1 - what is mobile friendliness?", by jason grlicky. ...
Separate sites for mobile and desktop - Developer guides
oach has positive and negative aspects. the good the first option is the most popular by far: use user-agent detection to route users on phones to a separate mobile site, typically at m.example.com. in a nutshell, this technique uses server-side logic to solve all three goals of mobile web development at once — if the user’s browser looks like it’s on a phone, you serve them mobile content,
formatted for their phone and optimized for speed. conceptually simple, this is the easiest option to add to an existing site, especially if you are using a cms or web application that supports templates. since only the mobile-specific content, styles, and scripts are sent to mobile users, this method also provides for the best per
formance out of any of the other options presented here. finally, it al...
...entally. when it is right to choose this option firstly, if your target audience includes users on older or low-end feature phones, it is worth noting that you may need to employ this strategy to some degree no matter what. this is because the default browsers on some feature-phones do not support the same markup that you would use to code a website targeted at the desktop, but instead understand
formats like xhtml-mp or the older wml. this factor aside, there is one case where this strategy really shines over other methods. if the functionality you would like to provide to your users on mobile devices is extremely different from that on a desktop, then using separate sites is simply likely to be the most practical choice. this is because you have the option of sending completely separate html...
.... in fact, mozilla picked this strategy for the mobile versions of addons.mozilla.org (amo) and support.mozilla.org (sumo). if you’d like to see the source code behind an example of this approach in action, feel free to check out the github repository for amo or sumo. approaches to mobile web development see the following articles for background and other approaches to developing for mobile plat
forms. what is mobile-friendliness? responsive design a hybrid approach original document in
formation this article was originally published on 13 may 2011, on the mozilla webdev blog as "approaches to mobile web development part 2 – separate sites", by jason grlicky. ...
HTML attribute: readonly - HTML: Hypertext Markup Language
makes the element not mutable, meaning the user can not edit the control. if the readonly attribute is specified on an input element, because the user can not edit the input, the element does not participate in constraint validation. 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. if the attribute is not included, the :read-write 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. range and...
...bute is not included, the :read-write 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. range and color, as both have default values. it is also not supported on hidden as it can not be expected that a user to fill out a
form that is hidden. nor is it supported on any of the button types, including image. note: only text controls can be made read-only, since for other controls (such as checkboxes and buttons) there is no useful distinction between being read-only and being disabled, so the readonly attribute does not apply. when an input has the readonly attribute, the :read-only pseudo-class also applies to it. c...
...ribute, the :read-only pseudo-class also applies to it. conversely, inputs that support the readonly attribute but don't have the attribute set match the :read-write pseudo-class. attribute interactions the difference between disabled and readonly is that read-only controls can still function and are still focusable, whereas disabled controls can not receive focus and are not submitted with the
form and generally do not function as controls until they are enabled. because a read-only field cannot have it's value changed by a user interaction, required does not have any effect on inputs with the readonly attribute also specified. the only way to modify dynamically the value of the readonly attribute is through a script. note: the required attribute is not permitted on inputs with the read...
HTML attribute: step - HTML: Hypertext Markup Language
supporting browsers will show the value as invalid. ...
...when using the min attribute, ensure this minimum requirement is understood by the user. providing instructions within the <label> may be sufficient. ...
...ormation. specifications specification status comment html living standardthe definition of 'step attribute' in that specification. living standard html5the definition of 'step attribute' in that specification. recommendation accessibility concerns provide instructions to help users understand how to complete the
form and use individual
form controls. indicate any required and optional input, data
formats, and other relevant in
formation. when using the min attribute, ensure this minimum requirement is understood by the user. providing instructions within the <label> may be sufficient. if providing instructions outside of labels, which allows more flexible positioning and design, consider using aria-labelledby or aria-describedby. ...
Block-level elements - HTML: Hypertext Markup Language
ear only within a <body> element. block-level vs. inline there are a couple of key differences between block-level elements and inline elements: content model generally, block-level elements may contain inline elements and (sometimes) other block-level elements. inherent in this structural distinction is the idea that block elements create "larger" structures than inline elements. default
formatting by default, block-level elements begin on new lines, but inline elements can start anywhere in a line. the distinction of block-level vs. inline elements was used in html specifications up to 4.01. in html5, this binary distinction is replaced with a more complex set of content categories. while the "inline" category roughly corresponds to the category of phrasing content, the "block-lev...
...ly correspond to any html5 content category, but "block-level" and "inline" elements combined together correspond to the flow content in html5. there are also additional categories, e.g. interactive content. elements the following is a complete list of all html "block-level" elements (although "block-level" is not technically defined for elements that are new in html5). <address> contact in
formation. <article> article content. <aside> aside content. <blockquote> long ("block") quotation. <details> disclosure widget. <dialog> dialog box. <dd> describes a term in a description list. <div> document division. <dl> description list. <dt> description list term. <fieldset> field set label. <figcaption> figure caption. <figure> groups media content with a caption (see <f...
...e content. <blockquote> long ("block") quotation. <details> disclosure widget. <dialog> dialog box. <dd> describes a term in a description list. <div> document division. <dl> description list. <dt> description list term. <fieldset> field set label. <figcaption> figure caption. <figure> groups media content with a caption (see <figcaption>). <footer> section or page footer. <
form> input
form. <h1>, <h2>, <h3>, <h4>, <h5>, <h6> heading levels 1-6. <header> section or page header. <hgroup> groups header in
formation. <hr> horizontal rule (dividing line). <li> list item. <main> contains the central content unique to this document. <nav> contains navigation links. <ol> ordered list. <p> paragraph. <pre> pre
formatted text. <section> section of a web page.
<b>: The Bring Attention To element - HTML: Hypertext Markup Language
however, you should not use <b> for styling text; instead, you should use the css font-weight property to create boldface text, or the <strong> element to indicate that text is of special importance. the source for this interactive example is stored in a github repository. ...
... other spans of text whose typical presentation would be boldfaced (but not including any special importance). do not confuse the <b> element with the <strong>, <em>, or <mark> elements. the <strong> element represents text of certain importance, <em> puts some emphasis on the text and the <mark> element represents text of certain relevance. ...
...n
formation; use it only when no others fit. similarly, do not mark titles and headings using the <b> element. for this purpose, use the <h1> to <h6> tags. further, stylesheets can change the default style of these elements, with the result that they are not necessarily displayed in bold. it is a good practice to use the class attribute on the <b> element in order to convey additional semantic in
formation as needed (for example <b class="lead"> for the first sentence in a paragraph). this makes it easier to manage multiple use cases of <b> if your stylistic needs change, without the need to change all of its uses in the html. historically, the <b> element was meant to make text boldface. styling in
formation has been deprecated since html4, so the meaning of the <b> element has been changed. ...
Standard metadata names - HTML: Hypertext Markup Language
he value. standard metadata names defined in the html specification the html specification defines the following set of standard metadata names: application-name: the name of the application running in the web page. note: browsers may use this to identify the application. it is different from the <title> element, which usually contain the application name, but may also contain in
formation like the document name or a status. simple web pages shouldn't define an application-name. author: the name of the document's author. description: a short and accurate summary of the content of the page. several browsers, like firefox and opera, use this as the default description of bookmarked pages. generator: the identifier of the software that generated the page. keywords:...
... should use to customize the display of the page or of the surrounding user interface. the content attribute contains a valid css <color>. standard metadata names defined in other specifications the css color adjustment specification defines the following metadata name: color-scheme: specifies one or more color schemes with which the document is compatible. the browser will use this in
formation in tandem with the user's browser or device settings to determine what colors to use for everything from background and foregrounds to
form controls and scrollbars. the primary use for <meta name="color-scheme"> is to indicate compatibility with—and order of preference for—light and dark color modes. the value of the content property for color-scheme may be one of the following: ...
...eople experiencing low vision conditions from being able to read and understand page content. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 see also the @viewport css at-rule. other metadata names the whatwg wiki metaextensions page contains a large set of non-standard metadata names that have not been
formally accepted yet; however, some of the names included there are already used quite commonly in practice — including the following: creator: the name of the creator of the document, such as an organization or institution. if there are more than one, several <meta> elements should be used. googlebot, a synonym of robots, is only followed by googlebot (the indexing crawler for google). publis...
<tr>: The Table Row element - HTML: Hypertext Markup Language
the rowspan attribute on cells to indicate they should span more than one table row. this can take a little practice to get right when building your tables. we have some examples below, but for more examples and an in-depth tutorial, see the html tables series in our learn web development area, where you'll learn how to use the table elements and their attributes to get just the right layout and
formatting for your tabular data. attributes this element includes the global attributes. there are also several deprecated attributes, which you should avoid but may need to know when reading older code. deprecated attributes the following attributes may still be implemented in browsers but are no longer part of the html specification and may be missing or may not work as expected. they should be...
...s. middle each cell's text is vertically centered. top each cell's text is drawn as closely as possible to the top edge of the containing cell. don't use the obsolete valign attribute. instead, add the css vertical-align property to the row. examples see <table> for examples on <tr>. basic example this simple example shows a table listing people's names along with various in
formation about membership in a club or service. html this html demonstrates the most basic structure of a table. there are no groups, no cells that span multiple rows or columns, no captions, and only the most basic styling to create lines around the components of the table for something resembling clarity. there are just four rows (including one header row), each with four columns (including one ...
...se of rowspan on to make the "name", "id", and "balance" headers occupy two rows instead of just one, and the use of colspan to make the "membership dates" header cell span across two columns. once again, we haven't touched the css. table { border: 1px solid black; } th, td { border: 1px solid black; } result the output is entirely unchanged, despite the addition of useful contextual in
formation under the hood: basic styling as is the case with all parts of a table, you can change the appearance of a table row and its contents using css. any styles applied to the <tr> element will affect the cells within the row unless overridden by styles applied to those cells. let's apply a basic style to the table to adjust the typeface being used, and add a background color to the header r...
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...alid value, it will use metadata (versions of chrome earlier than 52 treated an invalid value as subtitles). the following keywords are allowed: subtitles subtitles provide translation of content that cannot be understood by the viewer. for example dialogue or text that is not english in an english language film. subtitles may contain additional content, usually extra background in
formation. for example the text at the beginning of the star wars films, or the date, time, and location of a scene. captions closed captions provide a transcription and possibly a translation of audio. it may include important non-verbal in
formation such as music cues or sound effects. it may indicate the cue's source (e.g. music, text, character). suitable for users who are ...
itemscope - HTML: Hypertext Markup Language
specify an id attribute. you can use the id attribute to set a global identifier for the new item. a global identifier allows the item to relate to other items found on pages across the web. example there are four itemscope attributes in the following example. each itemscope attribute sets the scope of its corresponding itemtype attribute. the itemtypes, recipe, aggregaterating, and nutritionin
formation in the following example are part of the schema.org structured data for a recipe, as specified by the first itemtype, http://schema.org/recipe. <div itemscope itemtype="http://schema.org/recipe"> <h2 itemprop="name">grandma's holiday apple pie</h2> <img itemprop="image" src="https://udn.realityripple.com/samples/60/d063c361c1.jpg" width="50" height="50" /> <p> by <span itemprop="a...
...s </span> <br> prep time: <time datetime="pt30m" itemprop="preptime">30 min</time><br> cook time: <time datetime="pt1h" itemprop="cooktime">1 hou</time>r<br> total time: <time datetime="pt1h30m" itemprop="totaltime">1 hour 30 min</time><br> yield: <span itemprop="recipeyield">1 9" pie (8 servings)</span><br> <span itemprop="nutrition" itemscope itemtype="http://schema.org/nutritionin
formation"> serving size: <span itemprop="servingsize">1 medium slice</span><br> calories per serving: <span itemprop="calories">250 cal</span><br> fat per serving: <span itemprop="fatcontent">12 g</span><br> </span> <p> ingredients:<br> <span itemprop="recipeingredient">thinly-sliced apples: 6 cups<br></span> <span itemprop="recipeingredient">white sugar: 3/4 cup<br></span...
...ctions 1. cut and peel apples 2. mix sugar and cinnamon. use additional sugar for tart apples . itemprop author [person] itemprop name carol smith itemscope itemprop[itemtype] aggregaterating [aggregaterating] itemprop ratingvalue 4.0 itemprop reviewcount 35 itemscope itemprop[itemtype] nutrition [nutritionin
formation] itemprop servingsize 1 medium slice itemprop calories 250 cal itemprop fatcontent 12 g note: a handy tool for extracting microdata structures from html is google's structured data testing tool. try it on the html shown above. specifications specification status comment html microdatathe definition of 'itemsc...
HTTP authentication - HTTP
framework for access control and authentication. this page is an introduction to the http framework for authentication, and shows how to restrict access to your server using the http "basic" schema. the general http authentication framework rfc 7235 defines the http authentication framework, which can be used by a server to challenge a client request, and by a client to provide authentication in
formation. the challenge and response flow works like this: the server responds to a client with a 401 (unauthorized) response status and provides in
formation on how to authorize with a www-authenticate response header containing at least one challenge. a client that wants to authenticate itself with the server can then do so by including an authorization request header with the credentials. usu...
...gth and in their availability in client or server software. the most common authentication scheme is the "basic" authentication scheme, which is introduced in more detail below. iana maintains a list of authentication schemes, but there are other schemes offered by host services, such as amazon aws. common authentication schemes include: basic see rfc 7617, base64-encoded credentials. more in
formation below. bearer see rfc 6750, bearer tokens to access oauth 2.0-protected resources digest see rfc 7616, only md5 hashing is supported in firefox, see bug 472823 for sha encryption support hoba see rfc 7486, section 3, http origin-bound authentication, digital-signature-based mutual see rfc 8120 aws4-hmac-sha256 see aws docs basic authentication scheme the "basic" http authenticat...
...ing base64. security of basic authentication as the user id and password are passed over the network as clear text (it is base64 encoded, but base64 is a reversible encoding), the basic authentication scheme is not secure. https/tls should be used with basic authentication. without these additional security enhancements, basic authentication should not be used to protect sensitive or valuable in
formation. restricting access with apache and basic authentication to password-protect a directory on an apache server, you will need a .htaccess and a .htpasswd file. the .htaccess file typically looks like this: authtype basic authname "access to the staging site" authuserfile /path/to/.htpasswd require valid-user the .htaccess file references a .htpasswd file in which each line consists of a u...
Resource URLs - HTTP
on-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. resource urls, urls prefixed with the resource: scheme, are used by firefox and firefox browser extensions to load resources internally, but some of the in
formation is available to sites the browser connects to as well. syntax resource urls are composed of two parts: a prefix (resource:), and a url pointing to the resource you want to load: resource://<url> an example: resource://gre/res/svg.css when arrows are found in the resource url's ('->'), it means that the first file loaded the next one: resource://<file-loader> -> <file-loaded> please r...
...le: resource://gre/res/svg.css when arrows are found in the resource url's ('->'), it means that the first file loaded the next one: resource://<file-loader> -> <file-loaded> please refer to identifying resources on the web for more general details. in this article, we focus on resource uris, which are used internally by firefox to point to built-in resources. threats because some of the in
formation shared by resource: urls is available to websites, a web page could run internal scripts and inspect internal resources of firefox, including the default preferences, which could be a serious security and privacy issue. for example, a script on browserleaks highlights what firefox reveals when queried by a simple script running on the site (you can find the code in https://browserleaks.com/...
...) function. for example: http://searchfox.org/mozilla-central/rev/48ea452803907f2575d81021e8678634e8067fc2/browser/app/profile/firefox.js#575 web sites can easily collect firefox default preferences by overriding this pref() function and using the script resource:///defaults/preferences/firefox.js. furthermore, some default values of preferences differ between build configurations, such as plat
form and locale, which means web sites could identify individual users using this in
formation. solution in order to fix this problem, mozilla changed the behavior of loading resource: uris in bug 863246, which landed in firefox 57 (quantum). in the past, web content was able to access whatever resource: uris were desired — not only firefox’s internal resources, but also extensions’ assets. n...
Content Security Policy (CSP) - HTTP
administrators to reduce or eliminate the vectors by which xss can occur by specifying the domains that the browser should consider to be valid sources of executable scripts. a csp compatible browser will then only execute scripts loaded in source files received from those allowlisted domains, ignoring all other script (including inline scripts and event-handling html attributes). as an ultimate
form of protection, sites that want to never allow scripts to be executed can opt to globally disallow script execution. mitigating packet sniffing attacks in addition to restricting the domains from which content can be loaded, the server can specify which protocols are allowed to be used; for example (and ideally, from a security standpoint), a server can specify that all content must be loaded us...
...http header to ensure that browsers connect to them only over an encrypted channel. using csp configuring content security policy involves adding the content-security-policy http header to a web page and giving it values to control what resources the user agent is allowed to load for that page. for example, a page that uploads and displays images could allow images from anywhere, but restrict a
form action to a specific endpoint. a properly designed content security policy helps protect a page against a cross site scripting attack. this article explains how to construct such headers properly, and provides examples. specifying your policy you can use the content-security-policy http header to specify your policy, like this: content-security-policy: policy the policy is a string containing...
... ...
Feature Policy - HTTP
the feature-policy http header. the allow attribute on iframes. the primary difference between the http header and the allow attribute is that the allow attribute only controls features within an iframe. the header controls features in the response and any embedded content within the page. for more details see using feature policy. inferring the policy scripts can programatically query in
formation about the feature policy via the featurepolicy object located at either document.featurepolicy or htmliframeelement.featurepolicy. types of policy-controlled features though feature policy provides control of multiple features using a consistent syntax, the behavior of policy controlled features varies and depends on several factors. the general principle is that there should be an intuit...
...ault values or options that control the feature behavior. the current set of policy-controlled features fall into two broad categories: enforcing best practices for good user experiences. providing granular control over sensitive or powerful features. best practices for good user experiences there are several policy-controlled features to help enforce best practices for providing good per
formance and user experiences. in most cases, the policy-controlled features represent functionality that when used will negatively impact the user experience. to avoid breaking existing web content, the default for such policy-controlled features is to allow the functionality to be used by all origins. best practices are then enforced by using policies that disable the policy-controlled features. fo...
...user experience. to avoid breaking existing web content, the default for such policy-controlled features is to allow the functionality to be used by all origins. best practices are then enforced by using policies that disable the policy-controlled features. for more details see "enforcing best practices for good user experiences". the features include: layout-inducing animations legacy image
formats oversized images synchronous scripts synchronous xmlhttprequest unoptimized images unsized media granular control over certain features the web provides functionality and apis that may have privacy or security risks if abused. in some cases, you may wish to strictly limit how such functionality is used on a website. there are policy-controlled features to allow functionality to be enab...
CSP: referrer - HTTP
"none-when-downgrade" this is the user agent's default behavior if no policy is specified. ...
...n the referer header (with a single r as this was a typo in the original spec) for links away from a page. this api is deprecated and removed from browsers. use the referrer-policy header instead. syntax content-security-policy: referrer <referrer-policy>; where <referrer-policy> can be one of the following values: "no-referrer" the referer header will be omitted entirely. no referrer in
formation is sent along with requests. "none-when-downgrade" this is the user agent's default behavior if no policy is specified. the origin is sent as referrer to a-priori as-much-secure destination (https->https), but isn't sent to a less secure destination (https->http). "origin" only send the origin of the document as the referrer in all cases. the document https://example.com/page.html will ...
...ified. the origin is sent as referrer to a-priori as-much-secure destination (https->https), but isn't sent to a less secure destination (https->http). "origin" only send the origin of the document as the referrer in all cases. the document https://example.com/page.html will send the referrer https://example.com/. "origin-when-cross-origin" / "origin-when-crossorigin" send a full url when per
forming a same-origin request, but only send the origin of the document for other cases. "unsafe-url" send a full url (stripped from parameters) when per
forming a same-origin or cross-origin request. this policy will leak origins and paths from tls-protected resources to insecure origins. carefully consider the impact of this setting. examples content-security-policy: referrer "none"; specificat...
Transfer-Encoding - HTTP
http/2 doesn't support http 1.1's chunked transfer encoding mechanism, as it provides its own, more efficient, mechanisms for data streaming. transfer-encoding is a hop-by-hop header, that is applied to a message between two nodes, not to a resource itself. each segment of a multi-node connection can use different transfer-encoding values. if you want to compress data over the whole connection, use the end-to-end content-encoding header instead. when present on a response to a head request that has no body, it indicates the value that would have applied to the corresponding get message. ...
...nsfer-encoding: compress transfer-encoding: deflate transfer-encoding: gzip transfer-encoding: identity // several values can be listed, separated by a comma transfer-encoding: gzip, chunked directives chunked data is sent in a series of chunks. the content-length header is omitted in this case and at the beginning of each chunk you need to add the length of the current chunk in hexadecimal
format, followed by '\r\n' and then the chunk itself, followed by another '\r\n'. the terminating chunk is a regular chunk, with the exception that its length is zero. it is followed by the trailer, which consists of a (possibly empty) sequence of entity header fields. compress a
format using the lempel-ziv-welch (lzw) algorithm. the value name was taken from the unix compress program, which impleme...
...s taken from the unix compress program, which implemented this algorithm. like the compress program, which has disappeared from most unix distributions, this content-encoding is used by almost no browsers today, partly because of a patent issue (which expired in 2003). deflate using the zlib structure (defined in rfc 1950), with the deflate compression algorithm (defined in rfc 1951). gzip a
format using the lempel-ziv coding (lz77), with a 32-bit crc. this is originally the
format of the unix gzip program. the http/1.1 standard also recommends that the servers supporting this content-encoding should recognize x-gzip as an alias, for compatibility purposes. identity indicates the identity function (i.e. no compression, nor modification). this token, except if explicitly specified, is al...
User-Agent - HTTP
ers identify the application, operating system, vendor, and/or version of the requesting user agent. please read browser detection using the user agent for why serving different web pages or services to different browsers is usually a bad idea. header type request header forbidden header name no syntax user-agent: <product> / <product-version> <comment> common
format for web browsers: user-agent: mozilla/5.0 (<system-in
formation>) <plat
form> (<plat
form-details>) <extensions> directives <product> a product identifier — its name or development codename. <product-version> version number of the product. <comment> zero or more comments containing more details; sub-product in
formation, for example. firefox ua string for more on firefox- and gecko-b...
...ct identifier — its name or development codename. <product-version> version number of the product. <comment> zero or more comments containing more details; sub-product in
formation, for example. firefox ua string for more on firefox- and gecko-based user agent strings, see the firefox user agent string reference. the ua string of firefox is broken down into 4 components: mozilla/5.0 (plat
form; rv:geckoversion) gecko/geckotrail firefox/firefoxversion mozilla/5.0 is the general token that says the browser is mozilla-compatible. for historical reasons, almost every browser today sends it. plat
form describes the native plat
form the browser is running on (windows, mac, linux, android, etc.), and if it's a mobile phone. firefox os phones simply say mobile — the web is the plat
form. no...
...see below for further details and examples. rv:geckoversion indicates the release version of gecko (such as "17.0"). ...
Link prefetching FAQ - HTTP
gecko 1.9.1 (firefox 3.5), https content can be prefetched. what are the prefetching hints? the browser looks for either an html <link> or an http link: header with a relation type of either next or prefetch. an example using the link tag follows: <link rel="prefetch" href="/images/big.jpeg"> the same prefetching hint using an http link: header: link: </images/big.jpeg>; rel=prefetch the
format for the link: header is described in rfc 5988 section 5. the browser observes all of these hints and queues up each unique request to be prefetched when the browser is idle. there can be multiple hints per page, as it might make sense to prefetch multiple documents. for example, the next document might contain several large images. some more examples follow: <link rel="prefetch alternate sty...
...ue: websites can already cause things to be silently downloaded using js/dom hacks. prefetching is a browser feature; users should be able to disable it easily. it is important that websites adopt <link> tag based prefetching instead of trying to roll-in silent downloading using various js/dom hacks. the <link> tag gives the browser the ability to know what sites are up to, and we can use this in
formation to better prioritize document prefetching. the user preference to disable <link> tag prefetching may simply encourage websites to stick with js/dom hacks, and that would not be good for users. this is one reason why prefetching is enabled by default. which browsers support link prefetching? browsers based on mozilla 1.2 (or later) as well as browsers based on mozilla 1.0.2 (or later) suppo...
...ssed. ...
Closures - JavaScript
t this code still works. in some programming languages, the local variables within a function exist for just the duration of that function's execution. once makefunc() finishes executing, you might expect that the name variable would no longer be accessible. however, because the code still works as expected, this is obviously not the case in javascript. the reason is that functions in javascript
form closures. a closure is the combination of a function and the lexical environment within which that function was declared. this environment consists of any local variables that were in-scope at the time the closure was created. in this case, myfunc is a reference to the instance of the function displayname created when makefunc is run. the instance of displayname maintains a reference to its lexic...
... for instance, when creating a new object/class, methods should normally be associated to the object's prototype rather than defined into the object cons...
...d': 'age', 'help': 'your age (you must be over 16)'} ]; helptext.foreach(function(text) { document.getelementbyid(text.id).onfocus = function() { showhelp(text.help); } }); } setuphelp(); per
formance considerations it is unwise to unnecessarily create functions within other functions if closures are not needed for a particular task, as it will negatively affect script per
formance both in terms of processing speed and memory consumption. for instance, when creating a new object/class, methods should normally be associated to the object's prototype rather than defined into the object constructor. the reason is that whenever the constructor is called, the methods would get reassigned (that is, for every object creation). consider the following case: function myobject(...
Concurrency model and the event loop - JavaScript
ent loop, which is responsible for executing the code, collecting and processing events, and executing queued sub-tasks. this model is quite different from models in other languages like c and java. runtime concepts the following sections explain a theoretical model. modern javascript engines implement and heavily optimize the described semantics. visual representation stack function calls
form a stack of frames. function foo(b) { let a = 10 return a + b + 11 } function bar(x) { let y = 3 return foo(x * y) } console.log(bar(7)) //returns 42 when calling bar, a first frame is created containing bar's arguments and local variables. when bar calls foo, a second frame is created and pushed on top of the first one containing foo's arguments and local variables. when foo returns,...
...the message as an input parameter. as always, calling a function creates a new stack frame for that function's use. the processing of functions continues until the stack is once again empty. then, the event loop will process the next message in the queue (if there is one). event loop the event loop got its name because of how it's usually implemented, which usually resembles: while (queue.wait
formessage()) { queue.processnextmessage() } queue.wait
formessage() waits synchronously for a message to arrive (if one is not already available and waiting to be handled). "run-to-completion" each message is processed completely before any other message is processed. this offers some nice properties when reasoning about your program, including the fact that whenever a function runs, it cannot b...
...frame has its own stack, heap, and message queue. two distinct runtimes can only communicate through sending messages via the postmessage method. this method adds a message to the other runtime if the latter listens to message events. never blocking a very interesting property of the event loop model is that javascript, unlike a lot of other languages, never blocks. handling i/o is typically per
formed via events and callbacks, so when the application is waiting for an indexeddb query to return or an xhr request to return, it can still process other things like user input. legacy exceptions exist like alert or synchronous xhr, but it is considered a good practice to avoid them. beware: exceptions to the exception do exist (but are usually implementation bugs, rather than anything else). spe...
Character classes - JavaScript
the underscore. equivalent to [a-za-z0-9_]. for example, /\w/ matches "a" in "apple", "5" in "$5.28", and "3" in "3d". \w matches any character that is not a word character from the basic latin alphabet. equivalent to [^a-za-z0-9_]. for example, /\w/ or /[^a-za-z0-9_]/ matches "%" in "50%". \s matches a single white space character, including space, tab,
form feed, line feed, and other unicode spaces. equivalent to [ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]. for example, /\s\w*/ matches " bar" in "foo bar". \s matches a single character other than white space. equivalent to [^ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]. for example, /\s\w*/ matches "foo" in "foo bar". ...
... \s matches a single character other than white space. equivalent to [^ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]. for example, /\s\w*/ matches "foo" in "foo bar". \t matches a horizontal tab. \r matches a carriage return. \n matches a linefeed. \v matches a vertical tab. \f matches a
form-feed. [\b] matches a backspace. if you're looking for the word-boundary character (\b), see boundaries. \0 matches a nul character. do not follow this with another digit. \cx matches a control character using caret notation, where "x" is a letter from a–z (corresponding to codepoints u+0001–u+001f). for example, /\cm/ matches "\r" in "\r\n". ...
... specifications specification ecmascript latest draft (ecma-262)the definition of 'regexp: character classes' in that specification. ...
Using Promises - JavaScript
you might see thi...
...result3) */ timing to avoid surprises, functions passed to then() will never be called synchronously, even with an already...
...result3) */ timing to avoid surprises, functions passed to then() will never be called synchronously, even with an already-resolved promise: promise.resolve().then(() => console.log(2)); c...
JavaScript technologies overview - JavaScript
however, the umbrella term "javascript" as understood in a web browser context contains several very different elements. one of them is the core language (ecmascript), another is the collection of the web apis, including the dom (document object model). javascript, the core language (ecmascript) the core language of javascript is standardized by the ecma tc39 committee as a language named ecmascript. this core language is also used in non-browser environments, for example in node.js. ...
...ially approved and published as a standard on june 17, 2015 by the ecma general assembly. since then ecmascript editions are published on a yearly basis. internationalization api the ecmascript internationalization api specification is an addition to the ecmascript language specification, also standardized by ecma tc39. the internationalization api provides collation (string comparison), number
formatting, and date-and-time
formatting for javascript applications, letting the applications choose the language and tailor the functionality to their needs. the initial standard was approved in december 2012; the status of implementations in browsers is tracked in the documentation of the intl object. the internationalization specification is nowadays also ratified on a yearly basis and browsers co...
...tus of implementations in browsers is tracked in the documentation of the intl object. the internationalization specification is nowadays also ratified on a yearly basis and browsers constantly improve their implementation. dom apis webidl the webidl specification provides the glue between the dom technologies and ecmascript. the core of the dom the document object model (dom) is a cross-plat
form, language-independent convention for representing and interacting with objects in html, xhtml and xml documents. objects in the dom tree may be addressed and manipulated by using methods on the objects. the w3c standardizes the core document object model, which defines language-agnostic interfaces that abstract html and xml documents as objects, and also defines mechanisms to manipulate this abst...
JavaScript language resources - JavaScript
ecmascript standardized by the ecma international standards organization in the ecma-262 and ecma-402 specifications. ...
...this was the first version of the ecmascript standard. ecma-262 2nd edition pdf august 1998 ecmascript language specification. this is the second revision of the ecmascript standard; also iso standard 16262. ecma-262 3rd edition pdf december 1999 ecmascript language specification. this is the third revision of the ecmascript standard; corr...
...guage specification ecma-402 4th edition html june 2017 ecmascript 2017 internationalization api specification es.next is a dynamic name that refers to whatever the next version is at the time of writing. es.next features are more correctly called proposals, because, by definition, the specification has not been finalized yet. see wikipedia ecmascript entry for more in
formation on ecmascript history. you can participate in or just track the work on the next revisions of the ecmascript language specification, code-named "harmony", and the ecmascript internationalization api specification via public wiki and the es-discuss mailing list linked from ecmascript.org. implementations spidermonkey - the javascript engine used in various mozilla products, including fir...
Memory Management - JavaScript
s not needed anymore the majority of memory management issues occur at this phase. the most difficult aspect of this stage is determining when the allocated memory is no longer needed. low-level languages require the developer to manually determine at which point in the program the allocated memory is no longer needed and to release it. some high-level languages, such as javascript, utilize a
form of automatic memory management known as garbage collection (gc). the purpose of a garbage collector is to monitor memory allocation and determine when a block of allocated memory is no longer needed and reclaim it. this automatic process is an approximation since the general problem of determining whether or not a specific piece of memory is still needed is undecidable. garbage collection as st...
...nt a restriction of a solution to the general problem. this section will explain the concepts that are necessary for understanding the main garbage collection algorithms and their respective limitations. references the main concept that garbage collection algorithms rely on is the concept of reference. within the context of memory management, an object is said to reference another object if the
former has access to the latter (either implicitly or explicitly). for instance, a javascript object has a reference to its prototype (implicit reference) and to its properties values (explicit reference). in this context, the notion of an "object" is extended to something broader than regular javascript objects and also contain function scopes (or the global lexical scope). reference-counting garba...
...unt of available heap memory can be increased with a flag: node --max-old-space-size=6000 index.js we can also expose the garbage collector for debugging memory issues using a flag and the chrome debugger: node --expose-gc --inspect index.js see also ibm article on "memory leak patterns in javascript" (2007) kangax article on how to register event handler and avoid memory leaks (2010) per
formance ...
Classes - JavaScript
s are subject to the same hoisting restrictions as described in the class declarations section. class body and method definitions the body of a class is the part that is in curly brackets {}. this is where you define class members, such as methods or constructor. strict mode the body of a class is executed in strict mode, i.e., code written here is subject to stricter syntax for increased per
formance, some otherwise silent errors will be thrown, and certain keywords are reserved for future versions of ecmascript. constructor the constructor method is a special method for creating and initializing an object created with a class. there can only be one special method with the name "constructor" in a class. a syntaxerror will be thrown if the class contains more than one occurrence of a con...
...yntax, the above example can be written as: class rectangle { height = 0; width; constructor(height, width) { this.height = height; this.width = width; } } by declaring fields up-front, class definitions become more self-documenting, and the fields are always present. as seen above, the fields can be declared with or without a default value. see public class fields for more in
formation. private field declarations using private fields, the definition can be refined as below. class rectangle { #height = 0; #width; constructor(height, width) { this.#height = height; this.#width = width; } } it's an error to reference private fields from outside of the class; they can only be read or written within the class body. by defining things which are not visible o...
...an only be read or written within the class body. by defining things which are not visible outside of the class, you ensure that your classes' users can't depend on internals, which may change version to version. private fields can only be declared up-front in a field declaration. private fields cannot be created later through assigning to them, the way that normal properties can. for more in
formation, see private class fields. sub classing with extends the extends keyword is used in class declarations or class expressions to create a class as a child of another class. class animal { constructor(name) { this.name = name; } speak() { console.log(`${this.name} makes a noise.`); } } class dog extends animal { constructor(name) { super(name); // call the super class...
Deprecated and obsolete features - JavaScript
ator is deprecated. object methods watch and unwatch are deprecated. use proxy instead. __iterator__ is deprecated. __nosuchmethod__ is deprecated. use proxy instead. date methods getyear and setyear are affected by the year-2000-problem and have been subsumed by getfullyear and setfullyear. you should use toisostring instead of the deprecated togmtstring method in new code. tolocale
format is deprecated. functions expression closures are deprecated. use regular functions or arrow functions instead. proxy proxy.create and proxy.createfunction are deprecated. use proxy instead. the following traps are obsolete: hasown (bug 980565, firefox 33). getenumerablepropertykeys (bug 783829, firefox 37) getownpropertynames (bug 1007334, firefox 33) keys (bug 1007334...
...totype.eval() evaluates a string of javascript code in the context of the specified object. object.observe() asynchronously observing the changes to an object. object.unobserve() remove observers. object.getnotifier() creates an object that allows to synthetically trigger a change. function property description arity number of
formal arguments. array property description array.observe() asynchronously observing changes to arrays. array.unobserve() remove observers. number number.tointeger() parallelarray parallelarray statements for each...in is deprecated. use for...of instead. destructuring for...in is deprecated. use for...of instead. let blocks and let ex...
...escription array.observe() asynchronously observing changes to arrays. array.unobserve() remove observers. number number.tointeger() parallelarray parallelarray statements for each...in is deprecated. use for...of instead. destructuring for...in is deprecated. use for...of instead. let blocks and let expressions are obsolete. e4x see e4x for more in
formation. sharp variables see sharp variables in javascript for more in
formation. ...
The arguments object - JavaScript
this technique is useful for functions that can be passed a variable number of arguments, such as math.min(). this example function accepts any number of string arguments and returns the longest one: function longeststring() { var longest = ''; for (var i=0; i < arguments.length; i++) { if (arguments[i].length > longest.length) { longest = arguments[i]; ...
...hat the arguments belong to. forbidden in strict mode. arguments.length the number of arguments that were passed to the function. arguments[@@iterator] returns a new array iterator object that contains the values for each index in arguments. examples defining a function that concatenates several strings this example defines a function that concatenates several strings. the function's only
formal argument is a string containing the characters that separate the items to concatenate. function myconcat(separator) { let args = array.prototype.slice.call(arguments, 1); return args.join(separator); } you can pass as many arguments as you like to this function. it returns a string list using each argument in the list: // returns "red, orange, blue" myconcat(', ', 'red', 'orange', 'blue'...
...myconcat(', ', 'red', 'orange', 'blue'); // returns "elephant; giraffe; lion; cheetah" myconcat('; ', 'elephant', 'giraffe', 'lion', 'cheetah'); // returns "sage. basil. oregano. pepper. parsley" myconcat('. ', 'sage', 'basil', 'oregano', 'pepper', 'parsley'); defining a function that creates html lists this example defines a function that creates a string containing html for a list. the only
formal argument for the function is a string that is "u" if the list is to be unordered (bulleted), or "o" if the list is to be ordered (numbered). the function is defined as follows: function list(type) { var html = '<' + type + 'l><li>'; var args = array.prototype.slice.call(arguments, 1); html += args.join('</li><li>'); html += '</li></' + type + 'l>'; // end list return html; } you can...
Date.prototype.toDateString() - JavaScript
the todatestring() method returns the date portion of a date object in english in the following
format separated by spaces: first three letters of the week day name first three letters of the month name two digit day of the month, padded on the left a zero if necessary four digit year (at least), padded on the left with zeros if necessary e.g. "thu jan 01 1970". the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.todatestring() return value a string representing the date portion of the given date object in human readable
form in english. description date instances refer to a specific point in...
...if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.todatestring() return value a string representing the date portion of the given date object in human readable
form in english. description date instances refer to a specific point in time. calling tostring() will return the date
formatted in a human readable
form in english. in spidermonkey, this consists of the date portion (day, month, and year) followed by the time portion (hours, minutes, seconds, and time zone). sometimes it is desirable to obtain a string of the time portion; such a thing can be accomplished with the totimestring() method. the todatestring() method is especially useful because compliant engines impleme...
...ion (day, month, and year) followed by the time portion (hours, minutes, seconds, and time zone). sometimes it is desirable to obtain a string of the time portion; such a thing can be accomplished with the totimestring() method. the todatestring() method is especially useful because compliant engines implementing ecma-262 may differ in the string obtained from tostring() for date objects, as the
format is implementation-dependent and simple string slicing approaches may not produce consistent results across multiple engines. examples a basic usage of todatestring() var d = new date(1993, 5, 28, 14, 39, 7); console.log(d.tostring()); // logs mon jun 28 1993 14:39:07 gmt-0600 (pdt) console.log(d.todatestring()); // logs mon jun 28 1993 note: month are 0-indexed when used as an argume...
Date.prototype.toString() - JavaScript
e to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.tostring() return value a string representing the given date. description date instances inherit their tostring() method from date.prototype, not object.prototype. date.prototype.tostring() returns a string representation of the date in the
format specified in ecma-262 which can be summarised as: week day: 3 letter english week day name, e.g. "sat" space month name: 3 letter english month name, e.g. "sep" space date: 2 digit day in month, e.g. "01" space year: 4 digit year, e.g. "2018" space hour: 2 digit hour of day, e.g. "14" colon minute: 2 digit minute of hour, e.g. "53" colon second: 2 digit second of minute, e.g. "26...
...mezone name consisting of: space left bracket, i.e. "(" an implementation dependent string representation of the timezone, which might be an abbreviation or full name (there is no standard for names or abbreviations of timezones), e.g. "line islands time" or "lint" right bracket, i.e. ")" e.g. "sat sep 01 2018 14:53:26 gmt+1400 (lint)" until ecmascript 2018 (edition 9), the
format of the string returned by date.prototype.tostring was implementation dependent. therefore it should not be relied upon to be in the specified
format. the tostring() method is automatically called when a date is to be represented as a text value, e.g. console.log(new date()), or when a date is used in a string concatenation, such as var today = 'today is ' + new date(). tostring() is a generic...
... have an internal [[timevalue]] property that can't be constructed using native javascript, so it's effectively limited to use with date instances. if called on a non–date instance, a typeerror is thrown. examples using tostring() the following assigns the tostring() value of a date object to myvar: var x = new date(); var myvar = x.tostring(); // assigns a string value to myvar in the same
format as: // mon sep 08 1998 14:36:22 gmt-0700 (pdt) specifications specification ecmascript (ecma-262)the definition of 'date.prototype.tostring' in that specification. ...
Error.prototype.stack - JavaScript
bal scope), then by an at (@) sign, the file location (except when the function is the error constructor as the error is being thrown), a colon, and, if there is a file location, the line number. (note that the error object also possesses the filename, linenumber and columnnumber properties for retrieving these from the error thrown (but only the error, and not its trace).) note that this is the
format used by firefox. there is no standard
formatting. however, safari 6+ and opera 12- use a very similar
format. browsers using the v8 javascript engine (such as chrome, opera 15+, android browser) and ie10+, on the other hand, uses a different
format (see the archived msdn error.stack docs). argument values in the stack: prior to firefox 14, the function name would be followed by the argument va...
...script engine (such as chrome, opera 15+, android browser) and ie10+, on the other hand, uses a different
format (see the archived msdn error.stack docs). argument values in the stack: prior to firefox 14, the function name would be followed by the argument values converted to string in parentheses immediately before the at (@) sign. while an object (or array, etc.) would appear in the converted
form "[object object]", and as such could not be evaluated back into the actual objects, scalar values could be retrieved (though it may be — it is still possible in firefox 14 — easier to use arguments.callee.caller.arguments, as could the function name be retrieved by arguments.callee.caller.name). "undefined" is listed as "(void 0)". note that if string arguments were passed in with values such...
...function calls are indicated with "> function" and eval calls with "> eval". try { new function('throw new error()')(); } catch (e) { console.log(e.stack); } // anonymous@file:///c:/example.html line 7 > function:1:1 // @file:///c:/example.html:7:6 try { eval("eval('fail')"); } catch (x) { console.log(x.stack); } // @file:///...
Intl.DisplayNames() constructor - JavaScript
. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new intl.displaynames([locales[, options]]) parameters locales optional a string with a bcp 47 language tag, or an array of such strings. for the general
form and interpretation of the locales argument, see the intl page. the following unicode extension key is allowed: nu the numbering system to be used. possible values include: "arab", "arabext", "bali", "beng", "deva", "fullwide", "gujr", "guru", "hanidec", "khmr", "knda", "laoo", "latn", "limb", "mlym", "mong", "mymr", "orya", "tamldec", "telu", "thai", "tibt". options optional an obj...
... "arabext", "bali", "beng", "deva", "fullwide", "gujr", "guru", "hanidec", "khmr", "knda", "laoo", "latn", "limb", "mlym", "mong", "mymr", "orya", "tamldec", "telu", "thai", "tibt". options optional an object with some or all of the following properties: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for in
formation about this option, see the intl page. style the
formatting style to use, the default is "long". "narrow" "short" "long" type the type to use, the default is "language". "language" "region" "script" "currency" fallback the fallback to use, the default is "code". "code" "none" examples basic usage in basic use without sp...
...on, see the intl page. style the
formatting style to use, the default is "long". "narrow" "short" "long" type the type to use, the default is "language". "language" "region" "script" "currency" fallback the fallback to use, the default is "code". "code" "none" examples basic usage in basic use without specifying a locale, a
formatted string in the default locale and with default options is returned. console.log((new intl.displaynames()).of('us')); // expected output: 'us' specifications specification intl.displaynamesthe definition of 'the intl.displaynames constructor' in that specification. ...
Intl.DisplayNames.supportedLocalesOf() - JavaScript
the intl.displaynames.supportedlocalesof() method returns an array containing those of the provided locales that are supported in date and time
formatting without having to fall back to the runtime's default locale. syntax intl.displaynames.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings. for the general
form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for in
formation about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in da...
...t, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for in
formation about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in date and time
formatting without having to fall back to the runtime's default locale. description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in date and time
formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using sup...
...subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in date and time
formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in date and time
formatting, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is neither relevant to date and time
formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the "lookup" algorithm here — a "best fit" matcher might decide that indonesian is an adequate match for balinese s...
Intl.Locale.prototype.baseName - JavaScript
specifically, the property returns the substring containing the language, and the script and region if available. basename returns the language ["-" script] ["-" region] *("-" variant) subsequence of the unicode_language_id grammar. ...
...specifically, the property returns the substring containing the language, and the script and region if available. basename returns the language ["-" script] ["-" region] *("-" variant) subsequence of the unicode_language_id grammar. ...
...specifically, the property returns the substring containing the language, and the script and region if available. basename returns the language ["-" script] ["-" region] *("-" variant) subsequence of the unicode_language_id grammar. ...
Intl.Locale - JavaScript
esents a unicode locale identifier. description the intl.locale object was created to allow for easier manipulation of unicode locales. unicode represents locales with a string, called a locale identifier. the locale identifier consists of a language identifier and extension tags. language identifiers are the core of the locale, consisting of language, script, and region subtags. additional in
formation about the locale is stored in the optional extension tags. extension tags hold in
formation about locale aspects such as calendar type, clock type, and numbering system type. traditionally, the intl api used strings to represent locales, just as unicode does. this is a simple and lightweight solution that works well. adding a locale class, however, adds ease of parsing and manipulating the l...
... the intl api used strings to represent locales, just as unicode does. this is a simple and lightweight solution that works well. adding a locale class, however, adds ease of parsing and manipulating the language, script, and region, as well as extension tags. constructor intl.locale() creates a new locale object. instance properties intl.locale.prototype.basename returns basic, core in
formation about the locale in the
form of a substring of the complete data string. intl.locale.prototype.calendar returns the part of the locale that indicates the locale's calendar era. intl.locale.prototype.casefirst returns whether case is taken into account for the locale's collation rules. intl.locale.prototype.collation returns the collation type for the locale, which is used to order stri...
...otype.calendar returns the part of the locale that indicates the locale's calendar era. intl.locale.prototype.casefirst returns whether case is taken into account for the locale's collation rules. intl.locale.prototype.collation returns the collation type for the locale, which is used to order strings according to the locale's rules. intl.locale.prototype.hourcycle returns the time keeping
format convention used by the locale. intl.locale.prototype.language returns the language associated with the locale. intl.locale.prototype.numberingsystem returns the numeral system used by the locale. intl.locale.prototype.numeric returns whether the locale has special collation handling for numeric characters. intl.locale.prototype.region returns the region of the world (usually a country) ...
Math.imul() - JavaScript
description math.imul() allows for 32-bit integer multiplication with c-like semantics. this feature is useful for projects like emscripten. because imul() is a static method of math, you always use it as math.imul(), rather than as a method of a math object you created (math is not a constructor). if you use normal javascript floating point numbers in imul, you will experience a degrade in per
formance. this is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. the reason imul exists is because it is faster in only one (so far) circumstance: asmjs. asmjs allows for jist-optimizers to more easily implement internal integers in javascript. multiplying two numbers stored internally as i...
...ting the multiplied integer back into a floating point. the reason imul exists is because it is faster in only one (so far) circumstance: asmjs. asmjs allows for jist-optimizers to more easily implement internal integers in javascript. multiplying two numbers stored internally as integers (which is only possible with asmjs) with imul is the only potential circumstance where math.imul may prove per
formant in current browsers. polyfill this can be emulated with the following function: if (!math.imul) math.imul = function(a, b) { var ahi = (a >>> 16) & 0xffff; var alo = a & 0xffff; var bhi = (b >>> 16) & 0xffff; var blo = b & 0xffff; // the shift by 0 fixes the sign on the high part // the final |0 converts the unsigned value into a signed value return ((alo * blo) + (((ahi * bl...
... if (!math.imul) math.imul = function(opa, opb) { opb |= 0; // ensure that opb is an integer. opa will automatically be coerced. // floating points give us 53 bits of precision to work with plus 1 sign bit // a...
NaN - JavaScript
rable, non-writable property. even when this is not the case, avoid overriding it. it is rather rare to use nan in a program. there are five different types of operations that return nan: number cannot be parsed (e.g. parseint("blabla") or number(undefined)) math operation where the result is not a real number (e.g. math.sqrt(-1)) operand of an argument is nan (e.g. ...
...(-1)) operand of an argument is nan (e.g. 7 ** nan) indeterminate
form (e.g. 0 * infinity) any operation that involves a string and is not an addition operation (e.g. "foo"/3) examples testing against nan nan compares unequal (via ==, !=, ===, and !==) to any other value -- including to another nan value. use number.isnan() or isnan() to most clearly determine whether a value is nan. or per
form a self-comparison: nan, and only nan, will compare unequal to itself. nan === nan; // false number.nan === nan; // false isnan(nan); // true isnan(number.nan); // true number.isnan(nan); // true function valueisnan(v) { return v !== v; } valueisnan(1); // false valueisnan(nan); // true valueisnan(number.nan); // true however, do note the difference between isn...
...only nan, will compare unequal to itself. nan === nan; // false number.nan === nan; // false isnan(nan); // true isnan(number.nan); // true number.isnan(nan); // true function valueisnan(v) { return v !== v; } valueisnan(1); // false valueisnan(nan); // true valueisnan(number.nan); // true however, do note the difference between isnan() and number.isnan(): the
former will return true if the value is currently nan, or if it is going to be nan after it is coerced to a number, while the latter will return true only if the value is currently nan: isnan('hello world'); // true number.isnan('hello world'); // false additionally, some array methods cannot find nan, while others can. let arr = [2, 4, nan, 12]; arr.indexof(nan); // -1...
Object.setPrototypeOf() - JavaScript
avascript engine. in addition, the effects of altering inheritance are subtle and far-flung, and are not limited to simply the time spent in the object.setprototypeof(...) statement, but may extend to any code that has access to any object whose [[prototype]] has been altered. because this feature is a part of the language, it is still the burden on engine developers to implement that feature per
formantly (ideally). until engine developers address this issue, if you are concerned about per
formance, you should avoid setting the [[prototype]] of an object. instead, create a new object with the desired [[prototype]] using object.create(). syntax object.setprototypeof(obj, prototype) parameters obj the object which is to have its prototype set. prototype the object's new prototype (an o...
...roversial object.prototype.__proto__ property. appending prototype chains a combination of object.getprototypeof() and object.prototype.__proto__ permits appending a whole prototype chain to a new prototype object: /** *** object.appendchain(@object, @prototype) * * appends the first non-native prototype of a chain to a new prototype. * returns @object (if it was a primitive value it will trans
formed into an object). * *** object.appendchain(@object [, "@arg_name_1", "@arg_name_2", "@arg_name_3", "..."], "@function_body") *** object.appendchain(@object [, "@arg_name_1, @arg_name_2, @arg_name_3, ..."], "@function_body") * * appends the first non-native prototype of a chain to the native function.prototype object, then appends a * new function(["@arg"(s)], "@function_body") to that chain. * r...
...function mammalspecies(smammalspecies) { this.species = smammalspecies; } mammalspecies.prototype = new mammal(); mammalspecies.prototype.constructor = mammalspecies; var ocat = new mammalspecies('felis'); console.log(ocat.ismammal); // 'yes' function animal() { this.breathing = 'yes'; } object.appendchain(ocat, new animal()); console.log(ocat.breathing); // 'yes' second example: trans
forming a primitive value into an instance of its constructor and append its chain to a prototype function mysymbol() { this.issymbol = 'yes'; } var nprime = 17; console.log(typeof nprime); // 'number' var oprime = object.appendchain(nprime, new mysymbol()); console.log(oprime); // '17' console.log(oprime.issymbol); // 'yes' console.log(typeof oprime); // 'object' third example: appending a c...
escape() - JavaScript
...
...in string literals can be expanded by replacing the \x with %, then using the decodeuricomponent() function. syntax escape(str) parameters str a string to be encoded. return value a new string in which certain characters have been escaped. description the escape function is a property of the global object. special characters are encoded with the exception of: @*_+-./ the hexadecimal
form for characters, whose code unit value is 0xff or less, is a two-digit escape sequence: %xx. for characters with a greater code unit, the four-digit
format %uxxxx is used. examples using escape escape('abc123'); // "abc123" escape('äöü'); // "%e4%f6%fc" escape('ć'); // "%u0107" // special characters escape('@*_+-./'); // "@*_+-./" specifications specificat...
...t %uxxxx is used. ...
Iteration protocols - JavaScript
map, while other types (such as object) are not. in order to be iterable, an object must implement the @@iterator method, meaning that the object (or one of the objects up its prototype chain) must have a property with a @@iterator key which is available via constant symbol.iterator: property value [symbol.iterator] a zero-argument function that returns an object, con
forming to the iterator protocol. whenever an object needs to be iterated (such as at the beginning of a for...of loop), its @@iterator method is called with no arguments, and the returned iterator is used to obtain the values to be iterated. note that when this zero-argument function is called, it is invoked as a method on the iterable object. therefore inside of the function, the this keywor...
... for...of loops, the spread operator), yield*, and destructuring assignment: for (let value of ['a', 'b', 'c']) { console.log(value); } // "a" // "b" // "c" console.log([...'abc']); // ["a", "b", "c"] function* gen() { yield* ['a', 'b', 'c']; } console.log(gen().next()); // { value: "a", done: false } [a, b, c] = new set(['a', 'b', 'c']); console.log(a); // "a" non-well-
formed iterables if an iterable's @@iterator method doesn't return an iterator object, then it's considered a non-well-
formed iterable. using one is likely to result in runtime errors or buggy behavior: let nonwell
formediterable = {}; nonwell
formediterable[symbol.iterator] = () => 1; [...nonwell
formediterable]; // typeerror: [] is not a function iterator examples simple iterator function makeit...
... ...
Object initializer - JavaScript
the keys are "foo", "age" and "baz". the values of these keys are a string "bar", the number 42, and another object. let object = { foo: 'bar', age: 42, baz: {myprop: 12} } accessing properties once you have created an object, you might want to read or change them. object properties can be accessed by using the dot notation or the bracket notation. (see property accessors for detailed in
formation.) object.foo // "bar" object['age'] // 42 object.foo = 'baz' property definitions we have already learned how to notate properties using the initializer syntax. oftentimes, there are variables in your code that you would like to put into an object. you will see code like this: let a = 'foo', b = 42, c = {}; let o = { a: a, b: b, c: c } with ecmascript 2015, there is a s...
... // shorthand method names (es2015) let o = { property(parameters) {}, } in ecmascript 2015, there is a way to concisely define properties whose values are generator functions: let o = { *generator() { ........... } }; which is equivalent to this es5-like notation (but note that ecmascript 5 has no generators): let o = { generator: function* () { ........... } }; for more in
formation and examples about methods, see method definitions. computed property names starting with ecmascript 2015, the object initializer syntax also supports computed property names. that allows you to put an expression in brackets [], that will be computed and used as the property name. this is reminiscent of the bracket notation of the property accessor syntax, which you may have used to read a...
...is now possible using a shorter syntax than object.assign(). let obj1 = { foo: 'bar', x: 42 } let obj2 = { foo: 'baz', y: 13 } let clonedobj = { ...obj1 } // object { foo: "bar", x: 42 } let mergedobj = { ...obj1, ...obj2 } // object { foo: "baz", x: 42, y: 13 } note that object.assign() triggers setters, whereas the spread operator doesn't! prototype mutation a property definition of the
form __proto__: value or "__proto__": value does not create a property with the name __proto__. instead, if the provided value is an object or null, it changes the [[prototype]] of the created object to that value. (if the value is not an object or null, the object is not changed.) let obj1 = {} assert(object.getprototypeof(obj1) === object.prototype) let obj2 = {__proto__: null} assert(object.get...
typeof - JavaScript
active examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. for more in
formation about types and primitives, see also the javascript data structure page. type result undefined "undefined" null "object" (see below) boolean "boolean" number "number" bigint (new in ecmascript 2020) "bigint" string "string" symbol (new in ecmascript 2015) "symbol" function object (im...
... functions typeof function() {} === 'function'; typeof class c {} === 'function'; typeof math.sin === 'function'; typeof null // this stands since the beginning of javascript typeof null === 'object'; in the first implementation of javascript, javascript values were represented as a type tag and a value. the type tag for objects was 0. null was represented as the null pointer (0x00 in most plat
forms). consequently, null had 0 as type tag, hence the "object" typeof return value. (reference) a fix was proposed for ecmascript (via an opt-in), but was rejected. it would have resulted in typeof null === 'null'. using new operator // all constructor functions, with the exception of the function constructor, will always be typeof 'object' let str = new string('string'); let num = new number(100...
...; typeof func; // it will return 'function' need for parentheses in syntax // parentheses can be used for determining the data type of expressions. let idata = 99; typeof idata + ' wisen'; // 'number wisen' typeof (idata + ' wisen'); // 'string' regular expressions callable regular expressions were a non-standard addition in some browsers. typeof /s/ === 'function'; // chrome 1-12 non-con
form to ecmascript 5.1 typeof /s/ === 'object'; // firefox 5+ con
form to ecmascript 5.1 errors before ecmascript 2015, typeof was always guaranteed to return a string for any operand it was supplied with. even with undeclared identifiers, typeof will return 'undefined'. using typeof could never generate an error. but with the addition of block-scoped let and statements/const using typeof on let ...
try...catch - JavaScript
finally_statements statements that are executed after the try statement completes. these statements execute regardless of whether an exception was thrown or caught. description the try statement consists of a try-block, which contains one or more statements. {} must always be used, even for single statements. at least one catch-block, or a finally-block, must be present. this gives us three
forms for the try statement: try...catch try...finally try...catch...finally a catch-block contains statements that specify what to do if an exception is thrown in the try-block. if any statement within the try-block (or in a function called from within the try-block) throws an exception, control is immediately shifted to the catch-block. if no exception is thrown in the try-block, the catch-bl...
...ter the try-block and catch-block(s) have finished executing. it always executes, regardless of whether an exception was thrown or caught. you can nest one or more try statements. if an inner try statement does not have a catch-block, the enclosing try statement's catch-block is used instead. you can also use the try statement to handle javascript exceptions. see the javascript guide for more in
formation on javascript exceptions. unconditional catch-block when a catch-block is used, the catch-block is executed when any exception is thrown from within the try-block. for example, when the exception occurs in the following code, control transfers to the catch-block. try { throw 'myexception'; // generates an exception } catch (e) { // statements to handle any exceptions logmyerrors(e);...
...ow the error in other cases: try { myroutine(); } catch (e) { if (e instanceof rangeerror) { // statements to handle this very common expected error } else { throw e; // re-throw the error unchanged } } the exception identifier when an exception is thrown in the try-block, exception_var (i.e., the e in catch (e)) holds the exception value. you can use this identifier to get in
formation about the exception that was thrown. this identifier is only available in the catch-block's scope. function isvalidjson(text) { try { json.parse(text); return true; } catch { return false; } } the finally-block the finally-block contains statements to execute after the try-block and catch-block(s) execute, but before the statements following the try...catch...finally-bl...
var - JavaScript
below. the scope of a variable declared with var is its current execution context and closures thereof, which is either the enclosing function and functions declared within it, or, for variables declared outside any function, global. duplicate variable declarations using var will not trigger an error, even in strict mode, and the variable will not lose its value, unless another assignment is per
formed. 'use strict'; function foo() { var x = 1; function bar() { var y = 2; console.log(x); // 1 (function `bar` closes over `x`) console.log(y); // 2 (`y` is in scope) } bar(); console.log(x); // 1 (`x` is in scope) console.log(y); // referenceerror in strict mode, `y` is scoped to `bar` } foo(); variables declared using var are created before any code is executed in a p...
...; // 1 console.log('still going...'); // still going... in the global context, a variable declared using var is added as a non-configurable property of the global object. this means its property descriptor cannot be changed and it cannot be deleted using delete. the corresponding name is also added to a list on the internal [[varnames]] slot on the global environment record (which
forms part of the global lexical environment). the list of names in [[varnames]] enables the runtime to distinguish between global variables and straightforward properties on the global object. the property created on the global object for global variables, is set to be non-configurable because the identifier is to be treated as a variable, rather than a straightforward property of the global object.
...s you want to create a property named `foo` on the global object globalthis.hasownproperty('foo') // true in ecmascript 5, this behavior was changed for strict mode. assignment to an unqualified identifier in strict mode will result in a referenceerror, to avoid the accidental creation of properties on the global object. note that the implication of the above, is that, contrary to popular misin
formation, javascript does not have implicit or undeclared variables, it merely has a syntax that looks like it does. var hoisting because variable declarations (and declarations in general) are processed before any code is executed, declaring a variable anywhere in the code is equivalent to declaring it at the top. this also means that a variable can appear to be used before it's declared. this beh...
with - JavaScript
nt body. if an unqualified name used in the body matches a property in the scope chain, then the name is bound to the property and the object containing the property. otherwise a referenceerror is thrown. using with is not recommended, and is forbidden in ecmascript 5 strict mode. the recommended alternative is to assign the object whose properties you want to access to a temporary variable. per
formance pro & contra pro: the with statement can help reduce file size by reducing the need to repeat a lengthy object reference without per
formance penalty. the scope chain change required by 'with' is not computationally expensive. use of 'with' will relieve the interpreter of parsing repeated object references. note, however, that in many cases this benefit can be achieved by using a temporary va...
... of parsing repeated object references. note, however, that in many cases this benefit can be achieved by using a temporary variable to store a reference to the desired object. contra: the with statement forces the specified object to be searched first for all name lookups. therefore all identifiers that aren't members of the specified object will be found more slowly in a 'with' block. where per
formance is important, 'with' should only be used to encompass code blocks that access members of the specified object. ambiguity contra contra: the with statement makes it hard for a human reader or javascript compiler to decide whether an unqualified name will be found along the scope chain, and if so, in which object. so given this example: function f(x, o) { with (o) { console.log(x); }...
...t makes it hard for a human reader or javascript compiler to decide whether an unqualified name will be found along the scope chain, and if so, in which object. so given this example: function f(x, o) { with (o) { console.log(x); } } only when f is called is x either found or not, and if found, either in o or (if no such property exists) in f's activation object, where x names the first
formal argument. if you forget to define x in the object you pass as the second argument, or if there's some similar bug or confusion, you won't get an error -- just unexpected results. contra: code using with may not be forward compatible, especially when used with something other than a plain object. consider this example: function f(foo, values) { with (foo) { console.log(values); } } ...
JavaScript
ch as node.js, apache couchdb and adobe acrobat. javascript is a prototype-based, multi-paradigm, single-threaded, dynamic language, supporting object-oriented, imperative, and declarative (e.g. functional programming) styles. read more about javascript. this section is dedicated to the javascript language itself, and not the parts that are specific to web pages or other host environments. for in
formation about api specifics to web pages, please see web apis and dom. the standard for javascript is ecmascript. as of 2012, all modern browsers fully support ecmascript 5.1. older browsers support at least ecmascript 3. on june 17, 2015, ecma international published the sixth major version of ecmascript, which is officially called ecmascript 2015, and was initially referred to as ecmascript 6 or ...
...rrently ecmascript 2020. do not confuse javascript with the java programming language. both "java" and "javascript" are trademarks or registered trademarks of oracle in the u.s. and other countries. however, the two programming languages have a very different syntax, semantic, and use. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started tutorials learn how to program in javascript with guides and tutorials. for complete beginners head over to our learning area javascript topic if you want to learn javascript but have no previous experience of javascript or programming. the complete modules available there are as follows: javascript first steps answers some fundamen...
...osure is the combination of a function and the lexical environment within which that function was declared. advanced inheritance and the prototype chain explanation of the widely misunderstood and under-estimated prototype-based inheritance. strict mode strict mode defines that you can not use any variable before initializing it. it is a restricted variant of ecmascript 5, for faster per
formance and easier debugging. javascript typed arrays javascript typed arrays provide a mechanism for accessing raw binary data. memory management memory life cycle and garbage collection in javascript. concurrency model and event loop javascript has a concurrency model based on an "event loop". reference browse the complete javascript reference documentation. standard objects get to k...
<mstyle> - MathML
the mathml <mstyle> element is used change the style of its children. it accepts all attributes of all mathml presentation elements with some exceptions and additional attributes listed below. attributes dir overall directionality of
formulas. possible values are either ltr (left to right) or rtl (right to left). decimalpoint this attribute is specifying the character for the alignment point within <mstack> and <mtable> columns, if the decimalpoint value is used to specify the alignment. displaystyle a boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display
formulas. the main effect is that larger versions of operators are displayed, when displaystyle is set to true. see also largeop and movabl...
...lign does not apply to <mtable> or <mstack>. index cannot be set on <mstyle>. src and alt on <mglyph> cannot be set on <mstyle>. actiontype on <maction> cannot be set on <mstyle>. examples using displaystyle and mathcolor to effect style changes in the layout of the whole sum. ...
...e>. src and alt on <mglyph> cannot be set on <mstyle>. actiontype on <maction> cannot be set on <mstyle>. examples using displaystyle and mathcolor to effect style changes in the layout of the whole sum. <math> <mstyle displaystyle="true" mathcolor="teal"> <mrow> <munderover> <mo stretchy="true"
form="prefix">∑</mo> <mrow> <mi>i</mi> <mo
form="infix">=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <mstyle displaystyle="true"> <mfrac> <mn>1</mn> <mi>n</mi> </mfrac> </mstyle> </mrow> </mstyle> </math> specifications specification status comment mathml 3.0the definition of 'mstyle' in that specification. recommend...
<semantics> - MathML
re are two ways to mark up mathematics: presentation mathml is used to control the layout of equations, whereas content mathml is designed to encode the semantic mathematical meaning and to make expressions understandable to computer algebra systems. the mathml elements <semantics>, <annotation> and <annotation-xml> are used to combine presentation and content markup and to provide both, layout in
formation and semantic meaning of mathematical expressions. the <semantics> element acts as a container element associating annotations and must have child elements (it will raise an invalid markup error otherwise). the <annotation> element is the container element containing semantic in
formation in a non-xml
format, whereas the <annotation-xml> element contains content in an xml
format, e.g. content...
...esentation" "svg1.1" "text/html" "image/svg+xml" "application/xml". note that "application/mathml+xml" is not mentioned here as it does not distinguish between content or presentation mathml. attributes the following attributes can be set on <annotation> and <annotation-xml>: definitionurl the location of the annotation key symbol. encoding the encoding of the semantic in
formation in the annotation (e.g. "mathml-content", "mathml-presentation", "application/openmath+xml", "image/png") cd the content dictionary that contains the annotation key symbol. name the name of the annotation key symbol. src the location of an external source for semantic in
formation. example <math> <semantics> <!-- presentation mathml --> <mrow> <msup> <mi>x</m...
... recommendation current specification mathml 2.0the definition o...
MathML documentation index - MathML
tors from simple notations, wysiwyg editors and other content management systems to help writing web pages. 3 examples beginner, example, guide, mathml, needsbeginnerupdate below you'll find some examples you can look at to help you to understand how to use mathml to display increasingly complex mathematical concepts in web content. 4 mathml: deriving the quadratic
formula beginner, education, example, guide, html5, mathml, needsbeginnerupdate this page outlines the derivation of the quadratic
formula. 5 proving the pythagorean theorem beginner, example, guide, html5 math, math education, mathml, needsbeginnerupdate we will now prove the pythagorean theorem: 6 mathml attribute reference mathml, mathml reference ...
...nclosing notation specified by the notation attribute. 13 <merror> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <merror> element is used to display contents as error messages. in firefox this error message is rendered similar to the typical xml error message. note that this error is not thrown when your mathml markup is wrong or not well-
formed xml. you will still get an xml parsing error (in case of the xhtml notation of mathml), which has nothing to do with <merror>. 14 <mfenced> deprecated, mathml, mathml reference, mathml:element, mathml:general layout schemata the deprecated mathml <mfenced> element used to provide the possibility to add custom opening and closing parentheses (such as brackets) and separators...
... ...
color-rendering - SVG: Scalable Vector Graphics
the color-rendering attribute provides a hint to the svg user agent about how to optimize its color interpolation and compositing operations. color-rendering takes precedence over color-interpolation-filters. for example, assume color-rendering: optimizespeed and color-interpolation-filters: linearrgb. in this case, the svg user agent should per
form color operations in a way that optimizes per
formance, which might mean sacrificing the color interpolation precision as specified by through the linearrgb value for color-interpolation-filters. note: as a presentation attribute, color-rendering can be used as a css property. as a presentation attribute, it can be applied to any element but it only has an effect on the following 29 elements: <a>, <animate>, <animatecolor>, <circle>, <clippath>...
...="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="url(#gradient)" color-rendering="optimizequality" /> <text x="45" y="50%" color-rendering="optimizequality">quality-optimized</text> <circle cx="100" cy="100" r="100" color-rendering="optimizespeed" fill="url(#gradient)" style="trans
form: translatex(240px);" /> <text x="290" y="50%" color-rendering="optimizespeed">speed-optimized</text> </svg> usage notes value auto | optimizespeed | optimizequality default value auto animatable yes auto indicates that the user agent shall make appropriate tradeoffs to balance speed and quality, but quality shall be given more importance than s...
... optimizequality indicates that the user agent shall emphasize quality over rendering speed. ...
glyphRef - SVG: Scalable Vector Graphics
specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'glyphref for <glyphref>' in that specification. ...
... specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'glyphref for <glyphref>' in that specification. ...
... specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'glyphref for <glyphref>' in that specification. ...
path - SVG: Scalable Vector Graphics
"mypath" fill="none" stroke="silver" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <text> <textpath path="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50"> quick brown fox jumps over the lazy dog. </textpath> </text> </svg> animatemotion for <animatemotion>, path defines the motion path, expressed in the same
format and interpreted the same way as the d geometric property for the <path> element. the effect of a motion path animation is a translation along the x- and y-axes of the current user coordinate system by the x and y values computed over time. value <path-data> default value none animatable no <path-data> this value defines the motion path along which ...
...property for the <path> element. the effect of a motion path animation is a translation along the x- and y-axes of the current user coordinate system by the x and y values computed over time. value <path-data> default value none animatable no <path-data> this value defines the motion path along which the referenced element is animated. for detailed in
formation about the commands that can be used, see the explanation for the d attribute. textpath for <textpath>, path defines the path onto which the glyphs of a <text> element will be rendered. an empty string indicates that there is no path data for the element. this means that the text within the <textpath> element does not render or contribute to the bounding box of the <text> element. if the a...
...ath> element does not render or contribute to the bounding box of the <text> element. if the attribute is not specified, the path specified in href is used instead. value <path-data> default value path specified in href animatable yes <path-data> this value defines the text path along which the glyphs of the <text> element are aligned. for detailed in
formation about the commands that can be used, see the explanation for the d attribute. specifications specification status comment scalable vector graphics (svg) 2the definition of 'path for <textpath>' in that specification. candidate recommendation initial definition for <textpath> svg animations level 2the definition of 'path for <animatemotion>' in th...
requiredFeatures - SVG: Scalable Vector Graphics
witch> element. if requiredfeatures is used in other situations, it represents a simple switch on the given element whether to render the element or not. to detect availability of an svg feature from script, there is the (also deprecated) domimplementation.hasfeature() method. ...
... feature strings the following are the feature strings for the requiredfeatures attribute. these same feature strings apply to the hasfeature method call that is part of the svg dom's support for the domimplementation interface. in some cases the feature strings map directly to a set of attributes, properties or elements, in others they represent some functionality of the browser. note that the
format and naming for feature strings changed from svg 1.0 to svg 1.1. the svg 1.0 feature strings are not listed here but can be found in the svg specification. some browser support svg 1.0 feature strings for compatibility reasons. however, the svg 1.0 feature strings are considered deprecated. http://www.w3.org/tr/svg11/feature#svg at least one of the following feature is supported: http...
...1/feature#externalresourcesrequired the browser supports the externalresourcesrequired attribute http://www.w3.org/tr/svg11/feature#view the browser supports the <view> element http://www.w3.org/tr/svg11/feature#script the browser supports the <script> element http://www.w3.org/tr/svg11/feature#animation the browser supports the <animate>, <set>, <animatemotion>, <animatetrans
form>, <animatecolor> and <mpath> elements http://www.w3.org/tr/svg11/feature#font the browser supports the <font>, <font-face>, <glyph>, <missing-glyph>, <hkern>, <vkern>, <font-face-src>, <font-face-uri>, <font-face-
format> and <font-face-name> elements http://www.w3.org/tr/svg11/feature#basicfont the browser supports the <font>, <font-face>, <glyph>, <missing-glyph>, <hkern>, <font-face...
stroke-linejoin - SVG: Scalable Vector Graphics
8" y="6" /> </svg> usage context value arcs | bevel |miter | miter-clip | round default value miter animatable yes arcs note: the arcs value as been introduced in svg2 and it isn't widely supported yet, see browser compatibility bellow for details. the arcs value indicates that an arcs corner is to be used to join path segments. the arcs shape is
formed by extending the outer edges of the stroke at the join point with arcs that have the same curvature as the outer edges at the join point. example html,body,svg { height:100% } <svg viewbox="0 0 6 6" xmlns="http://www.w3.org/2000/svg"> <!-- effect of the "arcs" value --> <path d="m1,5 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3" stroke="black" fill="none" stroke-linejoin="arcs" /> <!-- ...
...ath for each stroke --> <g id="p"> <path d="m1,5 l2,-3 l2,3" stroke="pink" fill="none" stroke-width="0.025" /> <circle cx="1" cy="5" r="0.05" fill="pink" /> <circle cx="3" cy="2" r="0.05" fill="pink" /> <circle cx="5" cy="5" r="0.05" fill="pink" /> </g> </svg> miter the miter value indicates that a sharp corner is to be used to join path segments. the corner is
formed by extending the outer edges of the stroke at the tangents of the path segments until they intersect. note: if the stroke-miterlimit is exceeded, the line join falls back to bevel. example html,body,svg { height:100% } <svg viewbox="0 -1 10 7" xmlns="http://www.w3.org/2000/svg"> <!-- effect of the "miter" value --> <path d="m1,5 l2,-3 l2,3" stroke="black" fill="none" stroke-li...
...5" r="0.05" fill="pink" /> <circle cx="7.75" cy="2" r="0.05" fill="pink" /> <circle cx="8.5" cy="5" r="0.05" fill="pink" /> </g> </svg> miter-clip note: the miter-clip value as been introduced in svg2 and it isn't widely supported yet, see browser compatibility bellow for details. the miter-clip value indicates that a sharp corner is to be used to join path segments. the corner is
formed by extending the outer edges of the stroke at the tangents of the path segments until they intersect. if the stroke-miterlimit is exceeded, the miter is clipped at a distance equal to half the stroke-miterlimit value multiplied by the stroke width from the intersection of the path segments. this provides a better rendering than miter on very sharp join or in case of an animation. example ht...
to - SVG: Scalable Vector Graphics
the to attribute indicates the final value of the attribute that will be modified during the animation. the value of the attribute will change between the from attribute value and this value. five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetrans
form>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="100" height="100"> <animate attributetype="xml" attributename="width" fill="freeze" from="100" to="150" dur="3s"/> </rect> </svg> animate, animatecolor, animatemotion, animatetrans
form for <animate>, <animatecolor>, <animatemotion>, and <animatetrans
form>, to specifies the ending value of the animation. value <value> def...
...he exact value type for this attribute depend on the value of the attribute that will be animated. specifications specification status comment svg animations level 2the definition of 'to for <set>' in that specification. editor's draft no change svg animations level 2the definition of 'to for <animate>, <animatecolor>, <animatemotion>, and <animatetrans
form>' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'to for <set>' in that specification. recommendation initial definition for <set> scalable vector graphics (svg) 1.1 (second edition)the definition of 'to for <animate>, <animatecolor>, <animatemotion>, and <animatetrans
form>' in that specification. ...
...ond edition)the definition of 'to for <set>' in that specification. ...
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 <animatetrans
form> element, it defines the type of trans
formation, whose values change over time. for the <fecolormatrix> element, it indicates the type of matrix operation. the keyword matrix indicates that a full 5x4 matrix of values will be provided. the other keywords represent convenience shortcuts to allow commonly used color operations to be per
formed without specifying a complete matrix. for the <fefuncr>, <fefuncg>, <fefuncb>, and <fefunca> elements, it indicates the type of component transfer function. for the <feturbulence> element, it indicates whether the filter primitive should per
form a noise or turbulence function. for the <style> and <script> elements...
...thout specifying a complete matrix. for the <fefuncr>, <fefuncg>, <fefuncb>, and <fefunca> elements, it indicates the type of component transfer function. for the <feturbulence> element, it indicates whether the filter primitive should per
form a noise or turbulence function. for the <style> and <script> elements, it defines the content type of the element. ...
... animatable yes normative document svg 1.1 (2nd edition) for the <style> and <script> elements categories none value <content-type> animatable no normative document svg 1.1 (2nd edition) : script svg 1.1 (2nd edition) : style example elements the following elements can use the values attribute <animatetrans
form> <fecolormatrix> <fefunca> <fefuncb> <fefuncg> <fefuncr> <feturbulence> <script> <style> ...
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 per
formed. five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetrans
form>, and <fecolormatrix> animate, animatecolor, animatemotion, animatetrans
form for <animate>, <animatecolor>, <animatemotion>, and <animatetrans
form>, values is a list of values defining the sequence of values over the course of the animation. if this attribute is specified, any from, to, and by attribute values set on the element are ignored. value <list-of-values> default...
...e (degrees). for type="luminancetoalpha", values is not applicable. specifications specification status comment filter effects module level 1the definition of 'values for <fecolormatrix>' in that specification. working draft no change svg animations level 2the definition of 'values for <animate>, <animatecolor>, <animatemotion>, and <animatetrans
form>' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'values for <fecolormatrix>' in that specification. recommendation initial definition for <fecolormatrix> scalable vector graphics (svg) 1.1 (second edition)the definition of 'values for <animate>, <animatecolor>, <animatemotion>, and <animatetransfo...
...f 'values for <fecolormatrix>' in that specification. ...
xlink:href - SVG: Scalable Vector Graphics
the xlink:href attribute defines a reference to a resource as a reference iri. the exact meaning of that link depends on the context of each element using it. note: svg 2 removed the need for the xlink namespace, so instead of xlink:href you should use href. ...
... if the reference is to an <altglyphdef> element, then if an appropriate set of alternate glyphs is located from processing the <altglyphdef> element, then those alternate glyphs are rendered instead of the characters that are inside of the <altglyph> element. value <iri> default value none animatable no animate, animatecolor, animatemotion, animatetrans
form, set for <animate>, <animatecolor>, <animatemotion>, <animatetrans
form>, and <set>, xlink:href defines the reference to the element which is the target of this animation and which therefore will be modified over time. the target element must be part of the current svg document fragment. the value must point to exactly one target element which is capable of being the target of the given animati...
...specification. recommendation defines href for the <a> element. scalable vector graphics (svg) 1.1 (second edition)the definition of 'href for <altglyph>' in that specification. recommendation defines href for the <altglyph> element. scalable vector graphics (svg) 1.1 (second edition)the definition of 'href for <animate>, <animatecolor>, <animatemotion>, <animatetrans
form>, and <set>' in that specification. recommendation defines href for animation elements. scalable vector graphics (svg) 1.1 (second edition)the definition of 'href for <color-profile>' in that specification. recommendation defines href for the <color-profile> element. scalable vector graphics (svg) 1.1 (second edition)the definition of 'href for <cursor>' in that spec...
<g> - SVG: Scalable Vector Graphics
it can also group multiple elements to be referenced later with the <use> element. ...
...it can also group multiple elements to be referenced later with the <use> element. ...
...tes 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, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
<pattern> - SVG: Scalable Vector Graphics
ues 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. patterntrans
form this attribute contains the definition of an optional additional trans
formation from the pattern coordinate system onto the target coordinate system. value type: <trans
form-list>; default value: none; animatable: yes patternunits this attribute defines the coordinate system for attributes x, y, width , and height. value type: userspaceonuse|objectboundingbox; default value: objectboundingbox...
...tern coordinate system onto the target coordinate system. value type: <trans
form-list>; default value: none; animatable: yes patternunits this attribute defines the coordinate system for attributes x, y, width , and height. value type: userspaceonuse|objectboundingbox; default value: objectboundingbox; animatable: yes preserveaspectratio this attribute defines how the svg fragment must be de
formed 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)? ; default value: xmidymid meet; animatable: yes viewbox this attribute defines the bound of the svg viewport for the pattern fragment. value type: <list-of-numbers> ; default value: none; animatable: yes w...
...ibutes most notably: requiredextensions, systemlanguage 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, trans
form, vector-effect, visibility xlink attributes most notably: xlink:title usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <ma...
Tools for SVG - SVG: Scalable Vector Graphics
e will take a look at some tools to work with svg files. browser support as of internet explorer 9, all major browsers support svg: ie 9, mozilla firefox, safari, google chrome and opera. mobile devices with webkit-based browsers also support svg. on older or smaller devices, chances are that svg tiny is supported. inkscape url: www.inkscape.org one of the most important tools for a graphics
format is a decent drawing program. inkscape offers state-of-the-art vector drawing, and it's open source. moreover, it uses svg as its native file
format. to store inkscape specific data, it extends the svg file with elements and attributes in a custom namespace, but you can also choose to export as plain svg. adobe illustrator url: www.adobe.com/products/illustrator/ before adobe acquired macrom...
...s it for general applicability. apache batik url: xmlgraphics.apache.org/batik/ batik is a set of open source tools under the roof of the apache software foundation. the toolkit is written in java and offers almost complete svg 1.1 support, as well as some features that were originally planned for svg 1.2. batik offers a viewer (squiggle), a rasterizer for png output, an svg pretty printer to
format svg files, and a truetype-to-svg-font converter. together with apache fop batik can trans
form svg to pdf. other renderers several projects exist that can create a raster image from an svg source. imagemagick is one of the most famous command-line image processing tools. the gnome library rsvg is used by the wikipedia to raster their svg graphics. usage of headless browsers such as slimerjs a...
...e older browsers that raphael does. google docs url: www.google.com/google-d-s/drawings/ drawings from google docs can be exported as svg. science the well-known plotting tools xfig and gnuplot both support exporting as svg. to render graphs on the web jsxgraph supports vml, svg and canvas, automatically deciding which technology to use based on browser capabilities. in gis (geographic in
formation system) applications svg is often used as both storage and rendering
format. see carto.net for details. more tools! the w3c offers a list of programs that support svg. « previous ...
Tutorials
n your web pages, including the different ways that images can be included, and how to embed video, audio, and even entire other webpages. html tables representing tabular data on a webpage in an understandable, accessible way can be a challenge. this module covers basic table markup, along with more complex features such as implementing captions and summaries. advanced level html
forms
forms are a very important part of the web — these provide much of the functionality you need for interacting with websites, e.g. registering and logging in, sending feedback, buying products, and more. this module gets you started with creating the client-side parts of
forms. tips for authoring fast-loading html pages optimize web pages to provide a more responsive site for visitors a...
...g float and positioning, and new fangled layout tools like flexbox. css reference complete reference to css, with details on support by firefox and other browsers. fluid grids design layouts that fluidly resize with the browser window, while still using a typographic grid. css challenges flex your css skills, and see where you need more practice. advanced level using css trans
forms apply rotation, skewing, scaling, and translation using css. css transitions css transitions, part of the draft css3 specification, provide a way to animate changes to css properties, instead of having the changes take effect instantly. 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,...
...l javascript design patterns. advanced level javascript guide a comprehensive, regularly updated guide to javascript for all levels of learning from beginner to advanced. you don't know js a series of books diving deep into the core mechanisms of the javascript language. javascript garden documentation of the most quirky parts of javascript. exploring es6 reliable and in-depth in
formation on ecmascript 2015. javascript patterns a javascript pattern and antipattern collection that covers function patterns, jquery patterns, jquery plugin patterns, design patterns, general patterns, literals and constructor patterns, object creation patterns, code reuse patterns, dom. how browsers work a detailed research article describing different modern browsers, their engines, page...
Using the WebAssembly JavaScript API - WebAssembly
ple.wasm file and save a copy in a new directory on your local machine. next, let’s create a simple html file called index.html in the same directory as your wasm file (can use our simple template if you haven’t got one easily available). now, to help us understand what is going on here, let’s look at the text representation of our wasm module (which we also meet in converting webassembly
format to wasm): (module (func $i (import "imports" "imported_func") (param i32)) (func (export "exported_func") i32.const 42 call $i)) in the second line, you will see that the import has a two-level namespace — the internal function $i is imported from imports.imported_func. we need to reflect this two-level namespace in javascript when writing the object to be imported into the w...
...eveloper tool debugger panel has functionality to expose the text representation of any wasm code included in a web page. to view it, you can go to the debugger panel and click on the “wasm://” entry. starting soon in firefox, in addition to viewing webassembly as text, developers will be able to debug (place breakpoints, inspect the callstack, single-step, etc.) webassembly using the text
format. see webassembly debugging with firefox devtools for a video preview. memory in the low-level memory model of webassembly, memory is represented as a contiguous range of untyped bytes called linear memory that are read and written by load and store instructions inside the module. in this memory model, any load or store can access any byte in the entire linear memory, which is necessary to fa...
...stances — this is the "function address space" of the instance, used to implement c function pointers. future versions of webassembly may allow 0–n table instances per module instance. one memory or table instance can be used by 0–n module instances — these instances all share the same address space, allowing dynamic linking. you can see multiplicity in action in our understanding text
format article — see the mutating tables and dynamic linking section. summary this article has taken you through the basics of using the webassembly javascript api to include a webassembly module in a javascript context and make use of its functions, and how to use webassembly memory and tables in javascript. we also touched on the concept of multiplicity. ...
Porting the Library Detector - Archive of obsolete content
this means we'll need two additional content scripts: one in the widget's context, which listens for icon mouseover events and sends a message to main.js containing the name of the corresponding library: function setlibraryinfo(element) { self.port.emit('setlibraryinfo', element...
...in.js containing the name of the corresponding library: function setlibraryinfo(element) { self.port.emit('setlibraryinfo', element.target.title); } var elements = document.getelementsbytagname('img'); for (var i = 0; i < elements.length; i++) { elements[i].addeventlistener('mouseover', setlibraryinfo, false); } one in the panel, which updates the panel's content with the library in
formation: self.on("message", function(libraryinfo) { window.document.body.innerhtml = libraryinfo; }); finally main.js relays the library in
formation from the widget to the panel: widget.port.on('setlibraryinfo', function(libraryinfo) { widget.panel.postmessage(libraryinfo); }); ...
request - Archive of obsolete content
on of name/value pairs. nested objects & arrays should encode safely. for get and head requests, the query string (content) will be appended to the url. for post and put requests, it will be sent as the body of the request. contenttype string the type of content to send to the server. this explicitly sets the content-type header. the default value is application/x-www-
form-urlencoded. overridemimetype string use this string to override the mime type returned by the server in the response's content-type header. you can use this to treat the content as a different mime type, or to force text to be interpreted using a specific character. for example, if you're retrieving text content which was encoded as iso-8859-1 (latin 1), it will be gi...
...t is designed to be used once. attempts to reuse them will throw an error. since the request is not being made by any particular website, requests made here are not subject to the same-domain restriction that requests made in web pages are subject to. with the exception of response, all of a request object's properties correspond with the options in the constructor. each can be set by simply per
forming an assignment. however, keep in mind that the same validation rules that apply to options in the constructor will apply during assignment. thus, each can throw if given an invalid value. the example below shows how to use request to get the most recent tweet from the @mozhacks account: var request = require("sdk/request").request; var latesttweetrequest = request({ url: "https://api.twitte...
simple-prefs - Archive of obsolete content
{ "description": "how many eyes?", "type": "integer", "name": "eyecount", "value": 8, "title": "eye count" } string displayed as a textbox and stores a string. { "type": "string", "name": "monstername", "value": "kraken", "title": "monster name" } color displayed as a colorpicker and stores a string in the #123456
format. { "type": "color", "name": "highlightcolor", "value": "#6a5acd", "title": "highlight color" } file displayed as a "browse" button that opens a file picker and stores the full path and name of the file selected. { "type": "file", "name": "myfile", "title": "select a file" } directory displayed as a "browse" button that ...
...ovided as a string. it is used to label the button. in "package.json": { "type": "control", "label": "click me!", "name": "sayhello", "title": "say hello" } in "main.js": var sp = require("sdk/simple-prefs"); sp.on("sayhello", function() { console.log("hello"); }); localization using the sdk's localization system, you can provide translated
forms of the title and description attributes. see the localization tutorial for more details. getting and setting preferences unless you've marked them as hidden, the user will be able to see and change the preferences in the add-on manager. you can also see them and change them programmatically using the prefs property, and listen for changes to a preference using on(). simple-prefs in the prefe...
tabs - Archive of obsolete content
url string string url to be opened in the new tab. this is a required property. optional options: name type isprivate boolean boolean which will determine whether the new tab should be private or not. if your add-on does not support private browsing this will have no effect. see the private-browsing documentation for more in
formation. defaults to false. innewwindow boolean if present and true, a new browser window will be opened and the url will be opened in the first tab in that window. this is an optional property. inbackground boolean if present and true, the new tab will be opened to the right of the active tab and will not be active. this is an optional property. ...
...y loaded in the tab. this property is read-only. this property is deprecated. from version 1.15, use the favicon module's getfavicon() function instead. contenttype this is currently an experimental api, so we might change it in future releases. returns the mime type that the document currently loaded in the tab is being rendered as. this may come from http headers or other sources of mime in
formation, and might be affected by automatic type conversions per
formed by either the browser or extensions. this property is read-only. index the index of the tab relative to other tabs in the application window. this property can be set to change its relative position. ispinned whether or not this tab is pinned as an app tab. this property is read-only. window the window object for this tab.
widget - Archive of obsolete content
or toggle button apis, and for a more complex widget try the toolbar or sidebar apis. create a simple user interface for an add-on in firefox's add-on bar. usage "widgets" are small pieces of content that live in the firefox 4 add-on bar. they can be simple icons or complex web pages. you can attach panels to them that open when they're clicked, or you can define a custom click handler to per
form some other action, like opening a web page in a tab. there are a few advantages to using widgets over an ad hoc user interface. first, your users will be accustomed to interacting with add-ons via widgets and the add-on bar. second, it allows firefox to treat your interface as a first-class citizen. for example, in the future firefox may allow the user to drag widgets from the add-on bar to othe...
...support private browsing, refer to the documentation for the private-browsing module. examples for conciseness, these examples create their content scripts as strings and use the contentscript property. in your own add-ons, you will probably want to create your content scripts in separate files and pass their urls using the contentscriptfile property. see working with content scripts for more in
formation. var widgets = require("sdk/widget"); // a basic click-able image widget. widgets.widget({ id: "google-link", label: "widget with an image and a click handler", contenturl: "http://www.google.com/favicon.ico", onclick: function() { require("sdk/tabs").activetab.url = "http://www.google.com/"; } }); // a widget that changes display on mouseover. widgets.widget({ id: "mouseo...
/loader - Archive of obsolete content
verlapping mapping. the example above overlays the base path '' with a different mapping for 'toolkit/' prefixed modules. modules the loader may optionally be provided with a set of module exports. in the sdk we call these "pseudo modules". this feature may be used in a few different ways: to expose an api that doesn't have a js file with an implementation or is written in an incompatible
format such as jsm: let { loader } = require('toolkit/loader'); let loader = loader({ modules: { // require('net/utils') will get netutil.jsm 'net/utils': cu.import('resource:///modules/netutil.jsm', {}) } }); each loader instance comes with a set of built-in pseudo modules that are described in detail in the built-in modules section. to reuse module instances that are already ...
...l environment with a different state to test how specific modules handle unloads. @loader/unload this pseudo module exposes an object that is unique per loader instance. it is used as a subject for observer notification to allow use of the observer service for defining hooks reacting on the unload of a specific loader. the sdk builds a higher level api on top of this for handling unloads and per
forming cleanup: let unloadsubject = require('@loader/unload'); let observerservice = cc['@mozilla.org/observer-service;1']. getservice(ci.nsiobserverservice); let observer = { observe: function onunload(subject, topic, reason) { // if this module is unloaded then `subject.wrappedjsobject` will be // `unloadsubject`. `topic` will be `'sdk:loader:destroy'`, and // `reason`...
core/promise - Archive of obsolete content
to observe single resolution of all of them is as simple as this: var group = promised(array); var abc = group(aasync, basync, casync).then(function(items) { return items[0] + items[1] + items[2]; }); all the all function is provided to consume an array of promises and return a promise that will be accepted upon the acceptance of all the promises in the initial array. ...
... promised(array); var abc = group(aasync, basync, casync).then(function(items) { return items[0] + items[1] + items[2]; }); all the all function is provided to consume an array of promises and return a promise that will be accepted upon the acceptance of all the promises in the initial array. this can be used to per
form an action that requires values from several promises, like getting user in
formation and server status, for example: const { all } = require('sdk/core/promise'); all([getuser, getserverstatus]).then(function (result) { return result[0] + result[1] }); if one of the promises in the array is rejected, the rejection handler handles the first failed promise and remaining promises remain unfulfilled. const { all } = require('sdk/core/promise'); all([aasync, failasync, basync...
lang/functional - Archive of obsolete content
l(fn, arguments...) takes a function and bind values to one or more arguments, returning a new function of smaller arity. let { partial } = require("sdk/lang/functional"); let add = function add (x, y) { return x + y; } let addone = partial(add, 1); addone(5); // 6 addone(10); // 11 partial(add, addone(20))(2); // 23 parameters fn : function function on which partial application is to be per
formed. arguments... : mixed additional arguments returns function : the partial function. compose(fn...) returns the composition of a list of functions, where each function consumes the return value of the function that follows. in math terms, composing the functions f(), g(), and h() produces f(g(h())). let { compose } = require("sdk/lang/functional"); let welcome = compose(exclaim, greet); ...
... just parse the last name, as our naive // implementation assumes that they will share the same lineage let getlineage = memoize(function (name) { // computes lineage return data; }, hasher); // hashing function takes a string of first and last name // and returns the last name. function hasher (input) { return input.split(" ")[1]; } getlineage("homer simpson"); // computes and returns in
formation for "simpson" getlineage("lisa simpson"); // returns cached for "simpson" parameters fn : function the function that becomes memoized. hasher : function an optional function that takes the memoized function's parameter and returns a hash key for storing the result. returns function : the memoized version of fn. delay(fn, ms, arguments) much like settimeout, delay invokes a function ...
places/history - Archive of obsolete content
access the user's browsing history. usage this module exports a single function, search(), which synchronously returns a placesemitter object which then asynchronously emits data and end or error events that contain in
formation about the state of the operation. example let { search } = require("sdk/places/history"); // simple query search( { url: "https://developers.mozilla.org/*" }, { sort: "visitcount" } ).on("end", function (results) { // results is an array of objects containing // data about visits to any site on developers.mozilla.org // ordered by visit count }); // complex query // the query objects are or'd together // let's say we want to retrieve all visits from before a week ago // with the query of 'ruby', but from last week onwards, we want // all results with ...
...each query option can take several properties, which are and'd together to make one complete query. for additional queries within the query, passing more query options in will or the total results. an options object may be specified to determine overall settings, like sorting and how many objects should be returned. parameters querie...
system/runtime - Archive of obsolete content
globals properties insafemode this value is true if firefox was started in safe mode, otherwise false. os a string identifying the current operating system. for example, . "winnt", "darwin", or "linux". see os_target for a more complete list of possible values. processtype the type of the caller's process, which will be one of these constants: constant value description process_type_default 0 the default (chrome) process. process_type_plugin 1 a plugin subprocess. process_type_content 2 a content subprocess. ...
...lt (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. widgettoolkit a string identifying the target widget toolkit in use. xpcomabi a string identifying the abi of the current processor and compiler vtable. this string takes the
form <processor>-<compilerabi>, for example: "x86-msvc" or "ppc-gcc3". ...
system/xul-app - Archive of obsolete content
globals functions is(name) checks whether the host application is the given application. parameters name : string a host application name. returns boolean : true if the host application is name and false otherwise. isoneof(names) checks whether the host application is one of the given applications. parameters names : array an array of host application names. returns boolean : true if the host application is one of the names and false otherwise. ...
...range and false otherwise. properties id the guid of the host application. for example, for firefox this value is "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}". name the host application name. the possible values here are: "firefox" "fennec" "mozilla" "seamonkey" "sunbird" "thunderbird" "firefox"and"fennec"` are the most commonly used values. version the host application version. plat
formversion the gecko/xulrunner plat
form version. ids a mapping of application names to their ids. for example, ids["firefox"] == "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}". ...
test/httpd - Archive of obsolete content
usage the most basic usage is: var { startserverasync } = require("sdk/test/httpd"); var srv = startserverasync(port, basepath); require("sdk/system/unload").when(function cleanup() { srv.stop(function() { // you should continue execution from this point. }) }); this starts a server in background (assuming you're running this code in an application that has an event loop, such as firefox). the server listens at http://localhost:port/ and serves files from the specified directory. ...
... ...
ui/button/action - Archive of obsolete content
ltip, and when the button is in the menu, it appears underneath the button as a legend. icon url, string, object one or more icons for the button. you can specify this in one of three ways: as a resource:// url pointing at an icon file in your add-on's "data" directory, typically constructed using self.data.url(iconfile) as a relative path: a string in the
form "./iconfile", where "iconfile" is a relative path to the icon file beginning in your add-on's "data" directory as an object, or dictionary of key-value pairs. here you can specify a range of sizes for your button's icon. each key-value pair specifies an icon: each value specifies an image file as a resource:// url or relative path. each key must be a numeric string such ...
...on a device with a "normal" screen resolution, the toolbar has space for 18 x 18 pixels and the menu panel has space for 32 x 32 pixels. on a high resolution screen (such as a hidpi display), these are doubled to 36 x 36 and 64 x 64 pixels, respectivel...
ui/button/toggle - Archive of obsolete content
ltip, and when the button is in the menu, it appears underneath the button as a legend. icon url, string, object one or more icons for the button. you can specify this in one of three ways: as a resource:// url pointing at an icon file in your add-on's "data" directory, typically constructed using self.data.url(iconfile) as a relative path: a string in the
form "./iconfile", where "iconfile" is a relative path to the icon file beginning in your add-on's "data" directory as an object, or dictionary of key-value pairs. here you can specify a range of sizes for your button's icon. each key-value pair specifies an icon: each value specifies an image file as a resource:// url or relative path. each key must be a numeric string such ...
...on a device with a "normal" screen resolution, the toolbar has space for 18 x 18 pixels and the menu panel has space for 32 x 32 pixels. on a high resolution screen (such as a hidpi display), these are doubled to 36 x 36 and 64 x 64 pixels, respectivel...
cfx to jpm - Archive of obsolete content
belongs to which add-on. id handling with cfx when you use cfx, the id is taken from the id field in the add-on's package.json file. you can edit this file to create your own id, but if you don't, cfx will generate one for you, which will look something like "jid1-f3boogbjqje67a". add-on ids need to be one of two types: a guid or a string that includes an "@" symbol. the sdk expects the latter
format, and if the id in package.json doesn't contain "@", then cfx xpi will append "@jetpack" to the package.json field, and make that the add-on id. so: if you never did anything with ids when using cfx, then the value in your add-on's package.json will be something like "jid1-f3boogbjqje67a", and the corresponding id in the install.rdf will be "jid1-f3boogbjqje67a@jetpack". id handling with jpm ...
... requiring modules from test code similarly, suppose you've written some tests for your add-on: my-addon lib my-addon.js test test-my-addon-js with cfx, code inside "test-my-addon.js" can import "my-addon.js" using a statement like this: var my_addon = require("my-addon"); // this will not work with jpm! with jpm,...
Tools - Archive of obsolete content
articles listed here provide a reference for the sdk's tools: cfx enables you to test, run, and package add-ons. cfx is is no longer supported as of firefox 44 and no longer accepted for add-on submission, jpm should now be used instead. cfx to jpm a guide to working with jpm if you're already familiar with cfx. console enables your add-on to log error, warning or in
formational messages. jpm jpm is a command-line tool that enables you to test, run, and package add-ons. jpm-mobile the node-based replacement for cfx --force-mobile. enables you to run and test add-ons for firefox mobile (aka fennec). jpmignore use .jpmignore to ignore files from your xpi builds created via jpm. package.json the package.json file contains manifest data for your add-on, providing not on...
...mmand-line tool that enables you to test, run, and package add-ons. jpm-mobile the node-based replacement for cfx --force-mobile. enables you to run and test add-ons for firefox mobile (aka fennec). jpmignore use .jpmignore to ignore files from your xpi builds created via jpm. package.json the package.json file contains manifest data for your add-on, providing not only descriptive in
formation about the add-on for presentation in the add-ons manager, but other metadata required of add-ons. ...
Creating Event Targets - Archive of obsolete content
for example, you can listen to the panel object's show event either by calling: mypanel.on("show", listenerfunction); or by passing the onshow option to panel's constructor: var mypanel = require("sdk/panel").panel({ onshow: listenerfunction, contenturl: "https://en.wikipedia.org/w/index.php" }); if your class inherits ...
...; } exports.main = function() { bookmarkmanager.on("added", logadded); bookmarkmanager.on("visited", logvisited); }; exports.onunload = function() { bookmarkmanager.removelistener("added", logadded); bookmarkmanager.removelistener("visited", logvisited); } implementing "onevent" options finally, most event targets accept options of the
form "onevent", where "event" is the capitalized
form of the event type. for example, you can listen to the panel object's show event either by calling: mypanel.on("show", listenerfunction); or by passing the onshow option to panel's constructor: var mypanel = require("sdk/panel").panel({ onshow: listenerfunction, contenturl: "https://en.wikipedia.org/w/index.php" }); if your class inherits from eventtarget, options like this are automatic...
Getting started (cfx) - Archive of obsolete content
irefox with your add-on installed. when firefox launches, in the top-right corner of the browser you'll see an icon with the firefox logo. click the icon, and a new tab will open with https://www.mozilla.org/ loaded into it. that's all this add-on does. it uses two sdk modules: the action button module, which enables you to add buttons to the browser, and the tabs module, which enables you to per
form basic operations with tabs. in this case, we've created a button whose icon is the firefox icon, and added a click handler that loads the mozilla home page in a new tab. try editing this file. for example, we could change the page that gets loaded: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "...
..."./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://developer.mozilla.org/"); } at the command prompt, execute cfx run again. this time clicking it takes you to https://developer.mozilla.org/. packaging the add-on when you've finished the add-on and are ready to distribute it, you'll need to package it as an xpi file. this is the installable file
format for firefox add-ons. you can distribute xpi files yourself or publish them to https://addons.mozilla.org so other users can download and install them. to build an xpi, just execute the command cfx xpi from the add-on's directory: cfx xpi you should see a message like: exporting extension to my-addon.xpi. to test that this worked, try installing the xpi file in your own firefox installati...
Developing for Firefox Mobile - Archive of obsolete content
able of running the native version of firefox mobile. then: install the nightly build of the native version of firefox mobile on the device. enable usb debugging on the device (step 2 of this link only) on the development machine: install version 1.5 or higher of the add-on sdk install the correct version of the android sdk for your device using the android sdk, install the android plat
form tools next, attach the device to the development machine via usb. now open up a command shell. android plat
form tools will have installed adb in the "plat
form-tools" directory under the directory in which you installed the android sdk. make sure the "plat
form-tools" directory is in your path. then type: adb devices you should see some output like: list of devices attached 51800f220f01564 d...
...ile 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 plat
form/xpcom supported preferences/service supported stylesheet/style supported stylesheet/utils supported system/environment supported system/events supported system/runtime supported system/unload supported system/xul-app supported tabs/utils supported test/assert supported ...
Unit Testing - Archive of obsolete content
n writing reusable modules. if you're migrating test code from cfx to jpm, see the guide to migrating from cfx, in particular the section on loading modules from test code. the sdk provides a framework to help create and run unit tests for your code. to demonstrate how it works we'll write some unit tests for a simple base64 encoding module. a simple base64 module in a web page, you can per
form base64 encoding and decoding using the btoa() and atob() functions. unfortunately these functions are attached to the window object: since this object is not available in your main add-on code, atob() and btoa() aren't available either. so we'll create a base64 module to expose these functions from the plat
form (see creating reusable modules). to begin with, create a new directory, navigate to i...
...ctions from the plat
form (see creating reusable modules). to begin with, create a new directory, navigate to it, and run jpm init. now create a new file called "base64.js", and give it the following contents: const { atob, btoa } = require("resource://gre/modules/services.jsm"); exports.atob = a => atob(a); exports.btoa = b => btoa(b); this code exports two functions, which just call the plat
form's btoa() and atob() functions. to show the module in use, edit the "index.js" file as follows: var base64 = require("./base64"); var button = require("sdk/ui/button/action").actionbutton({ id: "base64", label: "base64", icon: "./icon-16.png", onclick: function() { encoded = base64.btoa("hello"); console.log(encoded); decoded = base64.atob(encoded); console.log(decoded); ...
Using XPCOM without chrome - Archive of obsolete content
below is an example for the xpcom bookmark observer. examples bookmarks observer normally, a bookmark observer would require chrome components and xpcomutils as described in the following links: (observing changes to bookmarks and tags) , (creating event targets). however, with the sdk module , we can remove this need. below is an example, where we extend the xpcom module's unknown class with an nsinavbookmarkobserverinterface and one of its optional interface methods (onitemchanged). we can then create an object from it and add it as an observer to the bookmarks service. ...
... example, where we extend the xpcom module's unknown class with an nsinavbookmarkobserverinterface and one of its optional interface methods (onitemchanged). we can then create an object from it and add it as an observer to the bookmarks service. ...
Alerts and Notifications - Archive of obsolete content
appropriate delay. it uses nsialertsservice. ...
...mac os x: function popup(title, text) { try { components.classes['@mozilla.org/alerts-service;1'] .getservice(components.interfaces.nsialertsservice) .showalertnotification(null, title, text, false, '', null); } catch(e) { // prevents runtime error on plat
forms that don't implement nsialertsservice } } if you need to display a comparable alert on a plat
form that doesn't support nsialertsservice, you can do this: function popup(title, msg) { var image = null; var win = components.classes['@mozilla.org/embedcomp/window-watcher;1'] .getservice(components.interfaces.nsiwindowwatcher) .openwindow(null, 'chrome://global/content/alerts/alert.xul', '_blank', 'chrome,titlebar=...
Miscellaneous - Archive of obsolete content
pace. it also collapses consecutive whitespaces into a single whitespace, and returns at most 150 characters, making it ideal to display text in context menus. it is defined at //github.com/realityripple/pale-moon/blob/master/palemoon/base/content/browser.js#l5113. note that it returns the empty string (""), not false, when nothing is selected. getbrowserselection() is not implemented on some plat
forms, such as thunderbird and songbird. see also http://mxr.mozilla.org/seamonkey/source/browser/base/content/browser.js#4674 discovering which element in the loaded document has focus // focusedcontrol stores the focused field, or null if there is none. // this excludes textareas for simplicity, but onpageload() can easily be // modified to cycle through textareas as well. further enhancements wo...
....org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbundle("chrome://myext/locale/myext.properties"), getlocalizedmessage: function(msg) { return this._bundle.getstringfromname(msg); } }; alert(common.getlocalizedmessage("invalid.url")) another similar alternative (using both getstringfromname and
formatstringfromname), is: var fcbundle = components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbundle("chrome://myext/locale/myext.properties"); function getstr(msg, args){ //get localised message if (args){ args = array.prototype.slice.call(arguments, 1); return fcbundle.
formatstringfromname(m...
Post data to window - Archive of obsolete content
s examples of sending post data to the server and displaying the server response. need more elaborate examples, examples of displaying the response in a new tab, in background tabs, and a link to using xmlhttprequest for post requests. preprocessing post data the apostdata argument of the (global) loaduri(), opendialog(), and (tab)browser.loaduriwithflags() methods expects the post data in the
form of an nsiinputstream (because they eventually call nsiwebnavigation.loaduri()) while post data can be created using nsimimeinputstream. most of the time, post data starts as a data string in the
form of "name1=data1&name2=data2&...", so you must convert it before passing the data to one of the methods. here is an example: var datastring = "name1=data1&name2=data2"; // post method requests must ...
...am;1"]. createinstance(ci.nsistringinputstream); if ("data" in stringstream) // gecko 1.9 or newer stringstream.data = datastring; else // 1.8 or older stringstream.setdata(datastring, datastring.length); var postdata = cc["@mozilla.org/network/mime-input-stream;1"]. createinstance(ci.nsimimeinputstream); postdata.addheader("content-type", "application/x-www-
form-urlencoded"); postdata.addcontentlength = true; postdata.setdata(stringstream); // postdata is ready to be used as apostdata argument ... posting data to the current tab there is a convenience method in global scope (in firefox, chrome://browser/content/browser.js): loaduri(auri, areferrer, apostdata, aallowthirdpartyfixup); posting data to a new window window.opendialog('chrome://browser...
Preferences - Archive of obsolete content
for more details on preferences in mozilla, see preferences system. if you haven't yet, read other documents about mozilla preferences on mdn (links below in resources section). note: this article doesn't cover all available methods for manipulating preferences; please refer to the xpcom reference pages listed in resources section for the complete list of methods. ...
... "no value stored")); be careful with this technique because prior to firefox 54, the additional (default) value will be ignored and an exception would still be thrown in this case. using preferences in extensions if you're writing your extension for one of the toolkit applications (firefox, thunderbird, nvu), you should provide default values for your extension's preferences (see above for in
formation on how to do it). it has the following benefits: you don't have to duplicate default values in various parts of your code. the code for reading preferences is simplified, since you don't need to worry about the get methods throwing exceptions. javascript wrappers for preferences system there are a few javascript wrappers to make your life easier: http://mozilla.doslash.org/prefutil...
SVG General - Archive of obsolete content
dynamic scripting helper this little helper script can be used to simplify creation of svg elements in script. svg requires you to use setattributens to add attributes to a newly created svg dom element. ...
...s. you will also find some general purpose scripting helpers, that should make scripting svg a little easier. svg template here is a basic markup template to start building an svg document: <svg xmlns="http://www.w3.org/2000/svg"> <!-- svg elements go here --> </svg> note: it is recommended that you do not use dtd's with svg documents. the tutorial and authoring guidelines have more in
formation. dynamic scripting helper this little helper script can be used to simplify creation of svg elements in script. svg requires you to use setattributens to add attributes to a newly created svg dom element. no properties like html. svg image also requires the use of xlink for the href attribute, which can be tricky to remember, especially when you're mixing svg with html or xul. here is th...
StringView - Archive of obsolete content
e are times when it would be helpful for javascript code to be able to quickly and easily manipulate raw binary data. in the past, this had to be simulated by treating the raw data as a string and using the charcodeat() method to read the bytes from the data buffer. however, this is slow and error-prone, due to the need for multiple conversions (especially if the binary data is not actually byte-
format data, but, for example, 32-bit integers or floats). javascript typed arrays provide a mechanism for accessing raw binary data much more efficiently. the stringview constructor is one level above typed arrays. the code stringview.js "use strict"; /*\ |*| |*| :: number.isinteger() polyfill :: |*| |*| /docs/web/javascript/reference/global_objects/number/isinteger |*| \*/ if (!number.isinte...
...); /* get the hindi subview passing an uint8array as argument... */ var nhindistart = mystringview.makeindex(19); var nhindiend = mystringview.makeindex(6, nhindistart); var mysubview2 = new stringview(mystringview.rawdata.subarray(nhindistart, nhindiend), "utf-8"); alert(mysubview1.rawdata.length); // 18 alert(mysubview2.rawdata.length); // 18 see also: stringview.foreachchar(). per
formance note: each invocation of stringview.makeindex() runs a cycle for all characters contained in the stringview object between startfrom and startfrom + characterslength. dont't use stringview.makeindex() in a cycle as if it were a normal length property. for custom cycles, look at the example proposed here. tobase64() syntax stringview.tobase64([wholebuffer]) description r...
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
the nsmsgutils.h header for developing core mail/news code, the nsmsgutils.h header is being enhanced to fill in some of the gaps caused by the differences between the internal and external apis. these enhancements make it easier to write code that will transparently compile using either api. the list of enhanc...
... ...
Chapter 1: Introduction to Extensions - Archive of obsolete content
extensions enhance features that already exist in firefox. tab mix plus offers detailed tab-related settings. prefbar gives access to numerous preferences from the toolbar. noscript enables and disables javascript execution on a site-by-site basis. web application integration extensions fixme: update this. the use the apis of certain web applications to provide certain pieces of in
formation. new feature extensions fixme: update this. extensions can add completely new features to firefox. this class of extension requires a greater level of knowledge and programming ability. greasemonkey userchrome.js both of these provide an environment for running user scripts (javascript) in firefox itself, where the scripts can target specific websites. adblock plus blocks the ...
...refox itself, where the scripts can target specific websites. adblock plus blocks the display of unwanted advertisements on web pages. all-in-one gestures adds mouse-gesture functionality. application level extensions fixme: update this. these are sophisticated extensions that can be considered full-scale applications in their own right, essentially using firefox as the development plat
form. one-trick gag extensions fixme: update this. there are a number of one-trick gag extensions that aren’t very useful. this is a very brief survey of a few extensions, but there are many other unique extensions available. table 1: advanced customization methods for firefox customization method does it work for web sites? does it work for firefox? user style shee...
Custom XUL Elements with XBL - Archive of obsolete content
ine of code: <property name="name"> <getter><![cdata[ return this.getattribute('name'); ]]></getter> <setter><![cdata[ this.setattribute('name', val); ]]></setter> </property> properties can be accessed just the same as fields, and they're the ones we prefer for public members. when you add a node to a xul document using an xbl binding, all normal dom operations can be per
formed on it. you can move it around, delete it or clone it. but there is one thing you need to know about moving or cloning your node: all internal state in the node will be lost. this means that all your properties and fields will be reset. if you want some value to be preserved after such dom operations, you must set it as an attribute and not an internal value. methods our "person" binding has...
...haves more like the rest. just like fields and properties, methods are easy to invoke if you have a reference to the object that corresponds to the node. we have experienced problems when calling methods and setting properties on xbl nodes right after they are created and inserted to the document. this is likely due to some asynchronous operation related to node insertion. if you need to per
form an operation to a node right after insertion, we recommend using a timeout to delay the operation (a timeout set to 0 works well). handlers the handlers and handler xbl elements are used to define event handlers for the element. we have a "click" handler that displays the greeting when the "person" element is clicked: <handler phase="bubbling" event="click"><![cdata[ window.alert(this.gr...
Getting Started with Firefox Extensions - Archive of obsolete content
sitory (amo) holds an extensive number of extensions with a wide variety of functions: content filtering (adblock plus, noscript), web application interaction (delicious bookmarks, ebay companion) and web development (dom inspector, firebug). these are very advanced and complex extensions, and you'll learn most of what it takes to create extensions like these. extensions now exist in 3 different
forms: add-ons sdk extensions (also known as jetpacks), bootstrapped extensions and traditional extensions. if you're only getting started developing add-ons, the add-ons sdk provides a great way to quickly create simple ones and build on them. this tutorial focuses on traditional extensions, which are created differently. bootstrapped extensions are a step above traditional ones in complexity, so you...
...d "hello world!". if you open the menu and then the menu item below, you'll see a nice alert message (for some definitions of 'nice'). click on the ok button to close it. that's all the extension does. now let's take a closer look at it. extension contents you may have noticed that the extension file you installed is named xulschoolhello1.xpi. xpi (pronounced "zippy") stands for cross-plat
form installer, because the same installer file can work on all plat
forms firefox supports. xpis are simply zip files, but firefox recognizes the xpi extension and triggers the installation process when an xpi file is loaded. to look into the xpi file you need to download it first, not install it. if the server triggers an install when clicking on a link or button, what you need to do is right click ...
XUL School Tutorial - Archive of obsolete content
the project is now published here following its sharing licenses. its contents have been modified from the original s...
...m xul elements with xbl mozilla documentation roadmap useful mozilla community sites appendices appendix a: add-on per
formance appendix b: install and uninstall scripts appendix c: avoiding using eval in add-ons appendix d: loading scripts appendix e: dom building and html insertion appendix f: monitoring dom changes the xul school project was developed by appcoast (
formerly glaxstar). the project is now published here following its sharing licenses. its contents have been modified from the original source as necessary. ...
Updating addons broken by private browsing changes - Archive of obsolete content
notifications: private-browsing private-browsing-cancel-vote private-browsing-change-granted private-browsing-transition-complete then your addon will require updating to correctly support the new per-window private browser feature in firefox 20 (and will require updating to work correctly in releases of firefox since the ones listed). idls nsitransferable: see using the clipboard for in
formation about the new init method. imgicache: this must no longer be obtained as a service. see the imgicache article for more in
formation. moziasyncfavicons/nsifaviconservice: setandfetchfaviconforpage/setandloadfaviconforpage now take a required privacy status argument, either nsifaviconservice.favicon_load_private or nsifaviconservice.favicon_load_non_private. nsiwebbrowserpersist: saveu...
... nsicontentprefservice: getpref, setpref, haspref, hascachedpref, removepref, removegroupedprefs, removeprefsbyname, getprefs, and getprefsbyname all take a required nsiloadcontext argument to indicate the privacy status of the pref in question. ...
Creating reusable content with CSS and XBL - Archive of obsolete content
this page illustrates how you can use css in mozilla to improve the structure of complex applications, making code and resources more easily reusable. note: xbl cannot be loaded over http, so this technique is only useful for local content accessed using the file:/// scheme, or from add-on code. you apply this technique in a simple demonstration. in
formation: xbl bindings the structure provided by markup languages and css is not ideal for complex applications where parts need to be self-contained and reusable. you can place stylesheets in separate files, and you can place scripts in separate files. but you must link those files from the document as a whole. another structural limitation concerns content. you can use css to provide content for selected elements, but the content is limited t...
...e selected element. mozilla provides a mechanism that overcomes these limitations: xbl (xml bindings language). you can use xbl to link selected elements to their own: stylesheets content properties and methods event handlers because you avoid linking everything at the document level, you can make self-contained parts that are easy to maintain and reuse. more details for more in
formation about xbl bindings, see the xbl page in this wiki. action: an xbl demonstration make a new html document, doc6.html. copy and paste the content from here: <!doctype html public "-//w3c//dtd html 4.0//en"> <html> <head> <title>mozilla css getting started - xbl demonstration</title> <link rel="stylesheet" type="text/css" href="style6.css"> </head> <body> <h1>xbl demonstration</h1> <d...
XUL user interfaces - Archive of obsolete content
mozilla overcomes this limitation by providing a specialized language for creating user interfaces: xul (xml user-interface language, usually pronounced like "zool"). in xul, many common user interface features are built in. ...
...mple, xul provides specialized windows like dialogs and wizards, as well as status bars, menus, tool bars, and even browsers. more specialized features can be built from parts by using xul together with other technologies that you have seen in this tutorial: css style, javascript code, and xbl bindings. like other xml-based languages, xul uses css stylesheets. more details for more in
formation about xul user interfaces, see the xul page in this wiki. action: a xul demonstration make a new xul document as a plain text file, doc7.xul. copy and paste the content from here, making sure that you scroll to get all of it: <?xml version="1.0"?> <?xml-stylesheet type="text/css" href="style7.css"?> <!doctype window> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there...
Case Sensitivity in class and id Names - Archive of obsolete content
note: this reprinted article was originally part of the devedge site. ...
...it is doubly important to ensure that your class and id names are of a consistent case throughout a document, and that you do not attempt to define names which are case-insensitive matches. related links html 4.01, section 7.5.2 html 4.01, section 12.2.3 original document in
formation author(s): eric a. meyer, netscape communications last updated date: published 05 mar 2001 copyright in
formation: copyright © 2001-2003 netscape. note: this reprinted article was originally part of the devedge site. ...
Install.js - Archive of obsolete content
er only, you don't need install.js, you need an install.rdf instead. see also this article from xulplanet's main tutorial. there is a different sample install.js template located at http://downloads.mozdev.org/xsidebar/mods/. this version has been developed as part of the effort to port firefox extensions to seamonkey from the xsidebar project. pros: this version consolidates all the changable in
formation at the top of the file. and it also knows how to install packaged components, search engines and default preferences. cons: code is bloated since it has to cater for several different ways an extension author can package the .jar file contained in the .xpi file. xpi file structure you can use the code below (taken from pike's extensions ). it assumes the following structure of your xpi file...
... regpath = 'locale/' + this.extlocalenames[locale] + '/' + this.extshortname + '/'; install.registerchrome(install.locale | installtype, jarpath, regpath); } // register skins for (var skin in this.extskinnames) { var regpath = 'skin/' + this.extskinnames[skin] + '/' + this.extshortname + '/'; install.registerchrome(install.skin | installtype, jarpath, regpath); } // per
form install var err = install.per
forminstall(); if (err == install.success || err == install.reboot_needed) { if (!this.silentinstall && this.extpostinstallmessage) { install.alert(this.extpostinstallmessage); } } else { this.handleerror(err); return; } }, parsearguments: function() { // can't use string handling in install, so use if statement instead var ar...
How Thunderbird and Firefox find their configuration files - Archive of obsolete content
likewise, firefox uses a similar file, located in %appdata%\mozilla\firefox\profiles.ini. the value contained in this key is a litteral value, no variables (such as %userprofile%/mozprofile) allowed. we chose to point this to the user's home directory (h:\thunderbird). ...
...cally created by mozilla on first start. unlike mozilla's binary registry.dat file, thunderbird's and firefox' profiles.ini file is a readable text file. here is an example of what this may look like: [general] startwithlastprofile=1 [profile0] name=default isrelative=1 path=profiles/default.uda if you want to point this to a location of your choice (for example h:\thunderbird), you need to per
form to changes: set isrelative to be 0 update the path to point to the desired place. note: for absolute paths thunderbird uses dos'ish backslashes (\) rather than unixish slashes (/). you'd obtain a file such as the following: [general] startwithlastprofile=1 [profile0] name=default isrelative=0 path=h:\thunderbird a discussion about this file can be found here ...
Adding the structure - Archive of obsolete content
it can contain both text messages (i.e. "done" in mozilla when a document finishes loading) and graphical messages (f.e. the lock icon in mozilla that shows whether or not a loaded document was encrypted with ssl). status bars comprise a series of panels, each one defined by a statusbarpanel xul element. each status bar panel displays ...
...cation's state can be displayed. it can contain both text messages (i.e. "done" in mozilla when a document finishes loading) and graphical messages (f.e. the lock icon in mozilla that shows whether or not a loaded document was encrypted with ssl). status bars comprise a series of panels, each one defined by a statusbarpanel xul element. each status bar panel displays a different kind of status in
formation. graphical panels (like the one we are creating here that displays an icon) are given the statusbarpanel-iconic class so they can be styled accordingly by the css stylesheet that defines these elements' appearance. the status attribute is not part of the xul definition for the statusbarpanel element, but is used by our extension to store the current tinderbox state. we'll update the value o...
Tinderbox - Archive of obsolete content
tinderbox is a web tool for tracking the status of the mozilla source code. it consists of a set of client machines that continuously build and test mozilla and report their results back to a server that makes those results available via a web page. the tool enables mozilla.org to be immediately notified of changes to the code that prevent mozilla from compiling and running (or compromise per
formance and footprint) so they can get someone to fix the problem or reverse the changes. mozilla engineers regularly check tinderbox before changing the code because changes are prohibited while the codebase is broken. the mozilla sheriff, a rotating position responsible for watching the code and getting engineers to fix breakage, checks tinderbox even more regularly. while it isn't difficult to loa...
...engineers to fix breakage, checks tinderbox even more regularly. while it isn't difficult to load the tinderbox web page or sidebar, it would be useful to have an even quicker way to check tinderbox that doesn't require going to a web page, changing sidebars, or even having the sidebar open. although there are multiple tinderbox clients machines doing different kinds of builds (f.e. different plat
forms), most people only care about the overall situation, i.e. whether or not any clients have failed. by checking for build failures first and test failures second, we make sure to show users the worst possible situation, i.e. if any clients have failed to build, we will display a red icon that signifies a build failure; if all clients built successfully but some failed tests we will display an oran...
Creating a Release Tag - Archive of obsolete content
and macintosh that aren't pulled by the normal script and need to be pulled by hand. the mini-branch is created so you can check in the build scripts with the necessary changes without touching the original branch. check out mozilla from the branch you want to tag. remember to also check out extra mac and win32 files that aren't normally checked out on linux or the tag won't build on those plat
forms. cvs co -r netscape_6_2_release mozilla/client.mk cd mozilla gmake -f client.mk checkout create a mini branch for the pull scripts on all three plat
forms so we can change them without changing anything on the original branch. cd .. cvs tag -b mozilla_0_9_4_1_release_mini_branch mozilla/client.mk delete the existing build scripts and repull them from the mini-branch you just c...
... build scripts find the variables defining the branch and change it from the branch you originally pulled from to the new tag you are creating. mozilla/client.mk check the build scripts back in to the mini-branch. cvs ci mozilla/client.mk create the tag. find . -type d \! -name cvs | xargs -l -p10 cvs tag -l mozilla_0_9_4_1_release >& ../taglog original document in
formation author(s): dawn endico last updated date: november 1, 2005 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Dehydra Object Reference - Archive of obsolete content
e parameter has a default value, e.g. void foo(int i = 42). aggregate types (class/struct/union/enum) this type object represents aggregate types in gcc. property type description .kind string one of "class", "struct", "union", or "enum". .isincomplete boolean flag the type was forward-declared and the full declaration has not been processed. .bases array of objects inheritance in
formation about the class. each member of the array has the following properties: { access: 'public' | 'protected' | 'private', type: type object representing the base class } .members array of variable objects an array containing all the member variables and methods. note: the .members will not include static member functions. .template template object the template from which this class ...
...ord template objects property type description .name string the name of the template, for example "nscomptr". .arguments array an array where arguments are either strings representing c++ constants or type objects. location objects location objects are passed to builtin functions such as warning() and error() to specify the location of the message. they convert to a string of the
form "file:line:column". they have the following properties: property type .file string .line integer .column integer (optional) ...
Download Manager improvements in Firefox 3 - Archive of obsolete content
r interface by implementing the new nsidownloadmanagerui interface. note: these changes will require some modest revisions to code using the download manager; several methods have had minor changes. download manager interfaces nsidownloadmanager gives applications and extensions access to the download manager, allowing them to add and remove files to the download list, retrieve in
formation about past and present downloads, and request notifications as to the progress of downloads. nsidownload describes a file in the download queue; these files may currently be queued for download, actively being downloaded, or finished being downloaded. nsidownloadprogresslistener applications and extensions implement this interface to be made aware of changes in th...
...n the status of downloads. nsidownloadmanagerui implement this interface to replace or augment the download manager user interface. other download manager documentation download manager preferences this article lists preferences used by the download manager as well as their default values. the download manager schema this article describes the database
format used to store and track in
formation about each download. examples monitoring downloads an example showing how to use the new download manager apis to create a download log window that shows all past and present downloads and their status, including the start and end times of the downloads, the download speed, and more. also demonstrates the storage api. ...
Download Manager preferences - Archive of obsolete content
on; 1 indicates that completed and canceled downloads should be removed on quit; 2 indicates that downloads should never be removed automatically. in firefox and seamonkey the default value is 2. in thunderbird the default value is 1; if the preference is missing, the value 0 is used. browser.download.manager.scanwhendone a boolean value that indicates whether or not to per
form virus scans after downloads are complete. on windows xp sp2 and windows vista, this value also indicates whether downloaded files trigger a security warning upon launch. default value is true. browser.download.manager.showalertinterval the minimum number of milliseconds that must elapse between download complete alerts; if two downloads complete within this amount of time, only on...
... browser.download.folderlist indicates the default folder to download a file to. 0 indicates the desktop; 1 indicates the systems default downloads location; 2 indicates a custom (see: browser.download.dir) folder. in firefox 3 and earlier, the default is 0 (except on windows vista, where it's toggled to 1 on initial launch). in firefox 3.5 and seamonkey, the default is 1 on all plat
forms. for thunderbird, the default is 0. see also nsidownloadmanager nsidownload nsidownloadmanagerui ...
Embedding FAQ - Archive of obsolete content
however, there is a stripped down, uncommented code with eclipse libraries in this thread. ...
...however, there is a stripped down, uncommented code with eclipse libraries in this thread. ...
Error Console - Archive of obsolete content
r the browser console for chrome content. the error console is a tool available in most mozilla-based applications that is used for reporting errors in the application chrome and in web pages user opens. it reports javascript-related errors and warnings, css errors and arbitrary messages from chrome code. in firefox, the error console can be opened from the tools menu or by ctrl-shift-j. for in
formation about what javascript exceptions get logged into the error console, and how to make all exceptions get logged, read the article exception logging in javascript. see setting up extension development environment#development preferences for the preferences you should set if you want to see errors from firefox and extensions in the error console. before gecko 1.8.1 (firefox 2), it was called ja...
...x 2), it was called javascript console (see bug 265871). types of errors error usually a syntax error that prevents the program from compiling. warning usually lets the program compile but warns of bad coding and suggests design flaws. message very similar to warning, used very rarely. manipulating data displayed in error console in
formation displayed in error console can be accessed and manipulated through the console service. extensions can write to the error console from javascript using components.utils.reporterror, or if you're fine with logging to the os-provided console, dump(). to bring up error console from within a browser or mail window, use the function tojavascriptconsole(). alternatives ...
Downloading Nightly or Trunk Builds - Archive of obsolete content
e terms. this usage may change. cutting edge firefox downloads. as a development organization, the mozilla community tends to describe things from the bottom up. so to figure out how to download a cutting edge or bleeding edge or 'beta' version of firefox, you need to look for a "build" (which is developer-speak for the packaged files you can download) of 1.9.1 (the number of the underlying 'plat
form' called 'gecko' or 'mozilla' that firefox uses). as it turns out there is a plat
form number for every firefox number, but they are not the same number. firefox 3.0 corresponds to mozilla 1.9.0; firefox 3.5 corresponds to mozilla 1.9.1; firefox 3.6 corresponds to mozilla 1.9.2. however, the numbers are not used all of the time. sometimes the firefox releases are described by a code name. for exa...
...an be a tester, you don't need to get approval before you can start testing. when people talk of "nightlies", they often mean "trunk nightlies", though there exist also "branch nightlies" which are somewhat less buggy but also not as "newest & greatest". for instance, one may use a thunderbird "branch nightly" as one's main e-mail client. note that nightly builds may not be created for every plat
form for every night. if one has questions about the way a particular nightly was built, the best way to get that in
formation is to download the executable, launch it, and then go to the "about:buildconfig" page, by typing this into the location bar. this should provide all the build flags and configuration settings used for building this executable. nightly builds can be downloaded from https://arch...
Code snippets - Archive of obsolete content
all of the in this page must be executed in a chrome-privileged console. to access a chrome-privileged console, open an about page (like about:about) then open a web console via the web developer menu. tabs from other computers this snippet shows how to load all tabs from other computers. components.utils.import("resource://services-sync/main.js"); // obtain a reference to the main firefox window. ...
... " + id); } get a count of the number of members of a collection on the server let collection = "passwords"; components.utils.import("resource://services-sync/main.js"); components.utils.import("resource://services-sync/resource.js"); json.parse(new resource(weave.service.storageurl + collection).get()).length; dump the cleartext of each record in a collection to the console. ...
Firefox Sync - Archive of obsolete content
nts communicate through it. firefox home an ios application that functions as a sync client. mozilla server instance an instance of the server deployed and maintained by mozilla. if you use sync in your browser, this is what it talks to by default. specifications there are numerous specifications concerning sync. ...
... for client-server interaction storage
formats used by the the clients cryptographic model for encrypting client data the definitive source for these specifications is http://docs.services.mozilla.com/. running a server it is possible to run your own sync server instance. full instructions are available at http://docs.services.mozilla.com/howtos/run-sync.html. getting involved and status for in
formation on the current development status of sync including how to get involved, see https://wiki.mozilla.org/services/sync. related info javascript client api (useful for interacting with sync from mozilla applications, including developing extensions against sync) syncing custom preferences (useful for extension developers) code snippets (demonstrates common actions with the javascript api) ...
GRE - Archive of obsolete content
lications to locate a compatible gecko runtime and embed it without knowing in advance where that runtime will be installed. this document describes how embedders should dynamically link to a gre. to understand how gres are registered, see gre registration. the xre project, which means "xul runtime environment", has been replaced by xulrunner. mozilla suite: the old gre there are two different
forms for the gre: the "old" gre was part of the mozilla application suite. it was installed with the windows installer of mozilla 1.4 through 1.7.x. there was never an official gre shipped for linux, but various distributors such as red hat have registered mozilla installations as if they were a gre. the mozilla suite never supported a gre on mac. xulrunner: the new gre xulrunner is the new version...
..., but various distributors such as red hat have registered mozilla installations as if they were a gre. the mozilla suite never supported a gre on mac. xulrunner: the new gre xulrunner is the new version of the gre, which not only allows embedding but is capable of bootstrapping entire xul applications such as firefox. xulrunner supports or is planned to support embedding on all three major plat
forms (windows, mac, and linux). finding and using a gre from application code avoid linking directly against xpcom.dll if an application wishes to use the gre, it must take careful steps to ensure that it links against the proper libraries. if you link directly against xpcom.dll/libxpcom.so (xpcom.lib import lib), your application will not launch unless xpcom.dll is in your path. this prevents dyn...
Gecko Coding Help Wanted - Archive of obsolete content
eptively easy. so we've compiled a list of pointers —from the experts. there's plenty to do, and we sure could use the help. here are some fixes that are straightforward; they just need some time and attention: decomtamination convert weird, ugly and inefficient method signatures to more natural c++ method signatures. it's really improved code readability, reduced code size, and sped up per
formance. it's kind of tedious but it's extremely valuable and will help you learn the way around the codebase. we've done a lot, but there's a lot more to do. roc is willing to work closely with anyone with reasonable c++ experience to get them started on this. just send him mail. not up for coding yet? join the gecko bugathon and help save gecko engineers from imminent doom! original document i...
...nce. it's kind of tedious but it's extremely valuable and will help you learn the way around the codebase. we've done a lot, but there's a lot more to do. roc is willing to work closely with anyone with reasonable c++ experience to get them started on this. just send him mail. not up for coding yet? join the gecko bugathon and help save gecko engineers from imminent doom! original document in
formation author(s): fantasai last updated date: may 4, 2004 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Introducing the Audio API extension - Archive of obsolete content
and removed from gecko 31. you should use the web audio api instead. reading audio streams the loadedmetadata event when the metadata of the media element is available, it triggers a loadedmetadata event. this event has the following attributes: mozchannels: number of channels mozsamplerate: sample rate per second mozframebufferlength: number of samples collected in all channels this in
formation is needed later to decode the audio data stream. the following example extracts the data from an audio element: <!doctype html> <html> <head> <title>javascript metadata example</title> </head> <body> <audio id="audio-element" src="song.ogg" controls="true" style="width: 512px;"> </audio> <script> function loadedmetadata() { ...
...e audio samples. users must create an audio object and then use the mozsetup() function to specify the number of channels and the frequency (in hz). for example: // create a new audio element var audiooutput = new audio(); // set up audio element with 2 channel, 44.1khz audio stream. audiooutput.mozsetup(2, 44100); once this is done, the samples need to be created. those samples have the same
format as the ones in the mozaudioavailable event. then the samples are written in the audio stream with the function mozwriteaudio(). it's important to note that not all the samples might get written in the stream. the function returns the number of samples written, which is useful for the next writing. you can see an example below: // write samples using a js array var samples = [0.242, 0.127, 0.0,...
Metro browser chrome tests - Archive of obsolete content
ve using javascript. it currently allows you to run javascript code in the same scope as the immersive browser and report results using the same functions as the mochitest test framework. running the metro browser chrome tests to run mochitest, first build mozilla with your changes; then run ./mach mochitest-metro this will launch metro browser chrome tests in the default immersive browser. for in
formation on setting your local build as the default, visit the windows 8 integration wiki page. it is possible to run individual tests as well. as with mochitest, the path given as an argument is the path to a test file within the mozilla source tree. if the path points to the root tests directory, then all metro browser chrome tests will be run. for example, to run a specific test the command would ...
...t() will be caught and reported as a general failure. setup(), teardown(), and run() each have individual exception handlers to prevent one method from interfering with the execution of another. an exception in any of these methods will cause a test failure. additional built-in framework test checks will run after the completion of each individual test insuring tests clean up properly. for more in
formation on test execution see the main test exectuon loop in head.js. adding a new browser chrome test to the tree to add a new metro browser chrome test add the test file to the browser_tests variable in /browser/metro/base/tests/mochitest/makefile.in. your test file name must be prefixed with "browser_", and must have a file extension of ".js". files that don't match this pattern will be ignored b...
LIR - Archive of obsolete content
in nanojit, lir is the source language for compilation to machine code. lir stands for low-level intermediate representation. it is a typed assembly language. the lir instruction set is best learnt by reading nanojit/liropcode.tbl. code for manipulating lir is in nanojit/lir.h. nanojit lir instruction cheat sheet.also in pdf
format see attachment. category op code code name return type featured description miscellaneous 0 start void start of a fragment 1 regfence void a register fence causes no code to be generated, but it affects register allocation so that no registers are live when it is reached. 2 skip void links code chunks. 3 parami integer 32 bit load an int parameter (register or stack location). 4 paramq ...
... its operand is always a lir_calli, but one that specifies a function that returns a double. it indicates that the double result is returned via two 32-bit integer registers. the result is always used as the second operand of a lir_ii2d. ...
How to Write and Land Nanojit Patches - Archive of obsolete content
adobe and mozilla share a copy of nanojit. ...
...t passes testing, file the patch to bugzilla (file a bug under the "nanojit" component in the "core" product) and get a review. generally, patches by mozilla people should be reviewed by adobe people and vice versa. once it passes review, land it on nanojit-central, mark the bug's whiteboard as fixed-in-nanojit, and note the revision in a comment. (note that nanojit-central revision urls have the
form http://hg.mozilla.org/projects/nanojit-central/<revid>, ie. there is a projects/ subdir in there. you might find it easier to just cut-and-paste links from the commit log.) you're done, but watch the nanojit tinderbox for breakage. scenario 2: creating an external patch write and test the patch, as in scenario 1 above. split the patch into three parts: nanojit, tracemonkey, tamarin. file the...
Plug-n-Hack - Archive of obsolete content
overview plug-n-hack (pnh) is a proposed standard from the mozilla security team for defining how security tools can interact with browsers in a more useful and usable way. security researchers commonly use security tools in conjunction with browsers, but until now direct integration has required writing plat
form and browser specific extensions. configuring a browser to work with a security tool can be a non-trivial process, and this can discourage people with less experience from using such tools. this can include application developers and testers, exactly the sort of people we would like to use these tools more! for example, to configure a browser to use an intercepting proxy that can handle https traffic, the user must typically: configure their browser to proxy via the tool c...
...ia their corporate proxy import the tool’s ssl certificate into their browser if any of these steps are carried out incorrectly then the browser will typically fail to connect to any website – debugging such problems can be frustrating and time-consuming. without integration between security tools and browsers, a user must often switch between the tool and their browser several times to per
form a simple task, such as intercepting an http(s) request. pnh allows security tools to declare the functionality that they support which is suitable for invoking directly from the browser. a browser that supports pnh can then allow the user to invoke such functionality without having to switch to and from the tool. while some of the pnh capabilities do have a fixed meaning, particularly around prox...
Styling - Archive of obsolete content
prism allows for some client-side web application styling. the web application bundle is allowed to hold a css file named webapp.css (called the webapp style). this file will be loaded into the web application content stylesheet and can override the web application's native styles. simply add the webapp.css to the bundle and it will be injected into the web application, regardless of the plat
form or os. it is also possible to create plat
form-specific styles. in this scenario, the css file is specific to an os. this allows prism webapps to take on an os-specific look. to use plat
form-specific styles, create a folder in the bundle archive for each supported os and place a webapp.css file in the folder. the folder names must match the following: windows - winnt mac os x - darwin linux - ...
... ...
Same origin policy for XBL - Archive of obsolete content
ipal of the element node involved (meaning the <style> element or the element whose style attribute is being looked at). for the nsidomdocumentxbl interface's nsidomdocumentxbl.addbinding() and nsidomdocumentxbl.loadbindingdocument() methods, the originating principal is the one of the script making the call, or the principal of the document the call is made on if there isn't a script. checks per
formed once the originating principal is determined, checks are done to make sure the load should be allowed. the checks per
formed are: if the principal originating the load is the system principal, the load is allowed. a call to checloaduriwithprincipal() is done to make sure the principal is able to link to the given uri in the first place. a content policy check is per
formed. if the uri is a chrom...
...tem principal, the load is allowed. a call to checloaduriwithprincipal() is done to make sure the principal is able to link to the given uri in the first place. a content policy check is per
formed. if the uri is a chrome: uri, the load is allowed. note that step 2 already denied the load attempt for cases in which the chrome: uri isn't accessible to untrusted content. a checkmayload() check is per
formed on the originating principal for the given uri. if the checkmayload() check passes, the load is allowed. ...
File object - Archive of obsolete content
ng the compilation of your spidermonkey engine. if you are building a standalone version of spidermonkey (see: spidermonkey build documentation), this variable can be added on the make command line, like so: cd mozilla/js/src make -f makefile.ref js_has_file_object=1 alternatively, if you are building a larger product (such as a browser) and want to include the file object, you may need to per
form minor makefile surgery. summary non-standard server-side object this object lets you work files and directories on the local filesystem, and create os pipelines. creating a pipeline involves spawning arbitrary processes; this means that giving a script access to the file object is exactly equivalent to giving the script access to the unix shell or dos command interpreter. filesystem access is...
...ate from december 1998: http://www.mozilla.org/js/js-file-object.html created by the file constructor: new file(); new file(filename); parameters filename name of the file we want to work with. directories and pipelines are considered special files. pipelines either begin or end with the pipe (|) symbol. description filenames are specified as strings that have an implementation defined
format. use of standard "file:" urls is encouraged. if no argument is supplied to the constructor, the current working directory is the file object that is returned. examples of possible prefix strings are "/" to indicate the unix root directory, "c:" to specify a windows drive letter, and "file:" to indicate a file url. when a file is constructed, leading and trailing spaces are removed from the fi...
Table Layout Regression Tests - Archive of obsolete content
it is unclear whether or how well rtest continues to work and whether it is still used or not. subject overview changes in layout, parser and content code can have unintended side effects, also known as regressions. it is good style to check for these unwanted regressions and fixing them before checkin rather than causing bugzilla avalanches. ...
...tes 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. please contact if you need help with running those tests. i would like to thank chris karnaze for his guidance and fantasai for her language support. original document in
formation author(s): bernd mielke other contributors: boris zbarsky last updated date: february 5, 2007 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
The Download Manager schema - Archive of obsolete content
the download manager uses an sqlite table to keep track of downloads in progress as well as queued and past downloads. the table is kept in a database file named "downloads.sqlite", in a table called "moz_downloads". the current database schema version is 8. this in
formation is available using nsidownloadmanager methods to retrieve nsidownload objects for each download entry; however, if you feel like poking directly into the table, you can do so using the storage api. the schema table field name type description id integer a unique id for the download. this field is the primary key for the table. name text the download's file name. source text the source uri for the download. target text the destination ur...
... integer the download's start time. endtime integer the download's end time. state integer the download's current state. see the constants list in the nsidownloadmanager documentation. referrer text the referrer for the download. entityid text the entity id from the nsiresumablechannel used to implement the download channel. this in
formation is used to resume the download after it's been paused. currbytes integer the current number of bytes that have been downloaded. defaults to 0, may not be null. maxbytes integer the total number of bytes that need to be downloaded. defaults to -1, may not be null. mimetype text the mime type of the file. preferredapplication text the...
TraceVis - Archive of obsolete content
tracevis is a per
formance visualization system for tracemonkey. if tracemonkey is built with tracevis, and run with tracevis enabled, then tracemonkey will output a log of all its activity transitions. the log can be postprocessed into a visualization that can be used to rapidly diagnose many tracing-related per
formance issues. so far, most of the documentation on tracevis is contained in the announcement blog post. prerequisites the visualization scripts require pil (python imaging library). building with tracevis these are the steps to build a js shell with tracevis, starting from a mozilla source directory. these directions create an optimized build, because optimized builds are usually better for per
formance analysis. cd js/src autoconf213 mkdir opt-tracevis cd opt-tracevis ../conf...
...s/src/tracevis. text summary python binlog.py /tmp/tracevis.log this prints a summary of the log. the first part lists the time tracemonkey spent in each major tracing activity. the second part lists the reasons tracemonkey transitioned to the interpreter, and the amount of interpreter time charged to each reason. visualization python vis.py /tmp/tracevis.log /tmp/tracevis.png this creates a png
format visualization of tracemonkey activities. there is a color for each activity. time goes forward down each column of pixels, then to the column on the right. the blog post linked above has examples of this output and how to analyze it. ...
Venkman Internals - Archive of obsolete content
notes on venkman source code. as with any complex application, aspects of the design may not be clear for new readers of the source. these notes are written by such readers: as you learn please correct any errors. questions why can't breakpoints be set on some source lines some of the time? sometimes the source has small ticks in the margin for every executable line in my javascript. sometimes these ticks are missing on some or all lines of a file. only lines with tick marks seem to break point properly. venkman asks the js engine which lines are executable. it will mark these with a "tick" as you call it. if the file is not currently loaded, the js engine doesn't know anything about the file. ...
...sg_alert. venkman-utils.js defines the dd debug dump and friends windowrecord representation of the open windows. filecontainerrecord - list of script tags found in the parent record's window.document property. to obtain the antecedent files: doc.getelementsbytagname("script"); then extract the urls from the src attributes. scriptwrapper newsgroup, 2002, rgrinda here is a bit more in
formation about how venkman tracks files and functions... a scriptwrapper is a pure js object defined only inside venkman. as you pointed out, there is a 1:1 relationship between scriptwrappers and functions. scriptwrapper has-a jsdscript property, which is an object which supports the jsdiscript interface. jsdiscript is a lower level access to the function than the scriptwrapper. in order to set a br...
When To Use ifdefs - Archive of obsolete content
rent code what are ifdefs ifdefs are conditional directives to a text preprocessor which mark that certain blocks of code are used only in certain conditions. in this document, the term is used more loosely to discuss any kind of conditional that differentiates between different build configurations. ...
...eprocessor which mark that certain blocks of code are used only in certain conditions. in this document, the term is used more loosely to discuss any kind of conditional that differentiates between different build configurations. when are ifdefs used? there are three major kinds of ifdefs in use in the mozilla tree: plat
form/widget ifdefs, feature ifdefs, and application-specific ifdefs: plat
form/widget ifdefs the mozilla code will frequently need to differentiate between code for different plat
forms or widget sets. these ifdefs are generally always acceptable. the only time when they might be a problem is in cross-plat
form extension code and locales: since this code is downloaded on multiple plat
forms, plat
form-specific ifdefs are generally out of the question. for an example of platfor...
Binding Attachment and Detachment - Archive of obsolete content
equently discarded as redundant and not implemented. var checkbox = document.getelementbyid("mycheckbox"); checkbox.style.mozbinding = "url(http://www.mozilla.org/xbl/htmlbindings.xml#checkbox)"; this attachment is not necessarily synchronous. scripts that invoke this method should not assume that the binding is installed immediately after this method returns. see binding documents for more in
formation. when a binding is attached using the dom, it inherits from the current most derived binding that may already be attached to the element. any bindings attached to an element will remain on the element until the element is destroyed or the corresponding style rule is removed. if a binding is attached and it already specifies an inherited binding using the extends attribute, then the base bi...
...he binding is destroyed. methods and properties with getters/setters are no longer accessible from the binding, although properties with raw values remain. any specified event handlers are unhooked from their respective targets. a binding can specify a <destructor> block within <implementation> section that executes prior to the binding detachment. using a <destructor> block, a binding can per
form any necessary cleanup before it is torn down. bindings in an inheritance chain are always detached from the most derived binding to the base. therefore the <destructor> block of the derived binding will execute, and then the base binding's block will execute. when bindings attached through style are detached because of a style change, they have no effect on any other bindings attached using the...
XBL 1.0 Reference - Archive of obsolete content
ew methods and properties that become accessible from the bound element, and anonymous content that is inserted around the bound element. there are numerous adjustments in the current implementation in comparison of earlier xbl proposals, and not all of them are reflected yet in this document. the documentation process is still in progress: please keep it in your mind while using the provided in
formation. xbl elements xbl 1.0 elements are in the http://www.mozilla.org/xbl namespace. bindings binding content children implementation constructor destructor field property getter setter method parameter body handlers handler resources stylesheet image binding attachment and detachment attachment using css attachment using element.style property <constructor> call <...
...e compact solution yet used here for demonstration purposes. ...
Install script template - Archive of obsolete content
// this block also invokes a function to write registry keys (plid) and checks return from key writing // this block invokes refreshplugins() to ensure that plugin and xpt are available for use immediately if (errblock1 == success) { // installation to the current browser was a success - this is the most important job of...
... you can also simply call refreshplugins() } else cancelinstall(errblock1); // plid solution -- write keys to the registry /** * function for secondary installation of plugin (firstinstall). * you should not stop the install process because ...
Install.addDirectory - Archive of obsolete content
install.adddirectory the install object's adddirectory method queues an entire directory for installation once per
forminstall is called. ...
... install.adddirectory the install object's adddirectory method queues an entire directory for installation once per
forminstall is called. ...
Windows Install - Archive of obsolete content
windows install example this example shows the installation of a xpi in which user profile in
formation is contained. note the disk space verification, the editing of the windows registry, the writing to the installation log, and the error checking before either per
forminstall or cancelinstall is called. // this function verifies disk space in kilobytes function verifydiskspace(dirpath, spacerequired) { var spaceavailable; // get the available disk space on the given path spaceavailable = filegetdiskspaceavailable(dirpath); // convert the available disk space into kilobytes spaceavailable = parseint(spaceavailable / 1024); // do the verification if(spaceavailable < spacerequired) { logcomment("insufficient disk space: " + dirpath); logcomment(" required : " + sp...
...t)) { setpackagefolder(fprogram); err = adddirectory("", "6.0.0.2000110801", "bin", // dir name in jar to extract fprogram, // where to put this file // (returned from getfolder) "", // subdir name to create relative to fprogram true); // force flag logcomment("adddirectory() returned: " + err); // check return value if(err == success) { err = per
forminstall(); logcomment("per
forminstall() returned: " + err); } else cancelinstall(err); } else cancelinstall(insufficient_disk_space); // end main ...
InstallVersion Object - Archive of obsolete content
he xpinstall api. the majority of this api is now deprecated and as of gecko 1.9 no longer available. extension, theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. in particular plugin developers should see how to package a plugin as an extension. ...
...ion. installversion you use installversion objects to contain version in
formation for software. overview this object and its methods are used both when triggering a download, to see whether a particular version needs to be installed, and when installing the software. the init() method associates a particular version with an installversion object, the tostring() method converts versions in various
formats to a string, and the compareto() method compares these string and indicates the relationship between the two versions. each of the version parameters is also available as a separate property of the installversion object. ...
cancelInstall - Archive of obsolete content
method of install object syntax void cancelinstall() void cancelinstall( int errorcode ) parameters none. returns an integer error code. the optional argument is an error code that can be returned to the triggering page. for most purposes, it's recommended that one of the standard return codes be used. but a script can, in fact, return any valid integer. for a list of possible values, and any custom errorcode created by install writer, see return codes. ...
... a script can, in fact, return any valid integer. ...
refreshPlugins - Archive of obsolete content
in list. returns nothing. description refreshplugins lets you register new plug-ins without having to restart the browser. when you use this method in an installation script, as the example below demonstrates, you can install new plug-ins and use them to display the requested media in a web page without interrupting the experience of the user. note that refreshplugins must be called after the per
forminstall method that initiates the actual installation. example // install dll into plugins // install xpt into components var xpisrc = "npmcult3dp.dll"; var xpisrc2 = "nsic3dpscriptablepeer.xpt"; initinstall( "cult3d plugin file", "@cycore.com/cult3d;version=1.0.0", "1.0.0"); setpackagefolder(getfolder("plugins")); addfile(xpisrc); addfile("",xpisrc2,getfolder("components"),...
... dll into plugins // install xpt into components var xpisrc = "npmcult3dp.dll"; var xpisrc2 = "nsic3dpscriptablepeer.xpt"; initinstall( "cult3d plugin file", "@cycore.com/cult3d;version=1.0.0", "1.0.0"); setpackagefolder(getfolder("plugins")); addfile(xpisrc); addfile("",xpisrc2,getfolder("components"),""); var err = getlasterror(); if (err == success) { err = per
forminstall(); if (err == success) refreshplugins(); } else cancelinstall(err); ...
Methods - Archive of obsolete content
displays a confirm dialog box with the specified message and ok and cancel buttons. also allows custom button labels and a checkbox. deleteregisteredfile deletes the specified file and its entry in the client version registry. execute extracts a file from the xpi file to a temporary location and schedules it for later execution. gestalt retrieves in
formation about the operating environment. (mac os only) getcomponentfolder returns an object representing the directory in which a component is installed. getfolder returns an object representing a directory, for use with the addfile method. getlasterror returns the most recent non-zero error code. getwinprofile constructs an object for working ...
...ct for working with the windows registry. initinstall initializes installation for the given software and version. loadresources returns an object whose properties are localized strings loaded from the specified property file. logcomment add a comment line to the install log. patch applies a set of differences between two versions. per
forminstall finalizes the installation of the software. refreshplugins refreshes the list of plug-ins registered for the browser. registerchrome registers chrome with the chrome registry. reseterror resets a saved error code to zero. setpackagefolder sets the default package folder that is saved with the root node. ...
WinReg Object - Archive of obsolete content
e how to package a plugin as an extension. winreg (windows only) windows developers use this object to manipulate the content of the windows registry. overview this object does not have a public constructor. instead, you construct an instance of this object by calling the getwinregistry method of the install object. this discussion assumes you are already familiar with the windows registry. for in
formation on it, see api documentation for windows nt or windows 95. when you construct a winreg object, it is set to operate with hkey_classes_root as its root key. to use a different root key, use the setrootkey method. typically values in the windows registry are strings. to manipulate such values, use the getvaluestring and setvaluestring methods. to manipulate other values, use the getvalue and s...
...et to operate with hkey_classes_root as its root key. to use a different root key, use the setrootkey method. typically values in the windows registry are strings. to manipulate such values, use the getvaluestring and setvaluestring methods. to manipulate other values, use the getvalue and setvalue methods. reading registry values is immediate. however, writing to the registry is delayed until per
forminstall is called. ...
XPInstall API reference - Archive of obsolete content
. ...
... winreg no properties methods createkey deletekey deletevalue enumkeys enumvaluenames getvalue getvaluenumber getvaluestring iskeywritable keyexists setrootkey setvalue setvaluenumber setvaluestring valueexists winregvalue constructor other in
formation return codes see complete list examples trigger scripts and install scripts code samples file.macalias file.windowsshortcut install.adddirectory install.addfile installtrigger.installchrome installtrigger.startsoftwareupdate windows install ...
XPJS Components Proposal - Archive of obsolete content
nager to do the registration. however, the xpjsmanager will pass the component manager its *own* filespec. so, at some future point some chunk of code will ask the component manager to create an object instance for some clsid (or progid). the component manager will load up the xpjsmanager's module and call the native nsgetfactory it finds there. that native nsgetfactory function will check the in
formation it stored in the registry to see that the js factory for the given clsid is in a given .js file. it will load that .js file (if not already loaded) and call the nsgetfactory function. our friend xpconnect will convert the js object returned from the js module's nsgetfactory function into an xpcom object. the component manager (and anyone else with a reference to that factory) can then call ...
...s into the module will force the xpjsmanager to load up a new instance of the .js file and start over. ...
XTech 2006 Presentations - Archive of obsolete content
baron a discussion of problems with existing standards and potential improvements in two areas: layout systems for user interfaces (rather than documents) and mechanisms for reordering content to allow the author to use good markup and appropriate layout. microsummaries in firefox and on the web - myk melez microsummaries are regularly-updated compilations of the most important and timely in
formation on web pages. this talk demonstrates how firefox will incorporate microsummaries into its ui, starting with bookmark labels. svg and canvas: graphics for web apps - vladimir vukićević this presentation examines some of the strengths and weaknesses of the html 'canvas' and svg for adding rich graphical capabilities to web applications. future browser graphics capabilities, both 2d and ...
...ark labels. svg and canvas: graphics for web apps - vladimir vukićević this presentation examines some of the strengths and weaknesses of the html 'canvas' and svg for adding rich graphical capabilities to web applications. future browser graphics capabilities, both 2d and 3d, are also discussed. converging rich-client and web application development with mozilla xulrunner (open office
format) - benjamin smedberg this presentation demonstrates the convergence of rich-client and web application development and discuss application deployment using mozilla xulrunner. etna, a wysiwyg xml relax ng- and gecko-based editor - daniel glazman this presentation describes etna, a new wysiwyg xml editor based on gecko, the relax ng parser and validator disruptive innovations implemented fo...
modifiers - Archive of obsolete content
shift: the shift key. alt: the alt key. on the macintosh, this is the option key. on macintosh this can only be used in conjunction with another modifier, since alt+letter combinations are reserved for entering special characters in text. ...
...ifier, since alt+letter combinations are reserved for entering special characters in text. meta: the meta key. on the macintosh, this is the command key. control: the control key. os: windows logo key on windows, super or hyper key on linux. this shouldn't be specified directly because it may conflict with system wide shortcut key. accel: the key used for keyboard shortcuts on the user's plat
form, which is control on windows and linux, and command on mac. usually, this would be the value you would use. access: the access key for activating menus and other elements. on windows, this is the alt key, used in conjuction with an element's accesskey. any: indicates that all modifiers preceding it are optional. ...
XUL Events - Archive of obsolete content
domnoderemoved this event is sent when a node is removed from an element. if you capture this event at the document level, you can be notified of document changes warning: it should be noted that the addition of any mutation event listeners to a document degrades the per
formance of subsequent dom operations in that document, and that removing the listeners later does not mitigate or reverse the effect. see mutation events for more details and mutation observers for a more efficient alternative. common xul events event description broadcast ...
...occurs when a command update occurs on a <commandset> element. you would use this to update the disabled status of its commands. attribute: oncommandupdate contextmenu this event is sent to an element when the user requests to open the context menu for the element. the action to do this varies by plat
form, but it will typically be a right click. this handler is usually used to dynamically set the commands on a menu when the user requests to display it, or you can use popupshowing event. returning false from this event handler prevents the popup from appearing. attribute: oncontextmenu drag the drag e...
Working With Directories - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file in
formation | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the plat
form (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. a reference to a directory may be created in the same wa...
..., "myfiles"); dir2.append("pictures"); dir2.append("vacations"); in this example, a subdirectory several levels down is referenced. each call to nsifile.append() navigates to a further subdirectory. the result is a subdirectory three levels below the desktop directory. these directories do not need to exist yet, but they can be created using nsifile.create(). see creating directories below for in
formation about this. note that nsifile.append() modifies the file object, rather than returning a new one. both files and directories are represented using the same kind of object so most of the functions available for nsifile will work for both. you can check if the object refers to a directory or a file by using nsifile.isdirectory(). this method returns true if a file object returned by nsiscripta...
Writing to Files - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file in
formation | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the plat
form (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. to write to a file, an output stream is used. an...
...the supplied value is larger than 8 bits, only the lowest significant 8 bits are written. write16 will write two bytes to the stream. write32 will write four bytes. writefloat will write a floating point value in four bytes. writedouble will write a floating point value in eight bytes. in this example, the write16 method is used to write the value 1000 in two bytes. the write32 method per
forms a similar operation except that the value 1000 is written using four bytes, padding the unused bits with zeroes. stream.write16(1000); stream.write32(1000); all values are read in big endian
form, which means that integers are stored in the file with their higher bits first. for the write16 and write32 methods, the values are always interpreted as unsigned values. if you want to write a negativ...
onFindAgainCommand - Archive of obsolete content
« xul reference home onfindagaincommand( findprevious ) return type: no return value call this method to handle your application's "find next" and "find previous" commands. ...
... « xul reference home onfindagaincommand( findprevious ) return type: no return value call this method to handle your application's "find next" and "find previous" commands. ...
ContextMenus - Archive of obsolete content
menu to apply to. one technique is to attach a context menu to an entire document area. for instance, the firefox browser applies a single context menu to the browser area which displays web pages. for example, the following will attach a context menu with the id 'contentareacontextmenu' to a browser element: <browser context="contentareacontextmenu"> indicating the default item on some plat
forms, one of the items in a context menu is marked as being a default operation. typically, this will cause the menuitem's label to appear in the context menu in bold. what constitutes the default item isn't specified, but is usually the operation carried out when the item was left-clicked or pressed normally, as opposed to context clicked. you can indicate this item, if it applies, using the default...
...e item was left-clicked or pressed normally, as opposed to context clicked. you can indicate this item, if it applies, using the default attribute. <menupopup id="link-menu"> <menuitem label="open link" default="true"/> <menuitem label="open in new window"/> <menuitem label="properties"/> </menupopup> the default attribute has been set to true on the first menu item ('open link'). on plat
forms that support it, it will be marked as a default item. on other plat
forms, the attribute will just be ignored and the menuitem will be displayed normally. naturally, it only makes sense to have one default item per context menu. note that the default attribute just affects how the item is displayed, it per
forms no other function itself. you will still need to associate code with the element to h...
Extensions - Archive of obsolete content
see firefox context menu for a list of the ids of the items found on the firefox context menu. showing and hiding context menu items to have a menuitem you have added be shown or hidden based on the context, you can use an event handler that listens for the popupshowing event. for instance, if an image was context clicked, you may wish to hide the menu item you have added if the operation it per
formed wouldn't apply to images. function init() { var contextmenu = document.getelementbyid("contentareacontextmenu"); if (contextmenu) contextmenu.addeventlistener("popupshowing", thumbnailsshowhideitems, false); } function thumbnailsshowhideitems(event) { var show = document.getelementbyid("thumbnail-show"); show.hidden = (document.popupnode.localname != "img"); } the init function ...
...es the menuitem with the id 'thumbnail-show' that was added by the extension and hides it if an image was not the target of the context menu. the popupnode property of the document holds the target of the context menu. for more details about hiding and showing items on a context menu, see hiding and showing menu items based on context. determining what element was context clicked for general in
formation about how to determine which element was the target of the context menu, that is, the element that was context clicked, see determining what was context clicked firefox uses its own popupshowing event listener to adjust the items on the context menu. this allows the menu to have different commands for different types of targets. while the popup is open, the gcontextmenu global variable is s...
MenuItems - Archive of obsolete content
nu> </menubar> the two menuitems are associated with a key using the key attribute. it should be set to the id of a key element within the same document. the result is that the items will display the shortcut key next to their labels. for the "open" item in this example, this command can be invoked by using the "accel" modifier key and pressing 'o'. the "accel" modifier key varies on each plat
form, but is the key typically used for shortcut keys. for instance, if the "accel" key is control, the menu might display "ctrl + o". although there isn't usually a need to do so, you can also set a custom label for the keyboard shortcut on the menu using the acceltext attribute. you might do this if the key associated with the item changes, for instance a list of open windows displayed on a window ...
...when disabled, the item will appear greyed out and the action associated with the item cannot be carried out. the command event will not fire when an item is disabled. to disable a menuitem that doesn't apply, set the disabled property to true. to renable the item again, set the disabled property to false again. you may wish to change the disabled state in a popupshowing event handler. for more in
formation about the popupshowing event, see the popupshowing event. if a menuitem is associated with a command, you can disable the menuitem by disabling the command instead. for instance, in the sample below, the delete command is disabled using the disabled attribute. <command id="cmd_delete" disabled="true" oncommand="alert('deleted!');"/> <menuitem label="delete" accesskey="f" command="cmd_delet...
PopupEvents - Archive of obsolete content
popup events there are several events related to popups and menus. an overview of these is listed below: contextmenu this event is fired when a request is made to open a context menu, whether by the keyboard or mouse. this event will be fired even for elements that don't have a context menu associated with them. for more in
formation about how to use this event, see context menu events. popupshowing this event is fired on a menupopup, panel or tooltip just before it is made visible. this event is most commonly used to add or adjust items on the popup based on the context. popupshown this event is fired on a menupopup, panel or tooltip once it is visible on screen. popuphiding this even...
...fy the menu as needed before it is displayed. for examples of the use of the popupshowing event when used with context menus, see hiding and showing menu items based on context. however, this technique can be applied to any type of popup. in this example, a label within a panel is initialized with the current time. <panel id="time-panel" onpopupshowing="this.lastchild.value = (new date()).tolocale
format('%t')"> <label value="time:"/> <label id="time"/> </panel> <toolbarbutton label="show time" popup="time-panel"/> you can prevent a menu or popup from appearing by calling the preventdefault method of the event from within a popupshowing listener. the default operation of the popupshowing event is to continue showing the popup. the preventdefault method will stop this from happening and t...
PopupKeys - Archive of obsolete content
the menu was open. for example, focusing a textbox and opening the textbox's context menu keeps the focus within the textbox. however, the capturing listener ensures that no key events reach the textbox while the menu is open. unlike with a menu, when a panel is opened, the focus is removed from any element that has it. this allows the focus to be shifted to elements within the panel. ...
...instead, you will have to handle this yourself. you would not normally use this attribute for a menu, however you may wish to disable the escape key handling for a panel in this way. ...
Tooltips - Archive of obsolete content
a toolbar button and waiting for a second can display a small popup label containing text describing the button's function. when the mouse is moved again, the tooltip disappears. this is a useful means of providing additional details about a user interface without cluttering up the main interface. note that tooltips can only be activated using the mouse, so they should never contain important in
formation that isn't available elsewhere. the tooltiptext attribute in most cases, the tooltip will display only a single label. for this, the tooltiptext attribute may be used, which is valid for all xul elements. the value of this attribute should be the text to appear in the tooltip. <toolbarbutton label="back" tooltiptext="go back one page"/> in this example, a back button on a toolbar is giv...
...will have a tooltip of its own. however, the close button does not have a tooltip associated with it, yet the parent toolbar does. the result is that the toolbar's tooltip will apply when the mouse is moved over the close button, as well as when the mouse is over an empty part of the toolbar. note that the tooltip text 'file buttons' isn't a good tooltip to use either. it conveys no additional in
formation to the user, so it shouldn't be used as in this example. the tooltip element tooltips are displayed using a tooltip element, which is a type of popup, but is styled to look different. elements that use the tooltiptext attribute display the tooltip in a default tooltip element, which typically looks like a small yellow box large enough to fit the text inside it. this default tooltip is crea...
Building Trees - Archive of obsolete content
d with trees—especially with large amounts of data—the template system supports a special builder just for creating trees. rather than generate content for every row in the tree, the results are stored in a list inside the builder. this means that dom nodes are not constructed for any of the items. this is much more efficient; creating large numbers of dom nodes adds a lot of overhead. the per
formance advantage is possible since trees only display text. as a result, the builder only has a few pieces of in
formation to keep track of. to use the tree builder, you need to add a flags attribute to the root node: <tree datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood" flags="dont-build-content"> the dont-build-content flag causes no content...
...ent. if you wish, you can also use the content builder for a tree. there may be situations that call for this, typically when handling smaller amounts of data. however, the content builder becomes slower as the amount of data increases. apart from the flags attribute, the template syntax for the tree builder and the content builder are identical. however, the tree builder requires a very specific
form to the action body. specifically, the action body should be a single treeitem with its rows and cells. here is an example (using an rdf source): <tree id="photoslist" flex="1" datasources="template-guide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos" flags="dont-build-content"> <treecols> <treecol id="name" label="name" flex="1"/> <treecol id="date" label="date" flex="1...
Filtering - Archive of obsolete content
use the same triple for each filter. when removing the filter, we only need to remove the triple from the query. this example only adds one triple, but you could add others, or add <member> elements. whether a triple or member is added or removed, the template must be rebuilt by calling the rebuild method. this method will remove all of the existing generated content, delete all of the internal in
formation pertaining to the results, and start again as if the template were just being examined for the first time. the template will be parsed again and the data examined for new results. you can view a complete example of this in action. a menulist is used to allow one to select either a specific country, or select all to show all of the photos. when a choice is made, the applyfilter function as sh...
...type of content is being created. in the previous example, we hard-coded a menulist with the list of countries, but we could also generate this list from the datasource. the same datasource may used for both the photos list and the menulist. even though the same datasource is used, it will only be loaded once and both templates will be notified when the data has loaded. we will need to add some in
formation to the datasource in order to specify the list of countries that are available. there are two possibilities. first, a separate seq could be added listing the countries. then, a simple <member> element can be used to iterate over it. or, we could use an rdf type to specify the countries. then, we could just look for all resources that were of the 'country' type. we'll use this method here sin...
Multiple Queries - Archive of obsolete content
tended queries in one template, although you may prefer to use the same style in all queries for consistency. however, if you are going to be using a number of queries, the template builder is more efficient when using multiple queries using the simple query syntax. this is because all simple queries will iterate over the same data, usually the children of an rdf container. so the builder only per
forms this step once and filters the data for each query. when using the extended query syntax, the manner in which the graph is navigated may be different for every query, so no optimization can be done. the builder needs to process every condition of every query. if, for example, you have six queries, each with a <member> condition, the builder will need to construct the children six times. you prob...
...hotos example we've been using, but you might for large datasets. thus, you will want to use the simple query syntax when possible. if you are only going to be using one query, it doesn't matter, of course. speaking of using a single query, the simple query syntax allows a slight shorthand. you can remove the <rule> element and place the rule's conditions directly on the <template>. there's no per
formance benefit, but it does save some typing. <hbox id="photoslist" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:dc="http://purl.org/dc/elements/1.1/"> <template dc:title="canal"> <button uri="rdf:*" image="rdf:*" label="view" orient="vertical"/> </template> </hbox> this example shows only a single photo since a condition is used ...
SQLite Templates - Archive of obsolete content
« previousnext » templates may use a datasource that is retrieved from an sqlite database, such as those used by the mozstorage api. this allows in
formation from the database to be used to generate xul content. to do this, set the querytype attribute on the root node of the template to the value storage. this will cause the datasource to be treated as an sqlite database. the datasources attribute may be set to one of two possible types of values. first, it may a file url pointing to a file on disk. in this case, you will often be setting the datasources attribute dynamically after determining the file path. ...
...ed as an sqlite database. the datasources attribute may be set to one of two possible types of values. first, it may a file url pointing to a file on disk. in this case, you will often be setting the datasources attribute dynamically after determining the file path. (if you intend to set it by script, you must set datasources in the xul to rdf:null). the second method involves using a special url
form: profile:filename.sqlite this
form with the 'profile' prefix is used to refer to files in the profile directory. this is useful for user data, and is suitable as you do not need to calculate where this directory is located. the file within this directory is specified after the colon, in this case 'filename.sqlite'. sqlite files typically have the 'sqlite' extension. as with xml datasources, the...
Sorting Results - Archive of obsolete content
container and the end results are the children. in this case, the natural order of the results will just be the order that the template builder generates the results. 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. when using a tree, sorting may be per
formed on each column of the tree. for instance, if a list of photos was displayed in a two column tree showing the title and description, you could sort by either title or description. the user can change the sort column and direction by clicking the column headers, however, you can programmatically change the sort as well. sorting tree results we'll examine sorting of trees first since trees are the...
... sorted chronologically. for rdf datasources, another way to sort by dates is to use the the parsetype="date" construct in the rdf datasource. this marks a literal as being a date value rather than a string. the builder will recognize this and sort chronologically instead. this also has the advantage that the dates will be displayed according to the user's current locale (meaning that the date is
formatted so as to be suitable for the user's language). 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/...
Template and Tree Listeners - Archive of obsolete content
tribute, which in the template builder is referred to as the root element. finally, you can remove a listener using the builder's removelistener method. listening for tree changes the second type of listener is used to handle particular actions related to trees. the tree builder implements the nsitreeview interface, so handles the gathering of data and passing it on to the tree. the tree widget in
forms the view when certain operations are per
formed that might affect the data. the tree view handles all of these operations, but allows an observer to be attached which is invoked during these operations. for instance, the observer may have an ontoggleopenstate method which will be called when the user opens or closes a row. the tree builder will handle the adding or removing of rows, but will call...
...ns are per
formed that might affect the data. the tree view handles all of these operations, but allows an observer to be attached which is invoked during these operations. for instance, the observer may have an ontoggleopenstate method which will be called when the user opens or closes a row. the tree builder will handle the adding or removing of rows, but will call the observer so that it can per
form some task. the tree builder observer implements the nsixultreebuilderobserver interface and may be attached to a tree builder using the builder's addobserver method. you can add more than one observer if needed, and can remove them again with the builder's removeobserver method. the observer is always invoked before the appropriate operation is per
formed. for instance, the ontoggleopenstate metho...
Tree Widget Changes - Archive of obsolete content
changes in xul trees api for gecko 1.8. there are no changes to xul tree tags, however the id attribute is no longer required on treecol elements just to get them to work. that means that the ids can be left out, although it's probably a good idea to use them anyway. instead of identifying columns by id, a new column object is used. this object implements the nsitreecolumn interface and holds in
formation about a single column in the tree. a tree will have one of these objects for each column (each treecol element) in the tree. the columns are grouped into a list which implements the nsitreecolumns interface. both the nsitreecolumn and nsitreecolumns interfaces can be found at layout/xul/base/src/tree/public/nsitreecolumns.idl. the column objects are created automatically, so you don't have ...
...tor pseudo has been improved to make it a proper box type and now has additional styling capabilities. example: treechildren::-moz-tree-separator { margin-top: 1px; border-top: 1px solid threedshadow; border-left: 1px solid threedshadow; border-right: 1px solid threedhighlight; border-bottom: 1px solid threedhighlight; height: 2px; } original document in
formation author: neil deakin source: here ...
Accesskey display rules - Archive of obsolete content
il). xul elements display their accesskeys in their label automatically if it's necessary. this document describes the rules of generating a label text. xul elements don't display any accesskeys on mac xul elements don't display any accesskeys on mac. because macos x doesn't have the conception of accesskey function on its native widgets/applications. basic accesskey display rules on non-mac plat
forms, a character which is same as its accesskey is underlined. e.g., when an accesskey of "file" is 'f', the generated label will be "file". if a label has two or more characters which are same as its accesskey, the first character of them will be underlined. if a label doesn't have the character, xul elements append the accesskey character with parentheses. e.g., when an accesskey of "open" is 'a...
...rties file or something. then, you should provide a way for specifying accesskeys which are independent from their labels. note that using '&' in label text is bad way. because japanese localizers "&cancel" need to localize to "キャンセル(&c)". this label will be displayed as "キャンセル(c)(c)" on the localized build. so, "(c)" will be doubled. for this issue, we recommend the following
format if you use .properties: <command-name>.label=cancel <command-name>.accesskey=c note that apis of nsipromptservice are using the bad way. because the apis are already frozen. therefore, xul toolkit removes accesskey text before setting the label to the buttons. however, xul application developers should not make same mistake. ...
Adding Buttons - Archive of obsolete content
left out, no text appears. image the url of the image to appear on the button. if this is attribute is left out, no image appears. you can also specify the image in a stylesheet using the list-style-image property. disabled if this attribute is set to true, the button is disabled. this is usually drawn with the text in grey. ...
... note: buttons support more attributes than those listed above. others will be discussed later. some examples of buttons example 1 : source view <button label="normal"/> <button label="disabled" disabled="true"/> the examples above will generate the buttons in the image. ...
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
key and match only when certain modifer keys are pressed. the previous example could be extended so that the checked property of the check box is changed when the space bar is pressed. <handlers> <handler event="keypress" key=" " action="this.checked=!checked"/> </handlers> you can also use the keycode attribute to check for non-printable keys. the section on keyboard shortcuts provides more in
formation. the modifier keys can be checked by adding a modifiers attribute. this should be set to one of the values set below: alt the user must press the alt key. control the user must press the control key. meta the user must press the meta key. shift the user must press the shift key. accel the user must press the speci...
...this should be set to one of the values set below: alt the user must press the alt key. control the user must press the control key. meta the user must press the meta key. shift the user must press the shift key. accel the user must press the special modifier key that is usually used for keyboard shortcuts on their plat
form. if set, the handler is only called when the modifier is pressed. you can require multiple modifier keys by separating them with spaces. the following alternate syntax can be used when the code in a handler is more complex: <binding id="binding-name"> <handlers> <handler event="event-name"> -- handler code goes here -- </handler> </handlers> </binding> handlers example the fol...
Adding Labels and Images - Archive of obsolete content
control attribute to the id of the element to be focused. example 3 : source view <label value="click here:" control="open-button"/> <button id="open-button" label="open"/> in the example above, clicking the label will cause the button to be focused. description element for descriptive text not associated with any particular control, you can use the description tag. this element is useful for in
formative text at the top of a dialog or a group of controls for example. as with the label element, you can either use the value attribute for a single line of text or place text or xhtml content inside opening and closing description tags for longer blocks of text. it is more common to use the attribute syntax for labels, and the text content syntax for descriptions. example 4 : source view <descrip...
...tion id="text" width="200"/> document.getelementbyid('text').textcontent = "some lengthy word wrapped text goes here."; internally, both the label element and the description elements are the same. the label element is intended for labels of controls, such as text fields. the control attribute is only supported for labels. the description element is intended for other descriptive text such as in
formative text at the top of a dialog box. images xul has an element to display images within a window. this element is appropriately named image. note that the tag name is different than html (image instead of img). you can use the src attribute to specify the url of the image file. the example below shows this: <image src="images/banner.jpg"/> although you can use this syntax, it would be better in...
Additional Install Features - Archive of obsolete content
for example, you may want to install a package only when certain conditions are met, such as having a particular library installed. in addition to the install object, a file object is also available during an installation script. it provides some functions which can be used to examine and modify files on disk. ...
...f error that occured. you can call this function at any point during the installation script to determine whether an error occured during the last operation. if an error occurs, you will likely want to abort the installation. you may also want to display an error message to the user. for example, you might put the following as the last section of your script: if (getlasterror() == success) { per
forminstall(); } else { cancelinstall(); } error codes that could be returned by getlasterror() are listed in the mozilla source file nsinstall.h. during installation, a log file is created that contains the operations that are per
formed. it will also show any errors that occured. the log file can be found in the file 'install.log' in the mozilla installation directory. a block of text will be adde...
Input Controls - Archive of obsolete content
text entry fields html has an input element which can be used for text entry controls. xul has a similar element, textbox, used for text entry fields. without any attributes, the textbox element creates a box in which the user can enter text. textboxes accept many of the same attributes as html input controls. the following are some of them: id a unique identifier so that you can identify the textbox. class the style class of the textbox. ...
... the letter specified is usually drawn underlined in the label. to view xul, you need e.g. seamonkey or waterfox and remote-xul-manager from https://github.com/jvillalobos/remote-xul-manager find files example so far : source view in the next section, we will look at some elements for entering and selecting numbers. « previousnext » looking for a guide to using input controls and
forms on the web? see
forms in html. ...
Introduction to RDF - Archive of obsolete content
urce description framework we can use the tree elements to display a set of data, such as bookmarks or mail messages. however, it would be inconvenient to do so by entering the data directly into the xul file. it would make it very difficult to modify the bookmarks if they were directly in the xul file. the way to solve this is by using rdf datasources. rdf (resource description framework) is a
format that can be used to store resources such as bookmarks or mail. alternatively, data in other
formats can be used and code written that will read the file and create rdf data from it. this is how mozilla works when it reads data such as bookmarks, the history or mail messages. mozilla provides datasources for this common data so that you can easily use them. you can use any of the provided rdf da...
... you can use any of the provided rdf datasources to populate trees with data or you can point to an rdf file stored in xml which contains the data. this makes it very convenient to display trees with lots of rows in them. rdf can also populate other xul elements as well such as listboxes and menus. we'll see this in the next section. a very brief overview of rdf will be provided here. for more in
formation about rdf, see the rdf specification. rdf/xml rdf consists of a model, which is a graph representation of data. rdf/xml is an xml language which can be used to represent rdf data. it contains a fairly simple set of elements. the sample below shows a simple rdf template. <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> ... </rdf:rdf> this has some s...
List Controls - Archive of obsolete content
t » xul has a number of types of elements for creating list boxes. list boxes a list box is used to display a number of items in a list. the user may select an item from the list. xul provides two types of elements to create lists, a listbox element to create multi-row list boxes, and a menulist element to create drop-down list boxes. they work similar to the html select element, which per
forms both functions, but the xul elements have additional features. the simplest list box uses the listbox element for the box itself, and the listitem element for each item. for example, this list box will have four rows, one for each item. example 1 : source view <listbox> <listitem label="butter pecan" /> <listitem label="chocolate chip" /> <listitem label="raspberry ripple" /> <listi...
...ch will be described later. multi-column list boxes the listbox also supports multiple columns. each cell may have arbitrary content within it, although usually only text is used. when the user selects an item in the list, the entire row is selected. you cannot have a single cell selected. two tags are used to specify the columns in the listbox. the listcols element is used to hold the column in
formation, each of which is specified using a listcol element. you will need one listcol element for each column in the listbox. the listcell element may be used for each cell in a row. if you want to have three columns, you will need to add three listcell elements inside each listitem. to specify the text content of a cell, place a label attribute on a listcell. for the simple case where there is onl...
Open and Save Dialogs - Archive of obsolete content
t a file picker. note that the file picker only works from chrome urls. you can use the file picker in one of three modes: open - the user is asked to select a file for opening. get folder - the user is asked to select a folder (directory). save - the user is asked to select the name to save a file to. the appearance of the dialog will be different for each type and will vary on each plat
form. once the user selects a file or folder, it can be read from or written to. the file picker interface nsifilepicker is responsible for displaying a dialog in one of the three modes. you can set a number a features of the dialog by using the interface. when the dialog is closed, you can use the interface functions to get the file that was selected. creating a file picker to begin, you need to c...
...all the appendfilters() function to set the file types that you wish to have displayed. fp.appendfilters(nsifilepicker.filterhtml | nsifilepicker.filterimages); fp.appendfilters(nsifilepicker.filtertext | nsifilepicker.filterall); the first example will add filters for html and for image files. the user will only be able to select those types of files. the manner in which this is done is plat
form specific. on some plat
forms, each filter will be separate and the user can choose between html files and image files. the second example will add filters for text files and for all files. the user therefore has the option to display text files only or all files. you can also use filterxml and filterxul to filter for xml and xul files respectively. if you would like to filter for custom files, ...
Popup Menus - Archive of obsolete content
ere and can contain any content. a good example is the drop down menu that appears when you click on the little down arrows next to the back and forward buttons in a browser window. context popups the context popup is a popup window which appears when the user presses the context menu button, which is usually the right mouse button. the exact way that a context menu is opened varies on each plat
form. on the macintosh for example, the user can either press the control key and click the mouse button, or hold the mouse button down for a moment. also note that it is possible to open context menus without using the mouse, for example by pressing the menu key on a keyboard. tooltips a tooltip popup window will appear when the user hovers over an element with the mouse. this type of popup is usua...
... have a separate block of content for each tooltip or to have a script which sets the content. however, it does allow you to use any content besides text in a tooltip. example 2 : source view <button label="save" tooltiptext="click here to save your stuff"/> <popupset> <tooltip id="moretip" orient="vertical" style="background-color: #33dd00;"> <description value="click here to see more in
formation"/> <description value="really!" style="color: red;"/> </tooltip> </popupset> <button label="more" tooltip="moretip"/> these two buttons each have a tooltip. the first uses the default tooltip style. the second uses a custom tooltip that has a different background color and styled text. the tooltip is associated with the more button using the tooltip attribute, which is set to the co...
Progress Meters - Archive of obsolete content
xul has a progressmeter element which can be used to create these. there are two types of progress meters: determinate and indeterminate. determinate progress meters are used when you know the length of time that an operation will take. ...
...that an operation will take. the progress meter will fill up and, once full, the operation should be finished. this can be used for the download file dialog as the size of the file is known. indeterminate progress meters are used when you do not know the length of time of an operation. the progress meter will have an animation such as a spinning barber pole or a sliding box, depending on the plat
form and theme used. determinate progress meter: indeterminate progress meter: the progress meter has the following syntax: <html:progress id="identifier" mode="determined" value="50" max="100"/> the attributes are as follows: id the unique identifer of the progress meter mode the type of the progress meter. if this is set to determined, the progress meter is a determinat...
Stacks and Decks - Archive of obsolete content
stack larger. shadowing is very useful for creating the disabled appearance of buttons: example 2 : source view <stack style="background-color: #c0c0c0"> <description value="disabled" style="color: white; padding-left: 1px; padding-top: 1px;"/> <description value="disabled" style="color: grey;"/> </stack> this arrangement of text and shadow colors creates the disabled look under some plat
forms. note that events such as mouse clicks and keypresses are passed to the element on the top of the stack, that is, the last element in the stack. that means that buttons will only work properly as the last element of the stack. decks a deck element also lays out its children on top of each other much like the stack element, however decks only display one of their children at a time. this would...
...er much like the stack element, however decks only display one of their children at a time. this would be useful for a wizard interface where a series of similar panels are displayed in sequence. rather than create separate windows and add navigation buttons to each of them, you would create one window and use a deck where the content changes. like stacks, the direct children of the deck element
form the pages of the deck. if there are three children of the deck element, the deck will have three children. the displayed page of the deck can be changed by setting an selectedindex attribute on the deck element. the index is a number that identifies which page to display. pages are numbered starting from zero. so, the first child of the deck is page 0, the second is page 1 and so on. example 3 :...
Toolbars - Archive of obsolete content
xul has a method to create toolbars. adding a toolbar like a number of elements, xul toolbars are a type of box. usually, a row of buttons would appear in the toolbar, but any element can be placed in a toolbar. for example, the mozilla browser window contains a textbox that displays the page url. toolbars may be placed on any side of the window, either horizontally or vertically. of course you wouldn't normally put a textbox in a vertical toolbar. ...
...ome applications, you will have several toolbars along the top of the window. you can put them all inside a toolbox. you do not have to put toolbar elements inside a toolbox. customizable toolbars firefox or other toolkit applications have customizable toolbars; therefore, many extensions add their toolbar buttons to the toolbar palette, rather than adding them directly to the toolbar. for more in
formation about customizable toolbars, see creating toolbar buttons. our find files example let's add a toolbar to the find files dialog. we don't really need one but we'll add one anyway to demonstrate its use. two buttons will be added, an open button and a save button. presumably, they would allow the user to save search results and re-open them later. <vbox flex="1"> <toolbox> <tool...
Tree Selection - Archive of obsolete content
how we can determine when an item is selected. the onselect() event handler may be added to the tree element. when the user selects an item from the tree, the event handler is called. the user may also change the selection by using the cursor keys. if the user holds down the cursor key to rapidly scroll through the items, the event handler is not called until the user stops. this results in a per
formance improvement. this also means that the highlight will appear on several items even though the select event is never fired for those items. the syntax of the onselect() event handler is shown below. <tree id="treeset" onselect="alert('you selected something!');"> tree indices the tree has a property currentindex, which can be used to get the currently selected item, where the first row is 0. c...
...n. in the image, there are eight rows displayed, of which two are selected. the first selected row has an index of 4 and the second has an index of 7. the rows that are not displayed are not included in the index count. multiple selection for trees that allow multiple selection, getting the list of selected rows is a bit more complicated. the tree's view has a selection property which holds in
formation about the selected rows. this selection will be an nsitreeselection object. the view doesn't need to implement this object itself, the tree will assign a selection object to the view's selection property when the view is attached to a tree. from the tree, you can get the selection using the tree's view property and then retrieve the view's selection property. you can use the methods of the s...
Using spell checking in XUL - Archive of obsolete content
checking the spelling of a word to check the spelling of a word, you must first create an interface to the mozispellcheckingengine component and then call the check() method on the string you wish to test. ...
... checking the spelling of a word to check the spelling of a word, you must first create an interface to the mozispellcheckingengine component and then call the check() method on the string you wish to test. ...
XUL accessibility tool - Archive of obsolete content
it is designed to test (insofar as automated testing is possible) the guidelines and requirement for creating accessible xul as set forth in the xul accessibility guidelines, and to report on any problems found in tested documents. while not meant to be a comprehensive test suite (meaning that passing all included tests does not guarantee that an application is free of accessibility bugs or issues), many of the most common accessibility mistakes will be found and reported. ...
...ht take a little while to be ready depending on the complexity of the application being analyzed and the speed of your machine. future work the following things have been suggested or are planned for a future version of the tool: new tests: (aaronlev) warning: hardcoded color and pixel sizings (aaronlev) error: duplicate accesskey in a dialog (already have this for menus) (aaronlev) error:
form control without accesskey (aaronlev) warning: accesskey as lowercase letter with descender (underlined g,j,y,q,p are hard to read, not recommended) (aaronandy) list of things to check manually, such as a list oftrees in the document (make sure they have accessible column picker equivs) or a list of toolbarbuttons (make sure they have accessible alternatives). new features: (aaronlev) automa...
arrowscrollbox - Archive of obsolete content
xul reference home [ examples | attributes | properties | methods | related ] a box which provides scroll arrows along its edges for scrolling through the contents of the box. the user only needs to hover the mouse over the arrows to scroll the box. this element is typically used for large popup menus. hovering the mouse over one of the (active) arrows triggers a scroll event. more in
formation is available in the xul tutorial. attributes clicktoscroll, disabled, smoothscroll, tabindex properties disabled, scrollboxobject, scrollincrement, smoothscroll, tabindex methods ensureelementisvisible, scrollbyindex, scrollbypixels examples <arrowscrollbox orient="vertical" flex="1"> <button label="red"/> <button label="blue"/> <button label="green"/> <button labe...
...e, the mouse must be hovered over the arrows to scroll automatically. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
browser - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a xul <browser> element represents a frame which is expected to contain a view of a web document. it is similar to an iframe except that it holds a page history and contains additional methods to manipulate the currently displayed page. are you here looking for in
formation about the firefox web browser, or because you'd like to download the latest version of firefox? get firefox most of the properties and methods of the browser will rarely be used and can only be called from chrome urls. other urls will need to use the document and history objects to change the displayed document. attributes autocompleteenabled, autocompletepopup, autoscroll, disablehistory, disableglobalhistory, disab...
...rty is true if there is a page to go forward to in the session history and the forward button should be enabled. contentdocument type: document this read-only property contains the document object in the element. contentprincipal type: nsiprincipal this read-only property contains the principal for the content loaded in the browser, which provides security context in
formation. contenttitle type: string this read-only property contains the title of the document object in the browser. contentvieweredit type: nsicontentvieweredit this read-only property contains the nsicontentvieweredit which handles clipboard operations on the document. contentviewerfile type: nsicontentviewerfile reference to ...
caption - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a header for a groupbox. it may contain either a text label, using the label attribute, or child elements for a more complex caption. more in
formation is available in the xul tutorial. attributes accesskey, crop, image, label, tabindex properties accesskey, crop, image, label, tabindex examples <groupbox> <caption label="my groupbox"/> </groupbox> <groupbox flex="1"> <caption> <checkbox label="a checked groupbox"/> </caption> </groupbox> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label attribute for the element. ...
...he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
command - Archive of obsolete content
if you include the script chrome://global/content/globaloverlay.js in your window, you can use the function godocommand function to invoke the command. using this function has the advantage that the command will be sent to the part of the ui which will respond to it. typically, this will be the currently focused element. like a broadcaster, commands forward attributes to other elements. more in
formation is available in the xul tutorial. see also: command attribute, commandset element attributes disabled, label, oncommand,reserved examples the following 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" oncomm...
...elp"/> <button label="more help" command="cmd_openhelp"/> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
editor - Archive of obsolete content
gn mode of the document loaded in the editor. to edit a new document, set the src attribute to about:blank. to access most of the functionality of the editor, your application must be part of an extension or part of the chrome. xul applications loaded via a url from a web server will not be able to access most of the features of the editor. see the rich text editing and midas pages for more in
formation about gecko's built-in rich text editor. attributes editortype, src, type properties accessibletype, commandmanager, contentdocument, contentwindow, docshell, editingsession, editortype, webbrowserfind, webnavigation methods geteditor, gethtmleditor, makeeditable examples this example shows how to made the editor editable by setting the designmode property of the loaded html...
... attributes editortype type: one of the values below the type of editor to use. this value will be overri...
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. the grid is expected to contain both a columns element as a child which defines the structure of the columns and a rows element as child to define the rows. the size and attributes defined on columns and rows will affect the size and placement of elements in each cell. ...
...ach cell. elements placed within both the columns and rows will be displayed, although usually only elements will be placed inside one of these. it is most common to place elements within the rows and use the columns only to define their flexibility and width. whichever of the columns and rows is last in the grid is displayed on top; commonly the columns element appears in the grid first. more in
formation is available in the xul tutorial. example <!-- groupbox containing a grid. the second column is twice as big as the first column --> <groupbox> <caption label="details"/> <grid> <columns> <column flex="1"/> <column flex="2"/> </columns> <rows> <row> <label value="user name"/> <textbox id="user"/> </row> <row> <lab...
keyset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container element for key elements. the keyset and its descendants are not displayed. more in
formation is available in the xul tutorial. attributes disabled examples <keyset> <key id="sample-key" modifiers="shift" key="r"/> </keyset> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortd...
...tyle, template, tooltip, tooltiptext, top, uri, wait-cursor, width disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
listcell - Archive of obsolete content
he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
... menupopup > menuitem, menupopup > menu { max-width: none; } disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
preference - Archive of obsolete content
operties | methods | related ] declares a preference that may be adjusted in a prefpane. this element must be placed inside a preferences element. each preference element corresponds to a preference which is stored in the user's preferences file. you can connect a user interface element such as a checkbox to a preference element using the user interface element's preference attribute. more in
formation is available in the preferences system article. attributes disabled, instantapply, inverted, name, onchange, readonly, tabindex, type properties defaultvalue, disabled, hasuservalue, inverted, locked, name, preferences, readonly, tabindex, type, value, valuefrompreferences methods reset examples <preferences> <preference id="pref_id" name="preference.name" type="int"/> </prefere...
...erences> see preferences system for a complete example. attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
scale - Archive of obsolete content
s is reverse of the order in which they appear in the xul code. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
...ue that the scale or number box may be set to. the default value is 100 for scales and infinity for number boxes. movetoclick type: boolean if true, clicking the slide area of the scale moves the thumb directly to that position. if false, clicking the slide area moves the thumb only one increment in that direction. if not specified, the default value is used, which varies for each plat
form. pageincrement type: integer the amount by which the value of the curpos or value attribute changes when the tray of the scroll bar (the area in which the scroll bar thumb moves) is clicked, or when the page up or page down keys are pressed. the default value is 10. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when t...
tabbrowser - Archive of obsolete content
ab( url, referreruri, charset, postdata, owner, allowthirdpartyfixup ) addtab( url, {referreruri: ..., charset: ..., postdata: ..., owner: ..., allowthirdpartyfixup: ..., relatedtocurrent: ... }) return type: tab element opens a new tab that loads a page with the specified url. the rest of the parameters are optional. the row of tabs will appear if needed. firefox 3.6 note the second
form of this method was added in firefox 3.6; it allows you to specify the parameters by name, in any order. it also adds the relatedtocurrent parameter; firefox uses this to decide whether the new tab should be inserted next to the current tab. see code snippets: tabbed browser for examples. see preprocessing post data for preparing postdata out of a string. addtabsprogresslistener( listener ) ...
...en the new tab in foreground or background. there's also no owner parameter as the owner tab is specified automatically. parameters inbackground if true the tab will be loaded in the background, if false the tab will be the newly selected tab. and if null or not specified, this parameter will default to the browser.tabs.loadinbackground preference. firefox 3.6 note the second
form of this method was added in firefox 3.6; it adds the relatedtocurrent parameter, and allows the parameters to be specified by name, in any order. loadtabs( uris, loadinbackground, replace ) loadtabs( uris, params ) return type: no return value loads a set of uris, specified by the array uris, into tabs. if loadinbackground is true, the tabs are loaded in the background, and if replace i...
tabs - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a row of tabs. a tabs element should be placed inside a tabbox and should contain tab elements. nb: you can add some other elements to tabs such as button, but they will receive an index. activating them will not change the selectedindex. more in
formation is available in the xul tutorial. attributes closebutton, disableclose, disabled, onclosetab, onnewtab, onselect, setfocus, selectedindex, tabbox, tabindex, tooltiptextnew, value, properties accessibletype, disabled, itemcount, selectedindex, selecteditem, tabindex, value, methods advanceselectedtab, appenditem, getindexofitem, getitematindex, insertitemat, removeitemat examples (example needed) attributes close...
...boolean if this attribute is true the close button will be disabled. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
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. ...
... 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. ...
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">. ...
...er to use. none no progress meter is displayed. the cell text is displayed instead. normal the cell uses its value attribute to determine the amount of the bar that is filled in. undetermined the progressmeter is indeterminate. properties type: space-separated list of property names sets the properties of the element, which can be used to style the element. for more in
formation, see styling a tree. ref type: uri for template-generated elements, this attribute is used to specify the root rdf node where content generation begins. this will correspond to the value of an about attribute on an rdf container. this attribute should be placed alongside the datasources attribute. src type: uri set this to the uri of an image to appear in the tree cell. if ...
where - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] indicate a condition that must match for a template result to be used. if the condition is true, the corresponding action body is generated; otherwise the result is ignored and no content is generated. for more in
formation, see where elements. attributes ignorecase, multiple, negate, rel, subject, value examples (example needed) attributes ignorecase type: boolean set to true to indicate that the case does not matter when making comparisons. otherwise, the default value is false, to indicate that the value should match with the same case. multiple type: boolean set to true to indicate that the value contains multiple values separated by commas. any of the values may match. ot...
...hat the value contains multiple values separated by commas. any of the values may match. otherwise, the entire value string is compared. negate type: boolean set to true to indicate that the comparison should be reversed. the where clause matches if the condition is false, and does not match if the condition is true. rel type: one of the values below the type of comparison to per
form. equals the subject and value must match exactly. less the numeric value of the subject must be less than the value greater the numeric value of the subject must be greater than the value before the string value of subject must come before value alphabetically after the string value of subject must come after value alphabetically startswith the value of subject must st...
XUL - Archive of obsolete content
xul tutorial a guided tutorial that will help you get started with xul, originally from xulplanet. xul (xml user interface language) is mozilla's xml-based language for building user interfaces of applications like firefox. the term xul is sometimes used to refer to the whole mozilla plat
form (e.g. xul applications are applications using xul and other components of the plat
form). xul controls lists some of the common controls provided by xul. documentation xul tutorial a guided tutorial that will help you get started with xul, originally from xulplanet. xul reference xul elements, attributes, properties, methods, and event ha...
... a quick list of all of the available xul controls. the joy of xul describes the key features and components of xul. menus and popups guide a guide on using menus and popup panels. template guide a detailed guide on xul templates, which is a means of generating content from a datasource. drag and drop how to per
form drag and drop operations. overlays overlays are used to describe extra content for the ui. they provide a powerful mechanism for extending and customizing existing xul applications. xul periodic table this collection of xul demos used to be available as a web page, but can no longer be viewed in firefox since support for remo...
CommandLine - Archive of obsolete content
however, if you'd like to retrieve the latest command line arguments (to open a file for example), a possible solution is to create your own command line handler. for the sake of simplicity, the proposed solution involves the observer service to notify observers that the updated arguments are available. a similar ...
...stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="main" title="&window.title;" windowtype="xulmine" style="width: 300px; height: 350px;" persist="screenx screeny width height sizemode"> <script type="application/javascript" src="cmdline.js" /> ... </window> original document in
formation author: georges-etienne legendre last updated date: august 21st, 2007 ...
Dialogs in XULRunner - Archive of obsolete content
sers, xul has a mechanism to automatically create and position the core dialog buttons ("ok," "cancel," and "help" for example). the developer just declares the need for the button, the button's caption, and the access key for the button, as well as the javascript function to call if the button is pressed. xul handles placing and styling the buttons on the dialog. this is also nice for cross-plat
form applications, as each os has its own convention for where buttons should be placed on a dialog. here is a short list of the button attributes on dialog; see also creating dialogs at mozillazine knowledge base: buttons a comma separated list of buttons to show on dialog (accept, cancel, help, extra1, and extra2). buttonlabelaccept label for the accept button; similar attributes exist for th...
...ox and thunderbird both support nearly native page setup and print dialogs. ...
XULRunner FAQ - Archive of obsolete content
runner is to facilitate development and deployment of internet applications. it is not meant to be a full-featured runtime; this allows xulrunner to maintain a smaller footprint and simpler deployment strategy than generic full-featured runtimes. if i use xulrunner do i have to write my application in xul? no! you can write your application in any language supported by the mozilla web plat
form, including html, xhtml, svg, or xul. so why is it called xulrunner, instead of htmlrunner or something? xul was always the original language of choice for ui in mozilla applications and the main library is called libxul, mostly the name is a hangover from that that has now stuck. when will firefox be based on xulrunner? there is no intention to do this for official release version...
...ode yet! this is a developer preview release: additional features for installing and deploying xulrunner and applications based on xulrunner will be available in future releases. i'm writing a xul application, how can i deploy that application to my users? right now mozilla recommends that xulrunner should be deployed privately with each application. see deploying xulrunner 1.8 for more in
formation. where is the source code? here. i think i've found a bug, how do i report it? bugzilla.mozilla.org is used to track bugs in all mozilla products. please search to make sure that your bug has not already been reported. how can i help? if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroup...
What XULRunner Provides - Archive of obsolete content
ertain circumstances: apis and user interface for installing, uninstalling, and upgrading xul applications. see the wikimo:xul:installation story. ...
... core support for profile roaming (with application-specific extensibility) pyxpcom embedding (not yet complete) - but it does work, if you compile a custom build that includes the pyxpcom bindings and there is a working python available. activestate uses pyxpcom in their products. what's out xulrunner will not supply: bookmarks or history ui (must be managed by the application/embedder) x
forms (x
forms will be available as an extension) ...
Windows and menus in XULRunner - Archive of obsolete content
is an example: <?xml version="1.0"?> <?xml-stylesheet href="chrome://basicapp/skin/main.css" type="text/css"?> <!doctype window system "chrome://basicapp/locale/main.dtd"> <window id="main" title="&title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="main.js"/> ... </window> notice the references to css and dtd files. the css is used to apply
formatting to elements, just as it would in html. the dtd is used to create entity references so strings for titles and labels are not stored directly in the xul file; this makes updating the text -- and localization of the application -- much easier. the window title is done this way in the above example. also notice the <script> element which is used to include the window’s javascript into the xul...
... application. there are quite a few things xul offers for application ui. ...
XUL Explorer - Archive of obsolete content
n easy way to experiment with xul. it’s a simple editor that can preview xul inline or in a separate popup window. it has a list of code snippets (small fragments of xul or javascript) that can be quickly inserted into the editor. the xul can be loaded from and saved to files. a xul validator and the error console are both available to help debug problems. the help menu provides access to xul in
formation on mdc. there is even simple “keyword” help lookup for xul elements. roadmap features: the preview pane can be toggled with the editor. previewing in a popup window is still available. option to automatically update the preview as the editor changes. indicator in the statusbar shows errors. double-click to display error console. option to specify the snippet used to load the edit...
... installs latest version: install (windows): xulexplorer-1.0a1pre.en-us.win32.exe 6.6mb install (mac): xulexplorer-1.0a1pre.en-us.mac.dmg 9.3mb install (linux): xulexplorer-1.0a1pre.en-us.linux-i686.tar.bz2 8.4mb contributing source code in svn bugzilla (for bugs and suggestions) open bugs, enter new bug blog pos...
reftest opportunities files - Archive of obsolete content
ask for review from the assignee (or anyone else that seems appropriate judging from comments in the bug). note that bugs with the testcase keyword already have one or more testcases attached to the bug that can be used when creating the reftest. ...
...rser/htmlparser/tests/html/ins003.html parser/htmlparser/tests/html/ins002.html parser/htmlparser/tests/html/ins001.html parser/htmlparser/tests/html/imgmap001.html parser/htmlparser/tests/html/html001.html parser/htmlparser/tests/html/home01.html parser/htmlparser/tests/html/head03.html parser/htmlparser/tests/html/head02.html parser/htmlparser/tests/html/head01.html parser/htmlparser/tests/html/
form002.html parser/htmlparser/tests/html/
form001.html parser/htmlparser/tests/html/fieldset003.html parser/htmlparser/tests/html/fieldset002.html parser/htmlparser/tests/html/fieldset001.html parser/htmlparser/tests/html/entity_list.html parser/htmlparser/tests/html/entity_attrlist.html parser/htmlparser/tests/html/entity001.html parser/htmlparser/tests/html/endswithcr.html parser/htmlparser/tests/ht...
Mozilla.dev.apps.firefox-2006-09-29 - Archive of obsolete content
binding tab bar to new theme discussion about how to bind a new theme to a tab bar without losing its original binding. the distributor university students working on cache distribution project - looking for help for how to tap the http requests.
... binding tab bar to new theme discussion about how to bind a new theme to a tab bar without losing its original binding. the distributor university students working on cache distribution project - looking for help for how to tap the http requests.
2006-09-29 - Archive of obsolete content
binding tab bar to new theme discussion about how to bind a new theme to a tab bar without losing its original binding. the distributor university students working on cache distribution project - looking for help for how to tap the http requests.
... binding tab bar to new theme discussion about how to bind a new theme to a tab bar without losing its original binding. the distributor university students working on cache distribution project - looking for help for how to tap the http requests.
2006-10-06 - Archive of obsolete content
e new features by building a mac.rdf file with all of the various .mac account properties mentioned in the document here. discussions is thunderbird using a valid w3c coding? peter lairo requested someone who are knowledgeable in w3c standards to confirm if the use of <blockquote type="cite"> is valid w3c code. q & a q: walt experienced an unusual behaviour in his build and wanted to per
form an experiment to figure out the problem, but he couldn't find the mozilla.org's config file. a: robert helmer pointed out the mozilla.org's config file could be found here and to look for -->mozconfig<---------------------------------------- -->end mozconfig<---------------------------------------- updated: developer documentation issues for thunderbird 2 eric shepherd has requested feedbac...
...------------------------ -->end mozconfig<---------------------------------------- updated: developer documentation issues for thunderbird 2 eric shepherd has requested feedback for any developer documentation issues that might need dealing with for thunderbird 2. discussion highlights: ziga sancin suggests writing an introductory article for potential developers containing basic project in
formation (history, list of main developers, project goals, roadmap and available communication channels, etc), tools needed to start developing and building tb, documentation on source structure as well as links to help one get started on the project. david bienvenu suggests a top down architectural description of tb's data structures along with documentation about extracting them. brian king also ...
2006-11-24 - Archive of obsolete content
--enable-default-toolkit=gtk2 to his .mozconfig file he gets an error. vin is asking for help on how to solve the error. announcements svg build dependency on cairo gfx on 11/22 november 21st: t rowley announced that: he will be landing his patch that starts the process of switching svg over to thebes (bug 354866). if you build dependencies with non-default toolkit or on a non tier-1 plat
form you'll need to disable svg in your mozconfig. gecko 1.9 intl rendering pe
formance november 20th: boris zbarskyannounced that: we need to create an intl per
formance page set or multiple intl per
formance 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. he stated that the goal here is that o...
... meetings there were no meetings this week. ...
2006-10-20 - Archive of obsolete content
traffic october 14, 2006, 6:53pm - ed notes that, on windows, composer 0.1's reccomended install directory needs to be different than those noted in the release notes. this is a xulrunner 1.8.0.4 application. benjamin smedberg would like to know what paths were used. started wed, oct 18 2006 9:38 am - a xulrunner developer, frank, discusses his desire to make xul/browser based applications. he wants to be able to build applications that will run inside the browser. ...
...eveloper, frank, discusses his desire to make xul/browser based applications. he wants to be able to build applications that will run inside the browser. nickolay ponomarev, benjamin smedberg, axel hecht clarify some misconceptions about front-end and back-end programming with xulrunner, including the difficulty of writing the backends in c++ (since that would require a recompilation on every plat
form frank wanted to support). meetings no meetings this week ...
2006-11-10 - Archive of obsolete content
benjamin smedberg crossposted a notice about unit testing for the mozilla toolkit, letting developers know about the importance of testing for the improvement of mozilla 2, and asks for complete coverage. several community members comment, backing up benjamin's post. ...
... resources are available at o'reily, in the creating applications with mozilla section. benjamin smedberg has been "working on some xptcall refactoring which will allow us to expose xptcall via a frozen api (and c linkage)". he is looking for xptcall port maintainers to submit patches to bug 349002. matthew gertner wants to know if anyone has written code to paste images from the clipboard on plat
forms other than windows? as of the end of the week, there is no reply. harry is looking for help with create thread in javascript using nsithread. he wants to know how to create new threads using javascript for background download operations. neil deakin points out that "downloads and other network operations are always done in another thread so you shouldn't be creating one yourself". meetings no m...
2006-11-17 - Archive of obsolete content
alex vincent ran into some difficulty with xulrunner extension manager not recognizing xulwidgets for verbosio? however he found out that it was a result of his flat-chrome version of xul widgets and works fine with the jarred-chrome version. boaz discuses the evolution of web browsers towards a more "application mode" whereas a web browser is loaded for the sole purpose of running a given website. ...
... peter naulls makes the suggestion in use and maintenance of xlib code that he become the nominal maintainer of the xlib code. meetings no meetings this week ...
2006-11-03 - Archive of obsolete content
aborting a new event/edit event dialog discussions about behaves of new event/edit event. wcap calendar subscription discussions about calendar subscriptions. ...
... aborting a new event/edit event dialog discussions about behaves of new event/edit event. wcap calendar subscription discussions about calendar subscriptions. ...
NPN_GetAuthenticationInfo - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary the function is called by plugins to get http authentication in
formation from the browser. syntax #include <npapi.h> nperror npn_getauthenticationinfo(npp instance, const char *protocol, const char *host, int32_t port, const char *scheme, const char *realm, char **username, uint32_t *ulen, char **password, uint32_t *plen); parameters this function has the following parameters: instance pointer to the current plug-in instanc...
... if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes. description plugin which implement their own http networking stack (such as the java plugin) may want to use the standard http auth prompts and password managed of the browser. this function allows the plugin to ask the browser for http authentication in
formation for a domain. unless the plugin has special networking needs, it is recommended to use the standard network apis, such as npn_geturlnotify/npn_posturlnotify. see also npn_setvalueforurl, npn_getvalueforurl ...
NPN_PluginThreadAsyncCall - Archive of obsolete content
urns nothing. description causes asynchronous execution of the specified function pointer on the "plug-in thread", passing in the specified user data pointer when it is called. the "plug-in thread" is the thread hosting the plug-in, which may be either the browser's main thread or the plug-in process if the plug-in is being executed out-of-process. it is the application's responsibility to per
form any synchronization between the thread calling npn_pluginthreadasynccall() and the thread on which the call is eventually executed. in particular, the user must ensure that the function pointer remains callable and the user data is not deallocated until the browser executes the call. there are inherent race conditions between calling this function and termination of the plug-in instance. the brow...
...ally executed. in particular, the user must ensure that the function pointer remains callable and the user data is not deallocated until the browser executes the call. there are inherent race conditions between calling this function and termination of the plug-in instance. the browser might not execute calls successfully registered with this api call during plug-in termination. plug-ins should per
form appropriate synchronization with the code in their npp_destroy() routine to ensure correct execution and avoid memory leaks. calling npn_pluginthreadasynccall() on the "browser main thread" or the "plug-in thread" is legal; the call to npn_pluginthreadasynccall() returns immediately. after control returns to the browser, it is free to call the function with its argument from this thread. see also...
NPN_PostURLNotify - Archive of obsolete content
unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description npn_posturlnotify functions identically to npn_posturl, with these exceptions: npn_posturlnotify supports specifying headers when posting a memory buffer. npn_posturlnotify calls npp_urlnotify upon successful or unsuccessful completion of the request. ...
...uest. for more in
formation, see npn_posturl. npn_posturlnotify is typically asynchronous: it returns immediately and only later handles the request and calls npp_urlnotify. if this function is called with a target parameter value of _self or a parent to _self, this function should return an invalid_param nperror. this is the only way to notify the plug-in once it is deleted. see npn_geturl for in
formation about this parameter. see also npn_geturl, npp_urlnotify, npn_posturl ...
NPN_SetValue - Archive of obsolete content
syntax #include <npapi.h> nperror npn_setvalue(npp instance, nppvariable variable, void *value); parameters the function has the following parameters: instance pointer to the plugin instance setting the variable. ...
... returns if successful, the function should return nperr_no_error. if unsuccessful, the function should return the most relevant npapi error code. for possible values, see error codes. description a good place to set plugin operation mode such as windowless mode is npp_new, so the browser knows rig...
NPN_SetValueForURL - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary allows a plugin to change the stored in
formation associated with a url, in particular its cookies. (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 typ...
... 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 in
formation to be changed. the only supported type is npnurlvcookie. url the url for which to change in
formation. value the new associated in
formation for the url. note: the value may have internal null bytes and may not be null-terminated. len the length of the value buffer. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for poss...
NPP_New - Archive of obsolete content
mory for the npsaveddata and the buffer it contains. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes. description npp_new creates a new instance of a plug-in. it is called after np_initialize and is passed the mime type, embedded or full-screen display mode, and, for embedded plug-ins, in
formation about html embed arguments. a new instance pointer (npp instance) is created by the plug-in, which is valid until the instance is destroyed with npp_destroy. if instance data was saved from a previous instance of the plug-in by the npp_destroy function, it is returned in the saved parameter for the current instance to use. all attributes in the embed tag (standard and private) are passed ...
...of the plug-in by the npp_destroy function, it is returned in the saved parameter for the current instance to use. all attributes in the embed tag (standard and private) are passed in npp_new in the argn and argv arrays. the browser ignores any non-standard attributes within an embed tag. this gives developers a chance to use private attributes to communicate instance-specific options or other in
formation to the plug-in. place private options at the end of the list of standard attributes in the embed tag. see also npp_destroy, np_shutdown, npp, npsaveddata ...
NPP_NewStream - Archive of obsolete content
ble. stream supports random access through calls to npn_requestread (for example, local files or http servers that support byte-range requests). false: not seekable. the browser must copy data in the stream to the local cache to satisfy random access requests made through npn_requestread. stype out parameter. the plugin should set this value to request a mode for the stream. for more in
formation about each of these values, see directions in this section. np_normal (default): delivers stream data to the instance in a series of calls to npp_writeready and npp_write. np_asfileonly: saves stream data to a file in the local cache. np_asfile: file download. like np_asfileonly except that data is delivered to the plug-in as it is saved to the file (as in mode np_normal). np_seek:...
..._asfileonly: the browser saves stream data to a file in the local cache. when the stream is complete, the browser calls npp_streamasfile to deliver the path of the file to the plug-in. if the stream comes from a local file, the npp_write and npp_writeready functions are not called. npp_streamasfile is simply called immediately. this mode allows the plug-in full random access to the data using plat
form-specific file operations. np_asfile: file download. differs from np_asfileonly in that data is delivered to the plug-in, through a series of calls to npp_writeready and npp_write, as it is saved to the file (as in mode np_normal). when the stream is complete, the browser calls npp_streamasfile to deliver the path of the file to the plug-in. if the data in the stream comes from a file that is alr...
NPP_Print - Archive of obsolete content
syntax #include <npapi.h> void npp_print(npp instance, npprint* printinfo); parameters the function has the following parameters: instance pointer to the current plug-in instance. must be embedded or full-screen. printinfo pointer to npprint structure. description npp_print is called when the user requests printing for a web page that contains a visible plug-in (either embedded or full-page). ...
...owser handles everything else, including displaying print dialog boxes, getting the printer device context, and any other tasks involved in printing, as well as printing the rest of the page. for an embedded plug-in, set the printinfo field to npembedprint. a full-page plug-in handles all aspects of printing itself. for a full-page plug-in, set the printinfo field to npfullprint or null. for in
formation about printing on your plat
form, see your plat
form documentation. ms windows on ms windows printinfo->print.embedprint.plat
formprint is the device context (dc) handle. be sure to cast this to type hdc. the coordinates for the window rectangle are in twips
format. this means that you need to convert the x-y coordinates using the windows api call dptolp when you output text. see also nppr...
NPPrintCallbackStruct - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary contains in
formation required by the plat
formprint field of the npembedprint structure during embedded mode printing on unix systems. this structure is only used on unix. syntax typedef struct { int32 type; file* fp; } npprintcallbackstruct; fields the data structure has the following fields: type always contains np_print. fp pointer to the file to which the plug-in should write its postscript data. description callback structures are used to pass plat
form-specific in
formation. the npprintcallbackstruct structure contains the file pointer to which the plug-in should write its postscript data. ...
... fp; } npprintcallbackstruct; fields the data structure has the following fields: type always contains np_print. fp pointer to the file to which the plug-in should write its postscript data. description callback structures are used to pass plat
form-specific in
formation. the npprintcallbackstruct structure contains the file pointer to which the plug-in should write its postscript data. this in
formation is required by the plat
formprint field of the npembedprint structure during embedded mode printing. at the time the plug-in is called, the browser has already opened the file and written postscript for other parts of the page. when the plug-in is done, it should leave the file open, so the browser can continue to write additional postscript data to the file. see also npp_print, npembedprint...
NPSavedData - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary block of instance in
formation saved after the plug-in instance is deleted; can be returned to the plug-in to restore the data in future instances of the plug-in. syntax typedef struct _npsaveddata { int32 len; void* buf; } npsaveddata; fields the data structure has the following fields: len length in bytes of the buffer pointed to by buf; set by the plug-in. buf pointer to a memory buffer allocated by the plug-in with npn_memalloc(). can be any reasonable size; its contents are private to the plug-in and are not modified by the browser. ...
...f; } npsaveddata; fields the data structure has the following fields: len length in bytes of the buffer pointed to by buf; set by the plug-in. buf pointer to a memory buffer allocated by the plug-in with npn_memalloc(). can be any reasonable size; its contents are private to the plug-in and are not modified by the browser. description the npsaveddata object contains a block of per-instance in
formation that the browser saves after the instance is deleted. this in
formation can be returned to another instance of the same plug-in if the user returns to the web page that contains it. you can use the plug-in's npp_destroy() function to allocate an npsaveddata object using the npn_memalloc() function, fill in the fields, and return it to the browser as an output parameter. see instance destructi...
NPSetWindowCallbackStruct - Archive of obsolete content
syntax typedef struct { int32 type; display* display; visual* visual; colormap colormap; unsigned int depth; } npsetwindowcallbackstruct; fields the data structure has the following fields: type always contains np_setwindow. display standard x toolkit attribute. pointer to the display structure that represents the browser-server connection. visual standard x toolkit attribute. ...
... to the display structure that represents the browser-server connection. visual standard x toolkit attribute. x visual for the plug-in window or drawable. colormap standard x toolkit attribute. colormap for the plug-in window or drawable. depth standard x toolkit attribute. depth of the plug-in window or drawable. description callback structures are used to pass plat
form-specific in
formation. the npsetwindowcallbackstruct object, allocated by the browser, contains in
formation required for the ws_info field of an npwindow. the npp_setwindow() function passes a pointer to this structure to the plug-in. the structure is valid for the lifetime of the npwindow, that is, until npp_setwindow() is called again or the instance is destroyed. the type field of this structur...
Samples and Test Cases - Archive of obsolete content
however, even if one cannot build the samples they can still be very valuable as code references. there is a guide to compiling the npruntime sample in visual studio. in addition to those samples, there are 2 more plugins in the tree that might be helpful. ...
...however, even if one cannot build the samples they can still be very valuable as code references. there is a guide to compiling the npruntime sample in visual studio. in addition to those samples, there are 2 more plugins in the tree that might be helpful. ...
XEmbed Extension for Mozilla Plugins - Archive of obsolete content
the capabilities of newer toolkits use xt. also, when included with builds of mozilla that are based on gtk 1.2 or gtk 2.x, the xt code that hosts the plugins is at best hacky and has been the source for many minor problems including inconsistent focus behavior as well as occasional crashes. it's recommended that you have a look at the gecko plugin api reference since this document will include in
formation that assumes that you are already familiar with the way that plugins are currently hosted as well as the apis. key differences all of the interfaces that you would normally expect to exist in the plugins will still exist when using xembed plugins. there are only two key differences: in the npp_setwindow call, the window parameter will be the xid of the hosting xembed window. as an implement...
...ct to exist in the plugins will still exist when using xembed plugins. there are only two key differences: in the npp_setwindow call, the window parameter will be the xid of the hosting xembed window. as an implementation note, this is really the xid of a gtksocket window. in your plugin instance npp_getvalue call you need to make sure that you support the new nppvpluginneedsxembed value. more in
formation is included on this below. hosting using gtk2.x included below are a couple of code snippits that should help you get started as well as some hints on building a successful plugin. please use the following diagram as a reference: as you can see from the diagram above, it's pretty easy to set up a plugin using gtk2. the general idea is that you use the xid that was passed into your npp_setw...
Why RSS Slash is Popular - Counting Your Comments - Archive of obsolete content
logs on the internet. with its own history and culture, it's responsible for the "first post!" phenomena, the anonymous coward, and the recognition of the slashdot effect, a phenomena that adorns its name. one of the quirks of slashdot is that it includes a comments count, a humorous department, a hit parade, and a section with every blog post. rss does not have any facilites for including this in
formation in an <item>, so the rss slash module exists to fill in this gap. an example using the most popular element of the rss slash module is shown below: <?xml version="1.0"> <rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" > <channel> <title>example</title> <description>an rss example with slash</description> <lastb...
... </item> </channel> </rss> the <slash:comments> element is it reason that the rss slash module is popular. this element gives the (current) total number of comments made for the item -- for the blog post. although not necessary, people also often use other rss modules to get at (and read) the comments (since rss does not currently provide facilities for this either). some use the well-
formed web rss module for this. and some are now using atomic rss for this. (using either of these 2 rss modules is out of the scope of this article.) in reality, an item's comments count could change at any given time. people can (potentially) post new comments to an item at any given time. and (spam) comments could get deleted. and thus the comments count that the <slash:comments> element provides i...
Syndicating content with RSS - Archive of obsolete content
this article provides a simple guide to using rss to syndicate web content. ...
...n creating the special <a> link to your feed. the icon looks like the following: you can get more icons like this from feed icons. (other sizes and colors, along with their source files, are available too.) advanced syndication techniques although this advanced technique for syndication is not required, support of this is recommended, especially for web sites and applications with high per
formance needs. 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. this technique takes advantage by having the client prefer rss (over html or other
formats). here's a simple example of it being done: accept: application/rss+xml, text/html with real production software, though, it would look more ...
What is RSS - Archive of obsolete content
this page explains what rss is. you will not yet be creating your own rss files, but you will be seeing how rss is commonly used and simple example rss files for these common uses. you will also be getting a little history on rss. what is rss? the most popular versions of rss are xml-based markup languages used for syndication. (although rdf-based rss
formats exist, namely the deprecated rss 0.90 and rss 1.0.) common uses of rss syndication are for the syndication of news web sites, of blogs, of internet radio, and of internet television. this tutorial teaches rss 2.0, but makes an effort to point out issues with other versions of rss. rss is almost never written by hand; it is almost always created by server-side software (usually written in a language like php, java, c#, or pytho...
...r versions of rss. rss is almost never written by hand; it is almost always created by server-side software (usually written in a language like php, java, c#, or python) on the web server. however, so that we can learn rss, we will be creating rss scripts by hand. a short history of rss in march of 1999 netscape released rss 0.90. it was much much different than today's rss. it wasn't really a
format for syndication, but was a
format for providing a summary of a website. in fact, back then, rss did not stand for really simple syndication but stood for rich site summary. in july of 1999 netscape's rss 0.91 was released. like rss 0.90, netscape's rss 0.91 was also a
format for providing a summary of a website, and not really a syndication
format (as it is today). netscape's rss 0.91 was crea...
Module - Archive of obsolete content
rss module list rss modules are micro
formats injected into an rss document through the use of xml namespaces. they are ways of extending rss. below is a list of the popular rss modules. ...
..., 2005 tim bray blogchannel september 17, 2002 dave winer content content creativecommons cc december 16, 2002 dave winer dublin core dc slash slash well-
formed web wfw joe gregorio and chris sells ...
Proposal - Archive of obsolete content
below that are marked "in development" should not be implemented. "in development" means that they are still working on it and trying to come up with a draft. those labeled with "draft exists" can be implemented, but be warned that they could radically change. name description status easy news topics easy news topics (ent) is intended to be a very simple standard for describing how topic in
formation can be introduced into an rss2.0 news feed. draft exists icbm let's you add latitude and longitude info to an item. spec exists itunes rss itunes extension modules used for ipradio/podcasting. spec exists media rss rss extension module used for iptv and ipradio/podcasting. spec exists newsgator feed extension created to make rss feeds work better with newsgator software. lets you spe...
...atitude and longitude info to an item. spec exists itunes rss itunes extension modules used for ipradio/podcasting. spec exists media rss rss extension module used for iptv and ipradio/podcasting. spec exists newsgator feed extension created to make rss feeds work better with newsgator software. lets you specify an image, up to 277x78 pixels. and lets you specifies a specific rendering trans
form (xslt) to be used when rendering the feed in newsgator for outlook. the trans
form must already exist on the machine running newsgator; stylesheets will not be downloaded or installed automatically. spec exists rss disposition hinting a proposal to make it so iptv and ipradio/podcasting works better with rss. uses an http "content-type" parameter to hint at an rss feeds disposition type -- to hi...
0.90 - Archive of obsolete content
rss 0.90 rss 0.90 is the earliest known version of rss released to the public, and was replaced by netscape's rss 0.91 (revision 1). it was created by netscape to be a metadata
format providing a summary of a website. (and not only a syndication
format, as it is today.) rss 0.90 is an rdf-based
format. when rss 0.90 was created, the rss initialization stood for rich site summary and not really simple syndication. (see rss - what is in a name for more info on rss's naming history.) note: rss 0.90 has been deprecated. producers of rssshould not be creating rss 0.90 feeds, andshould instead use a newer non-deprecated rss
format. (see the rss versions list for a list of non-deprecated rss
formats.) consumers of rssshould still be able to accept rss 0.90 feeds though. examples rss 0.90...
...rather than for syndication. specification the original rss 0.90 ...
SAX - Archive of obsolete content
quick start the sax parser functionality is available through the xml reader component. ...
... .createinstance(components.interfaces.nsisaxxmlreader); after you created the sax parser, you need to set the handlers for the events you're interested in and fire off the parsing process. all functionality is available through the nsisaxxmlreader interface. set the handlers handlers are user-defined objects implementing sax handler interfaces, depending on what kind of in
formation they need to get from the parser. after the parsing process is started, handlers receive a series of callbacks for the content of xml being parsed. the following handlers are available: interface purpose nsisaxcontenthandler receive notification of the logical content of a document (e.g. elements, attributes, whitespace, and processing instructions). nsisaxd...
Common Firefox theme issues and solutions - Archive of obsolete content
esolution to this issue is to add the following code to your browser.css file somewhere below where the main-window is made transparent to support aero glass. @media all and (-moz-windows-compositor) { /* make transition to fullscreen mode seamlessly in firefox 10+ */ #main-window[infullscreen="true"] { -moz-appearance: none; background-color: -moz-dialog!important; } } for more in
formation about this issue please see bug 732757 and bug 732757 and this mozillazine thread. mac os x os x lion missing toolbar button icons due to firefox bug 679708 and bug 702558, some toolbar buttons icons may be missing on firefox 8 and later running on mac os x lion. in order to work around this issue, you need to either rename any of the following files that are in your chrome://browser/skin...
...to test this please go to bug 324777 using the default theme and activate the "click me" link. the url bar of the resulting popup window is disabled. address bar "door hangers" door hanger sync p...
Theme changes in Firefox 4 - Archive of obsolete content
however, this does impact theme developers, since many of the files that they need to pull out and work with are now in a new place. in particular, the new file omni.jar contains most of the resources, including the skin. ...
...most likely you must replace all occurences of classic/1.0 in chrome.manifest and install.rdf with some other name. improving your appearance on windows the new -moz-windows-theme media query lets you determine which windows theme is currently in use; this lets you make your theme adapt to work...
Using IO Timeout And Interrupt On NT - Archive of obsolete content
nding overlapped io requests when we get io timeout or interrupt errors. if <tt>cancelio()</tt> really works as advertised, that should fundamentally solve this problem. ...
... <tt>cancelio()</tt> really works as advertised, that should fundamentally solve this problem. ...
Using Web Standards in your Web Pages - Archive of obsolete content
"browser makers are no longer the problem. the problem lies with designers and developers chained to the browser-quirk-oriented markup of the 1990s-often because they don't realize it is possible to support current standards while accommodating old browsers." -web standards project this article provides an overview of the process for upgrading the content of your web pages to con
form to the world wide web consortium (w3c) web standards. the first 2 sections address exclusively validation issues, benefits of validation, deprecated elements, deprecated attributes. how to upgrade a webpage markup code to pass validation and how to implement css are addressed by providing recommendations, tutorials and references. the other sections address dom and dhtml coding practices which are at odds with...
...s, outlines all the changes described in this article. the last section offers excellent and best references for those wishing to learn more about upgrading techniques presented in this article and more for those wishing to perfect their web pages. contents benefits of using web standards making your page using web standards - how to using the w3c dom developing cross browser and cross plat
form pages using xmlhttprequest summary of changes references original document in
formation author(s): mike cowperthwaite, marcio galli, jim ley, ian oeschger, simon paquet, gérard talbot last updated date: may 29, 2008 copyright in
formation: portions of this content are © 1998–2008 by individual mozilla.org contributors; content available under a creative commons license | details. ...
-ms-scroll-chaining - Archive of obsolete content
k-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values chained initial value. the nearest scrollable parent element begins scrolling when the user hits a scroll limit during any manipulation. no bounce effect is shown. none a bounce effect is shown when the user hits a scroll limit during any manipulation.
formal syntax chained | none examples the following example illustrates the -ms-scroll-chaining property in use. in this case the image container has its -ms-scroll-chaining property set to chained, which means that when a user is scrolling through a nested scrollable element and it hits its boundary the parent scrollable element will begin to scroll in the same direction. had the -ms-scroll-cha...
...he image container has its -ms-scroll-chaining property set to chained, which means that when a user is scrolling through a nested scrollable element and it hits its boundary the parent scrollable element will begin to scroll in the same direction. had the -ms-scroll-chaining property been set to none, the user would observe a bounce effect when the nested element reaches its boundary. for more in
formation, see html scrolling, panning and zooming sample or internet explorer 10 scrolling, panning, and zooming with touch. .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(...
-ms-wrap-flow - Archive of obsolete content
y the area before the start edge of the exclusion area. maximum inline flow content can wrap on the side of the exclusion with the largest available space for the given line, and must leave empty the other side of the exclusion. clear inline flow content can only wrap on top and bottom of the exclusion and must leave empty the areas to the start and end edges of the exclusion box.
formal syntax auto | both | start | end | maximum | clear specifications not part of any specification. remarks the -ms-wrap-flow property makes an element an exclusion element when it has a computed value other than auto. this property specifies that the exclusion element (the exclusion) can be positioned in various ways, and that inline content will wrap around the exclusion in a way similar t...
...exclusion in a way similar to how it wraps around floated elements. when the -ms-wrap-flow property's computed value is auto, the element does not become an exclusion element unless its float property's computed value is not none. in that case, the element contributes its border box to its containing block's wrapping context and content flows around it according to the clear property. for more in
formation about the impact of an exclusion element on content flow, see the terminology section of the css exclusions module level 1 specification. ...
-ms-wrap-through - Archive of obsolete content
dnocomputed valueas specifiedanimation typediscrete syntax values wrap the exclusion element inherits its parent node's wrapping context. its descendant inline content wraps around exclusions defined outside the element. none the exclusion element does not inherit its parent node's wrapping context. its descendants are only subject to exclusion shapes defined inside the element.
formal syntax wrap | none specifications not part of any specification. remarks you can use the -ms-wrap-through property to control the effect of exclusions; for instance, to cause one content block to wrap around an exclusion element and another to intersect the same exclusion element. the wrapping context of a box is a collection of exclusion areas contributed by its associated exclusion box...
...s; for instance, to cause one content block to wrap around an exclusion element and another to intersect the same exclusion element. the wrapping context of a box is a collection of exclusion areas contributed by its associated exclusion boxes. the inline flow content of a box is placed in the area that corresponds to the subtraction of its wrapping context from its own content area. for more in
formation about exclusion elements' impact on content flow, see the terminology section of the css exclusions module level 1 specification. ...
::-ms-browse - Archive of obsolete content
browser compatibility historically supported in internet explorer and edge before version 79. ...
... browser compatibility historically supported in internet explorer and edge before version 79. ...
::-ms-fill-lower - Archive of obsolete content
browser compatibility historically supported in internet explorer and edge before version 79. ...
... browser compatibility historically supported in internet explorer and edge before version 79. ...
::-ms-fill-upper - Archive of obsolete content
browser compatibility historically supported in internet explorer and edge before version 79. see also ::-ms-fill-lower ::-ms-track ::-ms-thumb ::-moz-range-progress css-tricks: styling cross-browser compatible range inputs with css quirksmode: styling and scripting sli...
... browser compatibility historically supported in internet explorer and edge before version 79. see also ::-ms-fill-lower ::-ms-track ::-ms-thumb ::-moz-range-progress css-tricks: styling cross-browser compatible range inputs with css quirksmode: styling and scripting sliders ...
::-ms-thumb - Archive of obsolete content
see also ::-ms-track ::-ms-fill-upper ::-ms-fill-lower ::-webkit-slider-thumb ::-moz-range-thumb css-tricks: styling cross-browser compatible range inputs with css quirksmode: styling and scripting sliders ...
... see also ::-ms-track ::-ms-fill-upper ::-ms-fill-lower ::-webkit-slider-thumb ::-moz-range-thumb css-tricks: styling cross-browser compatible range inputs with css quirksmode: styling and scripting sliders ...
E4X for templating - Archive of obsolete content
mple utility for localizing strings of a properties file: // localization function $s(msg, args){ //get localized message var strs = cc['@mozilla.org/intl/stringbundle;1'].getservice(ci.nsistringbundleservice). ...
... in the tutorial, it is possible to use anonymous functions inline (returning the desired content, including potentially xmllist's) in order to execute more than a single related statement, keeping this logic together with the resulting xml. ...
E4X - Archive of obsolete content
x is obsolete. it has been disabled by default for webpages (content) in firefox 17, disabled by default for chrome in firefox 20, and has been removed in firefox 21. use domparser/domserializer or a non-native jxon algorithm instead. ecmascript for xml (e4x) is a programming language extension that adds native xml support to javascript. it does this by providing access to the xml document in a
form that feels natural for ecmascript programmers. the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces. a valid alternative to e4x is a non-native jxon algorithm. e4x is standardized by ecma international in ecma-357 standard (currently in its second edition, december 2005). e4x is implemented (at least partially) in spidermonkey (gecko's javasc...
...nd edition, december 2005). e4x is implemented (at least partially) in spidermonkey (gecko's javascript engine) and in rhino (javascript engine written in java). note: in gecko 1.8 based browsers such as firefox 1.5, e4x is already partially enabled for web page authors. 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...
New in JavaScript 1.8.5 - Archive of obsolete content
freeze() freezes an object: other code can't delete or change any properties. bug 492844 object.isfrozen() determines if an object was frozen. bug 492844 array.isarray() checks if a variable is an array. bug 510537 date.prototype.tojson() returns a json
format string for a date object. function.prototype.bind() creates a new function that, when called, itself calls this function in the context provided (with a given sequence of arguments). bug 429507 new ecmascript5 features get and set operators now allows the identifier to be numeric ...
... description old proxy api offers support for creating object and function proxies that enable meta-programming in javascript. changed functionality in javascript 1.8.5 iso 8601 support in date: the date object's parse() method now supports simple iso 8601
format date strings. global objects made read only: the nan, infinity, and undefined global objects have been made read only, per the ecmascript 5 specification. obj.__parent__ and obj.__count__ become obsolete. some in
formation about why: spidermonkey change du jour: the special __parent__ property has been removed bug 551529 & bug 552560. trailing commas no longer accept...
Object.prototype.__noSuchMethod__ - Archive of obsolete content
t. the __nosuchmethod__ property used to reference a function to be executed when a non-existent method is called on an object, but this function is no longer available. while __nosuchmethod__ has been dropped, the ecmascript 2015 specification has the proxy object, with which you can achieve the below (and more). syntax obj.__nosuchmethod__ = fun parameters fun a function that takes the
form function (id, args) { . . . } id the name of the non-existent method that was called args an array of the arguments passed to the method description by default, an attempt to call a method that doesn't exist on an object results in a typeerror being thrown. this behavior can be circumvented by defining a function at that object's __nosuchmethod__ member. the function takes tw...
...ng typeerrors. examples simple test of __nosuchmethod__ var o = { __nosuchmethod__: function(id, args) { console.log(id, '(' + args.join(', ') + ')'); } }; o.foo(1, 2, 3); o.bar(4, 5); o.baz(); // output // foo (1, 2, 3) // bar (4, 5) // baz () using __nosuchmethod__ to simulate multiple inheritance an example of code that implements a primitive
form of multiple inheritance is shown below. // doesn't work with multiple inheritance objects as parents function nomethod(name, args) { var parents = this.__parents_; // go through all parents for (var i = 0; i < parents.length; i++) { // if we find a function on the parent, we call it if (typeof parents[i][name] == 'function') { return parents[i][name].apply(this, args); }...
Object.prototype.watch() - Archive of obsolete content
you can usually use setters and getters or proxies instead. the watch() method watches for a property to be assigned a value and runs a function when that occurs. ...
...r which a watchpoint has been set, that watchpoint does not disappear. if you later recreate the property, the watchpoint is still in effect. to remove a watchpoint, use the unwatch() method. by default, the watch method is inherited by every object descended from object. the javascript debugger has functionality similar to that provided by this method, as well as other debugging options. for in
formation on the debugger, see venkman. in firefox, handler is only called from assignments in script, not from native code. for example, window.watch('location', myhandler) will not call myhandler if the user clicks a link to an anchor within the current document. however, window.location += '#myanchor' will call myhandler. note: calling watch() on an object for a specific property overrides any p...
Archived JavaScript Reference - Archive of obsolete content
use the more general proxy object instead.arraybuffer.transfer()the static arraybuffer.transfer() method returns a new arraybuffer whose contents have been taken from the oldbuffer's data and then is either truncated or zero-extended by newbytelength. if newbytelength is undefined, the bytelength of the oldbuffer is used. this operation leaves oldbuffer in a detached state.date.prototype.tolocale
format()the non-standard tolocale
format() method converts a date to a string using the specified
formatting. intl.datetime
format is an alternative to
format dates in a standards-compliant way. see also the newer version of date.prototype.tolocaledatestring().ecmascript 2016 to es.next support in mozillaexpression closuresexpression closures are a shorthand function syntax for writing simple functions.
... define a legacy generator function inside an expression. ...
JSException - Archive of obsolete content
ion | +----netscape.javascript.jsexception description jsexception is an exception which is thrown when javascript code returns an error. constructor summary the netscape.javascript.jsexception class has the following constructors: jsexception deprecated constructors optionally let you specify a detail message and other in
formation. method summary the netscape.javascript.jsexception class has the following methods: getwrappedexception instance method getwrappedexception. getwrappedexceptiontype instance method getwrappedexceptiontype returns the int mapping of the type of the wrappedexception object. backward compatibility javascript 1.1 through 1.3 jsexception had three public constructors which opti...
...he following methods: getwrappedexception instance method getwrappedexception. getwrappedexceptiontype instance method getwrappedexceptiontype returns the int mapping of the type of the wrappedexception object. backward compatibility javascript 1.1 through 1.3 jsexception had three public constructors which optionally took a string argument, specifying the detail message or other in
formation for the exception. the getwrappedexception method was not available. jsexception constructors, deprecated in javascript 1.4, constructs a jsexception object with an optional detail message. declaration 1. public jsexception() 2. public jsexception(string s) 3. public jsexception(string s, string filename, int lineno, string source, int tokenindex) arguments s the deta...
MSX Emulator (jsMSX) - Archive of obsolete content
since javascript currently is mostly an interpreted language in web browsers, it is at least an order of magnitude slower than other languages such as c and java. ...
...ges such as c and java. therefore, jsmsx requires a very fast computer to emulate msx at the normal 50-60 interrupts per second inside a web browser. why? the initial motivation was to find some interesting project to develop while exploring the possibilities of the <canvas> tag and javascript language in the most recent web browsers like firefox 2. as you may have realized, many challenges on per
formance are faced when developing in javascript. they present an interesting testbed for pushing the current javascript implementations to their limits and for comparing their relative speed. jsmsx can also be used to tightly integrate existing msx programs in web page logic. how to help lots of work to optimize the per
formance and add msx 2.0, 2.0+ and turbor features are still necessary. version 1.
Examples - Archive of obsolete content
> <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) { // ... } </script> </head> <body> <h1>problem 1 - < in xhtml</h1> <p> this document is not well
formed due to the use of a raw <. </p> </body> </html> back to the article problem 2 <!-- this file should have a .xhtml extension --> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head> <title>problem 2 - comments in xhtml</title> <meta http-equi...
... </p> </body> </html> back to the article examples for "using css rules in inline style within comments" example 1 <!-- this file should have a .html extension --> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us...
RDF: Resource Description Framework for metadata - Archive of obsolete content
the subject is the resource, the "thing" being described. ...
...he predicate is a trait or aspect about that resource, and often expresses a relationship between the subject and the object. the object is the object of the relationship or value of that trait. documentation directions of the mozilla rdf engine this presentation shows new developments in the mozilla rdf engine. these include plans to expose the rdf api to public web content, as well as per
formance and correctness improvements. what is rdf tim bray's introduction to the resource description framework, at xml.com. rdf datasource how-to a cookbook-style document describing how to create a native, client-side datasource that works with mozilla's rdf implementation. view all... community view mozilla forums... mailing list newsgroup rss feed rdf-dev mailing ...
Server-Side JavaScript - Archive of obsolete content
the netscape organization to continue to advance the state of web technologies. today with computing cycles having increased more than 10-fold and mozilla's work on rhino (javascript interpreter in java) and spidermonkey (javascript interpreter in c) and javascript itself, we have very solid foundations for javascript to be extraordinarily useful and applicable on the server-side again -- with per
formance in the same range as popular server-side environments like php and ruby on rails. now, with tracemonkey available, javascript (both client side and server-side) can see 20x to 40x speed improvements according to brendan eich, mozilla cto and creator of javascript. server-side javascript is another way in which, as this article quotes eich, "mozilla wants to 'get people thinking about javas...
...ails. now, with tracemonkey available, javascript (both client side and server-side) can see 20x to 40x speed improvements according to brendan eich, mozilla cto and creator of javascript. server-side javascript is another way in which, as this article quotes eich, "mozilla wants to 'get people thinking about javascript as a more general-purpose language' and show them that 'it really is a plat
form for writing full applications.'" many vendors today are embedding mozilla rhino or mozilla spidermonkey into web server environments. some, like aptana with the open source jaxer server actually embed the entire mozilla firefox browser engine (including spidermonkey) within a web server to enable server-side ajax and server-side dom access in addition to server-side execution of javascript. ...
Standards-Compliant Authoring Tools - Archive of obsolete content
w3 standards. if you're using older versions of tools that rely on old browser bugs or generate browser-specific code, it may be time to upgrade: nvu is a standalone editor created from the remains of mozilla composer. currently the work done on nvu is being ported back to mozilla source code. html-kit is a full-featured, low priced editor designed to help html, xhtml and xml authors to edit,
format, lookup help, validate, preview and publish web pages. validation is done with html tidy, so you can verify standards compliance. macromedia™ dreamweaver™ cs6 style master and layout master by western civilisation some caveats: it appears that tools currently available from namo generate ie-specific or netscape 4-specific code that may require extra debugging for compatibility with stan...
... require extra debugging for compatibility with standards-based browsers. newer versions of microsoft frontpage™ have improved, however be sure not to rely on frontpage-specific extensions for critical website content or functionality. some versions of microsoft word create invalid html code that only works with internet explorer. always be sure to validate your web pages. original document in
formation last updated date: january 30th, 2003 copyright © 2001-2003 netscape. all rights reserved. related links validators html central ...
RFE to the Custom Controls - Archive of obsolete content
rfe put your requests here. ...
... documents for the following reason. xul, in many cases, is much better suited for application development than xhtml. therefore the control set may need to be more extensive to address the wider spectrum of requirements that a xul application will have on its controls. note: xul is a feature of mozilla only and custom control authors should be aware their controls won't work on other browser plat
forms. rfe put your requests here. output that shows the dom if output contains cdata section or text node and its data is any mozilla known language like xhtml/xul/svg then output should parse and display it (see bug 316817). output should show data in current locale
format the bug 331585 address the issue. probably this feature should be implemented by adding a new custom control. input t...
Fixing Incorrectly Sized List Item Markers - Archive of obsolete content
e bug still affects all netscape 6.2.x versions, as well as compuserve 7.0. the problem in affected browsers, list item markers will very often appear to be too big compared to the text in the list item itself. this is most obvious in ordered lists, where the number that precedes each list item may be obviously different than the content that follows it. in fact, the markers were set to be a uni
form size that did not change to match the content of the list items, so in rare cases the marker might actually appear to be smaller. see bug 110360, which explains the problem and shows when the fix was applied. in addition, when a document is displayed in "quirks" mode in mozilla 0.9.4 and later, the markers of lists will not use the font size of the list item text, but will instead stay the same ...
...st-number {font-size: 1em;} recommendations if it is important to make list item markers match the font size of the content, use one of the suggested rules. in situations where validation is a priority, segregate the rule into a separate stylesheet so that the rule will not confuse css validators run against the main stylesheet. related links bug 110360 bug 97351 original document in
formation author(s): eric a. meyer, netscape communications last updated date: published 04 oct 2002; revised 07 mar 2003 copyright in
formation: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Popup Window Controls - Archive of obsolete content
ich are allowed to use unsolicited popup windows. you can also provide a hyperlink which can be used to open a popup window even in the event that the user has suppressed unsolicited popups on your site. ...
...tain the same in
formation as the popup window. you can also use either the advanced features in the document object model (dom) or innerhtml to create the appropriate html. example the example tag links to devedge-temp.mozilla.org this example illustrates detecting suppressed popup windows as well as an approach for replacing popup windows with inline html using innerhtml. original document in
formation author(s): bob clary last updated date: december 5th, 2002 copyright © 2001-2003 netscape. ...
Styling Abbreviations and Acronyms - Archive of obsolete content
acronym[title] { text-decoration: dotted underline; } the solution if authors wish to remove the underline from abbr and acronym elements, this can be done with the following rule: abbr[title], acronym[title] { text-decoration: none; } it may be better to lessen the visual weight of the border without actually removing it. the underline tells readers that the word in question has extra in
formation associated with it. in mozilla, placing the mouse pointer over the element and leaving it for a moment will cause the contents of the title attribute to appear as a tooltip next to the mouse pointer. removing the underline from these elements will rob readers of an indication that there is extra in
formation available. related links web content accessibility guidelines 1.0 original doc...
...sociated with it. in mozilla, placing the mouse pointer over the element and leaving it for a moment will cause the contents of the title attribute to appear as a tooltip next to the mouse pointer. removing the underline from these elements will rob readers of an indication that there is extra in
formation available. related links web content accessibility guidelines 1.0 original document in
formation author(s): eric a. meyer, netscape communications last updated date: published 09 aug 2002 copyright in
formation: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Using the Right Markup to Invoke Plugins - Archive of obsolete content
e a missing plugin using the netscape plugin finder service. this behavior is not incorrect according to the html 4.01 specification, but it obliges web authors to diligently specifyobtainment mechanisms. at a minimum, web authors will have to nest some alternate text inside their object elements telling users where to obtain the missing component. adding an additional layer of convenience in the
form of automatic retrieval is the subject of a bug 180411 in the mozilla open source code. some plugins don't understand all the param elements that their documentation suggests should configure them in mozilla-based browsers. an example is versions of the macromedia flash player plugin upto flash player 6 r. 47, which don't understand the <param name="movie" value="animation.swf"> param element,...
...finder service to get plugins then whether these attributes are specified or not makes no difference -- the browser willalways consult with the plugin finder service to determine if it has a plugin to handle the missing mime type. if the preference is unchecked, the plugin finder service will be consulted only if the web page authordoes not specify either of these attributes. original document in
formation author(s): arun k. ranganathan, netscape communications last updated date: 14. nov 2002 copyright in
formation: copyright © 2001-2003 netscape. all rights reserved. link: http://devedge-temp.mozilla.org/view.../index_en.html references general -- specifications html 4.01 specification xhtml 1.0 specification object element html 4.01 specification on object element embed e...
Building up a basic demo with Three.js - Game development
the first <script> element includes the three.js library in the page, and we will write our example code inside the second. there are two helper variables already included, which store the window's width and he...
...e direction of our scene, so we can finally see something: var camera = new three.perspectivecamera(70, width/height); camera.position.z = 50; scene.add(camera); add the above lines to your code, below those previously added. there are other types of camera available (cube, orthographic), but the simplest is perspective. to initialize it, we have to set its field of view and aspect ratio: the
former is used to set how much is seen, and the latter is important for the objects on the screen to have the right proportions when rendered, and not look stretched. let's explain values we are setting for the code above: the value we set for the field of view, 70, is something we can experiment with: the higher the value, the greater the amount of scene the camera will show. imagine a normal came...
Square tilemaps implementation: Scrolling maps - Game development
this article covers how to implement scrolling square tilemaps using the canvas api. note: when writing this article, we assumed previous reader knowledge of canvas basics such as how get a 2d canvas context, load images, etc., which is all explained in the canvas api tutorial, as well as the basic in
formation included in our tilemaps introduction article. this article also builds upon implementing static square tilemaps — you should read that too if you've not done so already. ...
...s reader knowledge of canvas basics such as how get a 2d canvas context, load images, etc., which is all explained in the canvas api tutorial, as well as the basic in
formation included in our tilemaps introduction article. this article also builds upon implementing static square tilemaps — you should read that too if you've not done so already. the camera the camera is an object that holds in
formation about which section of the game world or level is currently being shown. cameras can either be free-
form, controlled by the player (such as in strategy games) or follow an object (such as the main character in plat
form games.) regardless of the type of camera, we would always need in
formation regarding its current position, viewport size, etc. in the demo provided along with this article, t...
Techniques for game development - Game development
this page lists essential core techniques for anyone wanting to develop games using open web technologies. using async scripts for asm.js especially when creating medium to large-sized games, async scripts are an essential technique to take advantage of, so that your game's javascript can be compiled off the main thread and be cached for future game running, resulting in a significant per
formance improvement for your users. this article explains how. optimizing startup per
formance how to make sure your game starts up quickly, smoothly, and without appearing to lock up the user's browser or device. using webrtc peer-to-peer data channels in addition to providing support for audio and video communication, webrtc lets you set up peer-to-peer data channels to exchange text or binary d...
...imations, and javascript loops involving window.requestanimationframe. audio for web games audio is an important part of any game — it adds feedback and atmosphere. web-based audio is maturing fast, but there are still many browser differences to negotiate. this article provides a detailed guide to implementing audio for web games, looking at what works currently across as wide a range of plat
forms as possible. 2d collision detection a concise introduction to collision detection in 2d games. tilemaps tiles are a very popular technique in 2d games for building the game world. these articles provide an introduction to tilemaps and how to implement them with the canvas api. ...
Accessibility tree (AOM) - MDN Web Docs Glossary: Definitions of Web-related terms
the accessibility tree, or accessibility object model (aom), contains accessibility-related in
formation for most html elements. browsers convert markup into an internal representation called the dom tree. the dom tree contains objects for all the markup’s elements, attributes, and text nodes. browsers then create an accessibility tree based on the dom tree, which is used by plat
form-specific accessibility apis for assistive technologies, such as screen readers. there are four things in an accessibility tree object: name how can we refer to this thing? for instance, a link with the text ‘read more’ will have ‘read more’ as its name (more on how names are computed in the accessible name and description computation spec). description how do we describe this element, if w...
... ...
Asynchronous - MDN Web Docs Glossary: Definitions of Web-related terms
e-mail is an asynchronous communication method; the sender sends an email and the recipient will read and reply to the message when it's convenient to do so, rather than doing so at once. and both sides can continue to send and receive messages whenever they wish, instead of having to schedule them around each other. when software communicates asynchronously, a program may make a request for in
formation from another piece of software (such as a server), and continue to do other things while waiting for a reply. for example, the ajax (asynchronous javascript and xml) programming technique—now usually simply "ajax", even though json is usually used rather than xml in modern applications—is a mechanism that requests relatively small amounts of data from the server using http, with the resu...
...w usually simply "ajax", even though json is usually used rather than xml in modern applications—is a mechanism that requests relatively small amounts of data from the server using http, with the result being returned when available rather than immediately. software design asynchronous software design expands upon the concept by building code that allows a program to ask that a task be per
formed alongside the original task (or tasks), without stopping to wait for the task to complete. when the secondary task is completed, the original task is notified using an agreed-upon mechanism so that it knows the work is done, and that the result, if any, is available. there are a number of programming techniques for implementing asynchronous software. see the article asynchronous javascript fo...
Attribute - MDN Web Docs Glossary: Definitions of Web-related terms
an attribute extends an element, changing its behavior or providing metadata. an attribute always has the
form name="value" (the attribute's identifier followed by its associated value). you may see attributes without the equals sign or a value. that is a shorthand for providing the empty string in html, or the attribute’s name in xml. ...
...name="value" (the attribute's identifier followed by its associated value). you may see attributes without the equals sign or a value. that is a shorthand for providing the empty string in html, or the attribute’s name in xml. <input required> <!-- is the same as… --> <input required=""> <!-- or --> <input required="required"> learn more technical reference html attribute reference in
formation about html's global attributes ...
Canonical order - MDN Web Docs Glossary: Definitions of Web-related terms
for example, background shorthand property values are made up of several background-* longhand properties. ...
...und-clip background-color furthermore, its syntax defines, that if a value for the background-size is given, it must be specified after the value for the background-position, separated by a slash. other values may appear in any order. learn more what does “canonical order” mean with respect to css properties? on stack overflow provides useful further discussion. the description of the
formal syntax used for css values on mdn ...
Developer Tools - MDN Web Docs Glossary: Definitions of Web-related terms
developer tools (or "development tools" or short "devtools") are programs that allow a developer to create, test and debug software. current browsers provide integrated developer tools, which allow to inspect a website. ...
...rrent browsers provide integrated developer tools, which allow to inspect a website. they let users inspect and debug the page's html, css, and javascript, allow to inspect the network traffic it causes, make it possible to measure it's per
formance, and much more. ...
Gaia - MDN Web Docs Glossary: Definitions of Web-related terms
the user interface and default application suite of the firefox os plat
form. once firefox os starts, anything drawn to screen is a product of the gaia layer (e.g., the lock screen, home screen, standard apps). gaia is implemented entirely with html, css, and javascript, and its only interfaces to the underlying operating system are through open web apis, which the gecko layer implements. you can install third-party apps alongside gaia. ...
...efox os starts, anything drawn to screen is a product of the gaia layer (e.g., the lock screen, home screen, standard apps). gaia is implemented entirely with html, css, and javascript, and its only interfaces to the underlying operating system are through open web apis, which the gecko layer implements. you can install third-party apps alongside gaia. learn more technical reference gaia plat
form guide gaia development/hacking guide ...
HTTP header - MDN Web Docs Glossary: Definitions of Web-related terms
an http header is a field of an http request or response that passes additional in
formation, altering or precising the semantics of the message or of the body. headers are case-insensitive, begins at the start of a line and are immediately followed by a ':' and a value depending of the header itself. the value finish at the next crlf or at the end of the message. traditionally, headers are classed in categories, though this classification is no more part of any specification: general header: headers applying to both requests and responses but with no relation to the data eventually transmitted in the body. ...
... a value depending of the header itself. the value finish at the next crlf or at the end of the message. traditionally, headers are classed in categories, though this classification is no more part of any specification: general header: headers applying to both requests and responses but with no relation to the data eventually transmitted in the body. request header: headers containing more in
formation about the resource to be fetched or about the client itself. response header: headers with additional in
formation about the response, like its location or about the server itself (name, version, …). entity header: headers containing more in
formation about the body of the entity, like its content length or its mime-type. a basic request with one header: get /example.http http/1.1 host:...
JavaScript - MDN Web Docs Glossary: Definitions of Web-related terms
t in their syntax, semantics, and use cases. javascript is primarily used in the browser, enabling developers to manipulate webpage content through the dom, manipulate data with ajax and indexeddb, draw graphics with canvas, interact with the device running the browser through various apis, and more. javascript is one of the world's most commonly-used languages, owing to the recent growth and per
formance improvement of apis available in browsers. origins and history conceived as a server-side language by brendan eich (then employed by the netscape corporation), javascript soon came to netscape navigator 2.0 in september 1995. javascript enjoyed immediate success and internet explorer 3.0 introduced javascript support under the name jscript in august 1996. in november 1996, netscape began w...
...under the name jscript in august 1996. in november 1996, netscape began working with ecma international to make javascript an industry standard. since then, the standardized javascript is called ecmascript and specified under ecma-262, whose latest (tenth, es2019) edition is available as of june 2019. recently, javascript's popularity has expanded even further through the successful node.js plat
form—the most popular cross-plat
form javascript runtime environment outside the browser. node.js - built using chrome's v8 javascript engine - allows developers to use javascript as a scripting language to automate things on a computer and build fully functional http and web sockets servers. learn more general knowledge javascript on wikipedia learning javascript the javascript guide on md...
MVC - MDN Web Docs Glossary: Definitions of Web-related terms
eady present. the view the view defines how the app's data should be displayed. in our shopping list app, the view would define how the list is presented to the user, and receive the data to display from the model. the controller the controller contains logic that updates the model and/or view in response to input from the users of the app. so for example, our shopping list could have input
forms and buttons that allow us to add or delete items. these actions require the model to be updated, so the input is sent to the controller, which then manipulates the model as appropriate, which then sends updated data to the view. you might however also want to just update the view to display the data in a different
format, e.g., change the item order to alphabetical, or lowest to highest price. ...
...uch as indexeddb [en-us].) your app's controlling code is probably written in html/javascript, and your user interface is probably written using html/css/whatever else you like. this sounds very much like mvc, but mvc makes these components follow a more rigid pattern. in the early days of the web, mvc architecture was mostly implemented on the server-side, with the client requesting updates via
forms or links, and receiving updated views back to display in the browser. however, these days, more of the logic is pushed to the client with the advent of client-side data stores, and xmlhttprequest allowing partial page updates as required. web frameworks such as angularjs and ember.js all implement an mvc architecture, albeit in slightly different ways. learn more general knowledge model–...
Node.js - MDN Web Docs Glossary: Definitions of Web-related terms
node.js is a cross-plat
form javascript runtime environment that allows developers to build server-side and network applications with javascript. ...
... node.js is a cross-plat
form javascript runtime environment that allows developers to build server-side and network applications with javascript. ...
Parse - MDN Web Docs Glossary: Definitions of Web-related terms
the parser parses tokenized input into the document, building up the document tree. when the html parser finds non-blocking resources, such as an image, the browser will request those resources and continue parsing. ...
...the parser parses tokenized input into the document, building up the document tree. when the html parser finds non-blocking resources, such as an image, the browser will request those resources and continue parsing. ...
RAIL - MDN Web Docs Glossary: Definitions of Web-related terms
in acronym order, the main tenets are: response respond to users immediately, acknowledging any user input in 100ms or less. animation when animating, render each frame in under 16ms, aiming for consistency and avoiding jank. ...
...in acronym order, the main tenets are: response respond to users immediately, acknowledging any user input in 100ms or less. animation when animating, render each frame in under 16ms, aiming for consistency and avoiding jank. ...
RTF - MDN Web Docs Glossary: Definitions of Web-related terms
rtf (rich text
format) is a plain-text-based file
format with support for
formatting instructions (like bold or italic). three programmers in the microsoft word team created rtf in the 1980s, and microsoft continued to develop the
format until 2008. however, many word-processing programs can still read and write rtf. ...
... rtf (rich text
format) is a plain-text-based file
format with support for
formatting instructions (like bold or italic). three programmers in the microsoft word team created rtf in the 1980s, and microsoft continued to develop the
format until 2008. however, many word-processing programs can still read and write rtf. ...
Real User Monitoring (RUM) - MDN Web Docs Glossary: Definitions of Web-related terms
rum helps identify how an application is being used, including the geographic distribution of users and the impact of that distribution on the end user experience. ...
...rum helps identify how an application is being used, including the geographic distribution of users and the impact of that distribution on the end user experience. ...
Request header - MDN Web Docs Glossary: Definitions of Web-related terms
not all headers appearing in a request are request headers. for example, the content-length appearing in a post request is actually an entity header referring to the size of the body of the request message. ...
...-encoding: gzip, deflate, br referer: https://developer.mozilla.org/testpage.html connection: keep-alive upgrade-insecure-requests: 1 if-modified-since: mon, 18 jul 2016 02:36:04 gmt if-none-match: "c561c68d0ba92bbeb8b0fff2a9199f722e3a621a" cache-control: max-age=0 strictly speaking, the content-length header in this example is not a request header like the others, but an entity header: post /my
form.html http/1.1 host: developer.mozilla.org user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0 content-length: 128 learn more technical knowledge list of all http headers ...
SVG - MDN Web Docs Glossary: Definitions of Web-related terms
scalable vector graphics (svg) is a 2d vector image
format based on an xml syntax. the w3c began work on svg in the late 1990s, but svg only became popular when internet explorer 9 came out with svg support. all major browsers now support svg. based on an xml syntax, svg can be styled with css and made interactive using javascript. html5 now allows direct embedding of svg tags in an html document. as a vector image
format, svg graphics can scale infinitely, making them invaluable in responsive design, since you can create interface elements and graphics that scale to any screen size. svg also provides a useful set of tools, such as clipping, masking, filters, and animations. ...
...ml document. as a vector image
format, svg graphics can scale infinitely, making them invaluable in responsive design, since you can create interface elements and graphics that scale to any screen size. svg also provides a useful set of tools, such as clipping, masking, filters, and animations. ...
Whitespace - MDN Web Docs Glossary: Definitions of Web-related terms
t of characters which is used to show horizontal or vertical spaces between other characters. they are often used to separate tokens in html, css, javascript, and other computer languages. whitespace characters and their usage vary between languages. in html html living standard specifies 5 characters as the ascii whitespace: u+0009 tab, u+000a lf, u+000c ff, u+000d cr, and u+0020 space. in the
form of text, they are treated as normal space characters and sequential whitespaces are collapsed as a single space in many cases (this behavior can be changed by the white-space css property. they are also used as a separator of an element name and its parameters, class names, and so on. in javascript ecmascript® 2015 language specification specifies several unicode codepoints as white space: u+0...
... whitespaces are collapsed as a single space in many cases (this behavior can be changed by the white-space css property. they are also used as a separator of an element name and its parameters, class names, and so on. in javascript ecmascript® 2015 language specification specifies several unicode codepoints as white space: u+0009 character tabulation <tab>, u+000b line tabulation <vt>, u+000c
form feed <ff>, u+0020 space <sp>, u+00a0 no-break space <nbsp>, u+feff zero width no-break space <zwnbsp> and other category “zs” any other unicode “separator, space” code point <usp>. these characters are usually unnecessary for the functionality of the code. ...
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
var acceptlanguage = xinclude.getattribute('accept-language'); // "accept-language: "+x var xifallback = xinclude.getelementsbytagnamens('http://www.w3.org/2001/xinclude', 'fallback')[0]; // only one such child is allowed if (href === '' || href === null) { // points to same document if empty (null is equivalent to empty string) href = null; // set for uni
formity in testing below if (parse === 'xml' && xpointer === null) { alert('there must be an xpointer attribute present if "href" is empty an parse is "xml"'); return false; } } else if (href.match(/#$/, '') || href.match(/^#/, '')) { alert('fragment identifiers are disallowed in an xinclude...
...); var a = []; for(var k = 0; k < xpathresult.snapshotlength; k++) { a[k] = xpathresult.snapshotitem(k); } responsenodes = a; } else { // otherwise, the response must be a single well-
formed document response responsenodes = [response.documentelement]; // put in array so can be treated the same way as the above } // prepend any node(s) (as xml) then remove xinclude for (j=0; j < responsenodes.length ; j++) { xincludeparent.insertbefore(...
XSLT - MDN Web Docs Glossary: Definitions of Web-related terms
the xslt processor produces a new document based on the xml document and an xslt stylesheet, making no changes to the original files in the process. ...
...the xslt processor produces a new document based on the xml document and an xslt stylesheet, making no changes to the original files in the process. ...
jQuery - MDN Web Docs Glossary: Definitions of Web-related terms
to explain it in detail, $(selector) will call jquery to select selector element(s), and assign it to an event api called .action(). ...
...ries out the same function as the following code: window.onload = function() { alert("hello world!"); document.getelementbyid("blackbox").style.display = "none"; }; or: window.addeventlistener("load", () => { alert("hello world!"); document.getelementbyid("blackbox").style.display = "none"; }); learn more general knowledge jquery on wikipedia jquery official website technical in
formation offical api reference documentation ...
non-normative - MDN Web Docs Glossary: Definitions of Web-related terms
software specifications often contains in
formation marked as non-normative or in
formative, which means that those are provided there for the purpose of helping the readers to understand the specification better or to show an example or a best practice, and not needed to be followed as a rule. sections that contain official part of the specification that must be followed are often marked as normative. ...
...marked as non-normative or in
formative, which means that those are provided there for the purpose of helping the readers to understand the specification better or to show an example or a best practice, and not needed to be followed as a rule. sections that contain official part of the specification that must be followed are often marked as normative. ...
Test your skills: WAI-ARIA - Learn web development
kup, which is obviously meant to be a list. assuming you are not able to change the elements used, how can you allow screenreader users to recognize this as a list? try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. ...
...eader users to recognize this as a list? try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. wai-aria 2 in our second wai-aria task, we present a simple search
form, and we want you to add in a couple of wai-aria features to improve its accessibility: how can you allow the search
form to be called out as a separate landmark on the page by screenreaders, to make it easily findable? how can you give the search input a suitable label, without explicitly adding a visible text label to the dom? try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. wai-aria 3 for this ...
Accessibility - Learn web development
y. web accessibility involves ensuring that content remains accessible, regardless of who and how the web is accessed. the firefox accessibility inspector is a very useful tool for checking out accessibility issues on web pages. the following video provides a nice introduction to it: looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites to get the most out of this module, it would be a good idea to either work through at least the first two modules of the html, css, and javascript topics, or perhaps even better, work through the relevant parts of the accessibility module as you work through the related technology topics. note: if you are working on a comput...
...el to improve accessibility. accessible multimedia another category of content that can create accessibility problems is multimedia — video, audio, and image content need to be given proper textual alternatives, so they can be understood by assistive technologies and their users. this article shows how. mobile accessibility with web access on mobile devices being so popular, and popular plat
forms such as ios and android having fully-fledged accessibility tools, it is important to consider the accessibility of your web content on these plat
forms. this article looks at mobile-specific accessibility considerations. assessments accessibility troubleshooting in the assessment for this module, we present to you a simple site with several accessibility issues that you need to diagnose a...
Backgrounds and borders - Learn web development
-top-right-radius: 1em 10%; } we have set all four corners in the example below and then changed the values for the top right corner to make it different. you can play with the values to change the corners. take a look at the property page for border-radius to see the available syntax options. test your skills! we have covered a lot in this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: backgrounds and borders. summary we have covered quite a lot here, and you can see that there is quite a lot to adding a background or a border to a box. do explore the different property pages if you want to find out more about any of the features we have discussed...
...from left to right? ...
Handling different text directions - Learn web development
are not using multiple writing modes then for now you might prefer to use the physical versions. however, ultimately we expect that people will transition to the logical versions for most things, as they make a lot of sense once you start also dealing with layout methods such as flexbox and grid. test your skills! we have covered a lot in this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: writing modes. summary the concepts explained in this lesson are becoming increasingly important in css. an understanding of the block and inline direction — and how text flow changes with a change in writing mode — will be very useful going forward. it will hel...
...at overflow in css. ...
Combinators - Learn web development
t in the markup. it is often better to create a simple class and apply that to the element in question. that said, your knowledge of combinators will come in very useful if you need to get to something in your document and are unable to access the html, perhaps due to it being generated by a cms. test your skills! we have covered a lot in this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: selectors. moving on this is the last section in our lessons on selectors. next we will move on to another important part of css — the css box model. previous overview: building blocks next in this module cascade and inheritance css selectors t...
... the css box model. ...
Sizing items in CSS - Learn web development
g to the viewport can be useful in your designs. for example, if you want a full-page hero section to show before the rest of your content, making that part of your page 100vh high will push the rest of the content below the viewport, meaning that it will only appear once the document is scrolled. test your skills! we have covered a lot in this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: sizing. summary this lesson has given you a rundown of some key issues that you might run into when sizing things on the web. when you move onto css layout, sizing will become very important in mastering the different layout methods, so it is worth understanding the...
...e before moving on. ...
CSS building blocks - Learn web development
vailable, units, sizing, styling backgrounds and borders, debugging, and lots more. the aim here is to provide you with a toolkit for writing competent css and help you understand all the essential theory, before moving on to more specific disciplines like text styling and css layout. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites before starting this module, you should have: basic familiarity with using computers, and using the web passively (i.e. just looking at it, consuming the content.) a basic work environment set up as detailed in installing basic software, and an understanding of how to create and manage files, as detailed in dealing with fi...
... units in use. sizing items in css in the various lessons so far you have come across a number of ways to size items on a web page using css. understanding how big the different features in your design will be is important, and in this lesson, we will summarize the various ways elements get a size via css and define a few terms around sizing that will help you in the future. images, media, and
form elements in this lesson we will take a look at how certain special elements are treated in css. images, other media, and
form elements behave a little differently in terms of your ability to style them with css than regular boxes. understanding what is and isn't possible can save some frustration, and this lesson will highlight some of the main things that you need to know. styling tables styl...
Multiple-column layout - Learn web development
summary you now know how to use the basic features of multiple-column layout, another tool at your disposal when choosing a layout method for the designs you are building. ...
... summary you now know how to use the basic features of multiple-column layout, another tool at your disposal when choosing a layout method for the designs you are building. ...
Getting started with CSS - Learn web development
take a simple html document and apply css to it, learning some practical things about the language along the way. prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, and html basics (study introduction to html.) objective: to understand the basics of linking a css document to an html file, and be able to do simple text
formatting with css. starting with some html our starting point is an html document. you can copy the code from below if you want to work on your own computer. save the code below as index.html in a folder on your machine. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>getting started with css</title> </head> <body> <h1>i am a level one heading</h1> <...
...ething to look different based on where it is in the document. there are a number of selectors that can help you here, but for now we will look at just a couple. in our document are two <em> elements — one inside a paragraph and the other inside a list item. to select only an <em> that is nested inside an <li> element i can use a selector called the descendant combinator, which simply takes the
form of a space between two other selectors. add the following rule to your stylesheet. li em { color: rebeccapurple; } this selector will select any <em> element that is inside (a descendant of) an <li>. so in your example document, you should find that the <em> in the third list item is now purple, but the one inside the paragraph is unchanged. something else you might like to try is styling a...
CSS first steps - Learn web development
of your content, split it into multiple columns, or add animations and other decorative features. this module provides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites before starting this module, you should have: basic familiarity with using computers, and using the web passively (i.e. looking at it, consuming the content.) a basic work environment set up as detailed in installing basic software, and an understanding of how to create and manage files, as detailed in dealing with files. ...
...re; you can return to this one to recap if you find any later concepts confusing. how css works we have learned the basics of css, what it is for and how to write simple stylesheets. in this lesson we will take a look at how a browser takes css and html and turns that into a webpage. using your new knowledge with the things you have learned in the last few lessons you should find that you can
format simple text documents using css, to add your own style to them. this article gives you a chance to do that. ...
How do you make sure your website works properly? - Learn web development
found", and that's why we didn't see the image. http statuses servers respond with a status message whenever they receive a request. here are the most common statuses: 200: ok the resource you asked for was delivered. 301: moved permanently the resource has moved to a new location. you won't see this much in your browser, but it's good to know about "301" since search engines use this in
formation a lot to update their indexes. 304: not modified the file has not changed since the last time you asked for it, so your browser can display the version from its cache, resulting in faster response times and more efficient use of bandwidth. 403: forbidden you aren't allowed to display the resource. usually it has to do with a configuration mistake (e.g. your hosting provider forgot to giv...
...reload the page: in this example, we learn (quite clearly) what the error is, and we can go fix it (we will cover javascript in another series of articles). more things to check we have listed a few simple ways to check that your website works properly, as well as the most common errors you may run across and how to fix them. you can also test if your page meets these criteria: how's the per
formance? does the page load fast enough? resources like webpagetest.org or browser add-ons like yslow can tell you a few interesting things: grades go from a to f. our page is just small and meets most criteria. but we can already note it would have been better to use a cdn. that doesn't matter very much when we're only serving one image, but it would be critical for a high-bandwidth website serv...
What HTML features promote accessibility? - Learn web development
html" tabindex="3">there</a></li> <li><a href="anywhere.html" tabindex="2">anywhere</a></li> </ul> in this example (which is used purely as a demonstration—do not do this), tabbing would jump from “here” to “anywhere” to “there”. link titles if you have a link that isn’t self-descriptive, or the link destination could benefit from being explained in more detail, you can add in
formation to a link using the title attribute. <p>i'm really bad at writing link text. <a href="inept.html" title="why i'm rubbish at writing link text: an explanation and an apology.">click here</a> to find out more.</p> access keys access keys provide easier navigation by assigning a keyboard shortcut to a link, which will usually gain focus when the user presses alt or ctrl + the access key. the...
...bute. <p>i'm really bad at writing link text. <a href="inept.html" title="why i'm rubbish at writing link text: an explanation and an apology.">click here</a> to find out more.</p> access keys access keys provide easier navigation by assigning a keyboard shortcut to a link, which will usually gain focus when the user presses alt or ctrl + the access key. the exact key combination varies by plat
form. <a href="somepage.html" accesskey="s">some page</a> skip links to aid tabbing, you can supply links that allow users to jump over chunks of your web page. you might want to allow someone to jump over a plethora of navigation links, for example, so they can just read a page’s main content rather than cycle through all of the links. <header> <h1>the heading</h1> <a href="#content">skip t...
How much does it cost to do something on the Web? - Learn web development
ately expensive (paintshop pro, less than $100), or several hundred dollars (adobe photoshop). you can use any of them, as they will have similar functionality, though some are so comprehensive you'll never use every feature. if at some point you need to exchange projects with other designers, you should find out what tools they're using. editors can all export finished projects to standard file
formats, but each editor saves ongoing projects in its own specialized
format. most of the images on the internet are copyrighted, so it is better to check the license of the file before you use it. sites like pixabay provide images under cc0 license, so you can use, edit and publish them even with modification for commercial use. media editors if you want to include video or audio into your website...
...ient, as part of its file manager. windows explorer, nautilus (a common linux file manager), and the mac finder all include this functionality. however, people often choose dedicated (s)ftp clients to display local or remote directories side-by-side and store server passwords. if you want to install an (s)ftp client, there are several reliable and free options: for example, filezilla for all plat
forms, winscp for windows, cyberduck for mac or windows, and more. because ftp is inherently insecure, you should make sure to use sftp — the secure, encrypted version of ftp that most hosting sites you'll deal with these days will offer by default — or another secure solution like rsync over ssh. browsers you either already have a browser or can get one for free. if necessary, download firefox...
What are hyperlinks? - Learn web development
ually called links, are a foundational concept behind the web. to explain what links are, we need to step back to the very basics of web architecture. back in 1989, tim berners-lee, the web's inventor, spoke of the three pillars on which the web stands: url, an address system that keeps track of web documents http, a transfer protocol to find documents when given their urls html, a document
format allowing for embedded hyperlinks as you can see in the three pillars, everything on the web revolves around documents and how to access them. the web's original purpose was to provide an easy way to reach, read, and navigate through text documents. since then, the web has evolved to provide access to images, videos, and binary data, but these improvements have hardly changed the three pillars...
...al link a link between two webpages, where both webpages belong to the same website, is called an internal link. without internal links, there's no such thing as a website (unless, of course, it's a one-page website). external link a link from your webpage to someone else's webpage. without external links, there is no web, since the web is a network of webpages. use external links to provide in
formation besides the content available through your webpage. incoming links a link from someone else's webpage to your site. it's the opposite of an external link. note that you don't have to link back when someone links to your site. when you're building a website, focus on internal links, since those make your site usable. find a good balance between having too many links and too few. we'll tal...
Test your skills: Other controls - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. other controls 1 in our first "other controls" assessment, we'll get you to create a multi-line text input. create a basic multi-line text input. associate it semantically with the provided "comment" label. give the input 35 columns, and 10 rows of space in which to add comments. ...
... download the starting point for this task to work in your own editor or in an online editor. other controls 3 in our final task of this set, we start with much the same list of food choices. however, this time we want to do things differently: create a basic text input that is semantically associated with the provided label. put the food choices into a list that can be associated with a
form input. associate the list with your text input, so that when you type characters, any of the list options that match the character sequence are given in a dropdown list as autocomplete suggestions. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. assessment or further help you ...
CSS basics - Learn web development
only when in the specified state. (for example, when a cursor hovers over a link.) a:hover selects <a>, but only when the mouse pointer is hovering over the link. there are many more selectors to discover. to learn more, see the mdn selectors guide. fonts and text now that we've explored some css fundamentals, let's improve the appearance of the example by adding more rules and in
formation to the style.css file. first, find the output from google fonts that you previously saved from what will your website look like?. add the <link> element somewhere inside your index.html's head (anywhere between the <head> and </head> tags). it looks something like this: <link href="https://fonts.googleapis.com/css?family=open+sans" rel="stylesheet"> this code links your page to a ...
...ou can either: 1) reduce the image width using a graphics editor, or 2) use css to size the image by setting the width property on the <img> element with a smaller value. note: don't be too concerned if you don't completely understand display: block; or the differences between a block element and an inline element. it will make more sense as you continue your study of css. you can find more in
formation about different display values on mdn's display reference page. conclusion if you followed all the instructions in this article, you should have a page that looks similar to this one: (you can view our version here.) if you get stuck, you can always compare your work with our finished example code on github. in this exercise, we have just scratched the surface of css. to go further, s...
Installing basic software - Learn web development
gnu emacs, or vim), or a hybrid editor (e.g. dreamweaver or webstorm). office document editors are not suitable for this use, as they rely on hidden elements that interfere with the rendering engines used by web browsers. web browsers, to test code in. currently, the most-used browsers are firefox, chrome, opera, safari, internet explorer and microsoft edge. you should also test how your site per
forms on mobile devices and on any old browsers your target audience may still be using (such as ie 8–10.) lynx, a text-based terminal web browser, is great for seeing how your site is experienced by visually-impaired users. a graphics editor, like gimp, figma, paint.net, photoshop, or xd, to make images or graphics for your web pages. a version control system, to manage files on servers, collabor...
... right now, git is the most popular version control system along with the github or gitlab hosting service. an ftp program, used on older web hosting accounts to manage files on servers (git is increasingly replacing ftp for this purpose). there are loads of (s)ftp programs available including cyberduck, fetch and filezilla. an automation system, like webpack, grunt, or gulp to automatically per
form repetitive tasks, such as minifying code and running tests. libraries, frameworks, etc., to speed up writing common functionality. a library tends to be an existing javascript or css file that provides ready-rolled functionality for you to make use of in your code. a framework tend to take this idea further, offering a complete system with some custom syntaxes for you to write a web app on top o...
What will your website look like? - Learn web development
previous overview: getting started with the web next what will your website look like? discusses the planning and design work you have to do for your website before writing code, including "what in
formation does my website offer?", "what fonts and colors do i want?", and "what does my site do?" first things first: planning before doing anything, you need some ideas. what should your website actually do? a website can do basically anything, but, for your first try, you should keep things simple. we'll start by creating a simple webpage with a heading, an image, and a few paragraphs. to begin, you'll need to answer these questions: what is your website about? do you like dogs, new york, or pac-man? what in
formation are you presenting on the subject? write a title and a few par...
...ragraphs. to begin, you'll need to answer these questions: what is your website about? do you like dogs, new york, or pac-man? what in
formation are you presenting on the subject? write a title and a few paragraphs and think of an image you'd like to show on your page. what does your website look like, in simple high-level terms? what's the background color? what kind of font is appropriate:
formal, cartoony, bold and loud, subtle? note: complex projects need detailed guidelines that go into all the details of colors, fonts, spacing between items on a page, appropriate writing style, and so on. this is sometimes called a design guide, design system, or brand book, and you can see an example at the firefox photon design system. sketching out your design next, grab pen and paper and s...
Add a hitmap on top of an image - Learn web development
mage link to different pages. this article discusses client-side image maps only. do not use server-side image maps, which require the user to have a mouse. image maps, and their drawbacks when you nest an image inside <a>, the entire image links to one webpage. an image map, on the other hand, contains several active regions (called "hotspots") that each link to a different resource.
formerly, image maps were a popular navigation device, but it’s important to thoroughly consider their per
formance and accessibility ramifications. text links (perhaps styled with css) are preferable to image maps for several reasons: text links are lightweight, maintainable, often more seo-friendly, and support accessibility needs (e.g., screen readers, text-only browsers, translation services). ...
...ation intuitive, make sure the source order of <area> elements corresponds to the visual order of hotspots. <area> elements are empty elements, but do require four attributes: shape coords shape takes one of four values: circle, rect, poly, and default. (a default <area> occupies the entire image, minus any other hotspots you’ve defined.) the shape you choose determines the coordinate in
formation you’ll need to provide in coords. for a circle, provide the center's x and y coordinates, followed by the length of the radius. for a rectangle, provide the x/y coordinates of the upper-left and bottom-right corners. for a polygon, to provide the x/y coordinates of each corner (so, at least six values). coordinates are given in css pixels. in case of overlap, source order ca...
Structuring a page of content - Learn web development
der spanning the full width of the site containing the main title for the page, the site logo, and the navigation menu. the title and logo appear side by side once styling is applied, and the navigation appears below those two items. a main content area containing two columns — a main block to contain the welcome text, and a sidebar to contain image thumbnails. a footer containing copyright in
formation and credits. you need to add a suitable wrapper for: the header the navigation menu the main content the welcome text the image sidebar the footer you should also: apply the provided css to the page by adding another <link> element just below the existing one provided at the start. hints and tips use the w3c nu html checker to catch unintended mistakes in your html, css, ...
...actice to get into — it's very hard to help someone with a coding problem if you can't see their code. ...
Test your skills: Advanced HTML text - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. advanced html text 1 in this task we want you to turn the provided animals and their definitions into a description list. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. ...
...ics to the provided html as follows: turn the second paragraph into a block-level quote, and semantically indicate that the quote is taken from accessibility. semantically mark up "html" and "css" as acronyms, providing expansions as tooltips. semantically associate machine-readable dates with the dates in the text. use subscript and superscript to provide correct semantics for the chemical
formulae and dates, and make them display correctly. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. assessment or further help you can practice these examples in the interactive editors above. if you would like your work assessed, or are stuck and want to ask for help: put your...
HTML table advanced features and accessibility - Learn web development
cell2 cell3 cell4 cell5 cell6 tables for visually impaired users let's recap briefly on how we use data tables. a table can be a handy tool, for giving us quick access to data and allowing us to look up different values. for example, it takes only a short glance at the table below to find out how many rings were sold in gent last august. to understand its in
formation we make visual associations between the data in this table and its column and/or row headers. items sold august 2016 clothes accessories trousers skirts dresses bracelets rings belgium antwerp 56 22 43 72 23 gent 46 18 50 61 15 brussels 51 27 38 69 28 the net...
...this is no problem when you're reading plain text but interpreting a table can be quite a challenge for a blind person. nevertheless, with the proper markup we can replace visual associations by programmatic ones. note: there are around 253 million people living with visual impairment according to who data in 2017. this section of the article provides further techni...
Structuring the web with HTML - Learn web development
to build websites, you should know about html — the fundamental technology used to define the structure of a webpage. html is used to specify whether your web content should be recognized as a paragraph, list, heading, link, image, multimedia player,
form, or one of many other available elements or even a new element that you define. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites before starting this topic, you should have at least basic familiarity with using computers and using the web passively (i.e. just looking at it, consuming the content). you should have a basic work environment set up as detailed in installing basic software, and understand...
...a challenge. this module covers basic table markup, along with more complex features such as implementing captions and summaries. solving common html problems use html to solve common problems provides links to sections of content explaining how to use html to solve very common problems when creating a webpage: dealing with titles, adding images or videos, emphasizing content, creating a basic
form, etc. ...
Introducing asynchronous JavaScript - Learn web development
nderstanding of javascript fundamentals. objective: to gain familiarity with what asynchronous javascript is, how it differs from synchronous javascript, and what use cases it has. synchronous javascript to allow us to understand what asynchronous javascript is, we ought to start off by making sure we understand what synchronous javascript is. this section recaps some of the in
formation we saw in the previous article. a lot of the functionality we have looked at in previous learning area modules is synchronous — you run some code, and the result is returned as soon as the browser can do so. let's look at a simple example (see it live here, and see the source): const btn = document.queryselector('button'); btn.addeventlistener('click', () => { alert('you clicked me!');...
...g() statements appear in the desired order, you could make the third console.log() statement run async as well. this can be done by moving it inside another .then() block chained onto the end of the second one, or by simply moving it inside the second then() block. try fixing this now. note: if you get stuck, you can find an answer here (see it running live also). you can also find a lot more in
formation on promises in our graceful asynchronous programming with promises guide, later on in the module. conclusion in its most basic
form, javascript is a synchronous, blocking, single-threaded language, in which only one operation can be in progress at a time. but web browsers define functions and apis that allow us to register functions that should not be executed synchronously, and should in...
Asynchronous JavaScript - Learn web development
in this module we take a look at asynchronous javascript, why it is important, and how it can be used to effectively handle potential blocking operations such as fetching resources from a server. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites asynchronous javascript is a fairly advanced topic, and you are advised to work through javascript first steps and javascript building blocks modules before attempting this. if you are not familiar with the concept of asynchronous programming, you should definitely start with the general asynchronous programming concepts article in this module. if you are, then you can probably skip to the introducing asynchronous ...
...re. this is really useful for setting up a sequence of operations to work correctly. this article shows you how promises work, where you'll see them in use in webapis, and how to write your own. making asynchronous programming easier with async and await promises can be somewhat complex to set up and understand, and so modern browsers have implemented async functions and the await operator. the
former allows standard functions to implicitly behave asynchronously with promises, whereas the latter can be used inside async functions to wait for promises before the function continues. this makes chaining promises simpler and easier to read. choosing the right approach to finish this module off, we'll consider the different coding techniques and features we've discussed throughout, looking at w...
Making decisions in your code — conditionals - Learn web development
conclusion and that's all you really need to know about conditional structures in javascript right now! if there is anything you didn't understand, feel free to read through the article again, or contact us to ask for help. ...
... conclusion and that's all you really need to know about conditional structures in javascript right now! if there is anything you didn't understand, feel free to read through the article again, or contact us to ask for help. ...
Silly story generator - Learn web development
we are saying "if a value has been entered into the customname text input, replace bob in the story with that custom name." inside the second if block, we are checking to see if the uk radio button has been selected. if so, we want to convert the weight and temperature values in the story from pounds and fahrenheit into stones and centigrade. what you need to do is as follows: look up the
formulae for converting pounds to stone, and fahrenheit to centigrade. inside the line that defines the weight variable, replace 300 with a calculation that converts 300 pounds into stones. concatenate ' stone' onto the end of the result of the overall math.round() call. inside the line that defines the temperature variable, replace 94 with a calculation that converts 94 fahrenheit into centigra...
...ove). this is a good practice to get into — it's very hard to help someone with a coding problem if you can't see their code. ...
Test your skills: Math - Learn web development
starting point for this task to work in your own editor or in an online editor. math 2 in the second task you are already provided with two calculations, with the results stored in the variables result and result2. but these results aren't what we want; you'll need to take the calculations and change them to give us what we want. ...
... 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. the value of finalnumber needs to be 10.42. ...
What went wrong? Troubleshooting JavaScript - Learn web development
es you error messages whenever a syntax error exists inside the javascript being fed into the browser's javascript engine. now let's go hunting. go to the tab that you've got number-game-errors.html open in, and open your javascript console. you should see an error message along the following lines: this is a pretty easy error to track down, and the browser gives you several useful bits of in
formation to help you out (the screenshot above is from firefox, but other browsers provide similar in
formation). from left to right, we've got: a red "x" to indicate that this is an error. an error message to indicate what's gone wrong: "typeerror: guesssubmit.addeventlistener is not a function" a "learn more" link that links through to an mdn page that explains what this error means in g...
... has been won. be careful! syntaxerror: missing ) after argument list this one is pretty simple — it generally means that you've missed the closing parenthesis at the end of a function/method call. note: see our syntaxerror: missing ) after argument list reference page for more details about this error. syntaxerror: missing : after property id this error usually relates to an incorrectly
formed javascript object, but in this case we managed to get it by changing function checkguess() { to function checkguess( { this has caused the browser to think that we are trying to pass the contents of the function into the function as an argument. be careful with those parentheses! syntaxerror: missing } after function body this is easy — it generally means that you've missed one of your ...
JavaScript First Steps - Learn web development
ions such as "what is javascript?", "what does it look like?", and "what can it do?", before moving on to taking you through your first practical experience of writing javascript. after that, we discuss some key building blocks in detail, such as variables, strings, numbers and arrays. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites before starting this module, you don't need any previous javascript knowledge, but you should have some familiarity with html and css. you are advised to work through the following modules before starting on javascript: getting started with the web (which includes a really basic javascript introduction). introduction to ht...
...mple "guess the number" game, step by step. what went wrong? troubleshooting javascript when you built up the "guess the number" game in the previous article, you may have found that it didn't work. never fear — this article aims to save you from tearing your hair out over such problems by providing you with some simple tips on how to find and fix errors in javascript programs. storing the in
formation you need — variables after reading the last couple of articles you should now know what javascript is, what it can do for you, how you use it alongside other web technologies, and what its main features look like from a high level. in this article we will get down to the real basics, looking at how to work with the most basic building blocks of javascript — variables. basic math in jav...
Object prototypes - Learn web development
oto__ property, which is derived from the prototype property on the constructor), and the properties and methods are found by walking up the chain of prototypes. note: it's important to understand that there is a distinction between an object's prototype (available via object.getprototypeof(obj), or via the deprecated __proto__ property) and the prototype property on constructor functions. the
former is the property on each instance, and the latter is the property on the constructor. that is, object.getprototypeof(new foobar()) refers to the same object as foobar.prototype. let's look at an example to make this a bit clearer. understanding prototype objects here we'll go back to the example in which we finished writing our person() constructor — load the example in your browser. you c...
...rty definitions function test(a, b, c, d) { // property definitions } // first method definition test.prototype.x = function() { ... }; // second method definition test.prototype.y = function() { ... }; // etc. this pattern can be seen in action in piotr zalewa's school plan app example. test your skills! you've reached the end of this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: object-oriented javascript. note that this set of tests relies on some of the knowledge taught in the next article, so you might want to read that first before you try them. summary this article has covered javascript object prototypes, including how prototype obje...
Introducing JavaScript objects - Learn web development
ta containers. the object-based nature of javascript is important to understand if you want to go further with your knowledge of the language, therefore we've provided this module to help you. here we teach object theory and syntax in detail, then look at how to create your own objects. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites before starting this module, you should have some familiarity with html and css. you are advised to work through the introduction to html and introduction to css modules before starting on javascript. you should also have some familiarity with javascript basics before looking at javascript objects in detail. before attempting...
... add methods to existing constructors. inheritance in javascript with most of the gory details of oojs now explained, this article shows how to create "child" object classes (constructors) that inherit features from their "parent" classes. in addition, we present some advice on when and where you might use oojs. working with json data javascript object notation (json) is a standard text-based
format for representing structured data based on javascript object syntax, which is commonly used for representing and transmitting data on web sites (i.e. sending some data from the server to the client, so it can be displayed on a web page). you'll come across it quite often, so in this article, we give you all you need to work with json using javascript, including parsing the json so you can access...
Routing in Ember - Learn web development
ed todos. add the following below the existing getters: get completed() { return this.todos.filter(todo => todo.iscompleted); } models now we need to add models to our route javascript files to allow us to easily return specific data sets to display in those models. model is a data loading lifecycle hook. for todomvc, the capabilities of model aren't that important to us; you can find more in
formation in the ember model guide if you want to dig deeper. we also provide access to the service, like we did for the components. the index route model first of all, update todomvc/app/routes/index.js so it looks as follows: import route from '@ember/routing/route'; import { inject as service } from '@ember/service'; export default class indexroute extends route { @service('todo-data') todos;...
... ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo
form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced s...
Accessibility in React - Learn web development
ll see the outline appear around the "add" button beneath the input. this shows you that the browser's focus has moved. press tab a few more times, and you will see this dashed focus indicator move between each of the filter buttons. keep going until the focus indicator is around the first "edit" button. press enter. the <todo /> component will switch templates, as we designed, and you'll see a
form that lets us edit the name of the task. but where did our focus indicator go? when we switch between templates in our <todo /> component, we completely remove the elements that were there before to replace them with something else. that means the element that we were focused on vanishes, and nothing is in focus at all. this could confuse a wide variety of users — particularly users who rely o...
... ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo
form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced s...
Creating our first Vue component - Learn web development
fects their display. registering props in vue, there are two ways to register props: the first way is to just list props out as an array of strings. each entry in the array corresponds to the name of a prop. the second way is to define props as an object, with each key corresponding to the prop name. listing props as an object allows you to specify default values, mark props as required, per
form basic object typing (specifically around javascript primitive types), and per
form simple prop validation. note: prop validation only happens in development mode, so you can't strictly rely on it in production. additionally, prop validation functions are invoked before the component instance is created, so they do not have access to the component state (or other props). for this component, we...
... ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo
form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced s...
Implementing feature detection - Learn web development
...
...e shown is a way of detecting html5 canvas support. function supports_canvas() { return !!document.createelement('canvas').getcontext; } if(supports_canvas()) { ... } method on element return value create an element in memory using document.createelement() and then check if a method exists on it. if it does, check what value it returns. see dive into html5 video
formats detection test. property on element retains value create an element in memory using document.createelement(), set a property to a certain value, then check to see if the value is retained. see dive into html5 <input> types detection test. note: the double not in the above example (!!) is a way to force a return value to become a "proper" boolean value, rather than a trut...
Understanding client-side web development tools - Learn web development
providing a complete toolchain example showing you how to get productive. get started now, with our "client-side tooling overview" prerequisites you should really learn the basics of the core html, css, and javascript languages first before attempting to use the tools detailed here. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started guides 1. client-side tooling overview in this article we provide an overview of modern web tooling, what kinds of tools are available and where you’ll meet them in the lifecycle of web app development, and how to find help with individual tools. 2. command line crash course in your development process you'll undoubtedly be required ...
...an use them in our own projects — to install project tool dependencies, keep them up-to-date, and more. 4. introducing a complete toolchain in the final couple of articles in the series we will solidify your tooling knowledge by walking you through the process of building up a sample case study toolchain. we'll go all the way from setting up a sensible development environment and putting trans
formation tools in place to actually deploying your app on netlify. in this article we'll introduce the case study, set up our development environment, and set up our code trans
formation tools. 5. deploying our app in the final article in our series, we take the example toolchain we built up in the previous article and add to it so that we can deploy our sample app. we push the code to github, deplo...
Tools and testing - Learn web development
we still need to keep cross-browser support in the forefront of our minds, and make sure that our code follows best practices that allow our projects to work across different browsers and devices that our users are using to browse the web, and be usable by people with disabilities. working out what tools you should be using can be a difficult process, so we have written this set of articles to in
form you of what types of tool are available, what they can do for you, and how to make use of the current industry favourites. note: we have referenced a number of tools in this topic, not because we endorse them or think they are the best, but because we know they work and have good industry support. in most cases there are other tools available, old ones will go out of fashion, and new ones will ...
... we have referenced a number of tools in this topic, not because we endorse them or think they are the best, but because we know they work and have good industry support. in most cases there are other tools available, old ones will go out of fashion, and new ones will no doubt appear. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites you should really learn the basics of the core html, css, and javascript languages first before attempting to use many the tools detailed here. for example, you'll need to know the fundamentals of these languages before you start debugging problems in complex web code, making effective use of javascript frameworks, or writing ...
Embedding API for Accessibility
comments/questions? please contact the mozilla accessibility community. mozilla needs to move in the direction of accessibility. here is the w3c's definition of accessibility for a user agent like mozilla. in part, being accessible means supporting a built-in accessibility apis for a plat
form, such as microsoft active accessibility or atk for linux and unix desktops. there are many other pieces, such as preferences to allow the user to change foreground and background colors, and font sizes. mozilla already supports some of these options. this document lays out what we already have, and what we'll need later, in the embedding api to support accessibility. text zoom on a per-window basis the nsidomwindow::gettextzoom(float *zoomfactor) and nsidomwindow::sett...
...m(float *zoomfactor) and nsidomwindow::settextzoom(float zoomfactor) methods can be used to set a wide range of text zoom factors on a content window. a zoom factor of 1.0 represents 100%, or normal zoom. for double-sized text, use nsidomwindow::settextzoom(2.0); using accessibility preferences there are a number of prefs related to accessibility. for the most part, an automatic reframe is per
formed when one of these prefs is changed. a reframe fixes the appearance of the page to match the new prefs, without reloading the document over the network. be aware that in debug builds, this can cause a great number of assertions (bug 71598) to use prefs in embedding, use something like the following code: #include "nsipref.h"; nsresult rv; nscomptr<nsipref> prefs(do_getservice(ns_pref_contra...
Frequently Asked Questions for Lightweight themes
the look of your firefox web browser. there are hundreds of thousands community-designed themes to choose from, with more added every day. start looking here for designs that fit your style. what kind of computers and operating systems do lightweight themes work with? lightweight themes work with any type of computer that has firefox installed. ...
...preview any theme by clicking "tap to preview"; the design appears in your browser header so you can "try it on." when you're ready, just click the blue install theme button. once a theme is installed, it is saved in the add-ons manager, where you can enable or disable them as you wish. ...
Add-ons
cesses for developing and testing how to publish your extension on addons.mozilla.org or distribute it yourself how to manage your published extension an enterprise guide for developing and using extensions how to develop themes for firefox firefox developer communities extensions for firefox for android in 2020, mozilla will release a new firefox for android experience. this new, high-per
formance browser for android has been rebuilt from the ground up using geckoview, mozilla’s mobile browser engine. we are currently building support for the webextensions api on geckoview. migrate an existing extension if you maintain a legacy extension, such as an xul overlay, bootstrapped, or add-on sdk-based extension, you can still port it to use webextension apis. there are some porting reso...
...er engine. we are currently building support for the webextensions api on geckoview. migrate an existing extension if you maintain a legacy extension, such as an xul overlay, bootstrapped, or add-on sdk-based extension, you can still port it to use webextension apis. there are some porting resources on firefox extension workshop, our site for firefox-specific development resources. for more in
formation about transition support, please visit our wiki page. publishing add-ons addons.mozilla.org, commonly known as "amo," is mozilla's official site for developers to list add-ons, and for users to discover them. by uploading your add-on to amo, you can participate in our community of users and creators and find an audience for your add-on. you are not required to list your add-on on amo, but...
Adding a new event
ispatched in content and do not represent user action. typically, events in this header file never cross process boundary. mouseevents.h this header file should be used for defining input events from pointing devices such as mouse. textevents.h this header file should be used for defining input events from keyboard or ime and also other text edit related events like querying focused content in
formation. touchevents.h this header file should be used for defining input events from touch devices. miscevents.h if the new event class isn't proper any header files above, you should use this. each event class should implement following methods manually. virtual internalfooevent* asfooevent() moz_override this method should just return this. this method is used for retrieving sub class p...
...reated with event constructor such as: var event = new fooevent("bar", { bubbles: true, cancelable: true, detail: 5 }); you shouldn't define construnctor in it. create xpcom interface for the dom event if your event class should be accessible via xpcom interface, you should create a new nsidomfooevent interface in dom/interfaces/events/. however, in these days, this is not necessary. ...
Application cache implementation overview
cationcache flag is now set true on the channel. when aentrystatus is a failure code, entry has not been found, but the url is falling under one of the network or fallback namespaces. when matching fallback namespace, the associated fallback entry for it is remembered. the load then continues from the network as a usual load, using http cache. when load of the resource fails fallback steps are per
formed (see “falling back on a resource load failure” chapter). associating the top level document with offline cache this happens between document load start and the first sub-resource download start and is not about associating nsiapplicationcache object with the channel, but with the document object the load is per
formed for. until steps described further the document doesn't know anything abou...
...ct to load entries from. the following loading process decisions are then the same as for the top level load with one addition: when the entry is neither found in the cache nor matches any namespace in that cache we fail the resource load with document_not_found. falling back on a resource load failure when a resource previously matching a fallback namespace failed to load from the network, we per
form fallback to the previously remembered fallback entry. it's actually a redirect to the fallback url loading from the associated nsiapplicationcache. updating an existing cache or first download of an offline cache the process of updating or first caching is invoked asynchronously from nscontentsink::processofflinemanifest() using nsofflinecacheupdateservice. the implementation of offline cache upd...
Choosing the right memory allocator
oks over some of them and tries to sort out which should be used under what circumstances. allocating memory in xpcom these are general purpose memory-management routines that you should use unless your code falls into one of the other categories below. use these if you link against xpcom or xpcom glue; this includes extensions with binary components. see the xpcom string guide for additional in
formation. ns_alloc() == nsimemory::alloc() ns_realloc() == nsimemory::realloc() ns_free() == nsimemory::free() nsmemory::clone() (note: not part of nsimemory) see infallible memory allocation for in
formation about how to allocate memory infallibly; that is, how to use memory allocators that will only return valid memory buffers, and never return null. allocating strings in xpcom code see "c...
...n api reference:memory. npn_memalloc npn_memfree npn_memflush javascript api memory allocators there are also routines intended for use within the javascript runtime engine (spidermonkey). this is the /js/ subtree of the source code. also, all consumers of the jsapi must use these routines for allocating memory they plan to pass to the javascript runtime. see jsapi reference for further in
formation. js_malloc() js_realloc() js_free() js_strdup() arena allocators nspr exposes arena allocators that can be used to efficiently allocate lots of small, uni
formly sized objects. presshell arena nsipresshell::allocateframe() and nsprescontext::allocatefromshell() can be used to allocate memory from an arena maintained by the presshell. these should only be used to allocate objects th...
Cookies Preferences in Mozilla
new in thunderbird 3 this preference is applicable to thunderbird 3 and later. earlier versions of thunderbird only allowed cookies on rss feeds. network.cookie.prefsmigrated default va...
...rated default value: false migration pref for users with older profiles (before mozilla 1.7). if you have the old-style prefs, they will be migrated when starting the application. (the old prefs are network.cookie.lifetime.enabled, network.cookie.lifetime.behavior, and network.cookie.warnaboutcookies.) true = prefs have been migrated false = migrate prefs on next startup original document in
formation author(s): mike connor last updated date: may 22, 2004 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Creating a Language Pack
nload the most recent en-us nightly that will be repacked to include your locale. $ make wget-en-us en_us_binary_url=http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-aurora if you're building on mac 64 bit, you'll need to change the command slightly: $ make wget-en-us en_us_binary_url=http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-aurora moz_pkg_plat
form=mac at some point, you should see the following success message: downloaded http://ftp.mozilla.org/pub/mozilla.o....en-us.mac.dmg to /users/your_id/mozilla/vc/firefox/browser/locales/../../dist/firefox-3.6b5pre.en-us.mac.dmg the en-us binary has been downloaded. let's unpack it $ make unpack again, for 64-bit mac, append moz_pkg_plat
form=mac to this command. at the end of the process, you s...
...singinfiles: 6124 missing: 5 0% of entries changed if you now preview the contents of the mergedir, you'll see that it contains the files which in your localization were missing some entities. all other files will be taken from en-us directly. it's now time to repackage the en-us binary with $ make installers-x-testing locale_mergedir=$(pwd)/mergedir again, for 64-bit mac, append moz_pkg_plat
form=mac to this command. each time you want to generate a new binary (often called a "repack"), you need to run these two commands. remember that you need to be in the directory firefox-build/browser/locales. $ make merge-x-testing locale_mergedir=$(pwd)/mergedir $ make installers-x-testing locale_mergedir=$(pwd)/mergedir at the end of the process, you should see the following success message. ...
Creating reftest-based unit tests
output. the reftest.list file can be named whatever you want, not necessarily reftest.list (but it has to end with .list). more to do create more reftests. new tests can be added to the reftest.list file, which can contain any number of tests. the file can include other things, but it does not get very complicated. ...
... there is one thing about automated tests that may not be obvious. there is really no way to construct a test that is too small. if you want to check something, and it seems trivial, that is ok. ...
Creating Sandboxed HTTP Connections
this: foo=bar&baz=eek. var inputstream = components.classes["@mozilla.org/io/string-input-stream;1"] .createinstance(components.interfaces.nsistringinputstream); inputstream.setdata(postdata, postdata.length); next, the nsichannel is qied to an nsiuploadchannel. ...
...ginputstream); inputstream.setdata(postdata, postdata.length); next, the nsichannel is qied to an nsiuploadchannel. ...
Capturing a minidump
a program as it's running, or as it was at the moment of a crash. small minidumps are created by the breakpad crash reporting tool, but sometimes that's not sufficient to diagnose a problem. for example, if the application is hanging (not responding to input, but hasn't crashed) then breakpad is not triggered, and it can be difficult to determine where the problem lies. sometimes a more complete
form of minidump is needed to see additional details about a crash, in which case manual capture of a minidump is desired. this page describes how to capture these minidumps on windows, to permit better debugging. privacy and minidumps warning! unlike the minidumps submitted by breakpad, these minidumps contain the complete contents of program memory. they are therefore much more likely to contain ...
...mp is needed to see additional details about a crash, in which case manual capture of a minidump is desired. this page describes how to capture these minidumps on windows, to permit better debugging. privacy and minidumps warning! unlike the minidumps submitted by breakpad, these minidumps contain the complete contents of program memory. they are therefore much more likely to contain private in
formation, if there is any in the browser. for this reason, you may prefer to generate minidumps against a clean profile where possible. capturing a minidump: application crash to capture a full minidump for an application crash, you can use a tool called windbg. install debugging tools for windows microsoft distributes the debugging tools for windows for free, those include windbg which you will ...
Debugging OpenGL
n be tricky. this article provides suggestions for how to improve your efficiency while debugging opengl code in gecko. opengl debug mode when running a debug build, you can enable the opengl debug mode by defining the environment variable moz_gl_debug. if you start up firefox with this variable defined, the following behavior changes occur: each time you issue an opengl call, a check is per
formed to ensure that the gl context is current, using a thread-local static variable to keep track of this. if the context isn't current, the call aborts. every time an opengl call completes, glfinish() gets run automatically. this flushes out each call, essentially turning opengl into a synchronous api. this makes debugging crashes caused by an opengl call much easier, since the stack you see will ...
...l into a synchronous api. this makes debugging crashes caused by an opengl call much easier, since the stack you see will match where the call was issued, rather than some time in the future when it happens to run and crash. if an opengl error occurred when executing the call, an error message is output. note: you can download debug builds from mozilla taskcluster — click an appropriate plat
form's debug build on the left, e.g. linux64-debug, then find the build link on the right hand side (this would be target.tar.bz2 for linux, target.dmg for macos, and target.zip for windows). if you need more verbose debug output, you can enable the verbose debug mode by defining the environment variable moz_gl_debug_verbose. with this enabled, messages are printed before and after every opengl call...
Makefiles - Best practices and suggestions
laundry list makefiles should remove all content that it will generate. prefer library rules whenever possible or create library rules that are missing. dependency builds - a second invocation of make within a sandbox should always be a nop. hardcoded values - avoid them like the plague. use variable assignments, autogen paths and dynamic file gathering. ...
... prefer library rules whenever possible or create library rules that are missing. dependency builds - a second invocation of make within a sandbox should always be a nop. hardcoded values - avoid them like the plague. use variable assignments, autogen paths and dynamic file gathering. plat
form specific - avoid this logic whenever possible. code as little plat
form specific logic within a makefile as possible, a conditional and compiler flags at most should be needed. for ex use defines within sources to shift plat
form logic into your source code. if a unit test is plat
form specific write your makefile so it can be used on all plat
forms but only do work on the specific hardware or class of hardware. for classes of hardware (unix/windows...
Old Thunderbird build
hardware requirements at least 4 gb of ram. 8 gb or more is recommended. while you can build thunderbird on older hardware it can take quite a bit of time to compile on slower machines with less ram. good internet connection for the initial source download. build prerequisites depending on your operating system you will need to carry out a different process to prepare your machine. ...
...les, for example to c:\program files (x86)\windows kits\8.1\include\shared and/or c:\program files (x86)\windows kits\10\include\10.0.nnnnn.0\shared respectively, where nnnnn is the highest number present on the system. check to make sure that the path in which you placed the source code has no spaces, and is not too long. searched the bug database for issues relating to your problem (e.g., plat
form-specific issues). try asking in mozilla.dev.builds - include details of what is in your mozconfig, and what the actual error is. check if your mozilla/ is a symlink. a symlink there is not supported. check for @topsrcdir@ or relative paths in your mozconfig. those have caused several problems historically and tend to be poorly tested when the build system changes. if on windows you get link e...
Simple Instantbird build
this should be kept in sync with simple thunderbird build, you might want to take a look at that page too. build prerequisites hardware requirements: while you can build instantbird on older hardware it can take quite a bit of time to compile on slower machines, and having 8gb of ram is recommended (though you can probably still get away with 4gb). good internet connection for the initial source download. ...
... the code? if the trunk is broken, you may wish to consider building one of the branches (to pull the source code from a branch, just replace the url to the repository in the hg clone instruction). checked to make sure that the path in which you placed the source code has no spaces, and is not too long? have you searched the bug database for issues relating to your problem (e.g., plat
form-specific issues)? try asking in mozilla.dev.chat - don't forget to include details of what is in your mozconfig, and what the actual error is. references general build documentation comm-central simple thunderbird build ...
Simple Sunbird build
building sunbird is no longer supported. you can give it a try, but its likely that the build system will present you an error. instead it is suggested to build thunderbird with lightning. please refer to the simple thunderbird build guide. you can build a bleeding-edge, development version of sunbird using the commands below. for complete in
formation, see the build documentation. installing build tools if your system is not listed below, see the build prerequisites page. ubuntu linux: sudo apt-get build-dep sunbird sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libiw-dev autoconf2.13 cvs fedora linux: sudo yum groupinstall 'development tools' 'development libraries' 'gnome software development' sudo yum install mercurial autoconf213 g...
...d to do is: echo 'ac_add_options --enable-calendar' >> .mozconfig or just add the ac_add_options --enable-calendar line to your .mozconfig with your favourite editor. then just re-run the "make -f client.mk" command above (you can do the addition before running make for the first time). this will build the lightning extension into src/../objdir-sb/mozilla/dist/xpi-stage/. see this section for in
formation on how to easily integrate lightning into a nightly version of thunderbird. how to build again later in your comm-central directory, run these commands: # get the latest source python client.py checkout then just re-run the "make -f client.mk" command above. make will only recompile files that changed, but it's still a long haul. an incremental build can be faster. building just lightning a...
Windows SDK versions
2 this comes with the windows 8.0 sdk included. visual studio 2012 express for windows desktop this comes with the windows 8.0 sdk included. visual c++ 10 (vs2010) professional this comes with the windows 7 sdk, so you should be all set out of the box. visual c++ 10 (vs2010) express download and install the windows 7 sdk. older versions some of the older version are no longer supported, further in
formation is available at obsolete build caveats and tips [en-us] under the windows sdk article. windows 8 sdk (official) features that depend on this sdk include: metro firefox front end gamepad api support you can download the sdk from the microsoft download center [web setup]. windows 7 sdk features that depend on this sdk include: windows 7 taskbar previews windows 7 download taskbar progre...
... (this was certainly the case for 64 bit windows 7 on a late 2008 macbook pro.) warning: due to a bug in windows 7 sdk, if you get "sdksetup encountered an error: expecting path %systemroot% to represent a valid system volume" error you may require to set environmental variable %windir% to something like "c:\windows" instead of "%systemroot%". older sdks these are no longer supported, further in
formation is available at obsolete build caveats and tips [en-us] under the windows sdk article. troubleshooting help! i know i have the correct sdk, but configure.in's still failing! try the following things in order: run the windows sdk configuration tool (if available) and make sure the right sdk is selected. restart the msys console. delete your entire object directory and start over. ...
Creating Custom Events That Can Pass Data
note that starting with version 6, firefox supports dom level 3 customevent, which lets you dispatch custom events with arbitrary data from javascript. ...
...the time of writing the author is not aware of a way to do this that doesn't involve modifications to trunk. what follows a list of the files you'll need to modify, as well as a discussion of each change. mozilla/dom/base/nsdomclassinfoclasses.h the change you make here is really rather small but it is incredibly important. if you peruse nsdomclassinfoclasses.h you'll see of list of macros of the
form domci_class(foo). you'll want to add an entry to it which looks like this: domci_class({truncated name}) here's the fun part: above i mentioned that you must name your events as nsdom. however, here you want to put the other part of the name (e.g. if you have an event named nsdommyfirstevent your nsdomclassinfoclasses entry would be domci_class(myfirstevent)). mozilla/dom/src/base/nsdomclassinfo...
ESLint
.jsx .jsm .xml .html .xhtml additionally, some directories and files are ignored, see the .eslintignore file handling errors if your code fails an eslint rule, you'll get an error similar to this: /gecko/toolkit/mozapps/installer/js-compare-ast.js 18:39 error 'snarf' is not defined. ...
...ls an eslint rule, you'll get an error similar to this: /gecko/toolkit/mozapps/installer/js-compare-ast.js 18:39 error 'snarf' is not defined. no-undef (eslint) if you don't understand a rule, you can look it up on eslint.org for more in
formation about it. mozilla specific rules there are some rules that are specific for the mozilla code-base. these have the prefix mozilla/. more in
formation: outline details of the rules rule source code common issues and how to solve them my editor says that "mozilla/whatever" is unknown run ./mach eslint --setup restart your editor if that doesn't work, check that you have your editor pointing to the correct node_modules folder. node.js is not recognized add it to your path environment variable by running path="$path:/path/to/...
Interface Compatibility
as we add new features to the web and to our applications, programming interfaces change. the rules which govern interface changes are different depending on the consumers and the languages involved. web content apis which are visible to web content are not modified, except as a last resort when inherent security vulnerabilities or incompatibility with other browsers make it the only option. any changes, including new features, must have super-review. one exception to this rule is apis which are explicitly shipped with mozilla prefixes as a technology preview. this includes css properties that begin with the -moz- prefix (e.g. -moz-box-shadow), or javascript apis that begin with the moz prefix (e.g. ...
... the jetpack sdk is planned for later in 2010. documented apis which are shipped as part of the jetpack sdk are designed to work in future versions of firefox. achieving this compatibility may require rebuilding the extension with a new version of the jetpack sdk. javascript/xul interfaces traditional extensions written using xul overlays and xpcom have access to the full power of the mozilla plat
form. with the power, however, comes the understanding that the mozilla plat
form is constantly changing and many apis may change in future versions of firefox. in micro/maintenance releases, there should be no incompatible changes to interfaces, except as a last resort when a security fix leaves no other option. this includes not only xpcom interfaces, but javascript functions, xbl bindings, and any...
Multiple Firefox profiles
running in different profiles, to avoid confusion, you might want to first exit/quit/terminate all running instances of firefox, firefox developer edition or nightly. then follow the instructions below, applicable to your operating system. from profile manager inside firefox if you already have firefox instance running, you can open another profile from the integrated profile manager on any plat
form: type about:profiles into the browser url search bar. find the profile you want to use. press the “launch profile in new browser” button next to it. windows windows xp click the start button. click "run". type firefox --new-instance--profilemanager. windows vista/7 click the start button. click the search bar at the bottom. type firefox --new-instance --profilemana...
...ored on your computer, click choose folder... to create the new profile, click finish. deleting a profile in the profile manager, select the profile to remove, and click delete profile.... confirm that you wish to delete the profile: don't delete files removes the profile from the profile manager yet retains the profile data files on your computer in the storage folder so that your in
formation is not lost. "don't delete files" is the preferred option, because it saves the old profile's folder, allowing you to recover the files to a new profile. delete files removes the profile and its files, including the profile bookmarks, settings, passwords, etc. warning: if you use the "delete files" option, the profile folder, and files will be deleted. this action cannot be ...
Storage access policy: Block cookies from trackers
is documentation, but may nevertheless impact the functionality of domains classified as trackers. we recommend sites test with firefox nightly, as this includes the newest version of our protections. as described above, note that nightly may include additional protections that end up getting removed or changed before they reach our release users. we’ll keep this page updated with the newest in
formation as we strengthen our protections. these protections are on by default in nightly. the cookie policy can be enabled in other versions of firefox through the content blocking settings (these steps will vary by version; the linked documentation includes a dropdown to select the appropriate firefox version). report broken sites if you find a website broken as a result of this change, file a b...
...n they are loaded on a top-level site owned by the same organization. firefox uses the built-in tracking protection url classifier to determine which resources match the tracking protection list. domains are matched against the list in accordance with the safebrowsing v4 specification. specifically, we check the exact hostname of the resource against the list, as well as the last four hostnames
formed by starting with the last five components and successively removing the leading component. consider the following examples: hostname on the list hostname of resource matched example.com example.com yes example.com a.b.example.com yes blah.example.com example.com no a.b.example.com c.d.example.com no blah.ex...
Tracking Protection
id works such that other page elements slide in to fill holes left by blocked elements. when firefox blocks content, it logs a message to the web console like this: the resource at "http://some/url" was blocked because tracking protection is enabled. note that with firefox for android, you can access console output using the remote debugger. click the ⓘ symbol in the address bar to view in
formation about the currently loaded page. the popup that appears will notify you when content has been blocked. you will also be able to disable tracking protection entirely if you choose by accessing the tracking settings. if tracking cookies were present, you would be able to view the list by clicking on "blocking tracking cookies" in the above image to view the following popup: you can click ...
... note: depending on a third party in this way is not a good practice anyway, because then your site can be broken if the third party is slow or unavailable, or if the tracker has been blocked by an add-on. ...
HTMLIFrameElement.addNextPaintListener()
note: the handler will receive the event once and then be thrown away. syntax instanceofhtmliframeelement.addnextpaintlistener(listener); returns void. ...
... note: the handler will receive the event once and then be thrown away. syntax instanceofhtmliframeelement.addnextpaintlistener(listener); returns void. ...
HTMLIFrameElement.getStructuredData()
this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the getstructureddata() method of the htmliframeelement interface retrieves any structured microdata (and hcard and hcalendar micro
format data) contained in the html loaded in the browser <iframe> and returns it as json. syntax var instanceofdomrequest = instanceofhtmliframeelement.getstructureddata(); returns a domrequest to handle the getstructureddata() request's success and error cases. if the request is successful, the request.result is a json object representation of all microdata contained on the page loaded in the bro...
... specification not part of any specification. ...
mozbrowsercontextmenu
e browser <iframe>'s viewport. clienty the y value of the coordinate that was clicked inside the browser <iframe>'s viewport. systemtargets an array containing one or more menusystem objects (see the menusystem object, below), containing details of the standard menu(s) that will be shown. for example, if the user clicked on an image nested in an <a> tag, two menus are available — one with in
formation related to the image, and one for the link. contextmenu a menu object (see the menu object, below) representing a custom menu defined via <menu> / <menuitem> elements and pointed to via a contextmenu attribute on the dom element clicked on, which contains the menu's id. contextmenuitemselected an anonymous function that fires when a menu item is selected. the menusystem object an obje...
... video clicked on to get the context menu. in the case of an link context menu, it is the link's href. text a domstring representing the text of the link clicked on, in the case of a link context menu. hasvideo a boolean. in the case of a video context menu, this returns true if the video has metadata and is bigger than 0 x 0, or false if not. action a domstring representing the action of a
form, in the case of a
form context menu. method a domstring representing the method of a
form, in the case of a
form context menu. name a domstring representing the name of a
form, in the case of a
form context menu. the menu object an object representing a custom menu defined via <menu> / <menuitem> elements and pointed to via a contextmenu attribute on the dom element clicked on, which conta...
Browser API
the methods of the eventtarget interface addeventlistener(), removeeventlistener(), and dispatchevent(). htmliframeelement.sendmouseevent() sends a mouseevent to the <iframe>'s content. utility methods last, there are some utility methods, useful for apps that host a browser <iframe>. htmliframeelement.getstructureddata() retrieves any structured microdata (and hcard and hcalendar micro
format data) contained in the html loaded in the browser <iframe> and returns it as json. browser api methods removed in firefox 65 in firefox 65, several of the mozilla browser api methods were removed in an effort to cut down on domrequest usage in the browser, and remove the parts of the browser api that are no longer needed (it is used only by the firefox devtools at this point). see bug 150307...
...wser <iframe> tries to open a context menu. this allows handling of the <menuitem> element available within the browser <iframe>'s content. mozbrowserdocumentfirstpaint sent when a new paint occurs on any document in the browser <iframe>. mozbrowsererror sent when an error occurs while trying to load content within a browser <iframe>. mozbrowserfindchange sent when a search operation is per
formed on the browser <iframe> content (see htmliframeelement search methods.) mozbrowserfirstpaint sent when the <iframe> paints content for the first time (this doesn't include the initial paint from about:blank.) mozbrowsericonchange sent when a new icon (e.g. <link rel="icon"> or <link rel="apple-touch-icon">) is available in the browser <iframe>'s content. mozbrowserloadend sent when the br...
overflow-clip-box
ntent-box. prior to firefox 29, this behavior was hardcoded; since then it uses this property that can be used elsewhere too. note that this property is activated by default only in the ua stylesheet and chrome contexts. ...
...stylesheet and chrome contexts. initial valuepadding-boxapplies toall elementsinheritednomediavisualcomputed valueas specifiedanimation typediscretecanonical orderthe unique non-ambiguous order defined by the
formal grammar syntax values padding-box this keyword makes the clipping be related to the padding box. content-box this keyword makes the clipping be related to the content box. ...
MozBeforePaint
usage outline in order to time your animation, the first thing you need to know is the time base; that is, the time at which your animation sequence started. you can determine this value by looking at window.mozanimationstarttime. this new property indicates the time, in milliseconds since epoch, at which all animations started in the specified window during the current refresh interval should be considered to have started running. with that value in hand, you can then schedule all your subsequent animation frames. ...
...th one another within the context of a given window. frame rate control mozbeforepaint won't fire more than a fixed number of times per second, e.g. 50 or 60. this is intentional, because modern operating systems and hardware won't let the browser display more frames than that anyway. limiting the frame rate avoids wasting work, thereby saving cpu usage and power and improving overall system per
formance. example this example per
forms a simple animation, moving a box a short distance after a short period of time. <!doctype html> <html> <body> <div id="d" style="width:100px; height:100px; background:lime; position:relative;"></div> <script> var d = document.getelementbyid("d"); var start = window.mozanimationstarttime; function step(event) { var progress = event.timestamp - start; d.sty...
Embedding the editor
application. (the current nseditorshell makes assumptions about the hosting xul document, which need to be broken.) composer embedded in a web page (<htmlarea>) ie 5 supports the <htmlarea> element; if mozilla is to support something similar, editor needs to be embeddable to the extent that this can be done. it is likely that we'd use xbl to implement this type of widget, as is the plan for other
form controls. as is the case for composer embedded in a native application, there is a requirement here that the composer ui be configurable, such that it can be displayed either as a toolbar at the top of the <htmlarea>, a floating palette, or a top-level toolbar. current problems the current composer architecture was created while other parts of mozilla were still under development, and as a result...
...t possible for an embedder to replace all of these with native ui? possible answer dialogs use the available editor apis to get and set data, so can do all their work through existing apis. ...
Embedding Tips
places such as looking up preference settings, creating new windows, locating files, displaying prompt or password dialog boxes and so on. embedders may wish to override some of the default service implementations with their own. for example, the default prompt service uses xul to render prompt dialogs and embedders may wish to render them in a way more appropriate for their application and plat
form.. how do i load a page? get thensiwebnavigation interface on your webbrowser and call the loaduri method with the appropriate uri and flags. this interface also has methods for reloading, stopping a load and going back and forward in the history. how do i block a load? implement the nsiwebprogresslistener interface and register it with the appropriate web browser object via the nsiwebbrowser:...
... operation. as the operation progresses, methods on the listener such as onstatechange, onprogresschange etc. are called, allowing the embedder to know what is happening. when the operation is completed, the onstatechange will be notified by a combination of state_stop | state_is_network state flags. you may also use the progress listener to query the request supplied in onstatechange for more in
formation. for example, if you wanted to check the server response headers, you might check onstatechange for state_start | state_is_request flags, and from the nsirequest argument qi fornsihttpchanne and call methods on that to determine response codes and other in
formation from the server. it is left as an exercise to make this sample synchronous, i.e. wait for persistence to complete before return...
Script security
when code from compartment a tries to access an object in compartment b, gecko gives it a cross-compartment wrapper. this is a proxy in compartment a for the real object, which lives in compartment b. inside the same compartment, all objects share a global and are therefore same-origin with each other. therefore there's no need for any security checks, there are no wrappers, and there is no per
formance overhead for the common case of objects in a single window interacting with each other. whenever cross-compartment access happens, the wrappers enable us to implement the appropriate security policy. because the wrapper we choose is specific to the relationship between the two compartments, the security policy it implements can be static: when the caller uses the wrapper, there's no need to ...
...ng objects in unexpected ways. for example, privileged code using an xray to a dom object sees only the original version of the dom object. any expando properties are not visible, and if any native dom properties have been redefined, they are not visible in the xray. the privileged code is able to waive xrays if it wants unfiltered access to the untrusted object. see xray vision for much more in
formation on xrays. unprivileged to privileged code if the caller has lower privileges than the target object, then the caller gets an opaque wrapper. an opaque wrapper denies all access to the target object. however, the privileged target is able to copy objects and functions into the less privileged scope using the exportfunction() and cloneinto() functions, and the less privileged scope is th...
Hacking with Bonsai
hacking mozilla with bonsai bonsai was originally created to solve the problem of tree instability. the original navigator code base had large sections that were shared across multiple plat
forms. many times, code checked in would compile or run on a handful of plat
forms. also, with as many as 100 engineers, it was very difficult to determine what happened in the tree that caused the instability. bonsai was created to solve these problems. the process everyone who checks into the tree, joins a group called "the hook" at 8:00 am pst every weekday morning, the source tree is closed. the build team will then pull the 8:00 am tree, and build it on a subset of the plat
forms, linux, win32 & macppc. at 10:00 am, everyone who is on the hook is available in case the build breaks eventually, the...
... check in, will be "on the hook" for the next day's build. the car pool lane is only available to those who arrange access ahead of time with the release team. when the tree is re-opened, the web page is updated and the hook is cleared. use the bonsai query tool to see what's been checked in to the tree lately and to look at differences between versions. read the introduction to bonsai for more in
formation about queries. the rules no checkins when the tree is closed unless you are fixing a build problem at the request of a build person. if you are on the hook, your top priority is to be available to the build team to fix bustages. if you are on the hook, you are findable. you are either at your desk, or pageable, checking e-mail constantly, or on irc so that you can be found immediately and ...
How to get a process dump with Windows Task Manager
ticle describes how to get a process dump with task manager on windows. (to get a process dump for thunderbird or some other product, substitute the product name where ever you see firefox in these instructions.) caution the memory dump that will be created through this process is a complete snapshot of the state of firefox when you create the file, so it contains urls of active tabs, history in
formation, and possibly even passwords depending on what you are doing when the snapshot is taken. it is advisable to create a new, blank profile to use when reproducing the hang and capturing the memory dump. please ask for help doing this! requirements windows to get a process dump, you need to be using windows vista or above. a firefox nightly or release you need a firefox version for wh...
...ed a firefox version for which symbols are available from the mozilla symbol server. you can use any official nightly build or released version of firefox from mozilla. you can find the latest trunk nightly builds under http://ftp.mozilla.org/pub/mozilla.o.../latest-trunk/. creating the dump file ensure that firefox is not already running. run firefox, reproduce the hang start firefox and per
form whatever steps are necessary to cause firefox to hang. once the browser hangs, continue with the steps below. after the hang open windows task manager (ctrl+shift+esc). find firefox.exe among the list of processes. right-click firefox.exe and select "create dump file". task manager should indicate where the dump file was written to. see also how to get a stacktrace for a bug report [en...
Implementing QueryInterface
aggregated objects, which may then return wrong interfaces. one more reason to avoid aggregation specifically, and complicated hierarchies in general. the ns_get_iid macro you can use the ns_get_iid macro instead of typing out the full getiid expression. in general, i disapprove of macros except in cases where the macro must expand to different text in different situations, e.g., different plat
forms, debugging vs. non-debugging, et al. in such cases macros are indispensible. in other cases macros may help some people but often cloud the issues for others. they always make the program source more fragile. in this case the macro is for convenience only, so i don't recommend it, but i do offer it up as an alternative. // ... if ( aiid.equals(ns_get_iid(nsix)) ) foundinterface ...
..., this); else if ( aiid.equals(ns_get_iid(nsiy)) ) foundinterface = ns_static_cast(nsiy*, this); // ...as many cases as needed... else if ( aiid.equals(ns_get_iid(nsisupports)) ) // ... thanks special thanks to heikki toivonen, chris waterson, and john bandhauer for valuable feedback that significantly improved the implementations presented here. original document in
formation author(s): scott collins last updated date: may 8, 2003 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
JavaScript-DOM Prototypes in Mozilla
lass on the global object, and the prototype will be set up by the resolving code (nswindowsh::globalresolve()). ...
...owsh::globalresolve()). this is also done only once per class, nsdomclassinfo::postcreate() checks if the prototype of the prototype of the wrapper jsobject (i.e. ...
Add-on Manager
the add-on manager is responsible for managing all of the add-ons installed in the application. through its apis in
formation about all installed add-ons can be retrieved and new add-ons can be installed. the apis are designed to be generic and support many different types of add-ons. many functions in the add-on manager interface operate asynchronously returning results through callbacks passed to the functions. the callbacks may be called immediately while the initial function is still executing or shortly after, depending on when the requested data becomes available. accessing installed add-ons in
formation about installed add-ons can be retrieved through the main addonmanager api. all of its functions are asynchronous, meaning that a callback function must be passed to receive the addon ...
...install(); }, "application/x-xpinstall"); the progress of addoninstalls can be monitored using an installlistener. a listener can be registered either for a specific install using the addlistener() method or for all installs using the addinstalllistener() method. finding updates add-ons can be checked for updates using the findupdates() method. it must be passed an updatelistener to receive in
formation about compatibility in
formation and new update in
formation. any available update is returned as an addoninstall which is ready to be downloaded and installed. detecting add-on changes requires gecko 7.0(firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) you can also get lists of add-ons that, at startup, were changed in various ways. the getstartupchanges() method lets you find out w...
DownloadLastDir.jsm
astdir = cu.import("resource://gre/modules/downloadlastdir.jsm").downloadlastdir; once you've imported the module, you can then use the downloadlastdir object it exports. using the downloadlastdir object to determine or set the path into which the last download occurred: // file is an nsifile var file = downloadlastdir.file; downloadlastdir.file = file; you can also set and retrieve this in
formation on a site-by-site basis. to set the path, use setfile: // file is an nsifile downloadlastdir.setfile(uri, file); to retrieve the path in firefox 26 or later, use getfileasync: downloadlastdir.getfileasync(uri, function (file) { // file is an nsifile console.log(file); }); deprecated since gecko 26.0 to retrieve the path in firefox 25 or earlier, use getfile: // file is an nsifile v...
... ...
FxAccountsProfileClient.jsm
the modules uses the firefox profiler server api. components.utils.import("resource://gre/modules/fxaccountsprofileclient.jsm"); creating a new fxaccountsprofileclient new fxaccountsprofileclient(object options); method overview fetchprofile(); attributes serverurl url profiler server url. token string bearer token. constructor fxaccountsprofileclient() creates and returns a new fxaccountsprofileclient object. ...
...fileclient object. fxaccountsprofileclient fxaccountsprofileclient( object options string serverurl, string token ); parameters serverurl - firefox profile server url. token - firefox accounts oauth bearer token. return value a newly created fxaccountsprofileclient object implementing the methods described in this article. methods fetchprofile() fetches firefox accounts profile in
formation. parameters none return value promise resolves: object - successful response from the '/profile' endpoint. rejects: fxaccountsprofileclienterror - profile client error. examples using the fxaccountsprofileclient chrome code let client = new fxaccountsprofileclient({ serverurl: "https://profile.accounts.firefox.com/v1", token: "fxa_oauth_bearer_token", }); client.fetc...
Http.jsm
http.jsm http.jsm provides httprequest - a wrapper for xmlhttprequest that provides convenient and simplified api for dealing with http requests. httprequest supports the following parameters: name meaning headers an array of headers postdata this can be: a string: send it as is an array of parameters: encode as
form values null/undefined: no post data. method get, post or put (this is automatically set if postdata exists). onload a function handle to call when the load is complete, it takes two parameters: the responsetext and the xhr object. onerror a function handle to call when an error occurs, it takes three parameters: the error, the responsetext and the xhr...
... be specified via postdata option. postdata can be of 2 different types: a string or an array of parameters. when null/undefined is given, no post data will be attached. if a string is given the data will be appended to the request as is. in case an array of parameters is given, it will be treated as an array of key-value pairs. 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. if the provided postdata is a string, the content type isn't touched. in this case, the content type may be set through the headers parameter. additional xhr configuration it is possible to modify things manually on the xhr obje...
ISO8601DateUtils.jsm
the iso8601dateutils.jsm javascript code module provides methods that make it easy to convert javascript date objects into iso 8601
format date strings and back. to use this, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/iso8601dateutils.jsm"); once you've imported the module, you can then use the iso8601dateutils object it exports. using the iso 8601 date utilities to convert a date string into a date object, simply use: dateobj = iso8601dateutils.parse(datestring); to convert a date object into a date string: datestring = iso8601dateutils.create(dateobj); method overview string create(adate); date parse(adatestring); methods create creates an iso 8601
format date string, e.g. "2010-05-15t13:45:00z", from a jav...
....parse(datestring); to convert a date object into a date string: datestring = iso8601dateutils.create(dateobj); method overview string create(adate); date parse(adatestring); methods create creates an iso 8601
format date string, e.g. "2010-05-15t13:45:00z", from a javascript date object. string create( adate ); parameters adate a javascript date object to translate into an iso 8601
format string. return value an iso 8601
format date string. parse converts an iso 8601
format date string into a javascript date object. date parse( adatestring ); parameters adatestring an iso 8601
format date string. return value a javascript date object corresponding to the specified date string. ...
NetUtil.jsm
to use these utilities, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/netutil.jsm"); once you've imported the module, you can then use its methods. ...
...onal] 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. methods asynccopy() the asynccopy() method per
forms a simple asynchronous copy of data from a source input stream to a destination output stream. both streams are automatically closed when the copy operation is completed. nsiasyncstreamcopier asynccopy( asource, asink, acallback ); parameters asource the input stream from which to read the source data. this must be an nsiinputstream based object. asink the output stream to which to...
Examples
/img/favicon32.png', 'blah blah']; i added 'blah blah' to that array, it will cuase the whole promise to reject. the case of unhandled rejections one of the difficult problems with promises is locating uncaught rejections. warning: when consuming promises, you should always handle or report errors (rejection reasons). see handling errors and common pitfalls. rejection handlers provide in
formation about the exact error time and location, but the handlers may sometimes be forgotten. consider the following cases: function f() { return promise.reject(new error("boom!")); // if nobody catches the error, how will it be reported? } function g() { return promise.resolve().then(function() { throw new error("boom!"); // if nobody catches the error, how will it be reported? }); } ...
...(new error("boom!"); // oops, we forgot to return the promise, nobody can catch it! } we adopt the following strategy: if a promise is rejected at the time of its garbage-collection and if the promise is at the end of a promise chain (i.e. thatpromise.then has never been called), then we print a warning. note: this warning is generated some time after the error occurred, and may provide less in
formation about the error location. it generally indicates the need to insert a proper error handler. when a proper rejection handler is used, it effectively replaces this delayed reporting. let deferred = promise.defer(); let p = deferred.promise.then(); deferred.reject(new error("i am an uncaught error")); deferred = null; p = null; in this snippet, since deferred.promise is not the last in the ...
PromiseWorker.jsm
like chromeworker objects, promiseworker is mostly used for js-ctypes but it is not limited to that. there is no xpcom access, similar to chromeworker. ...
...se]); promise_domyfuncfalse.then( function(aval) { console.log('fullfilled - promise_domyfuncfalse - ', aval); }, function(areason) { console.error('rejected - promise_domyfuncfalse - ', areason); } ).catch( function(acaught) { console.error('caught - promise_domyfuncfalse - ', acaught); } ); result running the code above will log the following in
formation to the console: "fullfilled - promise_domyfunctrue - " "you sent to promiseworker argument of: `true`" bootstrap.js line 8 "rejected - promise_domyfuncfalse - " "you passed in a non-true value for shouldresolve argument and therefore this will reject the main thread promise" bootstrap.js line 25 other examples githu...
Services.jsm
s to services by simply accessing them from the services object exported by the code module. ...
... application startup service storage mozistorageservice storage api service strings nsistringbundleservice string bundle service sysinfo nsipropertybag2 system info service telemetry nsitelemetry telemetry service tm nsithreadmanager thread manager service urifixup nsiurifixup uri fixup service url
formatter nsiurl
formatter url
formatter service vc nsiversioncomparator version comparator service wm nsiwindowmediator window mediator service ww nsiwindowwatcher window watcher service 1 mobile only 2 windows only 3 main process only 4 child process only ...
Webapps.jsm
st, aapp, arunupdate) _createactivitiestounregister: function(amanifest, aapp, aentrypoint) _unregisteractivitiesforapps: function(aappstounregister) _unregisteractivities: function(amanifest, aapp) _processmanifestforids: function(aids, arunupdate) observe: function(asubject, atopic, adata) addmessagelistener: function(amsgnames, aapp, amm) removemessagelistener: function(amsgnames, amm)
formatmessage: function(adata) receivemessage: function(amessage) getappinfo: function getappinfo(aappid) broadcastmessage: function broadcastmessage(amsgname, acontent) registerupdatehandler: function(ahandler) unregisterupdatehandler: function(ahandler) notifyupdatehandlers: function(aapp, amanifest, azippath) _getappdir: function(aid) _writefile: function(apath, adata) dogetlist: function(...
...lpackage: function doinstallpackage(adata, amm) pushcontentaction: function(windowid) popcontentaction: function(windowid) actioncancelled: function(windowid) denyinstall: function(adata) _setupapp: function(adata, aid) _cloneapp: function(adata, anewapp, alocalemanifest, amanifest, aid, alocalid) _writemanifestfile: function(aid, aispackage, ajsonmanifest) _nextlocalid: function() _appid
formanifesturl: function(auri) makeappid: function() _saveapps: function() _readmanifests: function(adata) _ensuresufficientstorage: function(anewapp) _checkdownloadsize: function(afreebytes, anewapp) _getrequestchannel: function(afullpackagepath, aislocalfileinstall, aoldapp,) _senddownloadprogressevent: function(anewapp, aprogress) _getpackage: function(arequestchannel, aid, aoldapp, anewapp...
XPCOMUtils.jsm
factory() or nsgetmodule() entry point. pseudocode this section provides some pseudocode that demonstrates how to put together a javascript class based on the steps listed above. constructor the constructor is a simple method that handles any required initialization tasks. function mycomponent() { // initialize the component here } class declaration declare the class prototype, using a
form similar to this. mycomponent.prototype = { // properties required for xpcom registration: classdescription: "unique text description", classid: components.id("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"), contractid: "@example.com/xxx;1", // [optional] custom factory (an object implementing nsifactory). if not // provided, the default factory is used, which returns // |...
...optional, defaults to the object's contractid (unless // 'service' is specified) value: "...", // optional, defaults to false. when set to true, and only if 'value' // is not specified, the concatenation of the string "service," and the // object's contractid is passed as avalue parameter of addcategoryentry. service: true, // optional array of applications' ids in the
form: // [ "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}", ... ] // if this is defined, the component is registered in this // category only on the specified applications. apps: [ ... ] }], // queryinterface implementation, e.g. using the generateqi helper queryinterface: xpcomutils.generateqi( [components.interfaces.nsiobserver, components.interfaces.nsimyinterface, "ns...
L10n Checks
) mode l10n checks can compare two locales found in different directories. you pass both paths to the directories, e.g.: check-l10n-completeness -i dir en-us/ my/ files (file) mode l10n checks can compare two files. you pass both paths to the files, e.g.: check-l10n-completeness -i file en-us.dtd my.dtd the output the output of l10n checks shows the missing and obsolete strings in a pseudo-diff
format. ab-cd browser chrome/browser browser.dtd +backforwardmenu.tooltip +fullzoomenlargecmd.commandkey3 +fullzoomreducecmd.commandkey2 +fullzoomresetcmd.commandkey2 +organizebookmarks.label -showallbookmarkscmd2.label migration/migration.dtd -importfromfile.accesskey -importfromfile.label +imp...
....commandkey2 +organizebookmarks.label -showallbookmarkscmd2.label migration/migration.dtd -importfromfile.accesskey -importfromfile.label +importfromhtmlfile.accesskey +importfromhtmlfile.label you can assume changed strings when you see entities removed and added with a similar name. the file names will be shown in a hierarchical
form, so in the example above, your files are browser.dtd in ab-cd/browser/chrome/browser and migration.dtd in another directory level deeper. the output closes with a summary, giving the total counts of missing and obsolete strings and some statistics on how many strings are changed or not, excluding access and command keys. that gives localizers an idea on how thorough the localization is. this numb...
Localizing XLIFF files for iOS
most translation tools support the xliff standard, making localizing the xliff files for firefox for ios easy to do using translation tools. editing the raw xliff file is also rather easy, especially if you're already familiar with xml. this tutorial will walk you through the steps you need to take to translation strings within an xliff file. ...
...rce> tag sets. <trans-unit id="add to bookmarks"> <source>add to bookmarks</source> <target>your_translation_here</target> </trans-unit> provide translations of the strings in the <source> tag sets by placing their translations in the <target> tag sets beneath them. keep in mind the following sets of characters that need to remain untranslated: $(some_text_here) is a variable
format, %1$@ is another variable
format. <note> tags contain localizer notes from developers and should not be translated. <trans-unit id="add to bookmarks"> <source>add to bookmarks</source> <target>agregar a marcadores</target> <note>no comment provided by engineer.</note> </trans-unit> save your translations along the way. once you've completed translation, it's importa...
Localizing extension descriptions
ethod for doing so was implemented in gecko 1.9 (firefox 3), there are two sets of instructions below. localizing in gecko 1.9 gecko 1.9 includes a new, more robust method for localizing add-on descriptions and other metadata. all of the different descriptions now appear in the install.rdf file using em:localized properties. each has at least one em:locale property marking the locale that the in
formation should be used for and then all the various strings for the locale. the following example demonstrates this (most normal manifest properties have been removed for brevity): <?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>tabsidebar@blueprintit.
...ame>tab sidebar</em:name> <em:description>laat voorbeeldweergaven van uw tabbladen in de zijbalk zien.</em:description> </description> </em:localized> <em:name>tab sidebar</em:name> <em:description>displays previews of your tabs in your sidebar.</em:description> </description> </rdf> all of the metadata mentioned below can be localized in this way. the localization in
formation provided by the em:localized property can be overriden using a set of localized preferences as detailed below. the process for selecting the em:localized property to use for a given locale is as follows: if a property exists with an em:locale that matches the locale exactly, then use that. if we have inexact matches then use the one with the most matching parts, parts being separated by...
Localizing with Mercurial
q by adding hg.ext = to your mercurial config file (~/.hgrc on unix-like systems or mercurial.ini on windows) under the [extensions] section. open your command line tool and navigate to your l10n directory. inside your l10n directory, init your repo with mq by running hg init --mq. to create a new patch, run hg qnew -m "your commit message" patch-name.patch. the commit message should take the
form of "bug 123456 - change this thing to work better by doing something; r=reviewers" if you are to fix a bug. make your change. once you finish making your change, run hg qrefresh to commit your changes to the patch. navigate to your <repository>/.hg/patches to find your .patch. you may repeat from step 4 to create another patch. your patches will be incremental, i.e. new patches are created ba...
...to the remote repo yourself, rather than creating patches and asking someone else to push them for you. to get write access to the l10n hg repositories on the mozilla server, there's a bit of paper work to be done. the localization team owner needs to file a bug requesting an hg account. this bug will request level 1 l10n priviledges. you need to follow the instructions regarding the contributor
form. write access to the hg repositories requires a ''voucher'', which, for the owner, will be done based on the review by mozilla. for peers of a localization, the owner can vouch (once she or he is registered). sending changes to mozilla now that you have hg account privileges, you can send your work to mozilla all by yourself. here are the steps to send your l10n work using mercurial: since y...
Localizing with Pontoon
ble for project. locale selector (slovenian) switches between languages to localize. go opens project-resource-locale selection. progress indicator displays your progress on the resource being localized. more details are available in the popup. user menu allows for user-specific tasks, like commiting to repository, downloading files and signing out. info menu gives important in
formation, like the anticipated project timeline and a list of keyboard shortcuts. alright, how about we do some translating now? translate strings when using pontoon for localization, you have a couple of options to translate your strings. you can translate in-context, out-of-context, or a combination of the two. we'll start with looking at in-context translation. in-context pontoon's in-...
...t to translate with your mouse. an edit button appears over that text. click on it to enable the translate mode. replace the original text with its translation into your language. click the save button to save your translation. out-of-context some strings are impossible to translate in-context, e.g. the contents of the <title> tag in websites and strings with placeables or different plural
forms. by clicking on the hamburger icon in the main toolbar, a list of all strings and available translations will open in the sidebar. you can also use the sidebar for out-of-context localization: click on the string you'd like to translate. translation panel with original string and its details (e.g. comments) opens. translate the string in the translation area below. click the save button...
Localization quick start guide
we will take you through the steps to get started, from the initial environment setup to testing and releasing your own localization. ...
...work. these four stages make up tech side of the l10n program. to learn more about any of these, click on any of the links above. to get the big picture, we suggest you start with the green bubble and move from stage to stage. 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 in
formation applies to which type of contributor. to help you filter through to the most applicable in
formation, note that all in
formation that is unique to those starting a new localization will be in orange font. all in
formation that is unique to those joining an existing localization will be in blue font. next » ...
Fonts for Mozilla's MathML engine
this wiki page describes how users can install and use such math fonts with mozilla's mathml engine. note that most of these instructions may as well apply to other web rendering engines. installation instructions windows install the latin modern math and stix fonts as follows: download latinmodern-math-1959.zip. open the zip archive, move inside the latinmodern-math-1959 directory and then inside the otf directory. you will find a latinmodern-math font file. open the latinmodern-math font file and click the install button. download stixv2.0.2.zip. ...
...web math fonts on all pages with mathml content. a better alternative on unix systems is to install the otf files for latin modern math and stix into some local font folder and (if necessary) to run fc-cache on it. on os x and linux, the standard paths are ~/library/fonts/ and ~/.fonts. fonts with a math table you can actually render mathml using any font with a math table and related open font
format features. a list of such math fonts is provided below. you can use the advanced font preference menu to configure the default font for mathematics. alternatively, you can try the mathml-fontsettings add-on. 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...
MathML Torture Test
mn></mrow></munder><mfrac><msqrt><mrow><mn>2</mn><mi>π</mi><mi>n</mi></mrow></msqrt><mrow><mi>n</mi><mo>!</mo></mrow></mfrac><msup><mrow><mo>(</mo><mfrac><mi>n</mi><mi>e</mi></mfrac><mo>)</mo></mrow><mi>n</mi></msup></mrow><mo>=</mo><mn>1</mn></math></td> </tr> <tr> <td>30</td> <td><img src="https://udn.realityripple.com/samples/d5/2cf8356a09.png" width="194" height="58" alt="leibniz
formula for the determinant" /></td> <td><math display="block" xmlns="http://www.w3.org/1998/math/mathml"><mrow><mrow><mo lspace="0em" rspace="0em">det</mo><mo stretchy="false">(</mo><mi>a</mi><mo stretchy="false">)</mo></mrow><mo>=</mo><munder><mo>∑</mo><mrow><mi>σ</mi><mo>∊</mo><msub><mi>s</mi><mi>n</mi></msub></mrow></munder><mrow><mi>ϵ</mi><mo stretchy="false">(</mo><mi>σ</mi><mo stretc...
...= document.getelementbyid("mathfont").value; if (mathfont == "default") { document.body.removeattribute("class"); } else { document.body.setattribute("class", mathfont); } } function load() { document.getelementbyid("mathfont"). addeventlistener("change", updatemathfont, false) } window.addeventlistener("load", load, false); the following test contains sample tex
formulas from knuth's tex book and equivalent mathml representations. it compares the rendering by the xetex engine using the default latin modern math font against the mathml rendering by your browser using the default math font, or an alternative opentype math fonts. to get the best rendering, be sure to have appropriate mathematical fonts installed on your system and to use a browser with opentype ...
MathML Accessibility in Mozilla
mac: mathml support is provided by voiceover. ...
... mac: mathml support is provided by voiceover. in bug 1175269 and bug 1001641, we relied on the webkit's nsaccessibility mathml tree to expose the main constructions. hence basic support is available in gecko 41.0 (firefox 41.0 / thunderbird 41.0 / seamonkey 2.38) and we are still trying to keep in sync with webkit/voiceover. ...
Mozilla Port Blocking
a simple exploit of this hole allows an attacker to send forged unsigned mail through a mail server behind your firewall: a really nasty hole. mozilla responded by modifying how protocols can access ports. ...
...volved and be able to justify it. things to do allow user preference to override default port blocking. currently you need to add preferences to either user.js or all.js. see bug 85601. per protocol port blocking/enabling preferences. better user interface allow the user to decide if the blocking is really required. some kind of way to manage the ports which are blocked. more in
formation nsioservice.cpp gbadportlist bug 83401 vulnerability note vu#476267 dougt@netscape.com original document in
formation author(s): doug turner last updated date: august 15, 2007 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Mozilla projects on GitHub
at place to start looking for any projects not listed below. projects this listing covers the larger-scale and more important mozilla projects on github. it does not include everything since it's hard to keep track of all the smaller projects. look to github for the most complete list of mozilla projects on github. project name description pdf.js a portable document
format (pdf) reader written entirely in javascript. shumway shumway is a flash vm and runtime written in javascript. addon-sdk the mozilla add-on sdk. asknot the what can i do for mozilla web site, which helps you figure out how you can contribute to mozilla. bugsahoy a web page to help new mozilla contributors identify bugs to fix. bugzilla-das...
...ers the firefox developer tools adapter that lets you debug various remote targets from the firefox developer tools. firefox-dev.tools a web page to help new mozilla contributors find bugs to work on that relate to the firefox developer tools. gecko-dev a read-only mirror of the mercurial repositories used for mozilla private code. kitsune kitsune is the plat
form that drives the mozilla support web site, sumo. kuma the django project that powers this site (mdn). mdn code samples for the mdn web site. mozbrick the mozilla brick project. mozilla-b2g the firefox os project. mozilla-appmaker the appmaker project -- a web tool to let non-programmers create apps. mozilla-l10n scripts and to...
Mozilla Style System
rocessor for all user css style sheets, and a single style rule processor for all author css style sheets. there is also a style rule processor for style attributes (which contain css declarations) and one for presentational attributes in html. the methods on nsistyleruleprocessor allow the front end to ask the back ends for the style data that applies to a given element or pseudo-element, in the
form of style rules. nsistylerule an nsistylerule is animmutable set of css property-value pairs. for css style sheets, they correspond to css's concept of rules. however, they also exist for the other types of rule processors. when script dynamically changes the data represented by a css style rule, we create a new nsistylerule object; keeping the old one around briefly helps to determine what c...
... struct must also be in the same css struct all of the properties in a style struct must be inherited or they must all be non-inherited (see inheritance for an explanation of the difference) the first of these rules is no longer important (in fact, the separation of the specified values into nscss* structs is no longer important). however, the second of these rules is the key to many of the per
formance and memory-use optimizations in the style system. most callers who interact with the style system do so using the style structs. the style context has a getter for each struct, and nsiframe, which represents the concept of a css box (or rendering object), also has getters that forward to the frame's style context. thus, typical calling code looks like this: if (aframe->getstyledisplay()->m...
Build Metrics
lower is better. compiler warnings number of compiler warnings detected during a build. lower is better. ...
...ld system and tracked by perfherder. num_constructors number of static constructors found by the compiler in the firefox c++ codebase. lower is better. static constructors are undesirable because their initialization imposes an unavoidable time penalty every time firefox is started. installer size size in bytes of the firefox installer. lower is better here, especially on space-restricted plat
forms like android. build times amount of time it takes to build firefox in automation on a specific plat
form / configuration. lower is better. compiler warnings number of compiler warnings detected during a build. lower is better. due to the way the build system works, compiler warnings are not consistently detected. so the value may fluctuate from build to build even if the number of compiler w...
Investigating leaks using DMD heap scan mode
-$pid.log.gz this can take a few minutes due to symbolification, but you only need to run it once on a log file. after that is done, we can finally find out which objects (possibly) point to other objects, using the block_analyzer script: python $srcdir/memory/replace/dmd/block_analyzer.py dmd-$pid.log.gz $leakaddr this will look through every block of memory in the log, and give some basic in
formation about any block of memory that (possibly) contains a pointer to that object. you can pass some additional options to affect how the results are displayed. “-sfl 10000 -a” is useful. the -sfl 10000 tells it to not truncate stack frames, and -a tells it to not display generic frames related to the allocator. caveat: i think block_analyzer.py does not attempt to clamp the address you pass ...
......
Intel Power Gadget
-related measures and estimates, all taken from the intel rapl msrs. this article provides a basic introduction. note: the power profiling overview is worth reading at this point if you haven't already. it may make parts of this document easier to understand. the main strengths of this tool are (a) it works on windows, unlike most other power-related tools, and (b) it shows this data in graph
form, which is occasionally useful. on mac and linux, tools/power/rapl is probably a better tool to use. understanding the power gadget output the following screenshot (from the mac version) demonstrates the available measurements. the three panes display the following in
formation: power: shows power estimates for the package and the cores ("ia"). these are reasonably useful for power profilin...
... frequency: shows operating frequency measurements for the cores ("ia") and the gpu ("gt"). these measurements aren't particularly useful for power profiling purposes. ...
JS::PerfMeasurement
it is a stopwatch profiler -- that is, it counts events that occur while code of interest is running; it does not do call traces or sampling. ...
...tions .cpu_migrations migrations of the profiled thread from one cpu core to another these events map directly to "generic events" in the linux 2.6.31+ <linux/perf_event.h> interface, and so unfortunately are a little vague in their specification; for instance, we can't tell you exactly which level of cache you get misses for if you measure cache_misses. we also can't guarantee that all plat
forms will support all event types, once we have more than one back end for this interface. here is the complete c++-level api: perfmeasurement::eventmask this is an enumeration defining all of the bit mask values in the above table. you bitwise-or the ones you want together and pass them to the constructor. perfmeasurement::all in a constructor call, this special value means "measure everything tha...
Memory Profiler
profiling reset - clear profile data when profiler is stopped profile data is accumulated and resumed after start. use reset to start a new recording. understanding the profiles traditional memory analysis tools look at the data. they build the referring-to, namely retaining graphs. this is helpful in exploring the relationships among objects and identifying memory leaks. however, the in
formation exposed in this way is usually a snapshot and the history of how memory has been used goes missing. moreover, they usually don't keep tracks of how objects are allocated. developers have to infer how an object might be allocated and freed by himself/herself. another common approach is to plot the allocations or the memory usages along the timeline. this gives some intuition of how and when ...
...l code snippet. this memory profiler is designed to solve the inconveniences and limitations. the goal is to identify the memory eager codes directly. the profiler is designed at the very beginning to support not only javascript but also native codes. naturally, not only javascript objects but also native allocations are tracked. the profile while recording is stored in memory in a very compact
format. it's supposed to profile a very long time period without problem. timeline view this view shows the allocation event across the period of time. it shows the overall memory usage history. red is allocate and blue is deallocate. rank-list view and tree view the rank-list view shows top functions that are most memory eager. the table could be sorted according to the 6 measurements: {retaine...
Phishing: a short definition
a relatively simple, yet effective, phishing scheme is sending an email with a fake invoice of a person’s favorite shopping site. this email will usually contain a link pretending to lead to the original service, but in reality, taking the victim to an attacker-controlled website. ...
... approaches. shifting blame to users some quick-to-implement, and cost-effective solutions, hold users accountable for their actions instead of restricting what’s technically possible. earlier responses by affected banks, and payment providers, was to attempt educating users to not click links in emails, along with requesting to verify email legitimacy through checking for relevant personal in
formation. another solution is to strengthen logins with pictures, or colored words, often chosen when signing up for a service. users look for these when logging in, and only enter their credentials when they recognize the user defined pictures or words. a study on the efficacy of security indicators, presented at the 2007 ieee symposium on security and privacy, suggests that the above countermeasu...
A brief guide to Mozilla preferences
what is a preference? a preference is any value or defined behavior that can be set (presumably, one setting is preferable to another). preference changes via user interface usually take effect immediately. ...
...le in the browser, the first line of the file is made un-parseable and skipped on loading. the only exception to this is user.js . on application launch, several preferences files are loaded. they are: default preference files firefox ships default preferences in several files, all in the application directory: greprefs.js - preferences shared by all applications using the mozilla plat
form services/common/services-common.js - preferences for some shared services code, this should arguably be included in some other file defaults/pref/services-sync.js - default preferences for firefox sync, also oddly misplaced browser/app/profile/channel-prefs.js - a file indicating the user's update channel. this is kept separate from other preferences because it can affect how updates are ap...
nglayout.debug.disable_xul_cache
the effect is that the source xml file is not read and re-parsed each time the chrome in question is displayed. the xul cache is serialized and saved between mozilla sessions in the xul fastload file, which saves a “compiled” version of the xul and javascript in a document to disk for faster startup the next time the application runs. during development of xul applications, it’s convenient to disable the xul cache so that changes you make to files on disk take effect the next time the window or dialog is loaded (instead of the next time mozilla starts). ...
...take effect the next time the window or dialog is loaded (instead of the next time mozilla starts). possible values and their effects: true: do not cache parsed xul documents and do not save the cache to the xul fastload file on exit; re-read the source files each time the window or dialog needs to be displayed. false: cache xul documents in memory and save the cache to disk on exit to improve per
formance. (default) see also: http://kb.mozillazine.org/nglayout.debug.disable_xul_cache ...
Preference reference
bout:newtab) which offers the most often visited pages for fast navigation.browser.search.context.loadinbackgroundbrowser.search.context.loadinbackground controls whether a search from the context menu with "search <search engine> for <selected text>" opening a new tab will give focus to it and load it in the foreground or keep focus on the current tab and open it in the background.browser.urlbar.
formatting.enabledthe preference browser.urlbar.
formatting.enabled controls whether the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey.browser.urlbar.trimurlsthe preference browser.urlbar.trimurls controls whether the protocol http and the trailing slash behind domain name (if the open page is exactly the domain name) are hidd...
...tions.stricttechnical review completed.mail.tabs.drawintitlebarstarting in thunderbird 17.0, the tabs are drawn in the title bar. the old behavior can be restored by setting the preference mail.tabs.drawintitlebar to false.nglayout.debug.disable xul fastloadthe preference nglayout.debug.disable_xul_fastload controls whether or not xul fastload is used.nglayout.debug.disable_xul_cacheto improve per
formance, mozilla caches chrome xul documents the first time they load for faster loading later. the effect is that the source xml file is not read and re-parsed each time the chrome in question is displayed. the xul cache is serialized and saved between mozilla sessions in the xul fastload file, which saves a “compiled” version of the xul and javascript in a document to disk for faster startup th...
Patches and pushes
for references on how each tag functions, visit the opensearch wiki page and the mozsearch wiki page. the pages are old (i mean, firefox 2???), but still accurate. each plugin has an icon image which is linked within the xml file as an uri id. upload your plug...
...for references on how each tag functions, visit the opensearch wiki page and the mozsearch wiki page. the pages are old (i mean, firefox 2???), but still accurate. each plugin has an icon image which is linked within the xml file as an uri id. upload your plugins icon image to data kitchen to obt...
Productization guide
ful and relevant content demonstrate certain features of the product the first one (provide users with useful and relevant content) is obvious: we want to improve our users’ experience on the web, so we provide a couple of well-thought suggestions for different services. for example, we ship firefox with 6 or 7 search engine plug-ins to make users’ lives easier when they’re looking for in
formation, translation, products, multimedia, spelling and definitions, etc. another example: when the user clicks on a mailto: link, we suggest a couple of possible handlers chosen from the applications installed on their computer. but we also suggest a few web-based clients (like yahoo! mail and gmail), so that if the user happens to use one of these in the browser, they don’t have to configure th...
...mple, putting one sample news feed on the bookmarks toolbar in new profiles in firefox helps in learning about the live bookmarks. including a couple of search engines instead of one in the search toolbar can help users understand that they can add as many plug-ins as they wish. this guide will walk you through the steps to successfully productizing your localization. the first page will cover per
forming research and preparing to submit productization recommendations. the following (and last) page will cover the technical steps to creating and submitting productization patches. next » ...
Emscripten
en wiki. using emscripten, you can compile c and c++ code into javascript compile any other code that can be translated into llvm bytecode into javascript. compile the c/c++ runtimes of other languages into javascript, and then run code in those other languages in an indirect way (this has been done for python and lua)! emscripten makes native code immediately available on the web: a plat
form that is standards-based, has numerous independent compatible implementations, and runs everywhere from pcs to ipads. with emscripten, c/c++ developers don’t have the high cost of porting code manually to javascript — or having to learn javascript at all. web developers also benefit, as they can use the many thousands of pre-existing native utilities and libraries in their sites. practically...
... pcs to ipads. with emscripten, c/c++ developers don’t have the high cost of porting code manually to javascript — or having to learn javascript at all. web developers also benefit, as they can use the many thousands of pre-existing native utilities and libraries in their sites. practically any portable c or c++ codebase can be compiled into javascript using emscripten, ranging from high per
formance games that need to render graphics, play sounds, and load and process files, through to application frameworks like qt. emscripten generates fast code — its default output
format is asm.js , a highly optimizable subset of javascript that can execute at close to native speed in many cases. note: sound interesting? read more about emscripten and try some demos, then get started with using ...
Firefox Sync
it uses firefox accounts for account, authentication and key management. ...
...ed for use by end-users, but instead for people who wish to understand the details of how sync is implemented or wish to interact with it. general the always prolific richard newman has written a couple of notes about bookmark syncing (first, second) and has a blog where he talks about the various challenges syncing this kind of data. servers documentation for the various servers, including in
formation on how to host your own. android searchfox has links to the main sync code and the storage layer. there are also some notes in a google document (that we really must move to its own wiki page) there's also in
formation available to help debug and diagnose android sync issues. ios there is some in-tree documentation and there are some extensive comments here and here. desktop notes on h...
JSHydra
documentation installing jshydra download, installation and dependency info for jshydra community view jshydra forums... ...
... documentation installing jshydra download, installation and dependency info for jshydra community view jshydra forums... ...
L20n HTML Bindings
conjunction with mvc frameworks. when all dom nodes are localized, the document element will fire a documentlocalized event, which you can listen to: document.addeventlistener('documentlocalized', function() { // the dom has been localized and the user sees it in their language yourapp.init(); }); exposing context data you can expose important bits of data to the localization context in
form of context data. <script type="application/l10n-data+json"> { "newnotifications": 3, "user": { "name": "jane", "gender": "feminine" } } </script> this data will be available context-wide to all localized strings. for instance, a string could use the in
formation about the user's gender to provide two variants of the translation, like in the example below. see l20n by example to le...
...rfc 2277). there is no language negotiation nor locale fallback possible in the monolingual mode. l20n simply always uses this one default locale. the monolingual mode may be useful when you first start a new project, when you want to test something quickly or when using server-side language negotiation. in order to enable the monolingual mode, remove the manifest link from your html. with no in
formation about the available and the default locales, l20n will switch to the monolingual mode. you can then embed localization resources right in your html. <script type="application/l20n"> <brandname "firefox"> <about "about {{ brandname }}"> </script> an alternative is to include localization resources in script elements. note that this still only works for a single language. we plan to add...
MailNews automated testing
automated testing is an increasingly significant and important part of mailnews development. it allows reviewers to quickly pick up regressions in patches and helps developers to think about different cases. this page and its sub-pages describe (and link to) the available test mechanisms within mailnews, and provide supporting in
formation for developers and testers. functional testing xpcshell-tests and make check these are core test harnesses to which mailnews adds its own tests. these tests are run against almost every changeset that gets committed to the thunderbird and seamonkey code bases. xpcshell-tests are run in javascript without any chrome present. this makes them especially useful for testing at the component / module level. xpcshell-tests are the quickest tests to ...
...sages by specifying what properties the messages should have. message injection: inject synthesized messages via local or imap (using a fake server). message manipulation: mark messages as read, tag them, untag them, move them to other folders, trash them, etc. enhanced logging: supports generating rich json streams to disk or over the network for consumption by logsploder or other tools. per
formance testing mail leak and bloat tests these tests start up thunderbird or seamonkey and record any leaks found, as well as the total memory requirement. although currently based on simple tests, these are useful for determining if new leaks have been introduced. for more in
formation, see leak and bloat tests. ...
MailNews
and filtering message composition address book the mailnews code lives in the mailnews/ directory of comm-central. asynctestutils extended framework the asynctestutils extended framework is one mechanism for testing the mailnews component of thunderbird. see mailnews automated testing for a description of the other testing mechanisms. ...
...to per
form tests that measure memory leaks and bloat for mailnews and its sub-components. mailnews automated testing automated testing is an increasingly significant and important part of mailnews development. it allows reviewers to quickly pick up regressions in patches and helps developers to think about different cases. see pages tagged mailnews for additional mailnews-specific in
formation. ...
Midas editor module security preferences
this means that the corresponding buttons on the mozilla rich text editing demo page will not work. to enable these funct...
...x or another mozilla product, try using keyboard shortcuts for the cut, copy, and paste commands: copy: ctrl+c or ctrl+insert (command+c on mac) paste: ctrl+v or shift+insert (command+v on mac) cut: ctrl+x or shift+delete (command+x on mac) the in
formation on the rest of this page is for web developers and advanced users. please do not try to modify this page. to protect users' private in
formation, unprivileged scripts cannot invoke the cut, copy, and paste commands in midas, which is mozilla's rich text editor component. this means that the corresponding buttons on the mozilla rich text editing demo page will not work. to enable these functions, you must modify your browser preferences. warning: changing these preferences can leave your browser insecure, especially if you grant per...
Process Forking in NSPR
the threads provided in netscape portable runtime (nspr) are implemented using different mechanisms on the various plat
forms. on some plat
forms, nspr threads directly map one-to-one to the threads provided by the plat
form vendor, on other plat
forms nspr threads are basically user-level threads within a single process (with no kernel threads) and on still others nspr threads are user-level threads implemented on top of one or more kernel threads within single address space. nspr does not override the fork function and so, when fork is called from the nspr thread the results are different on the various plat
forms. all the threads present in the parent process may be replicated in the child process, only the calling thread may be replicated in the child process or only the calling kernel ...
...ngle address space. nspr does not override the fork function and so, when fork is called from the nspr thread the results are different on the various plat
forms. all the threads present in the parent process may be replicated in the child process, only the calling thread may be replicated in the child process or only the calling kernel thread may be replicated. so, to be consistent across all plat
forms, it is suggested that when using fork in a nspr thread; the exec function should be called in the child process. no nspr functions should be called in the child process before the exec call is made. original document in
formation author: alan o. freier last updated date: 1998 ...
Cached Monitors
only while the protection is needed. this arrangement allows a cached monitor to be associated with another object without preallocating a monitor for all objects. a hash table is used to quickly map addresses to their respective monitors. the system automatically enlarges the hash table as needed. important cached monitors are slower to use than their uncached counterparts. ...
... pr_centermonitor enters the lock associated with a cached monitor. pr_cexitmonitor decrements the entry count associated with a cached monitor. pr_cwait waits for a notification that a monitor's state has changed. pr_cnotify notifies a thread waiting for a change in the state of monitored data. ...
Logging
nspr provides a set of logging functions that conditionally write printf() style strings to the console or to a log file. nspr uses this facility itself for its own development debugging purposes. you can select events to be logged by module or level. a module is a user-defined class of log events. a level is a numeric value that indicates the seriousness of the event to be logged. you can combine module and level criteria to get highly selective logging. nspr also provides "assert"-style macros and functions to aid in application debugging. ...
...vel criteria to get highly selective logging. nspr also provides "assert"-style macros and functions to aid in application debugging. 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. these controls are plat
form dependent. logging is not compiled in for the win16 plat
form. logging is compiled into the nspr debug builds; logging is not compiled into the nspr optimized builds. the compile time #define values debug or force_pr_log enable nspr logging for application programs. to enable nspr logging and/or the debugging aids in your application, compile using the nspr debug build headers and runtime. set on...
Long Long (64-bit) Integers
« previousnext » this chapter describes the global functions you use to per
form 64-bit integer operations. the functions define a portable api that can be used reliably in any environment. where 64-bit integers are desired, use of nspr's implementation is recommended to ensure cross-plat
form compatibility. most of the 64-bit integer operations are implemented as macros. the specific implementation of each macro depends on whether the compiler for the target plat
form supports 64-bit integers. for a specific target plat
form, if 64-bit integers are supported for that plat
form, define have_long_long at compile time. 64-bit integer types nspr provides two types to represent 64-bit integers: print64 pruint64 64-bit integer functions the api defined for the 64-bit integer f...
...the compiler for the target plat
form supports 64-bit integers. for a specific target plat
form, if 64-bit integers are supported for that plat
form, define have_long_long at compile time. 64-bit integer types nspr provides two types to represent 64-bit integers: print64 pruint64 64-bit integer functions the api defined for the 64-bit integer functions is consistent across all supported plat
forms. limits and initialization relational operators logical operators arithmetic operators shift operators conversion operators ...
NSPR LOG FILE
set nspr_log_file to the name of the log file you want to use. nspr logging, when enabled, writes to the file named in this environment variable. for ms windows systems, you can set nspr_log_file to the special (case-sensitive) value windebug. ...
... set nspr_log_file to the name of the log file you want to use. nspr logging, when enabled, writes to the file named in this environment variable. for ms windows systems, you can set nspr_log_file to the special (case-sensitive) value windebug. ...
Network Addresses
to manipulate network addresses. network address types and constants network address functions the api described in this chapter recognizes the emergence of internet protocol version 6 (ipv6). to facilitate the transition to ipv6, it is recommended that clients treat all structures containing network addresses as transparent objects and use the functions documented here to manipulate the in
formation. if used consistently, this api also eliminates the need to deal with the byte ordering of network addresses. typically, the only numeric declarations required are the well-known port numbers that are part of the prnetaddr structure. network address types and constants prhostent prprotoent pr_netdb_buf_size network address functions initializing a network address pr_initializeneta...
...sing these functions with other network address functions, clients can support either version 4 or version 6 of the internet protocol transparently. all nspr functions that require prnetaddr as an argument accept either an ipv4 or ipv6 version of the address. ...
PRExplodedTime
arameters tm_params; } prexplodedtime; description the prexplodedtime structure represents clock/calendar time. prexplodedtime has the familiar time components: year, month, day of month, hour, minute, second. it also has a microsecond component, as well as the day of week and the day of year. in addition, prexplodedtime includes a prtimeparameters structure representing the local time zone in
formation, so that the time point is non-ambiguously specified. the essential members of prexplodedtime are: tm_year: absolute year, ad (by "absolute," we mean if the year is 2000, this field's value is 2000). tm_month: number of months past tm_year. the range is [0, 11]. 0 is january and 11 is december. tm_mday: the day of month. the range is [1, 31]. note that it starts from 1 as opposed to 0.
...m_hour: number of hours past tm_mday. the range is [0, 23]. tm_min: number of minutes past tm_hour. the range is [0, 59]. tm_sec: number of seconds past tm_min. the range is [0, 61]. the values 60 and 61 are for accommodating up to two leap seconds. tm_usec: number of microseconds past tm_sec. the range is [0, 999999]. tm_params: a prtimeparameters structure representing the local time zone in
formation. the nonessential members of prexplodedtime are: tm_wday: day of week. the range is [0, 6]. 0 is sunday, 1 is monday, and 6 is saturday. tm_yday: day of year. the range is [0, 365]. 0 is the 1st of january. on input to nspr functions, only the essential members of prexplodedtime must be specified. the two nonessential members (day of week and day of year) are ignored by nspr function...
PRIOMethods
up to the specified number of bytes into buffer. write write specified number of bytes from buffer. available determine number of bytes available for reading. available64 same as previous field, except 64-bit. fsync flush all in-memory buffers of file to permanent store. seek position the file pointer to the desired place. seek64 same as previous field, except 64-bit. fileinfo get in
formation about an open file. fileinfo64 same as previous field, except 64-bit. writev write from a vector of buffers. connect connect to the specified network address. accept accept a connection from a network peer. bind associate a network address with the file descriptor. listen prepare to listen for network connections. shutdown shut down a network connection. recv receive up to th...
...file to the specified socket. getsockname get network address associated with a file descriptor. getpeername get peer's network address. getsockopt get current setting of specified socket option. setsockopt set value of specified socket option. description you don't need to know the type declaration for each function listed in the method table unless you are implementing a layer. for in
formation about each function, see the corresponding function description in this document. for example, the write method in priomethods implements the pr_write function. for type definition details, see prio.h. the i/o methods table provides procedural access to the functions of the file descriptor. it is the responsibility of a layer implementor to provide suitable functions at every entry point (t...
PRNetAddr
the structure has the following fields: family address family: pr_af_inet|pr_af_inet6 for raw.family, pr_af_inet for inet.family, pr_af_inet6 for ipv6.family. data raw address data. port port number of tcp or udp, in network byte order. ip the actual 32 (for inet.ip) or 128 (for ipv6.ip) bits of ip address. the inet.ip field is in network byte order. pad unused. flowinfo routing in
formation. description the union prnetaddr represents a network address. nspr supports only the internet address family. by default, nspr is built to support only ipv4, but it's possible to build the nspr library to support both ipv4 and ipv6. therefore, the family field can be pr_af_inet only for default nspr, and can also be pr_af_inet6 if the binary supports ipv6. prnetaddr is binary-compatible...
...liar berkeley socket interface, although this fact should not be relied upon. the raw member of the union is equivalent to struct sockaddr, the inet member is equivalent to struct sockaddr_in, and if the binary is built with ipv6 support, the ipv6 member is equivalent to struct sockaddr_in6. (note that prnetaddr does not have the length field that is present in struct sockaddr_in on some unix plat
forms.) the macros pr_af_inet, pr_af_inet6, pr_inaddr_any, pr_inaddr_loopback are defined if prio.h is included. pr_inaddr_any and pr_inaddr_loopback are special ipv4 addresses in host byte order, so they must be converted to network byte order before being assigned to the inet.ip field. ...
PRThreadPriority
lude <prthread.h> typedef enum prthreadpriority { pr_priority_first = 0, pr_priority_low = 0, pr_priority_normal = 1, pr_priority_high = 2, pr_priority_urgent = 3, pr_priority_last = 3 } prthreadpriority; enumerators pr_priority_first placeholder. pr_priority_low the lowest possible priority. this priority is appropriate for threads that are expected to per
form intensive computation. pr_priority_normal the most commonly expected priority. pr_priority_high slightly higher priority than pr_priority_normal. this priority is for threads per
forming work of high urgency but short duration. pr_priority_urgent highest priority. only one thread at a time typically has this priority. pr_priority_last placeholder description in general, an nspr thread o...
...high urgency but short duration. pr_priority_urgent highest priority. only one thread at a time typically has this priority. pr_priority_last placeholder description in general, an nspr thread of higher priority has a statistically better chance of running relative to threads of lower priority. however, because of the multiple strategies nspr uses to implement threading on various host plat
forms, nspr priorities are not precisely defined. at best they are intended to specify a preference in the amount of cpu time that a higher-priority thread might expect relative to a lower-priority thread. this preference is still subject to resource availability and must not be used in place of proper synchronization. see also setting thread priorities. ...
PRTimeParameters
the overall offset is broken into two components: tp_gmt_offset the offset of the local standard time from gmt. tp_dst_offset if daylight savings time (dst) is in effect, the dst adjustment from the local standard time. this is most commonly 1 hour, but may also be 30 minutes or some other amount. ...
...the overall offset is broken into two components: tp_gmt_offset the offset of the local standard time from gmt. tp_dst_offset if daylight savings time (dst) is in effect, the dst adjustment from the local standard time. this is most commonly 1 hour, but may also be 30 minutes or some other amount. ...
PR_CEnterMonitor
enters the lock associated with a cached monitor. syntax #include <prcmon.h> prmonitor* pr_centermonitor(void *address); parameter the function has the following parameter: address a reference to the data that is to be protected by the monitor. this reference must remain valid as long as there are monitoring operations being per
formed. returns the function returns one of the following values: if successful, the function returns a pointer to the prmonitor associated with the value specified in the address parameter. if unsuccessful (the monitor cache needs to be expanded and the system is out of memory), the function returns null. description pr_centermonitor uses the value specified in the address parameter to find a monitor in the monitor cache, then enters the lock assoc...
...find a monitor in the monitor cache, then enters the lock associated with the monitor. if no match is found, an available monitor is associated with the address and the monitor's entry count is incremented (so it has a value of one). if a match is found, then either the calling thread is already in the monitor (and this is a reentrant call) or another thread is holding the monitor's mutex. in the
former case, the entry count is simply incremented and the function returns. in the latter case, the calling thread is likely to find the monitor locked by another thread and waits for that thread to exit before continuing. note: pr_centermonitor and pr_cexitmonitor must be paired--that is, there must be an exit for every entry--or the object will never become available for any other thread. ...
PR_GetFileInfo
gets in
formation about a file with a specified pathname. file size is expressed as a 32-bit integer. syntax #include <prio.h> prstatus pr_getfileinfo( const char *fn, prfileinfo *info); parameters the function has the following parameters: fn the pathname of the file to get in
formation about. info a pointer to a file in
formation object (see prfileinfo). on output, pr_getfileinfo writes in
formation about the given file to the file in
formation object. returns one of the following values: if the file in
formation is successfully obtained, pr_success. if the file in
formation is not successfully obtained, pr_failure. description pr_getfileinfo stores in
formation about the file with the specified pathname in the prfileinfo structure pointed to by info. the file size is retu...
...ion is successfully obtained, pr_success. if the file in
formation is not successfully obtained, pr_failure. description pr_getfileinfo stores in
formation about the file with the specified pathname in the prfileinfo structure pointed to by info. the file size is returned as an unsigned 32-bit integer. see also for the 64-bit version of this function, see pr_getfileinfo64. to get equivalent in
formation on a file that's already open, use pr_getopenfileinfo. ...
PR_GetFileInfo64
gets in
formation about a file with a specified pathname. file size is expressed as a 64-bit integer. syntax #include <prio.h> prstatus pr_getfileinfo64( const char *fn, prfileinfo64 *info); parameters the function has the following parameters: fn the pathname of the file to get in
formation about. info a pointer to a 64-bit file in
formation object (see prfileinfo64). on output, pr_getfileinfo64 writes in
formation about the given file to the file in
formation object. returns one of the following values: if the file in
formation is successfully obtained, pr_success. if the file in
formation is not successfully obtained, pr_failure. description pr_getfileinfo64 stores in
formation about the file with the specified pathname in the prfileinfo64 structure pointed to by info. th...
...n is successfully obtained, pr_success. if the file in
formation is not successfully obtained, pr_failure. description pr_getfileinfo64 stores in
formation about the file with the specified pathname in the prfileinfo64 structure pointed to by info. the file size is returned as an unsigned 64-bit integer. see also for the 32-bit version of this function, see pr_getfileinfo. to get equivalent in
formation on a file that's already open, use pr_getopenfileinfo64. ...
PR_GetOpenFileInfo
gets an open file's in
formation. file size is expressed as a 32-bit integer. syntax #include <prio.h> prstatus pr_getopenfileinfo( prfiledesc *fd, prfileinfo *info); parameters the function has the following parameters: fd a pointer to a prfiledesc object for an open file. info a pointer to a prfileinfo object. on output, in
formation about the given file is written into the file in
formation object. returns the function returns one of the following values: if file in
formation is successfully obtained, pr_success. if file in
formation is not successfully obtained, pr_failure. description pr_getopenfileinfo obtains the file type (normal file, directory, or other), file size (as a 32-bit integer), and the file creation and modification times of the open file represented b...
...ed, pr_success. if file in
formation is not successfully obtained, pr_failure. description pr_getopenfileinfo obtains the file type (normal file, directory, or other), file size (as a 32-bit integer), and the file creation and modification times of the open file represented by the file descriptor. see also for the 64-bit version of this function, see pr_getopenfileinfo64. to get equivalent in
formation on a file that's not already open, use pr_getfileinfo. ...
PR_Initialize
provides an alternate
form of explicit initialization. in addition to establishing the sequence of operations, pr_initialize implicitly calls pr_cleanup on exiting the primordial function. syntax #include <prinit.h> printn pr_initialize( prprimordialfn prmain, printn argc, char **argv, pruintn maxptds); parameters pr_initialize has the following parameters: prmain the function that becomes the primordial thread's root function. returning from prmain leads to termination of the process. argc the length of the argument vector, whether passed in from the host's program-launching facility or fabricated by the actual main program. this approach con
forms to standard c programming practice. argv the base address of an array of strings that compromise the program's argument vect...
... maxptds this parameter is ignored. returns the value returned from the root function, prmain. ...
PR_IntervalToMicroseconds
returns equivalent in microseconds of the value passed in the ticks parameter. description conversion may cause overflow, which is not reported. ...
... returns equivalent in microseconds of the value passed in the ticks parameter. description conversion may cause overflow, which is not reported. ...
PR_IntervalToMilliseconds
returns equivalent in milliseconds of the value passed in the ticks parameter. description conversion may cause overflow, which is not reported. ...
... returns equivalent in milliseconds of the value passed in the ticks parameter. description conversion may cause overflow, which is not reported. ...
PR_IntervalToSeconds
returns equivalent in seconds of the value passed in the ticks parameter. description conversion may cause overflow, which is not reported. ...
... returns equivalent in seconds of the value passed in the ticks parameter. description conversion may cause overflow, which is not reported. ...
PR_SetError
if there is no appropriate os error number, a zero may be supplied. description nspr does not validate the value of the error number or os error number being specified. the runtime merely stores the value and returns it when requested. ...
...if there is no appropriate os error number, a zero may be supplied. description nspr does not validate the value of the error number or os error number being specified. the runtime merely stores the value and returns it when requested. ...
NSPR API Reference
ime 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 printing linked lists linked list types prclist linked list macros pr_init_clist pr_init_static_clist pr_append_link pr_insert_link pr_next_link pr_prev_link pr_remove_link pr_remove_and_init_link pr_insert_before pr_insert_after dynamic library linking library linking types prlibrary prstaticlinktable library linkin...
...pr_insert_before pr_insert_after dynamic library linking library linking types prlibrary prstaticlinktable library linking functions pr_setlibrarypath pr_getlibrarypath pr_getlibraryname pr_freelibraryname pr_loadlibrary pr_unloadlibrary pr_findsymbol pr_findsymbolandlibrary finding symbols defined in the main executable program plat
form notes dynamic library search path exporting symbols from the main executable program process management and interprocess communication process management types and constants prprocess prprocessattr process management functions setting the attributes of a new process creating and managing processes multiwait receive system in
formation and enviro...
Certificate functions
mxr 3.4 and later cert_findsmimeprofile mxr 3.2 and later cert_findsubjectkeyidextension mxr 3.7 and later cert_findusercertbyusage mxr 3.4 and later cert_findusercertsbyusage mxr 3.4 and later cert_finishcertificaterequestattributes mxr 3.10 and later cert_finishextensions mxr 3.5 and later cert_
formatname mxr 3.2 and later cert_freedistnames mxr 3.2 and later cert_freenicknames mxr 3.2 and later cert_getavatag mxr 3.2 and later cert_getcertchainfromcert mxr 3.4 and later cert_getcertemailaddress mxr 3.2 and later cert_getcertificatenames mxr 3.10 and later cert_getcertificaterequestextens...
...eralname mxr 3.10 and later cert_getprevnameconstraint mxr 3.10 and later cert_getsloptime mxr 3.2 and later cert_getsslcacerts mxr 3.2 and later cert_getstatename mxr 3.2 and later cert_getusepkixforvalidation mxr 3.12 and later cert_getvaliddnspatternsfromcert mxr 3.12 and later cert_gentime2
formattedascii mxr 3.2 and later cert_hexify mxr 3.2 and later cert_importcachain mxr 3.2 and later cert_importcerts mxr 3.2 and later cert_isrootdercert mxr 3.8 and later cert_isusercert mxr 3.6 and later cert_keyfromdercrl mxr 3.4 and later cert_makecanickname mxr 3.4 and later cer...
HTTP delegation
herefore the api should allow for keep-alive (persistent) http connections. http uris consist of host:port and a path, e.g. http://ocsp.provider.com:80/cgi-bin/ocsp-responder if nss needs to access a http server, it will request that an "http server session object" be created (sec_httpserver_createsessionfcn). the http server session object is logically associated with host and port destination in
formation, in our example this is "host ocsp.provider.com port 80". the object may be used by the application to associate it with a physical network connection. (nss might choose to be smart, and only create a single http server session object for each server encountered. nss might also choose to be simple, and request multiple objects for the same server. the application must support both strategies...
...nnection keep alive" function (sec_httpserver_keepalivesessionfcn) on the server session object, giving application code a chance to do whatever is required. for each individual http request, nss will request the creation of a "http request object" (sec_httprequest_createfcn). no full uri is provided as a parameter. instead, the parameters are a server session object (that carries host and port in
formation already) and the request path. in our example the path is "/cgi-bin/ocsp-responder". (when issueing get requests, the "?query-string=data" portion should already be appended to the request path) after creation, nss might call functions to provide additional details of the http request (e.g. sec_httprequest_setpostdatafcn). the application is expected to collect the details for later use. onc...
HTTP delegation
herefore the api should allow for keep-alive (persistent) http connections. http uris consist of host:port and a path, e.g. http://ocsp.provider.com:80/cgi-bin/ocsp-responder if nss needs to access a http server, it will request that an "http server session object" be created (sec_httpserver_createsessionfcn). the http server session object is logically associated with host and port destination in
formation, in our example this is "host ocsp.provider.com port 80". the object may be used by the application to associate it with a physical network connection. (nss might choose to be smart, and only create a single http server session object for each server encountered. nss might also choose to be simple, and request multiple objects for the same server. the application must support both strategies...
...nnection keep alive" function (sec_httpserver_keepalivesessionfcn) on the server session object, giving application code a chance to do whatever is required. for each individual http request, nss will request the creation of a "http request object" (sec_httprequest_createfcn). no full uri is provided as a parameter. instead, the parameters are a server session object (that carries host and port in
formation already) and the request path. in our example the path is "/cgi-bin/ocsp-responder". (when issuing get requests, the "?query-string=data" portion should already be appended to the request path) after creation, nss might call functions to provide additional details of the http request (e.g. sec_httprequest_setpostdatafcn). the application is expected to collect the details for later use. once...
4.3 Release Notes
the cvs tag for the jss 4.3 release is jss_4_3_rtm. source tarballs are available from https://archive.mozilla.org/pub/security/jss/releases/jss_4_3_rtm/src/jss-4.3.tar.bz2 binary releases are no longer available on mozilla. jss is a jni library we provide the jss4.jar but expect you to build the jss's matching jni shared library. we provide t...
...ecurity/jss/releases/jss_4_3_rtm/ documentation documentation for jss 4.3 is available as follows: build instructions for jss 4.3 javadoc [online] [zipped] read the instructions on using jss. source may be viewed with a browser (via the mxr tool) at http://mxr.mozilla.org/mozilla/source/security/jss/ the run time behavior of jss can be affected by the nss environment variables. plat
form in
formation jss 4.3 works with jdk versions 4 or higher we suggest the latest. jss 4.3 requires nss 3.12 or higher. jss 4.3 requires nspr 4.7.1 or higher. jss only supports the native threading model (no green threads). known bugs and issues for a list of reported bugs that have not yet been fixed, click here. note that some bugs may have been fixed since jss 4.3 was released. com...
JSS 4.4.0 Release Notes
jss 4.4.0 requires netswork security services (nss) 3.29.1 and netscape portable runtime (nspr) 4.13.1 or newer. jss 4.4.0 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/jss/releases/jss_4_4_0_rtm/src/ new in jss 4.40 new functionality new functions new macros notable changes in jss 4.40 picks up work done downstream for fedora and rhel and used by various linux distributions with includes:. ...
.... support for ipv6. support for tls v1.1 and tls v1.2 via nss though jss. bugs fixed in jss 4.4.0 this bugzilla query returns all the bugs fixed in nss 4.4.0: https://bugzilla.mozilla.org/buglist.cgi?product=jss&target_milestone=4.4&target_milestone=4.4&bug_status=resolved&resolution=fixed documentation build instructions for jss at https://hg.mozilla.org/projects/jss/file/tip/readme plat
form in
formation you can check out the source from mercurial via hg clone -r 055aa3ce8a61 https://hg.mozilla.org/projects/jss jss 4.4.0 works with openjdk versions 1.7 or higher we suggest the latest - openjdk 1.8. jss 4.4.0 requires nss 3.12.5 or higher though nss 3.28.3 is recommended. jss 4.3.1 requires nspr 4.7.1 or higher though nspr 3.13 is recommended. jss only supports the nati...
NSS 3.12.5 release_notes
nss 3.12.5 requires nspr 4.8. ...
..._rtm nspr cvs co -r nss_3_12_5_rtm nss see the documentation section for the build instructions. nss 3.12.5 source is also available on ftp.mozilla.org for secure https download: source tarball: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_5_rtm/src/. new in nss 3.12.5 ssl3 & tls renegotiation vulnerability see cve-2009-3555 and us-cert vu#120541 for more in
formation about this security vulnerability. all ssl/tls renegotiation is disabled by default in nss 3.12.5. this will cause programs that attempt to per
form renegotiation to experience failures where they
formerly experienced successes, and is necessary for them to not be vulnerable, until such time as a new safe renegotiation scheme is standardized by the ietf. if an application depends on renegot...
NSS 3.12.6 release notes
nss 3.12.6 release notes 2010-03-03 newsgroup: mozilla.dev.tech.crypto introduction network security services (nss) 3.12.6 is a patch release for nss 3.12. the bug fixes in nss 3.12.6 are described in the "bugs fixed" section below. nss 3.12.6 is tri-licensed under the mpl 1.1/gpl 2.0/lgpl 2.1. distribution in
formation the cvs tag for the nss 3.12.6 release is nss_3_12_6_rtm. nss 3.12.6 requires nspr 4.8.4. see the documentation section for the build instructions. nss 3.12.6 source and binary distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_6_rt...
... tls server name indication for servers tls server name indication (sni) for servers is almost fully implemented in nss 3.12.6. see bug 360421 for details. note: the tls server name indication for clients is already fully implemented in nss. new functions for sni (see ssl.h for more in
formation): sslsnisocketconfig return values: ssl_sni_current_config_is_used: libssl must use the default cert and key. ssl_sni_send_alert: libssl must send the "unrecognized_name" alert. ssl_snisocketconfighoo...
NSS 3.12.9 release notes
nss 3.12.9 requires nspr 4.8.7. ...
... bug 536485: crash during ssl handshake in [@ intel_aes_decrypt_cbc_256] bug 444367: nss 3.12 softoken returns the certificate type of a certificate object as ckc_x_509_attr_cert. bug 620908: certutil -t -d "sql:." dumps core bug 584257: need a way to expand partial private keys. bug 596798: win_rand.c (among others) u...
NSS 3.14.1 release notes
nss 3.14.1 requires nspr 4.9.4 or newer. ...
...ic nss functions. bug 810582 - tls false start is now only used with servers that negotiate a cipher suite that supports forward secrecy. note: the criteria for false start may change again in future nss releases. bugs fixed in nss 3.14.1 the following bugzilla query returns all of the bugs fixed in nss 3.14.1: https://bugzilla.mozilla.org/buglist.cgi?list_id=5216669;resolution=fixed;query_
format=advanced;bug_status=resolved;bug_status=verified;target_milestone=3.14.1;product=nss compatability nss 3.14.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.14.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functi...
NSS 3.14.4 release notes
nss 3.14.4 requires nspr 4.9.5 or newer. nss 3.14.4 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_14_4_rtm/src/ security advisories the following security-relevant bugs have been resolved in nss 3.14.4. users are encouraged to upgrade immediately. ...
...ialized data read in the event of a decryption failure. new in nss 3.14.4 new functionality no new major functionality is introduced in this release. this release is a patch release to address cve-2013-1739. bugs fixed in nss 3.14.4 https://bugzilla.mozilla.org/buglist.cgi?bug_id=894370%2c832942%2c863947&bug_id_type=anyexact&list_id=8338081&resolution=fixed&classification=components&query_
format=advanced&product=nss compatibility nss 3.14.4 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.14.4 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with ...
NSS 3.14.5 release notes
nss 3.14.5 requires nspr 4.9.5 or newer. nss 3.14.5 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_14_5_rtm/src/ security advisories the following security-relevant bugs have been resolved in nss 3.14.5. users are encouraged to upgrade immediately. ...
...ged to upgrade immediately. bug 934016 - (cve-2013-5605) handle invalid handshake packets new in nss 3.14.5 new functionality no new major functionality is introduced in this release. this release is a patch release to address cve-2013-5605. bugs fixed in nss 3.14.5 https://bugzilla.mozilla.org/buglist.cgi?bug_id=934016&bug_id_type=anyexact&resolution=fixed&classification=components&query_
format=advanced&product=nss compatibility nss 3.14.5 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.14.5 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with ...
NSS 3.15.1 release notes
hmac-sha256 cipher suites (rfc 5246 and rfc 5289) are supported, allowing tls to be used without md5 and sha-1. ...
...e guard macro of secmod.h. bug 876352 - certutil now warns if importing a pem file that contains a private key. bug 565296 - fix the bug that shlibsign exited with status 0 even though it failed. the nss_survive_double_bypass_failure build option is removed. bugs fixed in nss 3.15.1 https://bugzilla.mozilla.org/buglist.cgi?list_id=5689256;resolution=fixed;classification=components;query_
format=advanced;target_milestone=3.15.1;product=nss compatibility nss 3.15.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.15.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will...
NSS 3.15.2 release notes
users are encouraged to upgrade immediately. ...
...o be called before the handshake is finished. bug 848384 - deprecate the ssl cipher policy code, as it's no longer relevant. it is no longer necessary to call nss_setdomesticpolicy because all cipher suites are now allowed by default. a complete list of all bugs resolved in this release can be obtained at https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&target_milestone=3.15.2&product=nss&list_id=7982238 compatibility nss 3.15.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.15.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public...
NSS 3.15.3.1 release notes
nss 3.15.3.1 requires nspr 4.10.2 or newer. nss 3.15.3.1 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_3_1_rtm/src/ security advisories the following security-relevant bugs have been resolved in nss 3.15.3.1. ...
...release. this is a patch release to revoke trust of a subordinate ca certificate that was mis-used to generate a certificate used by a network appliance. bugs fixed in nss 3.15.3.1 bug 946351 - misissued google certificates from dcssi a complete list of all bugs resolved in this release can be obtained at https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&target_milestone=3.15.3.1&product=nss compatibility nss 3.15.3.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.15.3.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public function...
NSS 3.15.3 release notes
nss 3.15.3 requires nspr 4.10.2 or newer. nss 3.15.3 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_3_rtm/src/ security advisories the following security-relevant bugs have been resolved in nss 3.15.3. users are encouraged to upgrade immediately. ...
...e to address cve-2013-1741, cve-2013-5605 and cve-2013-5606. bugs fixed in nss 3.15.3 bug 850478 - list rc4_128 cipher suites after aes_128 cipher suites bug 919677 - don't advertise tls 1.2-only ciphersuites in a tls 1.1 clienthello a complete list of all bugs resolved in this release can be obtained at https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&target_milestone=3.15.3&product=nss compatibility nss 3.15.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.15.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will ...
NSS 3.15.4 release notes
nss 3.15.4 requires nspr 4.10.2 or newer. nss 3.15.4 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_4_rtm/src/ security advisories the following security-relevant bugs have been resolved in nss 3.15.4. users are encouraged to upgrade immediately. ...
...pplication must now register a callback using the ssl_setcanfalsestartcallback function. when building on windows, os_target now defaults to win95. to use the winnt build configuration, specify os_target=winnt. bugs fixed in nss 3.15.4 a complete list of all bugs resolved in this release can be obtained at https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&target_milestone=3.15.4&product=nss compatibility nss 3.15.4 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.15.4 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will ...
NSS 3.15.5 release notes
nss 3.15.5 requires nspr 4.10.2 or newer. nss 3.15.5 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_5_rtm/src/ new in nss 3.15.5 new functionality added support for the tls application layer protocol negotiation (alpn) extension. ...
.... applications should still take care when converting struct iov to priovec because the iov_len members of the two structures have different types (size_t vs. int). size_t is unsigned and may be larger than int. bugs fixed in nss 3.15.5 a complete list of all bugs resolved in this release can be obtained at https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&target_milestone=3.15.5&product=nss compatibility nss 3.15.5 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.15.5 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will ...
NSS 3.16.1 release notes
nss 3.16.1 requires nspr 4.10.5 or newer. nss 3.16.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_16_1_rtm/src/ new in nss 3.16.1 new functionality added the "ecc" flag for modutil to select the module used for elliptic curve cryptography (ecc) operations. ...
...r elliptic curve cryptography (ecc) operations. ...
NSS 3.16.2.3 release notes
nss 3.16.2.3 requires nspr 4.10.6 or newer. ...
...rr.h ssl_error_inappropriate_fallback_alert - a new ssl error code. in sslproto.h tls_fallback_scsv - a a signaling cipher suite value that indicates a handshake is the result of tls version fallback. notable changes in nss 3.16.2.3 bug 1057161: check that an imported elliptic curve public key is valid. previously nss would only validate the peer's public key before per
forming ecdh key agreement. now ec public keys are validated at import time. bugs fixed in nss 3.16.2.3 bug 1057161 - nss hangs with 100% cpu on invalid ec key bug 1036735 - add support for draft-ietf-tls-downgrade-scsv to nss compatibility nss 3.16.2.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will w...
NSS 3.16.2 release notes
nss 3.16.2 requires nspr 4.10.6 or newer. nss 3.16.2 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_16_2_rtm/src/ new in nss 3.16.2 new functionality dtls 1.2 is supported. ...
...utf-8". the default is to show a non-ascii character as ".". ...
NSS 3.16.3 release notes
nss 3.16.3 requires nspr 4.10.6 or newer. nss 3.16.3 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_16_3_rtm/src/ new in nss 3.16.3 this release consists primarily of ca certificate changes as listed below, and fixes an issue with a recently added utility function. ...
... cn = netlock expressz (class c) tanusitvanykiado sha1 fingerprint: e3:92:51:2f:0a:cf:f5:05:df:f6:de:06:7f:75:37:e1:65:ea:57:4b turned off websites and code signing trust bits (1024-bit root) bugs fixed in nss 3.16.3 this bugzilla query returns all the bugs fixed in nss 3.16.3: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.16.3 ...
NSS 3.16.4 release notes
nss 3.16.4 requires nspr 4.10.6 or newer. nss 3.16.4 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_16_4_rtm/src/ new in nss 3.16.4 this release consists primarily of ca certificate changes as listed below, and includes a small number of bug fixes. ...
...rtificate is a temporary measure to allow those sites to function, by allowing them to find a trust path to another 2048-bit root ca certificate. the temporarily included intermediate certificate expires november 1, 2015. bugs fixed in nss 3.16.4 this bugzilla query returns all the bugs fixed in nss 3.16.4: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.16.4 ...
NSS 3.17.1 release notes
nss 3.17.1 requires nspr 4.10.7 or newer. nss 3.17.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_17_1_rtm/src/ security advisories the following security-relevant bugs have been resolved in nss 3.17.1. users are encouraged to upgrade immediately. ...
...ndicates a handshake is the result of tls version fallback. notable changes in nss 3.17.1 signature algorithms now use sha-256 instead of sha-1 by default. added support for linux on little-endian powerpc64. bugs fixed in nss 3.17.1 this bugzilla query returns all the bugs fixed in nss 3.17.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.17.1 acknowledgements the nss development team would like to thank antoine delignat-lavaud, security researcher at inria paris in team prosecco, and the advanced threat research team at intel security, who both independently discovered and reported this issue, for responsibly disclosing the issue by providing advance copies of their research. compatibi...
NSS 3.17.3 release notes
nss 3.17.3 requires nspr 4.10.7 or newer. nss 3.17.3 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_17_3_rtm/src/ new in nss 3.17.3 new functionality support for tls_fallback_scsv has been added to the ssltap and tstclnt utilities. ...
...a program linked with older nss 3.x shared libraries will work with nss 3.17.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions wil...
NSS 3.17.4 release notes
nss 3.17.4 requires nspr 4.10.7 or newer. nss 3.17.4 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_17_4_rtm/src/ new in nss 3.17.4 new functionality no new functionality is introduced in this release. this is a patch release to fix multiple bugs. ...
...xed a memory corruption issue during failure of keypair generation. bug 1113632: fixed a failure to reload a pkcs#11 module in fips mode. bug 1119983: fixed interoperability of nss server code with a libressl client. bugs fixed in nss 3.17.4 this bugzilla query returns all the bugs fixed in nss 3.17.4: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.17.4 compatibility nss 3.17.4 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.17.4 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions wil...
NSS 3.17 release notes
nss 3.17 requires nspr 4.10.7 or newer. nss 3.17 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_17_rtm/src/ new in nss 3.17 new functionality when using ecdhe, the tls server code may be configured to generate a fresh ephemeral ecdh key for each handshake, by setting the ssl_reuse_server_ecdhe_key socket option to pr_false. ...
...nt the new parameters that had been added in nss 3.16.2. ...
NSS 3.18.1 release notes
nss 3.18.1 requires nspr 4.10.8 or newer. nss 3.18.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_18_1_rtm/src/ new in nss 3.18.1 no new functionality is introduced in this release. this is a patch release to update the list of root ca certificates. ...
...ol. cn=mcsholding test, o=mcsholding, c=eg sha1 fingerprint: e1:f3:59:1e:76:98:65:c4:e4:47:ac:c3:7e:af:c9:e2:bf:e4:c5:76 the version number of the updated root ca list has been set to 2.4 bugs fixed in nss 3.18.1 this bugzilla query returns all the bugs fixed in nss 3.18.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.18.1 compatibility nss 3.18.1 shared libraries are backward compatible with all older nss 3.18 shared libraries. a program linked with older nss 3.18 shared libraries will work with nss 3.18.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions w...
NSS 3.19.1 release notes
nss 3.19.1 requires nspr 4.10.8 or newer. ...
... compatibility nss 3.19.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.19.1 shared ...
NSS 3.19.2 release notes
nss 3.19.2 requires nspr 4.10.8 or newer. nss 3.19.2 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_19_2_rtm/src/ new in nss 3.19.2 new functionality no new functionality is introduced in this release. ...
...n ssl/tls. note: future versions of nss may increase the minimum keysizes required by the freebl module. consumers of nss are strongly encouraged to migrate to stronger cryptographic strengths as soon as possible. bugs fixed in nss 3.19.2 this bugzilla query returns all the bugs fixed in nss 3.19.2: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.19.2 compatibility nss 3.19.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.19.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions wil...
NSS 3.19.3 release notes
nss 3.19.3 requires nspr 4.10.8 or newer. nss 3.19.3 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_19_3_rtm/src/ new in nss 3.19.3 no new functionality is introduced in this release. this is a patch release to update the list of root ca certificates. ...
...a program linked with older nss 3.19 shared libraries will work with nss 3.19.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions w...
NSS 3.20 release notes
nss 3.20 requires nspr 4.10.8 or newer. nss 3.20 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_20_rtm/src/ new in nss 3.20 new functionality the tls library has been extended to support dhe ciphersuites in server applications. ...
...til when creating dsa keys has been increased to use 2048 bit parameters. the selfserv utility has been enhanced to support the new dhe features. nss no longer supports c compilers that predate the ansi c standard (c89). bugs fixed in nss 3.20 this bugzilla query returns all the bugs fixed in nss 3.20: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.20 compatibility nss 3.20 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.20 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.22 release notes
nss 3.22 requires nspr 4.11 or newer. nss 3.22 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_22_rtm/src/ new in nss 3.22 new functionality rsa-pss signatures are now supported (bug 1215295) new functions pk11_signwithmechanism() and pk11_signwithmechanism() are provided to allow rsa keys to be used with pss. ...
...t.h ssl_max_extensions is updated to 13 notable changes in nss 3.22 nss c++ tests are built by default, requiring a c++11 compiler. set the nss_disable_gtests variable to 1 to disable building these tests. bugs fixed in nss 3.22 this bugzilla query returns all the bugs fixed in nss 3.22: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.22 compatibility nss 3.22 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.22 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.25 release notes
nss 3.25 requires netscape portable runtime (nspr) 4.12 or newer. nss 3.25 source distributions are available on ftp.mozilla.org for secure https download at the following location. source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_25_rtm/src/ new in nss 3.25 new functionality implemented dhe key agreement for tls 1.3. added support for chacha with tls 1.3. added support for tls 1.2 ciphersuites that use sha384 as the prf. ...
...a program linked with older nss 3.x shared libraries will work with nss 3.25 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.26 release notes
nss 3.26 requires netscape portable runtime (nspr) 4.12 or newer. ...
...a program linked with older nss 3.x shared libraries will work with nss 3.26 shared libraries without recompiling or relinking. applications that restrict their use of nss apis, to the functions listed in nss public functions, will remain compati...
NSS 3.27 release notes
nss 3.27 requires netscape portable runtime (nspr) 4.13 or newer. nss 3.27 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_27_rtm/src/ new in nss 3.27 new functionality allow custom named group priorities for tls key exchange handshake (ssl_namedgroupconfig). ...
...a program linked with older nss 3.x shared libraries will work with nss 3.27 shared libraries without recompiling or relinking. applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatibl...
NSS 3.29 release notes
nss 3.29 requires netscape portable runtime (nspr) 4.13.1 or newer. nss 3.29 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_29_rtm/src/ notable changes in nss 3.29 fixed a nss 3.28 regression in the signature scheme flexibility that causes connectivity issues between ios 8 clients and nss servers with ecdsa certificates (bug1334114). ...
...ixed a nss 3.28 regression in the signature scheme flexibility that causes connectivity issues between ios 8 clients and nss servers with ecdsa certificates (bug1334114). tls 1.3 is now enabled by default in (bug1311296). bugs fixed in nss 3.29 this bugzilla query returns all the bugs fixed in nss 3.29: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.29 compatibility nss 3.29 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.29 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.34.1 release notes
nss 3.34.1 requires netscape portable runtime (nspr) 4.17, or newer. nss 3.34.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_34_1_rtm/src/ notable changes in nss 3.34.1 the following ca certificate was re-added. it was previously removed in nss 3.34, but now re-added with only the email trust bit set. (bug 1418678) cn = certum ca, o=unizeto sp. z o.o. ...
... removed entries from certdata.txt for actively distrusted certificates that have expired (bug 1409872). the version of the ca list was set to 2.20. new in nss 3.34 new functionality none new functions bugs fixed in nss 3.34.1 this bugzilla query returns all the bugs fixed in nss 3.34.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.34.1 compatibility nss 3.34.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.34 shared libraries, without recompiling, or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions wil...
NSS 3.34 release notes
nss 3.34 requires netscape portable runtime (nspr) 4.17, or newer. ...
...rsa-pss signatures are now supported on certificates. certificates with rsa-pss or rsa-pkcs#1v1.5 keys can be used to create an rsa-pss signature on a certificate, using the --pss-sign argument to certutil. new functions bugs fixed in nss 3.34 this bugzilla query returns all the bugs fixed in nss 3.34: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.34 compatibility nss 3.34 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.34 shared libraries, without recompiling, or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will re...
NSS 3.36.1 release notes
nss 3.36.1 requires nspr 4.19 or newer. nss 3.36.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/security/nss/releases/nss_3_36_1_rtm/src/ new in nss 3.xx new functionality no new functionality is introduced in this release. this is a patch release to fix regression bugs. ...
...d caused an interoperability regression with operating systems that are limited to 600 k iterations. nss 3.36.1 has been changed to use the same 600 k limit. bugs fixed in nss 3.36.1 certain smartcard operations could result in a deadlock. this bugzilla query returns all the bugs fixed in nss 3.36.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.36.1 compatibility nss 3.36.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.36.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions wil...
NSS 3.36.2 release notes
introduction network security services (nss) 3.36.2 is a patch release for nss 3.36. distribution in
formation the hg tag is nss_3_36_2_rtm. nss 3.36.2 requires nspr 4.19 or newer. nss 3.36.2 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/security/nss/releases/nss_3_36_2_rtm/src/ new in nss 3.36.2 new functionality no new functionality is introduced in this release. this is a patch release to fix regression bugs. bugs fixed in nss 3.36.2 bug 1462303 - connecting to a server that was recently upgraded to tls 1.3 would result in a ssl_rx_mal
formed_server_hello error. bug 1460673 - fix a rare bug with pkcs#12 files. this bugzilla query returns all the bugs fixed in nss 3.36.2: https://bug...
...e to fix regression bugs. bugs fixed in nss 3.36.2 bug 1462303 - connecting to a server that was recently upgraded to tls 1.3 would result in a ssl_rx_mal
formed_server_hello error. bug 1460673 - fix a rare bug with pkcs#12 files. this bugzilla query returns all the bugs fixed in nss 3.36.2: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.36.2 compatibility nss 3.36.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.36.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions wil...
NSS 3.36 release notes
introduction the nss team has released network security services (nss) 3.36, which is a minor release. distribution in
formation the hg tag is nss_3_36_rtm. nss 3.36 requires nspr 4.19 or newer. nss 3.36 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_36_rtm/src/ (make a link) new in nss 3.36 new functionality experimental apis for tls session cache handling. notable changes in nss 3.36 replaced existing vectorized chacha20 code with verified hacl* implementation. ...
...m/src/ (make a link) new in nss 3.36 new functionality experimental apis for tls session cache handling. notable changes in nss 3.36 replaced existing vectorized chacha20 code with verified hacl* implementation. bugs fixed in nss 3.36 this bugzilla query returns all the bugs fixed in nss 3.36: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.36 compatibility nss 3.36 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.36 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.37.1 release notes
introduction network security services (nss) 3.37.1 is a patch release for nss 3.37. distribution in
formation the hg tag is nss_3_37_1_rtm. nss 3.37.1 requires nspr 4.19 or newer. nss 3.37.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/security/nss/releases/nss_3_37_1_rtm/src/ new in nss 3.37.1 new functionality no new functionality is introduced in this release. this is a patch release to fix regression bugs. bugs fixed in nss 3.37.1 bug 1462303 - connecting to a server that was recently upgraded to tls 1.3 would result in a ssl_rx_mal
formed_server_hello error. bug 1460673 - fix a rare bug with pkcs#12 files. this bugzilla query returns all the bugs fixed in nss 3.37.1: https://bug...
...e to fix regression bugs. bugs fixed in nss 3.37.1 bug 1462303 - connecting to a server that was recently upgraded to tls 1.3 would result in a ssl_rx_mal
formed_server_hello error. bug 1460673 - fix a rare bug with pkcs#12 files. this bugzilla query returns all the bugs fixed in nss 3.37.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.37.1 compatibility nss 3.37.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.37.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions wil...
NSS 3.37.3 release notes
bug 1461731 - fix crash on macos related to authentication tokens, e.g. ...
...3 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/security/nss/releases/nss_3_37_3_rtm/src/ new in nss 3.37.3 new functionality no new functionality is introduced in this release. this is a patch release to fix regression bugs. bugs fixed in nss 3.37.3 bug 1459739 - fix build on armv6/armv7 and other plat
forms. bug 1461731 - fix crash on macos related to authentication tokens, e.g. pk11or webauthn. compatibility nss 3.37.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.37.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss api...
NSS 3.38 release notes
nss 3.38 requires nspr 4.19 or newer. nss 3.38 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_38_rtm/src/ new in nss 3.38 new functionality added support for the tls record size limit extension. when creating a certificate request (csr) using certutil -r, an existing orphan private key can be reused. parameter -k may be used to specify the id of an existing orphan key. ...
...sql database storage on linux, if it is located on a network filesystem that's known to benefit from caching. when repeatedly importing the same certificate into an sql database, the existing nickname will be kept. bugs fixed in nss 3.38 this bugzilla query returns all the bugs fixed in nss 3.38: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.38 compatibility nss 3.38 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.38 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.39 release notes
nss 3.39 requires nspr 4.20 or newer. nss 3.39 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_39_rtm/src/ new in nss 3.39 new functionality the tstclnt and selfserv utilities added support for configuring the enabled tls signature schemes using the -j parameter. nss will use rsa-pss keys to authenticate in tls. ...
...a program linked with older nss 3.x shared libraries will work with nss 3.39 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.40 release notes
nss 3.40 requires nspr 4.20 or newer. ...
...a program linked with older nss 3.x shared libraries will work with nss 3.40 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.41.1 release notes
nss 3.41.1 requires nspr 4.20 or newer. nss 3.41.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_41_1_rtm/src/ other releases are available in nss releases. ...
...patch release to fix bugs. bugs fixed in nss 3.41.1 bug 1507135 and bug 1507174 - add additional null checks to several cms functions to fix a rare cms crash. thanks to hanno böck and damian poddebniak for the discovery and fixes. (cve-2018-18508) this bugzilla query returns all bugs fixed in 3.41.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.41.1 compatibility nss 3.41.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.41.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions wil...
NSS 3.41 release notes
nss 3.41 requires nspr 4.20 or newer. nss 3.41 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_41_rtm/src/ new in nss 3.41 new functionality bug 1252891 - implemented eku handling for ipsec ike. bug 1423043 - enable half-closed states for tls. ...
...a program linked with older nss 3.x shared libraries will work with nss 3.41 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.42.1 release notes
nss 3.42.1 requires nspr 4.20 or newer. nss 3.42.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_42_1_rtm/src/ other releases are available in nss releases. bugs fixed in nss 3.42.1 bug 1507135 and bug 1507174 - add additional null checks to several cms functions to fix a rare cms crash. ...
...l null checks to several cms functions to fix a rare cms crash. thanks to hanno böck and damian poddebniak for the discovery and fixes. this was originally announced in nss 3.42, but was mistakenly not included in the release. (cve-2018-18508) this bugzilla query returns all the bugs fixed in nss 3.42.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.42.1 compatibility nss 3.42.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.42.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions wil...
NSS 3.42 release notes
nss 3.42 requires nspr 4.20 or newer. nss 3.42 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_42_rtm/src/ other releases are available in nss releases. ...
...ian poddebniak for the discovery and fixes. note: this was mistakenly not in release 3.42, and is instead in nss 3.42.1. bug 1513913 - a fix for solaris where firefox 60 core dumps during start when using profile from version 52 this bugzilla query returns all the bugs fixed in nss 3.42: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.42 compatibility nss 3.42 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.42 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.44.2 release notes
nss 3.44.2 requires nspr 4.21 or newer. nss 3.44.2 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_44_2_rtm/src/ other releases are available in nss releases. ...
...es. new in nss 3.44.2 no new functionality is introduced in this release. bugs fixed in nss 3.44.2 bug 1582343 - soft token mac verification not constant time bug 1577953 - remove arbitrary hkdf output limit by allocating space as needed this bugzilla query returns all the bugs fixed in nss 3.44.2: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.44.2 compatibility nss 3.44.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.44.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions wil...
NSS 3.44.3 release notes
nss 3.44.3 requires nspr 4.21 or newer. ...
...no new functionality is introduced in this release. bugs fixed in nss 3.44.3 bug 1579060 - don't set the constructed bit for issueruniqueid and subjectuniqueid in mozilla::pkix cve-2019-11745 - encryptupdate should use maxout, not block size this bugzilla query returns all the bugs fixed in nss 3.44: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.44 compatibility nss 3.44.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.44.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will ...
NSS 3.44 release notes
introduction the nss team has released network security services (nss) 3.44 on 10 may 2019, which is a minor release. the nss team would like to recognize first-time contributors: kevin jacobs, david carlier, alexander scheel, and edouard oger. distribution in
formation the hg tag is nss_3_44_rtm. nss 3.44 requires nspr 4.21 or newer. nss 3.44 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_44_rtm/src/ other releases are available in nss releases. new in nss 3.44 new functionality new functions in lib/certdb/cert.h cert_getcertificateder - access the der-encoded
form of a certcertificate. notable changes in nss 3.44 it is now possible to build...
...a program linked with older nss 3.x shared libraries will work with nss 3.44 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.45 release notes
nss 3.45 requires nspr 4.21 or newer. ...
...a program linked with older nss 3.x shared libraries will work with nss 3.45 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.46.1 release notes
nss 3.46.1 requires nspr 4.22 or newer. nss 3.46.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_46_1_rtm/src/ other releases are available in nss releases. ...
...es. new in nss 3.46.1 no new functionality is introduced in this release. bugs fixed in nss 3.46.1 bug 1582343 - soft token mac verification not constant time bug 1577953 - remove arbitrary hkdf output limit by allocating space as needed this bugzilla query returns all the bugs fixed in nss 3.46.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.46.1 compatibility nss 3.46.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.46.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions wil...
NSS 3.47.1 release notes
nss 3.47.1 requires nspr 4.23 or newer. ...
...a program linked with older nss 3.x shared libraries will work with nss 3.47.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will ...
NSS 3.47 release notes
nss 3.47 requires nspr 4.23 or newer. ...
...ignaturealgorithm field of signerinfo in cms for dsa and ecdsa bug 1576664 - remove -mms-bitfields from mingw nss build. bug 1577038 - add pk11_getcertsfromprivatekey to return all certificates with public keys matching a particular private key this bugzilla query returns all the bugs fixed in nss 3.47: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.47 compatibility nss 3.47 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.47 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.48.1 release notes
nss 3.48.1 requires nspr 4.23 or newer. nss 3.48.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_48_1_rtm/src/ other releases are available in nss releases. ...
... new in nss 3.48.1 no new functionality is introduced in this release. bugs fixed in nss 3.48.1 bug 1606992 - cache the most recent pbkdf2 password hash, to speed up repeated sdr operations, important with the increased kdf iteration counts. this bugzilla query returns all the bugs fixed in nss 3.48: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.48 compatibility nss 3.48.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.48.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will ...
NSS 3.49.1 release notes
nss 3.49.1 requires nspr 4.24 or newer. nss 3.49.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_49_1_rtm/src/ other releases are available in nss releases. ...
... new in nss 3.49.1 no new functionality is introduced in this release. bugs fixed in nss 3.49.1 bug 1606992 - cache the most recent pbkdf2 password hash, to speed up repeated sdr operations, important with the increased kdf iteration counts. this bugzilla query returns all the bugs fixed in nss 3.49: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.49 compatibility nss 3.49.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.49.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will ...
NSS 3.49.2 release notes
nss 3.49.2 requires nspr 4.24 or newer. nss 3.49.2 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_49_2_rtm/src/ other releases are available in nss releases. ...
...s. nss 3.49.1 sped up pbkdf2 operations, though pbkdf1 operations are also relevant for older nss databases. bug 1608327 - fix compilation problems with neon-specific code in freebl bug 1608895 - fix a taskcluster issue with python 2 / python 3 this bugzilla query returns all the bugs fixed in nss 3.49: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.49 compatibility nss 3.49.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.49.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will ...
NSS 3.51 release notes
nss 3.51 requires nspr 4.25 or newer. nss 3.51 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_51_rtm/src/ other releases are available in nss releases. ...
...a program linked with older nss 3.x shared libraries will work with nss 3.51 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.53 release notes
introduction the nss team released network security services (nss) 3.53 on 29 may 2020. nss 3.53 will be a long-term support release, supporting firefox 78 esr. the nss team would like to recognize first-time contributors: jan-marek glogowski jeff walden distribution in
formation the hg tag is nss_3_53_rtm. nss 3.53 requires nspr 4.25 or newer. nss 3.53 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_53_rtm/src/ other releases are available in nss releases. notable changes in nss 3.53 when using the makefiles, nss can be built in parallel, speeding up those builds to more similar per
formance as the build.sh/ninja/gyp system. (bug 290526) seed is now...
...a program linked with older nss 3.x shared libraries will work with nss 3.53 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.54 release notes
nss 3.54 requires nspr 4.26 or newer. nss 3.54 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_54_rtm/src/ other releases are available in nss releases. notable changes in nss 3.54 support for tls 1.3 external pre-shared keys (bug 1603042). use arm cryptography extension for sha256, when available. (bug 1528113). ...
...557 - fix numerous compile warnings in nss. bug 1644774 - ssl gtests to use clearservercache when resetting self-encrypt keys. bug 1645479 - don't use secitem_makeitem in secutil.c. bug 1646520 - stricter enforcement of asn.1 integer encoding. this bugzilla query returns all the bugs fixed in nss 3.54: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.54 compatibility nss 3.54 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.54 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
NSS 3.56 release notes
nss 3.56 requires nspr 4.28 or newer. nss 3.56 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_56_rtm/src/ other releases are available in nss releases. notable changes in nss 3.56 nspr dependency updated to 4.28. the known issue where makefile builds failed to locate seccomon.h was fixed in bug 1653975. ...
...etting "all" as the default makefile target. bug 1659792 - fix broken libpkix tests with unexpired paypal cert. bug 1659814 - fix interop.sh failures with newer tls-interop commit and dependencies. bug 1656519 - update nspr dependency to 4.28. this bugzilla query returns all the bugs fixed in nss 3.56: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.56 compatibility nss 3.56 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.56 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will rema...
Enc Dec MAC Output Public Key as CSR
2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
...own) { pr_fprintf(pr_stderr, "unknown key or hash type\n"); rv = secfailure; goto cleanup; } rv = sec_dersigndata(arena, &result, encoding->data, encoding->len, privk, signalgtag); if (rv) { pr_fprintf(pr_stderr, "signing of data failed\n"); rv = secfailure; goto cleanup; } /* encode request in specified
format */ if (ascii) { char *obuf; char *name, *email, *org, *state, *country; secitem *it; int total; it = &result; obuf = btoa_convertitemtoascii(it); total = pl_strlen(obuf); name = cert_getcommonname(subject); if (!name) { name = strdup("(not specified)"); } email = cert_getcertemailaddress(...
nss tech note5
note: this document contains code snippets that focus on essential aspects of the task and often do not illustrate all the cleanup that needs to be done. also, this document does not attempt to be an exhaustive survey of all possible ways to do a certain task; it merely tries to show a certain way. ...
... <big>secitem_freeitem(&wrappedkey, pr_true);</big> if (wrappingpubkey) seckey_destroypublickey(wrappingpubkey); if (unwrappingpvtkey) seckey_destroyprivatekey(unwrappingpvtkey); pk11_freeslot(slot); also look at a sample program that uses the above functions. generate a symmetric key subsequent to the operation, the symmetric key may need to be transported/stored in wrapped or raw
form. you can find a list of key generation mechanisms in security/nss/lib/softoken/pkcs11.c - grep for ckf_generate. for some key gen mechanisms, the keysize is in bytes, and for some it is in bits. <big>choose a key generation mechanism</big> ck_mechanism_type keygenmech = ckm_des_key_gen; (for example) <big>generate the key</big> pk11symkey* symkey = pk11_keygen(slot, keygenmech, n...
NSS release notes template
nss 3.xx requires nspr 4.xx or newer. ...
...se to fix ... or: ... new functions in ___.h function - description new types in ___.h type - description. new macros in ___.h macro - description notable changes in nss 3.xx ... bugs fixed in nss 3.xx this bugzilla query returns all the bugs fixed in nss 3.xx: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_
format=advanced&product=nss&target_milestone=3.xx (make a link) acknowledgements the nss development team would like to thank ... for responsibly disclosing the issue by providing advance copies of their research. compatibility nss 3.xx.y shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.xx.y shar...
Migration to HG
rts of the nss build instructions remain valid, especially the instructions about setting environment variables. updated instructions for building nss with nspr can be found at: /docs/nss_reference/building_and_installing_nss/build_instructions it's best to refer to the above document to learn about the various environment variables that you might have to set to build on your plat
form (this part hasn't changed). however, below is a brief summary that shows how to checkout the source code and build both nspr and nss: mkdir workarea cd workarea hg clone https://hg.mozilla.org/projects/nspr hg clone https://hg.mozilla.org/projects/nss cd nss # set use_64=1 on 64 bit architectures # set build_opt=1 to get an optimized build make nss_build_all ...
... because of the changes described above, we have decided to use a new series of (minor) version numbers. the first releases using the new code layout will be nspr 4.10 and nss 3.15 ...
FC_GetMechanismInfo
a user may call fc_getmechanisminfo without logging into the token (to assume the nss user role). ...
...a user may call fc_getmechanisminfo without logging into the token (to assume the nss user role). ...
FC_GetSessionInfo
name fc_getsessioninfo - obtain in
formation about a session. syntax ck_rv fc_getsessioninfo( ck_session_handle hsession, ck_session_info_ptr pinfo ); parameters hsession [in] the open session handle. pinfo [out] pointer to the ck_session_info structure to be returned. description fc_getsessioninfo obtains in
formation about a session. a user may call fc_getsessioninfo without logging into the token (to assume the nss user role). if the nss cryptographic module is in the error state, fc_getsessioninfo returns ckr_device_error. ...
...ut] pointer to the ck_session_info structure to be returned. description fc_getsessioninfo obtains in
formation about a session. a user may call fc_getsessioninfo without logging into the token (to assume the nss user role). if the nss cryptographic module is in the error state, fc_getsessioninfo returns ckr_device_error. otherwise, it fills in the ck_session_info structure with the following in
formation: state: the state of the session, i.e., no role is assumed, the user role is assumed, or the crypto officer role is assumed flags: bit flags that define the type of session ckf_rw_session (0x00000002): true if the session is read/write; false if the session is read-only. ckf_serial_session (0x00000004): this flag is provided for backward compatibility and is always set to true. retur...
FC_Initialize
summary fc_initialize - initialize the pkcs #11 library. syntax ck_rv fc_initialize(ck_void_ptr pinitargs); parameters pinitargs points to a ck_c_initialize_args structure. description fc_initialize initializes the nss cryptographic module for the fips mode of operation. in addition to creating the internal data structures, it per
forms the fips software integrity test and power-up self-tests. the pinitargs argument must point to a ck_c_initialize_args structure whose members should have the following values: createmutex should be null. destroymutex should be null. lockmutex should be null. unlockmutex should be null. flags should be ckf_os_locking_ok. libraryparameters should point to a string that contains the library parameters. preserved should be null. the libra...
...ent must point to a ck_c_initialize_args structure whose members should have the following values: createmutex should be null. destroymutex should be null. lockmutex should be null. unlockmutex should be null. flags should be ckf_os_locking_ok. libraryparameters should point to a string that contains the library parameters. preserved should be null. the library parameters string has this
format: "configdir='dir' certprefix='prefix1' keyprefix='prefix2' secmod='file' flags= " here are some examples. nss_nodb_init(""), which initializes nss with no databases: "configdir='' certprefix='' keyprefix='' secmod='' flags=readonly,nocertdb,nomod db,forceopen,optimizespace " mozilla firefox initializes nss with this string (on windows): "configdir='c:\\documents and settings\\wtc\\applicati...
NSPR functions
nss uses nspr internally as the porting layer. however, a small number of nspr functions are required for using the certificate verification and ssl functions in nss. these nspr functions are listed in this section. nspr initialization and shutdown nspr is automatically initialized by the first nspr function called by the application. call pr_cleanup to shut down nspr and clean up its resources. pr_cleanup error reporting nss uses nspr's thread-specific error code to report errors. call pr_geterror to get the error code of the last failed nss or nspr function. call pr_seterror to set the error code, which can be retrieved with pr_geterror later. ...
...e nss certificate verification functions take a prtime parameter that specifies the time instant at which the validity of the certificate should verified. the nspr function pr_now returns the current time in prtime. pr_now interval time the nspr socket i/o functions pr_recv and pr_send (used by the nss ssl functions) take a printervaltime timeout parameter. printervaltime has an abstract, plat
form-dependent time unit. call pr_secondstointerval or pr_millisecondstointerval to convert a time interval in seconds or milliseconds to printervaltime. pr_secondstointerval pr_millisecondstointerval nspr i/o layering nspr file descriptors can be layered, corresponding to the layers in the network stack. the ssl library in nss implements the ssl protocol as an nspr i/o layer, which sits on top of...
NSS tools : cmsutil
to run cmsutil, type the command cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section. each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options options specify an action. option arguments modify an action. ...
...1,cert2, . . ." sign message example cmsutil -s [-i infile] [-o outfile] [-d dbdir] [-p password] -n nickname[-tgp] [-y ekprefnick] see also certutil(1) see also additional resources nss is maintained in conjunction with pki and security-related projects through mozilla dn fedora. the most closely-related project is dogtag pki, with a project wiki at [1]http://pki.fedoraproject.org/wiki/. for in
formation specifically about nss, the nss project wiki is located at [2]http://www.mozilla.org/projects/security/pki/nss/. the nss site relates directly to nss code changes and releases. mailing lists: pki-devel@redhat.com and pki-users@redhat.com irc: freenode at #dogtag-pki authors the nss tools were written and maintained by developers with netscape and now with red hat. authors: elio maldonado <em...
NSS tools : vfychain
dule security database files. the tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases. options -a the following certfile is base64 encoded -b yymmddhhmmz validate date (default: now) -d directory database directory -f enable cert fetching from aia url -o oid set policy oid for cert validation(
format oid.1.2.3) -p use pkix library to validate certificate by calling: * cert_verifycertificate if specified once, * cert_pkixverifycert if specified twice and more. -r following certfile is raw binary der (default) -t following cert is explicitly trusted (overrides db trust) -u usage 0=ssl client, 1=ssl server, 2=ssl stepup, 3=ssl ca, 4=email signer, 5=email recipient, 6=object signer, 9=protected...
...vocation flags for the test type it follows. possible flags: "testlocalinfofirst" and "requirefreshinfo". -m method type sets method type for the test type it follows. possible types are "crl" and "ocsp". -s method flags sets revocation flags for the method it follows. possible types are "donotuse", "forbidfetching", "ignoredefaultsrc", "requireinfo" and "failifnoinfo". additional resources for in
formation about nss and other tools related to nss (like jss), check out the nss project wiki at [1]http://www.mozilla.org/projects/security/pki/nss/. the nss site relates directly to nss code changes and releases. mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto irc: freenode at #dogtag-pki authors the nss tools were written and maintained by developers with netscape, red hat, and su...
OLD SSL Reference
if you are inclined to help with this migration, your help would be very much appreciated. upgraded documentation may be found in the current nss reference ssl reference newsgroup: mozilla.dev.tech.crypto writer: sean cotter manager: wan-teh chang chapter 1 overview of an ssl application ssl and related apis allow compliant applications to configure sockets for authenticated, tamper-proof, and encrypted communications. this chapter introduces some of the basic ssl functions. ...
... validating certificates cert_verifycertnow cert_verifycertname cert_checkcertvalidtimes nss_cmpcertchainwcanames manipulating certificates cert_dupcertificate cert_destroycertificate getting certificate in
formation cert_findcertbyname cert_getcertnicknames cert_freenicknames cert_getdefaultcertdb nss_findcertkeatype comparing secitem objects secitem_compareitem chapter 6 key functions this chapter describes two functions used to mani...
ssltyp.html
if you are inclined to help with this migration, your help would be very much appreciated. 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. ...
...pter. some of these functions also use types defined by nspr and described in the nspr reference. <a name="> many of the structures presented here (certcertdbhandle, certcertificate, pk11slotinfo, and seckeyprivatekey) are opaque--that is, they are types defined as structures (for example, certcertdbhandlestr) that may change in future releases of network security services. as long as you use the
form shown here, your code will not need revision. certcertdbhandle an opaque handle structure for open certificate databases. syntax #include <certt.h> typedef struct certcertdbhandlestr certcertdbhandle; certcertificate an opaque x.509 certificate object. syntax #include <certt.h> typedef struct certcertificatestr certcertificate; description certificate structures are shared obje...
Utility functions
if documentation is available for a function listed below, the function name is linked to either its mdc wiki page or its entry in the old ssl reference. the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
...rt_setucs4_utf8conversionfunction mxr 3.2 and later port_strdup mxr 3.5 and later port_ucs2_asciiconversion mxr 3.2 and later port_ucs2_utf8conversion mxr 3.2 and later port_zalloc mxr 3.2 and later port_zfree mxr 3.2 and later rsa_
formatblock mxr 3.2 and later sec_asn1decode mxr 3.4 and later sec_asn1decodeinteger mxr 3.2 and later sec_asn1decodeitem mxr 3.2 and later sec_asn1decoderabort mxr 3.9 and later sec_asn1decoderclearfilterproc mxr 3.2 and later sec_asn1...
modutil-tasks.html
nss security tools: modutil tasks newsgroup: mozilla.dev.tech.crypto task list the jar installation script is very fragile with respect to plat
form definitions (especially version numbers). ...
... nss security tools: modutil tasks newsgroup: mozilla.dev.tech.crypto task list the jar installation script is very fragile with respect to plat
form definitions (especially version numbers). ...
NSS Tools modutil-tasks
nss security tools: modutil tasks newsgroup: mozilla.dev.tech.crypto task list the jar installation script is very fragile with respect to plat
form definitions (especially version numbers). ...
... nss security tools: modutil tasks newsgroup: mozilla.dev.tech.crypto task list the jar installation script is very fragile with respect to plat
form definitions (especially version numbers). ...
NSS Tools pk12util
mozilla.dev.tech.crypto the pkcs #12 utility makes sharing of certificates among enterprise server 3.x and any server (netscape products or non-netscape products) that supports pkcs#12 possible. the tool allows you to import certificates and keys from pkcs #12 files into nss or export them and also list certificates and keys in such files. availability see the release notes for the plat
forms this tool is available on. synopsis pk12util -i p12file [-h tokenname] [-v] [common-options] or pk12util -o p12file -n certname [-c keycipher] [-c certcipher] [-m | --key_len keylen] [-n | --cert_key_len certkeylen] [common-options] or pk12util -l p12file [-h tokenname] [-r] [common-options] where [common-options] = [-d dir] [-p dbprefix] [-k slotpasswordfile | -k slotpassword] [-w p12...
...word based encryption with sha1 and des cbc" it should be noted that the the crypto provider may be the softtoken module or an external hardware module. it may be the case that the cryptographic module does not support the requested algorithm and a best fit will be selected, likely to be the default. if no suitable replacement for the desired algorithm can be found a "no security module can per
form the requested operation" will appear on the error message. error codes pk12util can return the following values: 0 - no error 1 - user cancelled 2 - usage error 6 - nls init error 8 - certificate db open error 9 - key db open error 10 - file initialization error 11 - unicode conversion error 12 - temporary file creation error 13 - pkcs11 get slot error 14 - pkcs12 decoder start error 15 - e...
NSS tools : cmsutil
to run cmsutil, type the command cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section. each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options options specify an action. ...
...essage example cmsutil -s [-i infile] [-o outfile] [-d dbdir] [-p password] -n nickname[-tgp] [-y ekprefnick] see also certutil(1) see also additional resources nss is maintained in conjunction with pki and security-related projects through mozilla dn fedora. the most closely-related project is dogtag pki, with a project wiki at [1]http://pki.fedoraproject.org/wiki/. for in
formation specifically about nss, the nss project wiki is located at [2]http://www.mozilla.org/projects/security/pki/nss/. the nss site relates directly to nss code changes and releases. mailing lists: pki-devel@redhat.com and pki-users@redhat.com irc: freenode at #dogtag-pki authors the nss tools were written and maintained by developers with netscape and now with red hat. a...
NSS tools : vfychain
anagement are part of a process that typically also involves managing key databases and certificate databases. options -a the following certfile is base64 encoded -b yymmddhhmmz validate date (default: now) -d directory database directory -f enable cert fetching from aia url -o oid set policy oid for cert validation(
format oid.1.2.3) -p use pkix library to validate certificate by calling: * cert_verifycertificate if specified once, * cert_pkixverifycert if specified twice and more. -r following certfile is raw binary der (default) -t following cert is explicitly trusted (overrides db trust) -u usage 0=ssl client, 1=ssl server, 2...
...calinfofirst" and "requirefreshinfo". -m method type sets method type for the test type it follows. possible types are "crl" and "ocsp". -s method flags sets revocation flags for the method it follows. possible types are "donotuse", "forbidfetching", "ignoredefaultsrc", "requireinfo" and "failifnoinfo". additional resources for in
formation about nss and other tools related to nss (like jss), check out the nss project wiki at [1]http://www.mozilla.org/projects/security/pki/nss/. the nss site relates directly to nss code changes and releases. mailing lists: https://lists.mozilla.org/listinfo/dev-tech-crypto irc: freenode at #dogtag-pki authors the nss tools were written and maintained by developers with net...
Necko FAQ
...
...t about proxy auto config? todo what about socks support? todo when is the next stable release of this library going to be available? todo i'd like to use this library for my project. what licences apply? todo - mpl what do the page load options mean in the preferences? todo original document in
formation author(s): gagan saksena last updated date: december 21, 2001 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Proxies in Necko
proxies are implemented transparently to necko users. 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 in
formation about the type of the proxy, its host and its port. nsiioservice the decision whether to use a proxy is made in nsioservice::newchannelfromuri. it first asks the nsiprotocolproxyservice for an nsiproxyinfo. 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. otherwise, the proxy inf...
... gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6), proxy servers are not used when accessing hosts with no dots in their names, if manual proxy configuration is used and "<local>" is added to the "no proxy for:" text field field. to be written xxx missing paragraphs are about pac, and more details about http proxying, and maybe some more details about socks proxies. original document in
formation author(s): christian biesinger last updated date: april 8, 2005 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Personal Security Manager (PSM)
personal security manager (psm) consists of a set of libraries that per
form cryptographic operations on behalf of a client application. these operations include setting up an ssl connection, object signing and signature verification, certificate management (including issuance and revocation), and other common pki functions. ...
...sm) consists of a set of libraries that per
form cryptographic operations on behalf of a client application. these operations include setting up an ssl connection, object signing and signature verification, certificate management (including issuance and revocation), and other common pki functions. notes: psm always builds with firefox now, so there aren't separate build instructions. ...
Installing Pork
o make pork easy to use, you will want to install mcpp that integrates into gcc. you will probably want a separate gcc for this so you don't have to modify your standard system gcc. you can install gcc in the normal way in a special directory. build and install mcpp mcpp generates macro expansion comments that allow pork's elsa to undo macros, which is necessary in order to get exact position in
formation. to tell mcpp which gcc installation to integrate itself with, place the selected gcc bin dir as the first element of your path: path=/bindir/of/my/gcc:$path if you want to use a gcc that has binaries named something other than "gcc" and "g++", or you use "ccache" for you main gcc installation and want mcpp to override a separate installation, you need to pass the options "cc=gccxxx cxx=g...
...you don't do this, mcpp will get the wrong set of automatic definitions and you'll end up with an unpleasant hybrid x86-64/i686 build system. $ export path=/builds/gcc-3.4.6-installed/bin:$path $ export cppflags=-m32 $ cc=gcc34 cxx=g++34 cppflags=-m32 ldflags=-m32 ../src/configure --enable-replace-cpp --prefix=/builds/gcc-3.4.6-installed --target=i686-pc-linux $ make $ make install program_trans
form_name= ...
Pork
the inputs driving the rewriting would normally be provided by a program-analysis system outside of pork. (see dehydra, treehydra). pork has been tested mostly on linux, but in theory it should be possible to make it work on other systems. ...
... but in theory it should be possible to make it work on other systems. note: pork is not presently used at mozilla. please refer to the oink link below for a more up-to-date toolchain. pork is based on the elsa (and oink) tool chain, and the mcpp preprocessor. as of october 2009 oink incorporates the pork functionality into its standard distribution; look for files and tests having the prefix "x
form". documentation installing pork download, installation and dependency info for pork pork tools description of rewriting tools pork tool development in progress page... old pork page pork details that haven't been moved to mdc renaming with pork sample pork application todos pork 1.0 release tracking bug pork rel...
Download Rhino
rhino is available for download both in source and compiled
form. binaries release release date change log download link rhino 1.7r4 2012-06-18 new in rhino 1.7r4 rhino1_7r4.zip rhino 1.7r5 2015-01-29 release notes rhino1_7r5.zip rhino 1.7.6 2015-04-15 release notes rhino1.7.6.zip rhino 1.7.7 2015-06-17 release notes rhino1.7.7.zip rhino 1.7.7.1 2016-02-01 release notes rhino1.7.7.1.zip rhino 1.7.7.2 2017-08-24 release notes rhino1.7.7.2.zip rhino 1.7.8 2018-01-22 release notes rhino1.7.8.zip rhino 1.7.9 2018-03-15 release notes rhino1.7.9.zip rhino 1.7.10 2018-04-09 release notes rhino1.7.10.zip ...
... rhino 1.7.11 2019-05-30 release notes rhino1.7.11.zip rhino 1.7.12 2020-01-13 release notes rhino1.7.12.zip to download older rhino versions, see the rhino downloads archive. license rhino is open source. as of release 1.7r4 rhino is available under mpl 2.0. previous versions were released under mpl 1.1/gpl 2.0 license. see rhino license for further in
formation. source in addition to getting the source from the zip files above, the source code for rhino can be found in github at https://github.com/mozilla/rhino. to get the source, use the command git clone https://github.com/mozilla/rhino.git rhino uses gradle as its build system. running the ./gradlew tasks command at the top directory of the rhino distribution will print the list of availab...
Rhino JavaScript compiler
riding any methods in the base class by the same name. -implements java-intf-name specifies that a java class implementing the java interface java-intf-name should be generated from the incoming javascript source file. each global function in the source file is made a method of the generated class, implementing any methods in the interface by the same name. -debug -g specifies that debug in
formation should be generated. may not be combined with optimization at an optlevel greater than zero. -main-method-class classname specify the class name used for main method implementation. the class must have a method matching public static void main(script sc, string[] args). -nosource does not save the source in the class file. functions and scripts compiled this way cannot be decompiled.
... not be specified. -package packagename specifies the package to generate the class into. the string packagename must be composed of valid identifier characters optionally separated by periods. -version versionnumber specifies the language version to compile with. the string versionnumber must be one of 100, 110, 120, 130, 140, 150, 160, or 170. see javascript language versions for more in
formation on language versions. examples $ cat test.js java.lang.system.out.println("hi, mom!"); $ java org.mozilla.javascript.tools.jsc.main test.js $ ls *.class test.class $ java test hi, mom! $ java org.mozilla.javascript.tools.jsc.main -extends java.applet.applet -implements java.lang.runnable nervoustext.js --norrisboyd 12:26, 13 june 2007 (pdt) ...
Rhino license
majority of the source code for rhino is available under a mpl 1.1/gpl 2.0 license. license for portions of the rhino debugger additionally, some files (currently the contents of toolsrc/org/mozilla/javascript/tools/debugger/treetable/) are available under the following license: * copyright 1997, 1998 sun microsystems, inc. all rights reserved. ...
... copyright 1997, 1998 sun microsystems, inc. all rights reserved. * * redistribution and use in source and binary
forms, with or without * modification, are permitted provided that the following conditions * are met: * * - redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - redistributions in binary
form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - neither the name of sun microsystems nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * *...
Rhino shell
r-url content and execute it as a javascript script. -opt optlevel / -o optlevel optimizes at level optlevel, which must be -1 or an integer between 0 and 9. see rhino optimization for more details. -version versionnumber specifies the language version to compile with. the string versionnumber must be one of 100, 110, 120, 130, 140, 150, 160 or 170. see javascript language versions for more in
formation on language versions. -strict enable strict mode. -continuations enable experimental support for continuations and set the optimization level to -1 to force interpretation mode. starting with rhino 1.7 this options is no longer available. note if the shell is invoked with the system property rhino.use_java_policy_security set to true and with a security manager installed, the shell res...
... js> runcommand("bad_command", "--bad-arg", opt) js: "<stdin>", line 18: uncaught javascript exception: java.io.ioexception: bad_command: not found js> // passing explicit environment to the system shell js> runcommand("sh", "-c", "echo $env1 $env2", { env: {env1: 100, env2: 200}}) 100 200 0 js> // use args option to provide additional command arguments js> var arg_array = [1, 2, 3, 4]; js>...
GCIntegration - SpiderMonkey Redirect 1
che, where clearwrapper() is called directly from a finalizer. one saving grace is that most weak pointers already have a read barrier on them: xpc_unmarkgray(). besides gray unmarking, this function automatically checks if an incremental gc is running and, if so, marks the given object black. this is how the read barrier for nswrappercache::getwrapper() actually works. moving gc there are two
forms of moving gc we are likely to implement: generational gc and compacting gc. in generational gc, certain newly allocated are moved from one place (a nursery) to another (the tenured space). at least initially, only jsstrings and jsobjects without finalizers will be allocated in the nursery, and so only they will be subject to moving. compacting gc is more exhaustive: every object is subject to mo...
...llocated are moved from one place (a nursery) to another (the tenured space). at least initially, only jsstrings and jsobjects without finalizers will be allocated in the nursery, and so only they will be subject to moving. compacting gc is more exhaustive: every object is subject to moving. stack roots to implement moving gc, we will remove the conservative stack scanner. we don't have a fully
formed plan in place for what will replace it, but whatever it is will likely resemble auto-rooters. the main difference is that every reference will need to be rooted. for example, the following code will be incorrect: autorootedobject obj1 = ...; jsobject *obj2 = obj1; // use obj2 if a gc runs in the middle of this code, and if obj1/obj2 is moved, then the obj1 pointer will be updated to point to...
JS::Compile
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the global object, or null. obsolete since jsapi 39 options js::readonlycompileoptions & compile options. srcbuf js::sourcebufferholder & source buffer containing the script to compile. chars const char16_t * ...
... js::compile compiles a script, srcbuf, chars, bytes, or file, for execution. the script is associated with a js object. srcbuf, chars, bytes is the string containing the text of the script. length indicates the size of the text version of the script in characters. file is the filehandle containing the text of the script. filename is the name of the file (or url) containing the script. this in
formation is included in error messages if an error occurs during compilation.. on success, js::compile stores an object representing the newly compiled script into script, and returns true. otherwise, it returns false and the value left in script is undefined. see also the jsapi user guide contains example code using compiled scripts. mxr id search for js::compile js::evaluate js::compileofft...
JS::CompileOptions
troduced in spidermonkey 17 compile options classes. 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 in
formation. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. version jsversion javascript version used to compile the script. methods some methods of js::owningcompileoptions and js::compileoptions return the instance itself to allow method chain. methods of js::readonlycompileoptions method description bool mut...
... request on this jscontext. version jsversion javascript version used to compile the script. methods some methods of js::owningcompileoptions and js::compileoptions return the instance itself to allow method chain. methods of js::readonlycompileoptions method description bool mutederrors() const determines if errors are muted. the web plat
form allows scripts to be loaded from arbitrary cross-origin sources. this allows an attack by which a malicious website loads a sensitive file (say, a bank statement) cross-origin (using the user's cookies), and sniffs the generated syntax errors (via a window.onerror handler) for juicy morsels of its contents. to counter this attack, html5 specifies that script errors should be sanitized ("mute...
JS_CheckAccess
work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. check whether a running script may access a given object property. 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 per
form the access check. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the object that has the property being accessed. id jsid the name or index of the property being accessed. mode jsaccessmode the type of access requested (read, write, etc.) vp jsval * out parameter. on success,...
...to get the property's value. jsacc_write when bitwise-ored with one of the above values, check for permission to write the property, not read it. the access check proceeds as follows. if obj has custom jsobjectops, the access check is delegated to the jsobjectops.checkaccess callback. otherwise, if obj's class has a non-null jsclass.checkaccess callback, then it is called to per
form the check. otherwise, if a runtime-wide check-object-access callback has been installed by calling js_setcheckobjectaccesscallback, then that is called to per
form the check. otherwise, access is granted. on success, js_checkaccess returns js_true, *vp is set to the current value of the specified property, and *attrsp is set to the property's attributes. on error or exception, including if access...
JS_CompileScriptForPrincipals
// obsoleted since jsapi 19 name type description cx jscontext * the context in which to compile the script. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object with which the script is associated. principals jsprincipals * pointer to the structure holding the security in
formation for this script. src const char * or const jschar * string containing the script to compile. length size_t the length of src, in characters. filename const char * name of file or url containing the function. used to report filename or url in error messages. lineno unsigned int line number. used to report the offending line in the fi...
...or url if an error occurs. version jsversion javascript version for the script. description js_compilescriptforprincipals compiles a security-enabled script, src, for execution. js_compileucscriptforprincipals is the unicode version of the function. the script is associated with a js object. principals is a pointer to the jsprincipals structure that contains the security in
formation to associate with this script. src is the string containing the text of the script. length indicates the length of the script, in characters. filename is the name of the file (or url) containing the script. this in
formation is included in error messages if an error occurs during compilation. similarly, lineno is used to report the line number of the script or file where an error occurred d...
JS_DeleteProperty
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete a property. name or id const char * or jsid or const char16_t * name of the property to delete. namelen size_t (only in js_deleteucproperty) the length of name in characters; or -1 to indicate that name i...
...opresult & (out parameter) receives the result of the operation. description js_deleteproperty removes a specified property, name, from an object, obj. js_deletepropertybyid is the same but takes a jsid for the property name. these functions are identical to js_deleteproperty2 and js_deletepropertybyid2 except that they do not have an out parameter. first, a property lookup is per
formed. then one of the following cases applies: if obj has no property with the given name or id, or if obj inherits the specified property from its prototype, then obj's jsclass.delproperty hook is called. no property is deleted, but this is not an error. if obj has the specified property but it is permanent, nothing happens. no property is deleted, but this is not an error. otherwise obj has a...
JS_DeleteProperty2
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete a property. name or id const char * or const char16_t or js::handleid name of the property to delete. namelen size_t (only in js_deleteucproperty2) the length of name in characters; or -1 to indicate that...
...rmanent and true otherwise. description js_deleteproperty2 removes a specified property, name, from an object, obj, and stores true or false in *succeeded. it behaves like the javascript expression delete obj[name]. js_deleteucproperty2 is the unicode version of the function. js_deletepropertybyid2 is the same but takes a js::handleid for the property name. first, a property lookup is per
formed. then one of the following cases applies: if obj has no property with the given name or id, or if obj inherits the specified property from its prototype, then *succeeded is set to true and obj's jsclass.delproperty hook is called (which may change *succeeded). no property is deleted, but this is not an error. if obj has the specified property but it is permanent, then *succeeded receives fa...
JS_EnumerateDiagnosticMemoryRegions
this article covers features introduced in spidermonkey 17 enumerate memory regions that contain diagnostic in
formation.. syntax void js_enumeratediagnosticmemoryregions(jsenumeratediagnosticmemorycallback callback); name type description callback jsenumeratediagnosticmemorycallback pointer to the new callback function to use. callback syntax typedef bool (* jsenumeratediagnosticmemorycallback)(void *ptr, size_t length); name type description ptr void * pointer to the allocated memory. length size_t length of the allocated memory. ...
...ew callback function to use. callback syntax typedef bool (* jsenumeratediagnosticmemorycallback)(void *ptr, size_t length); name type description ptr void * pointer to the allocated memory. length size_t length of the allocated memory. description js_enumeratediagnosticmemoryregions enumerates memory regions that contain diagnostic in
formation intended to be included in crash report minidumps. see also mxr id search for js_enumeratediagnosticmemoryregions mxr id search for jsenumeratediagnosticmemorycallback bug 662646 ...
JS_EvaluateScriptForPrincipals
description cx jscontext * the context in which to run the script. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the scope in which to execute the script. this parameter is documented in detail at js_executescript. principals jsprincipals * pointer to the structure holding the security in
formation for this script. src / bytes / chars const char * or const jschar string containing the script to compile and execute. length unsigned int the length of src, in characters. filename const char * name of file or url containing the script. used to report filename or url in error messages. lineno unsigned int line number. used to repor...
...alue from the last-executed expression statement in the script. version jsversion javascript version for the script. description js_evaluatescriptforprincipals compiles and executes a script in the specified scope, obj. js_evaluateucscriptforprincipals is the unicode version of the function. principals is a pointer to the jsprincipals structure that contains the security in
formation to associate with this script. src is the string containing the text of the script. length is the length of the script, in characters. filename is the name of the file (or url) containing the script. this in
formation is used in messages if an error occurs during compilation. similarly, lineno is used to report the line number of the script or file where an error occurred during compilation...
JS_GetPropertyAttrsGetterAndSetter
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object from which to retrieve property attributes. name or id const char * or const jschar * or jsid the name of the property to examine. namelen size_t (only in js_getucpropertyattrsgetterandsetter) the length of name in c...
...setter) is a javascript function, not a c/c++ function. 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. the application may cast it back to jsobject * (using a c cast or a c++ reinterpret_cast) to access the getter/setter function object. for more in
formation about javascript getters and setters, see defining getters and setters. property attributes bug 893186 ...
JS_MaybeGC
offer the javascript engine an opportunity to per
form garbage collection if needed. syntax void js_maybegc(jscontext *cx); name type description cx jscontext * the context in which to per
form garbage collection, if needed. description js_maybegc tries to determine whether garbage collection in cx's runtime would free up enough memory to be worth the amount of time it would take. if so, it per
forms some garbage collection. calling js_maybegc when the application is idle can help prevent garbage collection from happening at less convenient times. calling js_maybegc periodically when the application is busy, from a jsbranchcallback or jsoperationcallback added in spidermonkey 1.8, can keep memory usage down and improve per
formance. both are good pract...
...h cases, frequent calls js_maybegc are safe and will not cause the application to spend a lot of time doing redundant garbage collection work. implementation note: spidermonkey 1.8 and earlier determine whether garbage collection is appropriate by analyzing statistics about the gc heap and memory usage since the last garbage collection cycle. the analysis is simplistic but produces acceptable per
formance for many applications. in some applications, js_maybegc collects more often than it should for ideal per
formance. such applications can benefit from implementing their own custom-tuned maybe-gc function that conditionally calls js_gc on the basis of some application-specific analysis, and using that instead of js_maybegc. to per
form a full garbage collection unconditionally, use js_gc. see ...
JS_PopArguments
ript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. frees the stack entry allocated by js_pusharguments. syntax void js_poparguments(jscontext *cx, void *mark); name type description cx jscontext * pointer to a js context from which to derive runtime in
formation. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. mark void * pointer to a void * which holds the stack frame pointer previously supplied by js_pusharguments. description js_poparguments frees the stack frame pointer previously allocated by js_pusharguments and unroots the jsvals which have been associated with it (those retu...
...scontext. ...
JS_ReportError
create a
formatted error or warning message to pass to a user-defined error reporting function. this function can also raise a javascript exception which a currently executing script can catch. syntax void js_reporterror(jscontext *cx, const char *
format, ...); bool js_reportwarning(jscontext *cx, const char *
format, ...); name type description cx jscontext * pointer to a js context from which to derive runtime in
formation. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.
format const char *
format string to convert into an error message using js_vsmprintf. ... ... error message variables to insert into the
format string. description js_reporterror is the simplest jsapi function...
...the resulting error message is passed to the context's jserrorreporter callback, if any. if the caller is in a jsapi callback, js_reporterror also creates a new javascript error object and sets it to be the pending exception on cx. ...
JS_ReportErrorNumber
16_t ** additional arguments for the error message. these arguments must be of type char * for js_reporterrornumber or js_reporterrorflagsandnumber, or char16_t * for js_reporterrornumberuc or js_reporterrorflagsandnumberuc. the number of additional arguments required depends on the error message, which is determined by the errorcallback. callback syntax typedef const jserror
formatstring * (* jserrorcallback)(void *userref, const unsigned errornumber); name type description userref void * the userref pointer that was passed to the reporterrornumber api. errornumber const unsigned the errornumber that was passed to the reporterrornumber api. description these functions create a jserrorreport, populate it with an error mes...
...ornumber api. description these functions create a jserrorreport, populate it with an error message obtained from the given jserrorcallback, and either report it to the current error reporter callback or create an error object and set it as the pending exception. first errorcallback(userref, errornumber) is called. if errorcallback returns null, (??? what happens?). otherwise, if the jserror
formatstring returned by the jserrorcallback has .exntype == jsexn_none, then the error reporter, if any, is called, and no error object is created. (??? the source code seems to say we ignore the .exntype, actually, but surely i'm just missing something.) otherwise, if any javascript code is running in cx (for example, if the caller is a jsnative that was called from a script), then an error object i...
JS_SET_TRACING_DETAILS
this article covers features introduced in spidermonkey 1.8 set debugging in
formation about the next thing to be traced by a jstracer. syntax js_set_tracing_details(trc, printer, arg, index) name type description trc jstracer * the tracer whose debugging hooks are to be set. printer jstracenameprinter a callback function, described below; or null. arg void * see the description. index size_t see the description. callback syntax typedef void (*jstracenameprinter)(jstracer *trc, char *buf, size_t bufsize); name type description trc jstracer * the tracer. buf char * out parameter. the callback stores a string describing the reference traced in buf. ...
...null. arg void * see the description. index size_t see the description. callback syntax typedef void (*jstracenameprinter)(jstracer *trc, char *buf, size_t bufsize); name type description trc jstracer * the tracer. buf char * out parameter. the callback stores a string describing the reference traced in buf. bufsize size_t the size of buf, in chars. description set debugging in
formation about a reference to a traceable thing to prepare for the following call to js_calltracer. when printer is null, arg must be const char * or char * c string naming the reference and index must be either (size_t)-1 indicating that the name alone describes the reference or it must be an index into some array vector that stores the reference. when printer is not null, the arg and index argument...
JS_SetGCZeal
quency); name type description cx jscontext * a context. the gc zeal level of the associated jsruntime is set. zeal uint8_t the desired level of garbage collection. frequency uint32_t with some zeal levels, a gc is triggered every frequency allocations. description js_setgczeal sets the level of additional garbage collection to per
form for a runtime, for the purpose of finding or reproducing bugs. there are several different levels which have different functions: zeal level description 0 normal amount of collection. the default: no additional collections are per
formed. 1 collect when roots are added or removed. 2 collect when every frequency allocations. 3 collect...
... 8 incremental gc in two slices: 1) mark roots 2) finish collection. 9 incremental gc in two slices: 1) mark all 2) new marking and finish. 10 incremental gc in multiple slices. 11 verify post write barriers between instructions. 12 verify post write barriers between paints. 13 check internal hashtables on minor gc. 14 per
form a shrinking collection every frequency allocations. with gc zeal enabled, gc-related crashes are much easier to reproduce (they happen more reliably) and debug (they happen sooner, closer to the source of the bug). the drawback is that gc zeal can cause javascript code to run extremely slowly. regularly running your test suite with gc zeal enabled at level 2 is a good practice. this functio...
JS_SetOptions
convert warnings to errors. mxr id search for jsoption_werror jsoption_varobjfix make js_evaluatescript() use the last object on its obj param's scope chain (that is, the global object) as the ecma "variables object". this flag is recommended. without it, the two scripts "x = 1" and "var x = 1", where no variable x is in scope, do two different things. the
former creates a property on the global object. the latter creates a property on obj. with this flag, both create a global property. mxr id search for jsoption_varobjfix jsoption_private_is_nsisupports mozilla extension. the context's private data points to an xpcom object (see nsisupports). this is only meaningful if spidermonkey is built with xpconnect. mxr id...
...onnect. mxr id search for jsoption_private_is_nsisupports jsoption_compile_n_go caller of js_compilescript et al promises to execute the compiled script once only, in the same scope object used for compilation. the caller may not modify objects on the scope chain between compilation and execution. this enables compile-time scope chain resolution of consts (a per
formance optimization). mxr id search for jsoption_compile_n_go jsoption_atline //@line number ["filename"] option supported for the xul preprocessor and kindred beasts. mxr id search for jsoption_atline jsoption_xml obsolete since jsapi 15 ecmascript for xml (e4x) support: parse <!-- --> as a token, not backward compatible with the c...
JS_SetProperty
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handlevalue object to which the property to set belongs. name or id const char * or const char16_t *or js::handleid name of the property to set. namelen size_t (only in js_setucproperty) the length of name in characters; or -1 to indicate that n...
...ign to v. description js_setproperty assigns the value v to the property name of the object obj. it behaves like the javascript expression obj[name] = v. js_setucproperty is the unicode version of the function. js_setpropertybyid is the same but takes a js::handleid for the property name. if obj is a proxy, the js_setproperty [[set]] internal method defined in es2015 (rev 29 9.5.9) is per
formed. if obj is a native object with custom setgeneric op, the op is called with (cx, obj, id, &v, false)). otherwise, [[set]] internal method defined in es2015 (rev 29 9.1.9) is per
formed. if the lookup found no property with the given name, or if it found that obj inherits such a property from a non-native object, then a new own property is added to obj, as described below. the new property i...
JS_TracerInit
pidermonkey 1.8 note: in jsapi 12, the macro js_tracer_init has been replaced by the function js_tracerinit initialize a jstracer for object graph tracing. syntax void js_tracerinit(jstracer *trc, jsruntime *rt, jstracecallback callback); name type description trc jstracer * the tracer to be initialized. cx jscontext * the context in which to per
form tracing. callback jstracecallback a callback, described below, which the tracing apis will call each time a pointer is found from one gc thing to another. callback syntax typedef void (*jstracecallback)(jstracer *trc, void *thing, uint32 kind); name type description trc jstracer * the tracer visiting obj. thing void * a gc thing. ...
...stracer *trc, void *thing, uint32 kind); name type description trc jstracer * the tracer visiting obj. thing void * a gc thing. kind uint32 one of the constants jstrace_object, jstrace_double, jstrace_string; or a tag denoting an internal implementation-specific traversal kind. in the latter case, the only operations the callback may per
form on thing are to call js_tracechildren or the debug-only js_printtracethinginfo function. description js_tracechildren and other tracing apis call the tracer callback for each traceable thing directly referenced by a particular object or runtime structure. it is the callback's responsibility to ensure the traversal of the full object graph, if desired, by eventually calling js_tracechildren ...
JS_ValueToFunction
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. ...
...r use js_convertvalue() to convert a value to jstype_function safely. if v is a function object, this returns the associated jsfunction. if v is null, undefined, a boolean, a number, or a string, a typeerror is reported and js_valuetofunction returns null. otherwise, v is an object. the javascript engine attempts to convert it to a function. (implementation note: the actual conversion is per
formed by the object itself. the object's jsobjectops.defaultvalue method is called with hint=jstype_function.) js_valuetofunction returns a pointer to the converted function. if conversion fails with an error or exception, js_valuetofunction returns null. see also mxr id search for js_valuetofunction mxr id search for js_valuetoconstructor ...
SpiderMonkey 52
is pleased to announce the release of spidermonkey 52. you can download full source code from treeherder, by going to the mozilla-esr52 repository and clicking on the first sm(pkg) link you see. that will open a small window in the bottom left with a line like "artifact uploaded:mozjs-52.x.y.tar.bz2". spidermonkey 52 is the javascript engine that shipped in firefox 52. it continues to improve per
formance over previous spidermonkey releases. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. you may wish to make the bugs block bug 837921 (aliased as "sm.embedding"). ...
... over previous spidermonkey releases. it also contains new language and api features described in detail below. ...
Running Automated JavaScript Tests
by default, these are only run when no tests paths are specified; this can be overridden by the --wpt=enabled flag. running jstest in a browser jstests also runs on browser, with the following command: ./mach jstestbro...
...by default, these are only run when no tests paths are specified; this can be overridden by the --wpt=enabled flag. ...
XUL Accessibility
name the following rules to generate accessible name are applied: check aria-labelledby attribute, name is generated from elements pointed by aria-labelledby attribute <description id="descr1">label1</description> <description id="descr2">label2</description> <textbox aria-labelledby="descr1 descr2" /> if the element implements nsidomxullabeledcontrolelement or nsidomxulse...
...role role_alert <panel noautofocus = "true" /> role_alert ...
Feed content access API
"feedtest_window"); var doc = win.document.wrappedjsobject; doc.open(); // write the html header and page title doc.write("<html><head><title>feed: " + feed.title.text + "</title></head><body>"); doc.write("<h1>" + feed.title.text + "</h1><p>"); var itemarray = feed.items; var numitems = itemarray.length; // write the article in
formation if (!numitems) { doc.write("<i>no news is good news!</i>"); } else { var i; var theentry; var theurl; var info; for (i=0; i<numitems; i++) { theentry = itemarray.queryelementat(i, components.interfaces.nsifeedentry); if (theentry) { theurl = doc.write('<b...
...the document; we're done! doc.write("</body></html>"); doc.close(); } } the handleresult() function receives as its argument an nsifeedresult that describes a feed; its doc property is an nsifeed that contains all the feed data. to get the title of the feed, you look at the feed.title property. the title is an nsifeedtextconstruct that can represent the text in various
formats; we get its text property to fetch the feed's title as html-encoded text. we could, alternatively, use its plaintext() method to get a copy of the title translated into plain text. we then scan the array of items in the feed by looking at the feed.items nsiarray. this array contains nsifeedentry objects that describe each feed item. we build the contents of the document by looking at the title...
Life After XUL: Building Firefox Interfaces with HTML
work on this is being tracked in bug 1453783 and bug 1446829. this page gathers technical solutions to common problems encountered by teams shipping html-based interfaces inside firefox. background: discussion of how to replace xul is ongoing within the plat
form team. in the meantime, some teams are already experimenting with html5-based interfaces. ...
... common problems encountered by teams shipping html-based interfaces inside firefox. background: discussion of how to replace xul is ongoing within the plat
form team. in the meantime, some teams are already experimenting with html5-based interfaces. ...
Places Expiration
expiration is handled in toolkit/components/places/nsplacesexpiration.js. algorithm expiration is based on hardware specs, specifically on memory size and available disk space. this means on mobile and old systems expiration will be more aggressive than on high-end hardware, to try keep the database size at a reasonable (and per
formant) value. all of expiration uses the storage async api, that ensures i/o is in a separate thread, plus it won't block any read thanks to the use of the wal journaling system. common expiration runs on a timer, every 3 minutes and uses a simple adaptive algorithm: if the last step was unable to expire enough entries the next one will expire more entries, otherwise if the previous step completed the cleanup the next step will be delayed. this ensures exp...
...it won't block any read thanks to the use of the wal journaling system. common expiration runs on a timer, every 3 minutes and uses a simple adaptive algorithm: if the last step was unable to expire enough entries the next one will expire more entries, otherwise if the previous step completed the cleanup the next step will be delayed. this ensures expiration doesn't lag behind without hitting per
formances when there is no need for it. apart this periodic expiration, there are other steps on idle, on shutdown on clear history. on idle on idle it expires a larger chunk of pages, then timed expiration is stopped. this ensures to not interfere with standby tasks and preserves battery on mobile. on shutdown most of the times the adaptive algorithm will ensure the database is clean before shut...
Using the Places favicon service
.setandloadfaviconforpage() will use the default expiration time. currently, the default expiration time is set to one day in the future. this makes sure that we aren't obsessively reloading favicons into the database for every page viewed, but also that changes in the favicon will be picked up quickly. most of the time, the favicon will be served from the browser's cache and will have minimal per
formance impact. this expiration time is not the time that the favicon will be deleted. expiration is handled by browser/components/places/src/nsnavhistoryexpire.cpp as described in places design. the expiration time is only used to determine whether data should be reloaded from the network (or cache) or whether the version in the database is fresh enough. getting favicon images you can use favicon...
...ion uris are described in more detail in using the places annotation service. you should always use nsifaviconservice.getfaviconimageforpage() to get the favicon for a page. if the page has no favicon, or we have never heard of the page, this function will return a "chrome:" uri of the default favicon. this allows efficient caching, since the default favicon will probably be cached in its decoded
form by the image library. if there is an error loading the favicon for an annotation uri, the default favicon data will be returned by the annotation service's protocol handler. however, since the uri will be different from the default favicon, the decoded image will not be cached by the image library. see also nsifaviconservice ...
The Publicity Stream API
view the activity, and (following successful login and authorization with the stream server) registers the activity in a stream at [address]. this stream can be pulled down by getpublicitystream() and helps determine the results for getuserrecommendedapps(). example use cases: 'adam got a high score in mafia wars', 'bethany bought a plane ticket to the caribbean', etc. activity is an object,
formatted as per the fixme: deadlinkactivity streams open specification. onsuccess is a callback that will be invoked with no arguments if the activity is successfully posted. onerror is an error callback that will be invoked if the publicity fails. possible error codes include: denied - if the user refuses to publicize the activity permissiondenied - if the publicizing site is not allowe...
...: <int> ]): provides a means for a web store to receive a list of the current user's socially relevant app activity by being called from an origin which hosts a web store. it is not recommended that applications consume the publicity stream in any way (please use your own server for any in-app social aspects). it is suggested that the list be processed and condensed into an attractive, cohesive
format for users (eg., multiple tweets show as 'adam tweeted 4 times'). onsuccess will be called with a single argument: a json list of the current user's socially relevant app activity in the fixme: deadlinkactivity streams open specification. onerror is an error callback that will be invoked if the installation fails. possible error codes include: denied - if the user does not log in corre...
Toolkit API
to xul applications. ...
... registration browsing history extension and theme management application update service safe mode printing official references structure of an installable bundle: describes the common structure of installable bundles, including extensions, themes, and xulrunner applications extension packaging: specific in
formation about how to package extensions theme packaging: specific in
formation about how to package themes multiple-item extension packaging: specific in
formation about multiple-item extension xpis xul application packaging: specific in
formation about how to package xulrunner applications chrome registration printing in xul apps see also the following developer pages contain examples and discussions of particular topics: xul xul overlays develop...
Aggregating the In-Memory Datasource
e, assert() would've taken any old random garbage. similarly, i wanted to trap flush() so that i could write the bookmarks.html file back to disk. in short, the only case where this technique is useful is when you're implementing a datasource to get "read-only reflection". that is, you want to reflect the contents of something as an rdf graph (presumably so that it can be aggregated with other in
formation or displayed as styled content). technical details as before, have an nscomptr as your delegate, but this time around,don't derive from nsirdfdatasource. also, instead of keeping an nscomptr<nsirdfdatasource>, you'll just want an nscomptr<nsisupports>: class myclass : public nsimyinterface { ... private: nscomptr<nsisupports> minner; }; construct the datasource delegate when you...
...basic idea is to overload queryinterface(), allowing it to return adelegate object that supports the interface. there is some trickery involved on the delegate's part to ensure that reference counting is done sanely, and that the reflexive, symmetric, and transitive properties of queryinterface() are preserved. if you're really interested, i'd recommend reading about it in a com book. for more in
formation on writing a datasource, see the rdf datasource how-to document. you could also forward other interfaces to the minner that youknow it can support; however, this is extremely risky. it's risky because another implementation of the same object mightnot support those interfaces. then the queryinterface() will be forwarded back to you, and we'll recurse off to infinity (and beyond!... interw...
Creating a Python XPCOM component
d94883)] interface nsipysimple : nsisupports { attribute string yourname; void write( ); void change(in string avalue); }; this is the same as the nsisimple interface used here. theoretically, because several components can share an interface, the same file could be used. pay special attention to types here - python and javascript are both loosely-typed, so it's fairly easy to pass in
formation from one to the other. note: there are exceptions; see this discussion for in
formation on the use of string and wstring for unicode transfer. 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 di...
...he .autoreg (a hidden file) in the bin directory, or delete xpti.dat. then, the next time mozilla starts, it will rebuild the index of components, including any new one in the 'components' directory. it is helpful to then start mozilla from the command line to see if new components register successfully. generating implementation templates the module xpcom.xpt is used internally to process type in
formation, but it has a nice feature - it can spit out a template for a python implementation of any interface. just execute this file as a script with the interface name as a param. for example: % cd c:\mozilla\bin\python\xpcom % python xpt.py nsisample class nsisample: _com_interfaces_ = xpcom.components.interfaces.nsisample # if this object needs to be registered, the following 2 are also n...
Fun With XBL and XPConnect
xbl is used to define an interface through xpconnect to a c++ object that does auto completion. once the regular xul textfield widget is bound to this interface, it calls the auto complete function of the object using regular javascript. the basic model of interaction is as follows: binding to the xpcom object the widget holds onto an xpcom object that is the auto complete engine that will per
form our auto complete lookups. <binding name="autocomplete" extends="xul:box"> <content> <xul:textfield class="addressingwidget"/> <xul:menupopup/> </content> <implementation> <property name="autocompletesession"> <![cdata[ components.classes['component://netscape/messenger/autocomplete&type=addrbook']. getservice(components.interfaces.nsiautocompletesession);...
...andler calls the auto complete method we've exposed on the widget which in turn forwards the call to the xpcom object, passing in our implementation of nsiautocompletelistener. <handlers> <handler type="keypress" keycode="vk_return" value="autocomplete(anonymouscontent[0].value, this.autocompletelistener);"/> </handlers> </implementation> </binding> original document in
formation author(s): scott macgregor last updated date: april 13, 2000 copyright in
formation: copyright (c) scott macgregor ...
Creating XPCOM components
or reading data processing the white list data iweblock method by method lock and unlock addsite removesite setsites getnext getsites hasmoreelements finishing the component using frozen interfaces copying interfaces into your build environment implementing the nsicontentpolicy interface receiving notifications implementing the nsicontentpolicy uni
form resource locators checking the white list creating nsiuri objects building the weblock ui user interface package list client code overview xul the xul document the locking ui site adding ui weblock.xul overlaying new user interface into mozilla weblockoverlay.xul other resources weblock.css image resources packaging weblock component installat...
...opyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. distribution of the work or derivative of the work in any standard (paper) book
form is prohibited unless prior permission is obtained from the copyright holder. ...
XPCOM guide
that's not inherently multiple inheritance, though, because you only mix in interfaces (i.e. the problem would no...
...bstract classes in c++, a common problem when dealing with idl is when you have an idl inheritance hierarchy, and a corresponding c++ implementation hierarchy, you run into multiple inheritance. that's not inherently multiple inheritance, though, because you only mix in interfaces (i.e. the problem would not exist with java's interfaces).making cross-thread calls using runnablesin the mozilla plat
form, most activities such as layout, dom operations, content javascript, and chrome javascript run on the main thread. however, it may be useful for c++ code in the mozilla plat
form to run tasks on another thread.mozilla internal string guidemost of the mozilla code uses a c++ class hierarchy to pass string data, rather than using raw pointers. this guide documents the string classes which are visibl...
Components.ID
components.classes, components.classesbyid, components.interfaces provide pretty much all the nsids that most javascript code would ever need to deal with. ...
...components.classes, components.classesbyid, components.interfaces provide pretty much all the nsids that most javascript code would ever need to deal with. ...
XPCShell Reference
r is passed to the screen, putting spaces between arguments and appending a newline at the end. an example print(1, 2, 3) will print 1 2 3<newline>. dump(object) dump() is almost like print. it only handles one parameter and it doesn't append a newline. dumpxpc(depth) this function dumps the xpconnect object. see the documentation on debugdump() for the nsixpconnect interface for more in
formation. version(newversion) version() returns the javascript engine version number. if you pass a number to it, it will set the version number (and return the old version number). see the above documentation on the -v command-line argument for more in
formation. quit(exitcode) quit() exits the shell. you can specify arguments that will get translated to an exit code. quit(5) will exit xpcs...
... javascript engine version number. if you pass a number to it, it will set the version number (and return the old version number). see the above documentation on the -v command-line argument for more in
formation. quit(exitcode) quit() exits the shell. you can specify arguments that will get translated to an exit code. quit(5) will exit xpcshell with a result code of 5. original document in
formation author: david bradley <dbradley@netscape.com> last updated date: 17 march 2003 copyright in
formation: portions of this content are © 1998–2008 by individual mozilla.org contributors; content available under a creative commons license. ...
Core XPCOM functions
servicemanager function returns a reference to the xpcom service manager.ns_initxpcom2the ns_initxpcom2 function initiates use of xpcom in the calling process.ns_initxpcom3the ns_initxpcom3 function initiates use of xpcom in the calling process with support for statically defined xpcom modules. ...
...ns_initxpcom3the ns_initxpcom3 function initiates use of xpcom in the calling process with support for statically defined xpcom modules. ns_newlocalfilethe ns_newlocalfile function creates an instance of nsilocalfile that provides a plat
form independent representation of a file path.ns_newnativelocalfilethe ns_newnativelocalfile function creates an instance of nsilocalfile that provides a plat
form independent representation of a file path.ns_reallocreallocates a block of memory using the xpcom memory manager.ns_shutdownxpcomthe ns_shutdownxpcom function terminates use of xpcom in the calling process.nsresultthe nsresult data type is a strongly-typed enum used to represent a value returned by an xpcom function; these are typically error or status codes. for a list of defined result values, ...
RefPtr
it is similar to nscomptr, but does not require that the type be an xpcom interface. like with nscomptr, it is the responsibility of the object itself to implement reference counting. 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. when should i use nscomptr versus refptr? the rules are simple: use nscomptr to hold pointers to xpcom interfaces, and use refptr to hold pointers to concrete class, even if the concrete class implements one or more xpcom interfaces. ...
...mptr) but not when an instance of the concrete class is assigned directly?). and it's not clear what happens when the compiler does accept this pattern. what goes wrong at runtime - uaf? memory leak? qi failure and null-deref crashes?. note: in the above example, "nscomptr<nsfoo>" might compile and work ok (it won't if your xpcom class multiply-inherits nsisupports). but this is considered bad
form, and may soon be made a compile-time error. don't do it! can i queryinterface a refptr to get a nscomptr from the object it points to? sure. instead of using "do_queryinterface()" (which is used for nscomptrs), use "do_queryobject()", which works with refptrs: // let's say nsfoo implements nsifoo and nsibar xpcom interfaces: refptr<nsfoo> foo = new nsfoo(); nscomptr<nsibar> bar(do_queryobjec...
IAccessible2
[propget] hresult attributes( [out] bstr attributes ); parameters attributes return value s_false returned if there is nothing to return, [out] value is null. s_ok. extendedrole() returns the extended role. an extended role is a role which is dynamically generated by the application. it is not predefined by the iaccessible2 specification. [propget] hresult extendedrole( [out] bstr ext...
...nored. refer to @ref _arrayconsideration "special consideration when using arrays" for more details. extendedstates this array is allocated by the server. free it with cotaskmemfree. nextendedstates the number of extended states returned; the size of the returned array. return value s_false if there are no states, [out] values are null and 0 respectively. s_ok. groupposition() returns grouping in
formation. used for tree items, list items, tab panel labels, radio buttons, and so on. also used for collections of non-text objects. [propget] hresult groupposition( [out] long grouplevel, [out] long similaritemsingroup, [out] long positioningroup ); parameters grouplevel 1 based, 0 indicates that this value is not applicable. similaritemsingroup 1 based, 0 indicates that this value is not a...
IAccessibleHypertext
1.0 66 introduced gecko 1.9 inherits from: iaccessibletext last changed in gecko 1.9 (firefox 3) the iaccessiblehypertext interface is the main interface to expose hyperlinks in a document, typically a text document, that are used to reference other documents. a typical implementation is to implement this interface on the smallest text object such as a paragraph of text. ...
...ethod overview [propget] hresult hyperlink([in] long index, [out] iaccessiblehyperlink hyperlink ); [propget] hresult hyperlinkindex([in] long charindex, [out] long hyperlinkindex ); [propget] hresult nhyperlinks([out] long hyperlinkcount ); methods hyperlink() returns the specified link. the returned iaccessiblehyperlink object encapsulates the hyperlink and provides several kinds of in
formation describing it. [propget] hresult hyperlink( [in] long index, [out] iaccessiblehyperlink hyperlink ); parameters index this 0 based index specifies the hyperlink to return. hyperlink if the given index is valid, that is it lies in the interval from 0 to the number of links minus one, a reference to the specified hyperlink object is returned. if the index is invalid then a null pointer i...
mozIStorageConnection
f8string asqlstatement ); parameters asqlstatement the sql statement to execute. return value returns a new mozistoragestatement to be used to execute the specified statement. note if the statement is meant to be executed asynchronously, you should rather create it with createasyncstatement. the resulting statement will be faster to execute. additionally, the system will be able to in
form you if you erroneously attempt to execute it synchronously. createtable() this method creates a table with the given table name and schema. void createtable( in string atablename, in string atableschema ); parameters atablename the name of the table to create; table names may consist of the letters a-z in either upper or lower case, the underscore, and the digits 0-9. the first ...
...mozistoragestatement. anumstatements the number of statements in astatements. acallback optional a mozistoragestatementcallback object to receive progress, error, and completion notifications. return value a mozistoragependingstatement object that can be used to cancel the statements' execution. executesimplesql() executes an sql expression that has no bound parameters. warning: per
forming synchronous io on the main thread can cause serious per
formance problems. as a result, this method of modifying the database is strongly discouraged! void executesimplesql( in autf8string asqlstatement ); parameters asqlstatement the sql statement to execute. indexexists() this method determines whether or not the given index exists. boolean indexexists( in autf8string ain...
mozIStorageError
ble. read only. result long one of the error code values listed under constants on this page. constants constant value description error 1 general sql error, or missing database ioerr 10 a disk i/o error occurred. corrupt 11 the database on disk is mal
formed. full 13 an insertion failed because the database is full. cantopen 14 unable to open the database file. empty 16 the database is empty. schema 17 the database schema changed. toobig 18 a string or blob exceeds the size limit. constraint ...
...traint violation. internal 2 an internal logic error occurred. mismatch 20 a data type mismatch occurred. misuse 21 library used incorrectly. nolfs 22 attempted to use os features not supported on the host system. auth 23 authorization denied.
format 24 auxiliary database
format error. notadb 26 the opened file is not a database. perm 3 access permission denied. abort 4 a callback routine requested an abort. busy 5 the database file is locked. locked 6 a table in the database is locked. ...
nsIAppStartup
nsisupports nativeappsupportorsplashscreen); obsolete since gecko 1.9.1 void quit(in pruint32 amode); void restartinsafemode(in pruint32 aquitmode); void run(); attributes attribute type description interrupted boolean true if the startup process was interrupted by an interactive prompt. this can be used, for example, when doing per
formance testing of the startup process to discount numbers for tests that were interrupted by a user prompt. nativeappsupport nsinativeappsupport getter for "native application support." read only. obsolete since gecko 1.9.1 constants the following flags may be passed as the amode parameter to the quit() method. one and only one of the "quit" flags must be specified. the erest...
... object. event identifier (key) description main time at which main application core was loaded. note: only available with libxul builds. firstpaint time the first paint occurred. note: only available with libxul builds. sessionrestored time session restore finished. example this example logs startup time in
formation to the console. var aconsoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice); var startupinfo = components.classes["@mozilla.org/toolkit/app-startup;1"] .getservice(ci.nsiappstartup_mozilla_2_0).getstartupinfo(); var keys = object.keys(startupinfo); keys.sort(function(a, b) { retu...
nsIAuthPromptCallback
method. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) callers must call exactly one method if nsiauthprompt2.asyncpromptauth() returns successfully. they must not call any method on this interface before nsiauthprompt2.asyncpromptauth() returns. ...
... one method if nsiauthprompt2.asyncpromptauth() returns successfully. they must not call any method on this interface before nsiauthprompt2.asyncpromptauth() returns. method overview void onauthavailable(in nsisupports acontext, in nsiauthin
formation aauthinfo); void onauthcancelled(in nsisupports acontext, in boolean usercancel); methods onauthavailable() authentication in
formation is available. note: any exceptions thrown from this method should be ignored. void onauthavailable( in nsisupports acontext, in nsiauthin
formation aauthinfo ); parameters acontext the context as passed to nsiauthprompt2.asyncpromptauth(). aauthinfo authentication in
formation. must be the same object that was passed to nsiauthprompt2.asyncpromptauth(). onauthcancelled()...
nsIBidiKeyboard
tl(); void setlangfrombidilevel(in pruint8 alevel); attributes attribute type description havebidikeyboards boolean indicates whether or not the system has at least one keyboard for each direction (left-to-right and right-to-left) installed. read only. note: this throws ns_error_not_implemented if the widget layer doesn't provide this in
formation. currently, this is only implemented on windows. methods islangrtl() determines if the current keyboard language is right-to-left. (supported on: win32, mac, gtk2) note: prior to gecko 1.9 this method used a parameter 'out prbool aisrtl' to return the value. boolean islangrtl(); parameters none. return value true if the current keyboard is right-to-left, false if it is not. excep...
...e on gtk+ later, and we will use gtk+ api instead. both gtk+ and gecko versions, check keysym's on keyboard layout to detect the direction of the layout. for gtk+ (>=2.10.1, >=2.12.0) and all gecko versions, we check only the first shift-level of the layout, to fix the problem with hebrew layouts. more info: bug 348724, bug 348724, and gnome bug: 116626 mac only islangrtl is supported on this plat
form. bug 266551 see also documentation for bidi mozilla ...
nsIBinaryOutputStream
output is written in big-endian order (high-order byte first), as this is traditional network order. ...
...output is written in big-endian order (high-order byte first), as this is traditional network order. ...
nsICacheEntryDescriptor
uests. this means that pending requests will not get a cache descriptor. this is meant as a tool for clients that wish to instruct pending requests to skip the cache. void doomandfailpendingrequests( in nsresult status ); parameters status the access status. getmetadataelement() this method retrieves the meta data. meta data is a table of key/value string pairs. the strings do not have to con
form to any particular charset, but they must be null terminated. string getmetadataelement( in string key ); parameters key the key for retrieving the meta data. return value returns the string value containing the meta data for the provided key. markvalid() this method means that a writer must validate this cache object before any readers are given a descriptor to the object. void markvalid(); ...
...e. setexpirationtime() this method sets the time at which the cache entry should be considered invalid (in seconds since the epoch). void setexpirationtime( in pruint32 expirationtime ); parameters expirationtime the time for cache entry expiration (in seconds). setmetadataelement() this method sets the meta data. meta data is a table of key/value string pairs. the strings do not have to con
form to any particular charset, but they must be null terminated. void setmetadataelement( in string key, in string value ); parameters key the key for setting the meta data. value the value for setting the meta data. visitmetadata() this method means that the visitor will be called with key/value pair for each meta data element. void visitmetadata( in nsicachemetadatavisitor visitor ); para...
nsICacheVisitor
netwerk/cache/nsicachevisitor.idlscriptable this interface provides in
formation about cache devices and entries. inherits from: nsisupports last changed in gecko 1.7 method overview boolean visitdevice(in string deviceid, in nsicachedeviceinfo deviceinfo); boolean visitentry(in string deviceid, in nsicacheentryinfo entryinfo); methods visitdevice() this method is called to provide in
formation about a cache device. boolean visitdevice( in string deviceid, in nsicachedeviceinfo deviceinfo ); parameters deviceid specifies the device being visited. deviceinfo specifies in
formation about this device. return value returns true to start visiting all entries for this device, otherwise returns false to advance to the next device. visitentry() this method is called to prov...
...
formation about a cache device. boolean visitdevice( in string deviceid, in nsicachedeviceinfo deviceinfo ); parameters deviceid specifies the device being visited. deviceinfo specifies in
formation about this device. return value returns true to start visiting all entries for this device, otherwise returns false to advance to the next device. visitentry() this method is called to provide in
formation about a cache entry. boolean visitentry( in string deviceid, in nsicacheentryinfo entryinfo ); parameters deviceid specifies the device being visited. entryinfo specifies in
formation about this entry. return value returns true to visit the next entry on the current device, or if the end of the device has been reached, advance to the next device, otherwise returns false to advance to t...
nsIChannel
inherits from: nsirequest last changed in gecko 19.0 (firefox 19.0 / thunderbird 19.0 / seamonkey 2.16) once a channel is created (via nsiioservice.newchannel()), parameters for that request may be set by using the channel attributes, or by calling queryinterface() to retrieve a subclass of nsichannel for protocol-specific parameters. then, the uri can be fetched by calling open() or asyncopen(). ...
...the entity that is responsible for this channel. used by the security manager to grant or deny privileges to mobile code loaded from this channel. note: this is a strong reference to the owner, so if the owner is also holding a strong reference to the channel, care must be taken to explicitly drop its reference to the channel. securityinfo nsisupports transport-level security in
formation (if any, else null) corresponding to the channel, normally presented through the interfaces nsitransportsecurityinfo and nsisslstatusprovider read only. uri nsiuri the uri corresponding to the channel. its value is immutable. read only. constants channel specific load flags: bits 23-31 are reserved for future use by this interface or one of its derivatives (for an exa...
nsIChromeRegistry
chrome/public/nsichromeregistry.idlscriptable provides access to the chrome registry; you can use this to get in
formation about chrome documents that have been registered. inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) implemented by: @mozilla.org/chrome/chrome-registry;1 as a service: var chromeregistry = components.classes["@mozilla.org/chrome/chrome-registry;1"] .getservice(components.interfaces.nsichromeregistry); method overview void canonify(in nsiuri achromeurl); obsolete since gecko 1.8 void checkfornewchrome(); nsiuri convertchromeurl(in nsiuri achromeurl); boolean wrappersenabled(in nsiuri auri); violates the xpcom interface guidelines constants ...
...kage. css for a "skin" package. dtd for a "locale" package. void canonify( in nsiuri achromeurl ); parameters achromeurl the url that is to be canonified. checkfornewchrome() refreshes the chrome list at runtime, looking for new packages and so forth. void checkfornewchrome(); parameters none. convertchromeurl() resolves a chrome url to an loadable uri using the in
formation in the registry. a new nsiuri is returned; the original is left unmodified. this lets you take a non-canonical chrome uri, such as chrome://package/provider/file, and convert it into a canonical one. this is useful because chrome urls are allowed to be specified in "shorthand", leaving the "file" portion off. in that case, the url is expanded to chrome://package/provider/package.ext. the ext...
nsIComponentManager
bootstrappedmanifestlocation() for details. void removebootstrappedmanifestlocation( in interface nsilocalfile alocation ); parameters examples using addbootstrappedmanifestlocation in a bootstrapped extension for firefox 8 and 9: alocation the directory or xpi to stop reading the chrome.manifest from. ...
...in a bootstrapped extension for firefox 8 and 9: alocation the directory or xpi to stop reading the chrome.manifest from. ...
nsIContentSniffer
ged in gecko 1.9 (firefox 3) to implement this interface use net-content-sniffers category. see netwerk/build/nsnetcid.h about ns_content_sniffer_category. method overview acstring getmimetypefromcontent(in nsirequest arequest, [const,array,size_is(alength)] in octet adata, in unsigned long alength); methods getmimetypefromcontent() given a chunk of data, determines a mime type. in
formation from the given request may be used in order to make a better decision. note: implementations should consider the request read-only. especially, they should not attempt to set the content type property that subclasses of nsirequest might offer. acstring getmimetypefromcontent( in nsirequest arequest, [const,array,size_is(alength)] in octet adata, in unsigned long alength ); parameters ...
... let conv = cc["@mozilla.org/intl/scriptableunicodeconverter"] .createinstance(ci.nsiscriptableunicodeconverter); conv.charset = charset; try { let str = conv.convertfrombytearray(adata, alength); if (str.substring(0, 5) == "%pdf-") return "application/pdf"; // we detected a pdf file } catch (e) { // try to get in
formation from arequest } ...
nsICookie
e name of the cookie. read only. path autf8string the path pertaining to the cookie. read only. policy nscookiepolicy holds the sites compact policy value. read only. status nscookiestatus holds the p3p status of cookie. read only. value acstring the cookie value. read only. constants constant value description status_unknown 0 the cookie collected in a previous session, and its in
formation no longer exists. available status_accepted 1 the cookie was accepted. status_downgraded 2 the cookie was accepted but downgraded to a session cookie. status_flagged 3 the cookie was not accepted. status_rejected 4 the cookie was rejected. policy_unknown 0 the cookie collected in a previous session, and its in
formation no longer available. policy_none 1 the site did not send a co...
...ngraded 2 the cookie was accepted but downgraded to a session cookie. status_flagged 3 the cookie was not accepted. status_rejected 4 the cookie was rejected. policy_unknown 0 the cookie collected in a previous session, and its in
formation no longer available. policy_none 1 the site did not send a compact policy along with the cookie. policy_no_consent 2 the site collects identifiable in
formation without user involvement. policy_implicit_consent 3 the site collects identifiable in
formation unless user opts out. policy_explicit_consent 4 the site does not collect identifiable in
formation unless user opts in. policy_no_ii 5 the site does not collect identifiable in
formation. ...
nsICookieManager2
com", host or domain cookies for "weather.yahoo.com" and "yahoo.com" would both be counted, while a cookie for "my.weather.yahoo.com" would not. unsigned long countcookiesfromhost( in autf8string ahost ); parameters ahost the host string to look for, such as "google.com". this should consist only of the host portion of the uri and should not contain a leading dot, port number, or other in
formation. return value the number of matching cookies found. findmatchingcookie() obsolete since gecko 1.9 (firefox 3) find whether a matching cookie already exists, and how many cookies a given host has already set. this is useful when e.g. prompting the user whether to accept a given cookie. boolean findmatchingcookie( in nsicookie2 acookie, out unsigned long aco...
... host or domain cookies for "weather.yahoo.com" and "yahoo.com" would both be returned, while a cookie for "my.weather.yahoo.com" would not. nsisimpleenumerator getcookiesfromhost( in autf8string ahost ); parameters ahost the host string to look for, such as "google.com". this should consist only of the host portion of the uri and should not contain a leading dot, port number, or other in
formation. return value an nsisimpleenumerator of nsicookie2 objects representing the matching cookies. importcookies() imports an old-style cookie file. the imported cookies will be added to the existing cookie database. if the database contains any cookies that are the same as those being imported (that is, they have the same domain, name, and path), they are replaced with the ones being import...
nsIDOMGeoGeolocation
you can request a single notification of the user's current position, or you can monitor the position over time. dom/interfaces/geolocation/nsidomgeogeolocation.idlscriptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports implemented by: @mozilla.org/geolocation;1. ...
... current position is available. errorcallback an nsidomgeopositionerrorcallback that is called if an error occurs while retrieving the position; this parameter is optional. options an nsidomgeopositionoptions object specifying options; this parameter is optional. watchposition() similar to getcurrentposition(), except it continues to call the callback with updated position in
formation periodically until clearwatch() is called. unsigned short watchposition( in nsidomgeopositioncallback successcallback, [optional] in nsidomgeopositionerrorcallback errorcallback, [optional] in nsidomgeopositionoptions options ); parameters successcallback an nsidomgeopositioncallback that is to be called whenever new position in
formation is available. errorcallback a...
nsIDOMProgressEvent
this implementation is a placeholder until the specification is complete, and is compatible with the webkit progressevent. ...
...this implementation is a placeholder until the specification is complete, and is compatible with the webkit progressevent. ...
nsIDocShell
ind out if the currently loaded document came from a suspicious channel (such as a jar channel where the server-returned content type is not a known jar type). read only. charset string the converter to use when reading the document's data. in mozilla code, all text is encoded as unicode. when reading a document, a converter is used to translate the text from its original
format into unicode. this attribute lets you: see what converter was used when retrieving the document's data. override that character set for documents for which the specified fallback or auto-detected character set is incorrect. reading this value reports the encoding that was used when loading the data into the document. setting this attribute overrides the encoding; however...
...sting) aheadersstream stream containing "extra" request headers. aloadflags flags to modify load behaviour. flags are defined in nsiwebnavigation. ashentry active session history entry (if loading from sh) firstparty true if this is the master top-level document. adocshell if the load was succesfully initiated, this receives the nsidocshell that actually per
formed the load. arequest the new channel created for the load. isbeingdestroyed() boolean isbeingdestroyed(); parameters none. return value returns true if the docshell is being destroyed, false otherwise. native code only!loadstream loads a given stream. this will give priority to loading the requested stream in the object implementing this interface. if it can not be loaded here however, ...
nsIDownloadProgressListener
astatus, in nsidownload adownload ); parameters awebprogress the nsiwebprogress instance used by the download manager to monitor downloads. arequest the nsichannel that changed state. this parameter will not be null. astateflags flags indicating the download's new state. this value is a combination of one of the nsiwebprogresslistener.state_transition_flags. astatus the new state in
formation for the download. see nsiwebprogresslistener.onstatechange() for details. this can also be one of the nsidownloadmanager.constants. adownload the download whose state changed. onstatuschange() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) called when the status of a download request has changed. the received status message is intend...
...d to the download manager. void onstatuschange( in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage, in nsidownload adownload ); parameters awebprogress the nsiwebprogress instance used by the download manager to monitor downloads. arequest the nsirequest that changed state. this parameter will not be null. astatus the new state in
formation for the download. see nsiwebprogresslistener.onstatechange() for details. amessage a user-readable status message intended to be displayed visibly on the screen. adownload the download whose status changed. example var dm = components.classes["@mozilla.org/download-manager;1"] .getservice(components.interfaces.nsidownloadmanager); dm.addlistener({ onsecuritychange : functi...
nsIFaviconDataCallback
to this article. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void oncomplete(in nsiuri auri, in unsigned long adatalen, [const,array,size_is(adatalen)] in octet adata, in autf8string amimetype); methods oncomplete() called when the required favicon's in
formation is available. it's up to the invoking method to state if the callback is always invoked, or called on success only. check the method documentation to ensure that. the caller will receive the most in
formation we can gather on the icon, but it's not guaranteed that all of them will be set. for some method we could not know the favicon's data (it could just be too expensive to get it, or the m...
...void oncomplete( in nsiuri auri, in unsigned long adatalen, [const,array,size_is(adatalen)] in octet adata, in autf8string amimetype ); parameters auri receives the "favicon uri" (not the "favicon link uri") associated to the requested page. ...
nsIFeed
toolkit/components/feeds/public/nsifeed.idlscriptable this interface represents a single atom or rss (really simple syndication) news feed. it includes attributes that provide in
formation about the feed, as well as access to the items or entries in the feed. 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. enclosurecount long indicates the number of enclosures associated with a feed. generator nsifeedgene...
...hich the feed should not be fetched. the hours are represented as integer values from 0 (midnight) to 23 (11:00 pm), and are always indicated using utc. note: this field is rarely implemented. subtitle nsifeedtextconstruct returns a subtitle for the feed, based on its description, subtitle, and appropriate extensions. textinput nsiwritablepropertybag2 in
formation about a text box that can be displayed along with the feed by aggregators that support it, to allow the reader to send a response back to the source of the feed. note: this field is almost never used, and is incompatible with many aggregators. type unsigned long indicates the type of content presented by a feed. see constants. note: you should consider this a bit mask...
nsIFeedContainer
es access to all the fields found in the document. common atom and rss fields are normalized, including some namespaced extensions such as "dc:subject" and "content:encoded". consumers can avoid normalization by checking the feed type and accessing specific fields. common namespaces are accessed using prefixes, such as get("dc:subject");. see nsifeedresult.registerextensionprefix() for more in
formation about prefixes. id astring a string that identifies the feed or entry. not all feeds have these, but all major feed
formats have ids for each entry. link nsiuri a uri containing the primary link for the feed or entry. links nsiarray an array of all links for a feed or entry. rights nsifeedtextconstruct the feed or entry's rights...
...d or entry. rights nsifeedtextconstruct the feed or entry's rights or license text. title nsifeedtextconstruct the feed or entry's title. keep in mind that some feeds have no title, and some use markup in their titles, so be cautious when decoding this attribute. updated astring a string containing the date the feed or entry was last updated, in rfc822
form. this string is parsable by javascript and mail code. methods normalize() synchronizes a container's fields with its convenience attributes. void normalize(); parameters none. see also nsiuri nsifeedtextconstruct interwiki link ...
nsIGlobalHistory3
1.0 66 introduced gecko 1.8 obsolete gecko 9.0 inherits from: nsiglobalhistory2 last changed in gecko 1.9 (firefox 3) this interface was originally created as part of nsiglobalhistory2, but was split off during the transition to places. ...
...irected to anewchannel. implementations should generally add the uri for aoldchannel to history for link coloring, but are advised not to expose it in the history user interface. this function is preferred if nsiglobalhistory3 is available. otherwise, nsiglobalhistory2.adduri() should be called with redirect=true. this function is preferred to nsiglobalhistory2.adduri() because it provides more in
formation (including the redirect destination, channels involved, and redirect flags) to the history implementation. for implementors of nsiglobalhistory3: the history implementation is responsible for sending ns_link_visited_event_topic to observers for redirect pages. this notification must be sent for history consumers for all non-redirect pages. the other params to this function are the same as th...
nsIINIParserWriter
ini files contain zero or more sections, denoted by a name in square brackets, followed by zero or more lines of text with a property name on the left, then an equals sign ("="), then the value of the property. ...
...ini files contain zero or more sections, denoted by a name in square brackets, followed by zero or more lines of text with a property name on the left, then an equals sign ("="), then the value of the property. ...
nsIJSID
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) the following methods return objects that implement this interface: components.interfaces.name components.classes[contract] components.interfacesbyid[uuid] components.classesbyid[cid] the first two cases create a named jsid while the last two cases create an unnamed jsid. an unnamed jsid also results when you implement a function that is passed an nsiidref parameter, such as queryinterface(). note that for these cases of jsid the specified class or interface must exist and be scriptable. ...
...ijsid to compare to. return value true if the nsijsid's are valid and have the same nsid, otherwise false. violates the xpcom interface guidelines getid() const nsid* getid(); parameters none. return value a pointer to the internal nsid structure. initialize() initializes the jsid. void initialize( in string idstring ); parameters idstring the number to initialize the jsid, in string
format, e.g. {00000000-0000-0000-c000-000000000046}. a jsid can only be initialized once. tostring() this methods returns a string representation of the object. string tostring(); parameters none. return value the name of the jsid if it has one, otherwise the string representation of its nsid. ...
nsIJumpListBuilder
is returned by a call to initlistbuild(). nsijumplistbuilder does not filter entries added that have been removed since the last commit. to prevent repeatedly adding entires users have removed, applications are encouraged to track removed items internally. each list is made up of an array of nsiwinjumplistitems representing items such as shortcuts, links, and separators. see nsijumplistitem for in
formation on adding additional jump list types. method overview void abortlistbuild(); boolean addlisttobuild(in short acattype, in nsiarray items optional, in astring catname optional); boolean commitlistbuild(); boolean deleteactivelist(); boolean initlistbuild(in nsimutablearray removeditems); attributes attribute type description available short indicates whether jump list taskb...
.... indicates if a commit has already occurred in this session. read only. exceptions thrown ns_error_not_available on all calls if taskbar functionality is not supported by the operating system. maxlistitems short the maximum number of jump list items the current desktop can support. read only. constants constant value description jumplist_category_tasks 0 tasks are common actions per
formed by users within the application. a task can be represented by an application shortcut and associated command line parameters or a uri. task lists should generally be static lists that do not change often, if at all - similar to an application menu. tasks are given the highest priority of all lists when space is limited. jumplist_category_recent 1 recent lists are based on window's recent docu...
nsILivemarkService
parameters container the folder id of a livemark container. return value a nsiuri representing the uri of the feed; if the livemark container doesn't have a valid feed uri, null will be returned or the nsiuri object returned will be the empty string. exceptions thrown ns_error_invalid_arg if the folder id isn't known or identifies a folder that isn't a livemark container. ns_error_mal
formed_uri if the site uri annotation has somehow been corrupted (and can't be turned into an nsiuri) getlivemarkidforfeeduri() determines whether the feed uri is a currently registered livemark. long long getlivemarkidforfeeduri( in nsiuri afeeduri ); parameters afeeduri feed uri to look for. return value the id of the livemark. getsiteuri() this method retrieves the uri of the webs...
.... nsiuri getsiteuri( in long long container ); parameters container the folder id of a livemark container. return value a nsiuri representing the uri of the website; if the livemark container doesn't have a valid site uri, null will be returned. exceptions thrown ns_error_invalid_arg if the folder id isn't known or identifies a folder that isn't a livemark container. ns_error_mal
formed_uri if the site uri annotation has somehow been corrupted (and can't be turned into an nsiuri) islivemark() this method determines whether the folder with the given folder id identifies a livemark container. boolean islivemark( in long long folder ); parameters folder a folder id. return value true if the given folder is a livemark folder, otherwise it returns false. exceptions...
nsILoginMetaInfo
hanged in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) you can specifically modify these values by passing changes into nsiloginmanager.modifylogin() using an nsipropertybag2 object as the input. metadata properties are ignored when comparing logins. attributes attribute type description guid astring the guid to uniquely identify the login. this can be any arbitrary string, but a
format as created by nsiuuidgenerator is recommended. for example, "{d4e1a1f6-5ea0-40ee-bff5-da57982f21cf}" timecreated unsigned long long the time, in unix epoch milliseconds, when the login was first created. timelastused unsigned long long the time, in unix epoch milliseconds, when the login was last submitted in a
form or used to begin an http auth session. timepasswordchanged unsigned lon...
...seconds, when the login was first created. timelastused unsigned long long the time, in unix epoch milliseconds, when the login was last submitted in a
form or used to begin an http auth session. timepasswordchanged unsigned long long the time, in unix epoch milliseconds, when the login's password was last modified. timesused unsigned long the number of times the login was submitted in a
form or used to begin an http auth session. see also nsiloginmanager nsilogininfo creating a login manager storage module ...
nsIMIMEInputStream
when true a "content-length" header is automatically added to the stream. the value of the content-length is automatically calculated using the available() method on the data stream. the value is recalculated every time the stream is rewound to the start. not allowed to be changed once the stream has been started to be read. methods addheader() adds an additional header to the stream on the
form "name: value". may not be called once the stream has been started to be read. void addheader( in string name, in string value ); parameters name name of the header. value value of the header. setdata() sets data-stream. may not be called once the stream has been started to be read. the cursor of the new stream should be located at the beginning of the stream if the implemen...
...ation of the nsimimeinputstream also is used as an nsiseekablestream. ...
nsIMarkupDocumentViewer
solete since gecko 1.8 authorstyledisabled boolean disable entire author style level (including html presentation hints) bidicharacterset octet whether to force the user's character set 1 - use the document character set 2 - use the character set chosen by the user. obsolete since gecko 6.0 bidicontrolstextmode octet the order of bidirectional text in
form controls. 1 - logical 2 - visual 3 - like the containing document. obsolete since gecko 2.0 bidinumeral octet the type of numerals to display. 1 - depending on context, default is arabic numerals 2 - depending on context, default is hindi numerals 3 - arabic numerals 4 - hindi numerals. bidioptions pruint32 use this attribute to access all the bidi options in one ope...
...cument. obsolete since gecko 2.0 bidinumeral octet the type of numerals to display. 1 - depending on context, default is arabic numerals 2 - depending on context, default is hindi numerals 3 - arabic numerals 4 - hindi numerals. bidioptions pruint32 use this attribute to access all the bidi options in one operation. bidisupport octet whether to use plat
form bidi support or mozilla's bidi support 1 - use mozilla's bidi support 2 - use the plat
form bidi support 3 - disable bidi support. biditextdirection octet options for bidi presentation. use these attributes to access the individual bidi options. the default direction for the layout of bidirectional text. 1 - left to right 2 - right to left. biditexttype octe...
nsIModule
the iid of interface requested. aresult the resulting interface pointer. exceptions thrown ns_error_factory_not_registered indicates that the requested class is not available. ns_error_no_interface indicates that the requested interface is not supported. registerself() when the nsimodule is discovered, this method will be called so that any setup registration can be pre
formed. void registerself( in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr, in string atype ); parameters acompmgr the global component manager. alocation the location of the nsimodule on disk. aloaderstr opaque loader specific string. atype loader type being used to load this module. unregisterself() when the nsimodule is being un...
...tion, in string aloaderstr, in string atype ); parameters acompmgr the global component manager. alocation the location of the nsimodule on disk. aloaderstr opaque loader specific string. atype loader type being used to load this module. unregisterself() when the nsimodule is being unregistered, this method will be called so that any unregistration can be pre
formed. void unregisterself( in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr ); parameters acompmgr the global component manager. alocation the location of the nsimodule on disk. aloaderstr opaque loader specific string. remarks this interface was finalized (frozen) for gecko 0.9.9. see bug 99154 for details. from gecko 2.0 interfaces are no...
nsIMsgDBHdr
es the state of the database, although it is not saved until the database is committed. in clear, if you want to do a persistent change to a message header, such as marking it as read, or replied to, or whatever, you must do it through its corresponding nsimsgfolder (msghdr.folder) or nsimsgdatabase (msghdr.folder.msgdatabase). it is also mandatory to set msghdr.folder.msgdatabase = null after per
forming this kind of operations to prevent leaking. don't even think about using orflags and/or andflags. method overview astring getproperty(in string propertyname); void setproperty(in string propertyname, in astring propertystr); void setstringproperty(in string propertyname, in string propertyvalue); string getstringproperty(in string propertyname); u...
...have been run on a message yet. return value the value of the property. setuint32property() void setuint32property(in string propertyname, in unsigned long propertyval); parameters propertyname the name of the property to set. propertyval the value of the property. markread() marks this header as read. thunderbird provides a utility function which per
forms this for the currently selected message: markcurrentmessageasread(). void markread(in boolean read); parameters read if true, mark as read. if false mark as undread. markflagged() void markflagged(in boolean flagged); parameters flagged if true, mark as flagged. if false remove flag. markhasattachments() void markhasattachments(in boolean hasattachments); parameters ha...
nsIMsgDatabase
nsisimpleenumerator enumeratemessages(); ...
...mmittype); parameters committype forceclosed() force closed is evil, and we should see if we can do without it. in 4.x, it was mainly used to remove corrupted databases. void forceclosed(); clearcachedhdrs() void clearcachedhdrs(); resethdrcachesize() void resethdrcachesize(in unsigned long size); getmsghdrforkey() nsimsgdbhdr getmsghdrforkey(in nsmsgkey key); parameters key getmsghdr
formessageid() nsimsgdbhdr getmsghdr
formessageid(in string messageid); parameters messageid containskey() returns whether or not this database contains the given key. boolean containskey(in nsmsgkey key); parameters key createnewhdr() must call addnewhdrtodb after creating. the idea is that you create a new header, fill in its properties, and then call addnewhdrtodb. addnewhdrtodb will send no...
nsIMsgMessageService
objects that implements nsimsgmessageservice give the user top level routines related to messages like copying, displaying, attachment's manipulation, printing, streaming the message content to eml
format string, etc. inherits from: nsisupports method overview void copymessage(in string asrcuri, in nsistreamlistener acopylistener, in boolean amovemessage, in nsiurllistener aurllistener, in nsimsgwindow amsgwindow, out nsiuri aurl); [noscript] void copymessages(in nsmsgkeyarrayptr keys, in nsimsgfolder 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 ns...
...hod. note: the uri must refer to a message and not a folder! void geturlforuri(in string amessageuri, out nsiuri aurl, in nsimsgwindow amsgwindow); parameters amessageuri amsgwindow nsimsgwindow for progress and status feedback return values aurl the nsiuri of the message. displaymessageforprinting() when you want a message displayed in a
format that is suitable for printing. void displaymessageforprinting(in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, out nsiuri aurl); parameters amessageuri a uri representing the message to display.
nsINavBookmarkObserver
folder has been added. void onfolderadded( in print64 folder, in print64 parent, in print32 index ); parameters folder the id of the folder that was added. parent the id of the folder's parent. index the folder's index inside its parent. onfolderchanged() obsolete since gecko 1.9 (firefox 3) notify this observer that a bookmark folder's in
formation has changed. this will be called whenever any attributes like "title" are changed. void onfolderchanged( in print64 folder, in acstring property ); parameters folder the id of the folder that was changed. property the property that was changed. onfoldermoved() obsolete since gecko 1.9 (firefox 3) notify this observer that a bookmark folder has...
...uri of the item that was added when aitemtype is type_bookmark, null otherwise. atitle the title of the added item. adateadded the stored date added value, in microseconds from the epoch. aguid the unique id associated with the item. aparentguid the unique id associated with the item's parent. onitemchanged() this method notifies this observer that an item's in
formation has changed. it is called whenever any attributes like "title" are changed. void onitemchanged( in long long aitemid, in acstring aproperty, in boolean aisannotationproperty, in autf8string anewvalue, in prtime alastmodified, in unsigned short aitemtype, in long long aparentid, in acstring aguid, in acstring aparentguid ); parameters aitemid the id of the item tha...
nsINavHistoryResult
out of scope it will continue to observe changes till it is cycle collected. while the result waits to be collected it will stay in memory, and continue to update itself, potentially causing unwanted additional work. when you close the root node the result will stop observing changes, so it is good practice to close the root node when you are done with a result, since that will avoid unwanted per
formance hits. read only. sortingannotation autf8string the annotation to use in sort_by_annotation_* sorting modes; you must set this value before setting the sortingmode attribute. sortingmode unsigned short specifies the sorting mode for the result. this value must be one of nsinavhistoryqueryoptions.sort_by_*. changing this value updates the...
... result. this value must be one of nsinavhistoryqueryoptions.sort_by_*. changing this value updates the corresponding options for the result so that reusing the current options and queries will always return results based on the current view. suppressnotifications boolean if true, notifications are suppressed. this is used to prevent rapid flickering of changes when per
forming batch or temporary operations on the result structure. viewer nsinavhistoryresultviewer the viewer for this result. the viewer is responsible for actually updating the view object itself, as well as for handling events on the view. obsolete since gecko 2.0 methods addobserver() adds an observer for changes that occur on the result. void addobserver( in n...
nsINavHistoryResultNode
toolkit/components/places/public/nsinavhistoryservice.idlscriptable this is the base class for all places history result nodes, containing the uri, title, and other general in
formation. 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. for hosts, this is the total number of the children under it, rather than the total number of times the host has been accessed (getting that in
formation would require an additional query, so for per
formance reasons that in
formation isn't given by default). read only. bookmarkindex long when this item is in a bookmark folder (its ...
...en an item is added lastmodified is set to the same value as dateadded. read only. parent nsinavhistorycontainerresultnode identifies the parent result node in the result set. the value is null for top level nodes. read only. parentresult nsinavhistoryresult the history-result to which this node belongs. read only. propertybag nsiwritablepropertybag you can use this to associate temporary in
formation with the result node. this property bag is associated with the result node and is not persisted in any way. read only. obsolete since gecko 2.0 tags astring for uri nodes, this is a sorted list of the tags, delimited with commans, for the uri represented by this node. otherwise this is an empty string. read only. time prtime the time at which the user accessed the page. read only. for vi...
nsIPromptService
lude an ampersand in the button's text, use two of them, like this: "&&". note: some of these interface methods use out and inout parameters. in c++, out parameters are pointers. for javascript, they are extra work, as you can't use an out parameter directly. 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. for more in
formation on out parameters and javascript refer to working with out parameters. implemented by: @mozilla.org/embedcomp/prompt-service;1. to get an instance, use: var promptservice = components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getservice(components.interfaces.nsipromptservice); method overview void alert(in nsidomwindow aparent, in wstring adi...
...all flags are defined as unsigned long constants and can be accessed as components.interfaces.nsipromptservice.flagname from javascript and as nsipromptservice::flagname from c++. button position flags on linux and mac, button 2 is on the left of the prompt, while buttons 1 and 0 are on the right. on windows and os/2, the buttons are centred in the ...
nsIProtocolHandler
s -1. read only. protocolflags unsigned long protocol-specific flags. read only. note: starting with firefox 3, one of uri_loadable_by_anyone, uri_dangerous_to_load, uri_is_ui_resource, or uri_is_local_file must be set on every protocol handler. current versions of firefox assume that the uri has uri_loadable_by_anyone set, but this will not work starting with the mozilla 2 plat
form. scheme acstring the scheme for this protocol ("file", "http", and so forth). read only. constants constant value description uri_std 0 a standard full uri with authority component and understanding relative uris; this includes http and ftp, for example. uri_norelative 1<<0 the protocol doesn't support relative uris (for exam...
...uri string in utf-8 encoding. depending on the protocol's implementation, unicode character sequences may or may not be %xx escaped. aorigincharset the character set of the document from which this uri string originated. this corresponds to the character set that should be used when communicating this uri to an origin server. if this is null, then utf-8 encoding is assumed and no character trans
formation is not per
formed. abaseuri if null, aspec must specify an absolute uri. otherwise, aspec may be resolved relative to abaseuri, depending on the protocol. if the protocol has no concept of relative uris, this parameter is ignored. return value the new uri object suitable for loading using the protocol. see also nsiproxiedprotocolhandler adding a new protocol to mozilla writing a fi...
nsIProtocolProxyService
inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/network/protocol-proxy-service;1. ...
... void registerfilter(in nsiprotocolproxyfilter afilter, in unsigned long aposition); void unregisterfilter(in nsiprotocolproxyfilter afilter); constants constant value description resolve_non_blocking 1<<0 this flag may be passed to the resolve method to request that it fail instead of block the calling thread. proxy auto config (pac) may per
form a synchronous dns query, which may not return immediately. so, calling resolve without this flag may result in locking up the calling thread for a lengthy period of time. by passing this flag to resolve, one can failover to asyncresolve to avoid locking up the calling thread if a pac query is required. when this flag is passed to resolve, resolve may throw the exception ns_base_stream_wo...
nsIResumableChannel
l, and read starting at the specified offset. the request given to the nsistreamlistener will be qiable to nsiresumableinfo. void asyncopenat( in nsistreamlistener listener, in nsisupports ctxt, in unsigned long startpos, in nsiresumableentityid entityid ); parameters listener as for asyncopen. ctxt as for asyncopen. startpos the starting offset, in bytes, to use to download. entityid in
formation about the file, to match before obtaining the file. pass an empty string to use anything. resumeat() prepare this channel for resuming. the request will not start until asyncopen or open is called. calling resumeat after open or asyncopen has been called has undefined behaviour. during onstartrequest, this channel will have a status of ns_error_not_resumable if the file cannot be resumed, f...
...may be ns_error_entity_changed, which indicates that the entity has changed, as indicated by a changed entityid. in both of these cases, no ondataavailable will be called, and onstoprequest will immediately follow with the same status code. void resumeat( in unsigned long long startpos, in acstring entityid ); parameters startpos the starting offset, in bytes, to use to download. entityid in
formation about the file, to match before obtaining the file. pass an empty string to use anything. see also implementing download resuming ...
nsISHEntry
inherits from: nsihistoryentry last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) implemented by: @mozilla.org/browser/session-history-entry;1. ...
...ate(). docshellid unsigned long long the history id of the docshell. document nsidomdocument dom document. obsolete since gecko 1.8 expirationstatus boolean indicates whether the page is already expired in cache. id unsigned long an id to help identify this entry from others during subframe navigation. layouthistorystate nsilayouthistorystate layouthistorystate for scroll position and
form values. loadtype unsigned long the loadtype for this entry. this is typically loadhistory except when reload is pressed, it has the appropriate reload flag. owner nsisupports get the owner, if any, that was associated with the channel that the document that was loaded to create this history entry came from. pageidentifier unsigned long an integer that should be the same for two entries att...
nsIScreen
inherits from: nsisupports last changed in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) use nsiscreenmanager to obtain references to screens. ...
...ng the screen's color depth; this is the number of bits used to represent a color. read only. pixeldepth long the screen's pixel depth; this is the number of bits used to represent a pixel. read only. rotation unsigned long the screen's current rotation; you may set this to any of the values listed in screen rotation constants. this will only have an effect on plat
forms that support screen rotation. gecko 1.9.2 note starting in gecko 1.9.2, gecko running on microsoft windows reports 24 bits per pixel instead of 32 bits per pixel on 8-bits per color component displays, since this is typically what the caller is actually looking for. constants screen brightness constants constant value description brightness_dim 0 the sc...
nsIScreenManager
widget/public/nsiscreenmanager.idlscriptable this interface lets you get in
formation about the display screen (or screens) attached to the user's computer. 66 introduced gecko 0.9.5 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/gfx/screenmanager;1 as a service: var screenmanager = components.classes["@mozilla.org/gfx/screenmanager;1"] .getservice(components.interfaces.nsiscreenmanager); method overview nsiscreen screenfornativewidget( in voidptr nativewidget ); native code only! 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. read ...
...reens unsigned long the number of screens on the user's computer. read only. primaryscreen nsiscreen the primary display screen; this is the screen with the menu bar (on the mac) or taskbar or equivalent on windows or linux. read only. methods native code only!screenfornativewidget returns the nsiscreen instance for the native widget pointer. this pointer's definition is specific to the plat
form's native widget implementation, and is typically of the same type as ns_native_window. nsiscreen screenfornativewidget( in voidptr nativewidget ); parameters nativewidget the native widget for which to obtain an nsiscreen instance. return value the nsiscreen instance for the native widget pointer. screenforrect() returns the nsiscreen containing the specified rectangle. if the rectangle over...
nsISearchEngine
n describing the engine. read only. hidden boolean whether the engine should be hidden from the user. iconuri nsiuri a nsiuri corresponding to the engine's icon, stored locally. may be null. read only. name astring the display name of the search engine. this is a unique identifier. read only. search
form astring a url string pointing to the engine's search
form. read only. type long the search engine type. read only. constants search engine type constants constant value description type_mozsearch 1 type_sherlock 2 type_opensearch 3 ...
... since an engine can have several different request urls, differentiated by response types, this parameter selects a request to add parameters to. if null, will default to "text/html" exceptions thrown ns_error_invalid_arg if name or value are null. ns_error_failure if the search engine is read-only. getsubmission() gets a nsisearchsubmission object that contains in
formation about what to send to the search engine, including the uri and postdata, if applicable. nsisearchsubmission getsubmission( in astring data, [optional] in astring responsetype, [optional] in astring purpose ); parameters data data to add to the submission object. that is the search terms. responsetype [optional] the mime type that we'd like to receive in re...
nsISound
ecify 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. similarly, if you specify "blow", you can play the mac os x "blow" system sound, but, similarly, it's played only on the macintosh. if you wish to use this method for playing sounds, you should check the plat
form before you call playsystemsound(). note: this second usage is obsolete starting in gecko 1.9.2. you should instead use playeventsound() instead. typically, it will be more useful to request that appropriate sounds be played based on which event you wish to represent by the sound effect. various event names are provided, which will result in playing the corresponding sound effect on...
...ou call playsystemsound(). note: this second usage is obsolete starting in gecko 1.9.2. you should instead use playeventsound() instead. typically, it will be more useful to request that appropriate sounds be played based on which event you wish to represent by the sound effect. various event names are provided, which will result in playing the corresponding sound effect on the plat
form the user is running on: _moz_mailbeep the system sound when the system receives email. _moz_alertdialog the system sound when an alert dialog is opened. _moz_confirmdialog the system sound when a confirm dialog is opened. _moz_promptdialog the system sound when a prompt ...
nsIStandardURL
it supports initialization from a relative path and provides some customization on how urls are normalized. inherits from: nsimutable last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/standard-url;1. ...
...r => blah:///foo/bar methods init() normalizes a given url to an standard url. void init( in unsigned long aurltype, in long adefaultport, in autf8string aspec, in string aorigincharset, in nsiuri abaseuri ); parameters aurltype one of the constants listed above. adefaultport if the port parsed from the url string matches this port, then the port will be removed from the canonical
form of the url. aspec url string. aorigincharset the charset from which this uri string originated. this corresponds to the charset that should be used when communicating this uri to an origin server, for example. if null, then provide abaseuri implements this interface, the origin charset of abaseuri will be assumed, otherwise defaulting to utf-8 (that is, no charset trans
formation from aspec). abas...
nsIStreamConverter
e x to your desired output type and return converted data to you via the nsistreamlistener you passed in by calling its nsistreamlistener.ondataavailable() method. stream converter suppliers registering a stream converter: stream converter registration is a two step process. ...
...ing its nsistreamlistener.ondataavailable() method. stream converter suppliers registering a stream converter: stream converter registration is a two step process. first of all the stream converter implementation must register itself with the component manager using a contractid in the
format below. second, the stream converter must add the contractid to the registry. ...
nsIStructuredCloneContainer
ainer more than once. once you've initialized the container, you can get a copy of the object it stores by calling deserializetovariant(). you can also get a base-64-encoded string containing a copy of the container's serialized data, using getdataasbase64(). method overview nsivariant deserializetovariant(); astring getdataasbase64(); void initfrombase64(in astring adata,in unsigned long a
formatversion); void initfromvariant(in nsivariant adata); attributes attribute type description
formatversion unsigned long get the version of the structured clone algorithm which was used to generate this container's serialized buffer. read only. serializednbytes unsigned long long get the size in bytes of this container's serialized data. read only. methods deserializetovariant() des...
...eserializetovariant(); parameters none. return value an nsivariant. getdataasbase64() get this structured clone container's data as a base-64-encoded string. astring getdataasbase64(); parameters none. return value a base-64-encoded string. initfrombase64() initialize this structured clone container from a base-64-encoded byte stream. void initfrombase64( in astring adata, in unsigned long a
formatversion ); parameters adata a base-64-encoded byte stream. a
formatversion the version of the structured clone algorithm which was used to generate adata. initfromvariant() initialize this structured clone container so it contains a clone of the given variant. void initfromvariant( in nsivariant adata ); parameters adata a nsivariant, must be backed by a jsval. ...
nsITelemetry
toolkit/components/telemetry/nsitelemetry.idlscriptable a service to gather per
formance data that can be tracked over time to allow generating histograms. 1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) implemented by: @mozilla.org/base/telemetry;1 as a service: let telemetry = components.classes["@mozilla.org/base/telemetry;1"] .getservice(components.interfaces.nsitelemetry); method overview jsval gethistogrambyid(in acstring id); jsval snapshothistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); jsval getkeyedhistogrambyid(in acstring id); void capturestack(in acstring name); jsval ...
...ropriate bucket. for count histograms providing the value is optional. snapshot([optional] key) - returns a snapshot of the keyed histogram or (if key is provided) the snapshot of the contained histogram with that key. keys() - returns an array with the string keys of the currently registered histograms. clear() - clear out the registered histograms and keys. example you can find detailed in
formation on adding a new telemetry probe and recording telemetry data at adding a new telemetry probe [en-us]. see also bug 649502 - expose histograms to js bug 585196 - telemetry infrastructure bug 668312 - report only probes defined in histograms.json bug 1069874 - add keyed histogram types bug 1426453 - documentation of nsitelemetry not up to date ...
nsITreeSelection
layout/xul/base/src/tree/public/nsitreeselection.idlscriptable this interface is used by the tree widget to get in
formation about what is selected. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void adjustselection(in long index, in long count); void clearrange(in long startindex, in long endindex); void clearselection(); void getrangeat(in long i, out long min, out long max); long getrangecount(); void invalidateselection(); void invertselection(); boolean isselected(in long index); void rangedselect(in long startindex, in long endindex, in boolean augment); void select(in long index); void selectall(); void timedselect(in long index, in...
... augment if true, the range is added to the selection without clearing out anything else. if false, everything is cleared except for the specified range. select() deselect all rows and select the row at the specified index. void select( in long index ); parameters index index of the row to select. selectall() selects all rows. void selectall(); parameters none. timedselect() per
form a timed select. void timedselect( in long index, in long delay ); parameters index index of the row to select. delay time in miliseconds to delay selection. toggleselect() toggle the selection state of the row at the specified index. void toggleselect( in long index ); parameters index row to toggle. ...
nsIUpdateItem
type description iconurl astring the url of the icon that can be shown for this item. read only. id astring the guid of the item. read only. installlocationkey astring the name of the install location where this item is installed. read only. maxappversion astring the maximum version of the application that this item works with, in fvf
format. read only. minappversion astring the minimum version of the application that this item works with, in fvf
format. read only. name astring the name of this item. read only. objectsource astring returns a js object source representing an nsiupdateitem. read only. targetappid astring the target application id used for checking compa...
... type long the type of this item. read only. updatekey astring the public key to verify updates for this item. this must be the public part of the key that was used to sign update manifests for this add-on. read only. updaterdf astring the url of the update rdf file for this item. read only. version astring the version of the item, in fvf
format. read only. xpihash astring the string hash for the xpi file. can be null and if supplied must be in the
format of "type:hash" (see the types in nsicryptohash and nsixpinstallmanager.initmanagerwithhashes(). read only. xpiurl astring the url of the xpi where this item can be downloaded. read only. constants item type constants constants representing types ...
nsIVersionComparator
==" + b; else if(x > 0) return a + ">" + b; return a + "<" + b; } dump(compareversions("1.0pre", "1.0")); example - compare current browser version this example here uses nsixulappinfo component to get the version of the browser that the code is running in. ...
...result == -1) { //currentbrowserversion is less than '25.*' (comparetothisversion) } else if (compareresult == 0) { //currentbrowserversion is '25.*' (comparetothisversion) } else if (compareresult == 1) { //currentbrowserversion is greater than '25.*' (comparetothisversion) } else { //will never get here as services.vc.compare only returns -1, 0, or 1 } see also toolkit version
format ...
nsIWebNavigation
nsiuri the referring uri for the currently loaded uri or null. read only. sessionhistory nsishistory the session history object used by this web navigation instance. methods goback() tells the object to navigate to the previous session history item. when a page is loaded from session history, all content is loaded from the cache (if available) and page state (such as
form values and scroll position) is restored. void goback( ); goforward() tells the object to navigate to the next session history item. when a page is loaded from session history, all content is loaded from the cache (if available) and page state (such as
form values and scroll position) is restored. void goforward( ); gotoindex() tells the object to navigate to the session history item at a ...
...est, then this stream is appended directly to the http request headers. it may be prefixed with additional http headers. this stream must contain a \r\n sequence separating any http headers from the http request body. this parameter may be null. headers if the uri corresponds to a http request, then any http headers contained in this stream are set on the http request. the http header stream is
formatted as: ( header \r\n )* this parameter may be null. reload() tells the object to reload the current page. there may be cases where the user will be asked to confirm the reload (for example, when it is determined that the request is non-idempotent). void reload( unsigned long reloadflags ); parameters reloadflags flags modifying load behaviour. this parameter is a bitwise combination...
nsIWebNavigationInfo
docshell/base/nsiwebnavigationinfo.idlscriptable exposes a way to get in
formation on the capabilities of gecko web navigation objects. 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) implemented by: @mozilla.org/webnavigation-info;1 as a service: var webnavigationinfo = components.classes["@mozilla.org/webnavigation-info;1"] .getservice(components.interfaces.nsiwebnavigationinfo); method overview unsigned long istypesupported(in acstring atype, in nsiwebnavigation awebnav); constants support type constants constant value description unsupported 0 returned by istypesupported() to indicate lack of support for...
...bility. you may specify null to check for compatibility with nsiwebnavigation objects that are in their default state; otherwise, the result is determined based on the configuration of the specified object (that is, how it is configured by using nsiwebbrowsersetup). return value returns one of the support type constants, indicating whether or not the specified mime type is supported, and in what
form that support exists. example let webnavigationinfo_service = components.classes["@mozilla.org/webnavigation-info;1"] .getservice(components.interfaces.nsiwebnavigationinfo); let support_code = webnavigationinfo_service.istypesupported(contenttype, null); if (support_code == webnavigationinfo_service.unsupported) { dump("unsupported content-type: not displaying i...
nsIWifiAccessPoint
read only. rawssid acstring the public name of the wireless network, as an ascii string. this string is null if not available. read only. ...
...read only. rawssid acstring the public name of the wireless network, as an ascii string. this string is null if not available. read only. ...
nsIWindowMediator
pe" is the |windowtype| attribute of the xml <window> element.) if null, all windows will be enumerated. afronttoback if true, the enumerator enumerates windows in order from front to back. back to front if false. return value an enumerator of nsidomwindows. this method may not work on linux or mac (bug 462222) nor on os2 (bug 370134) - please check those bugs before relying on it. more in
formation can be found by searching mxr for broken_wm_z_order) getzorderxulwindowenumerator() identical to getzorderdomwindowenumerator() except returns an enumerator of nsixulwindow. nsisimpleenumerator getzorderxulwindowenumerator( in wstring awindowtype, in boolean afronttoback ); parameters awindowtype the returned enumerator will enumerate only windows of this type. ("type" is the |...
...us changes. void removelistener( in nsiwindowmediatorlistener alistener ); parameters alistener the listener to unregister. native code only!setzlevel set the window's z level (as defined in nsixulwindow). the implementation will reposition the window as necessary to match its new z level. the implementation will assume a window's z level to be nsixulwindow.normalz until it has been in
formed of a different level. void setzlevel( in nsixulwindow awindow, in pruint32 azlevel ); parameters awindow the window in question. azlevel the window's new z level. native code only!setzposition a window has been positioned behind another. in
form windowmediator. void setzposition( in nsixulwindow inwindow, in unsigned long inposition, in nsixulwindow inbelow ); parameters...
nsIXPConnect
precated do-nothing function. void syncjscontexts(); parameters none. exceptions thrown missing exception missing description native code only!updatexows obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. ...
...rk in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. per
forms an operation over all of |object|'s xows such as clearing their scopes or updating their concept of the current principal. void updatexows( in jscontextptr ajscontext, in nsixpconnectwrappednative aobject, in pruint32 away ); parameters ajscontext a context to use to per
form js operations. aobject which xpcwrappednative we should find the xows for. away what operation to per
form. exceptions thrown missing exception missing description varianttojs() jsval varianttojs( in jscontextptr ctx, in jsobjectptr scope, in nsivariant value ); parameters ctx missing description scope missing description value missing description return value missi...
nsIXULTemplateQueryProcessor
the reference point is important when generating output recursively, as the query will be the same for each iteration, however, the reference point will differ. for instance, when examining an xml source, an xml query processor might begin at the node referred by the reference variable and end at a list of that node's children. some queries may not need the reference variable if the syntax or the
form of the data implies the value. for instance, a datasource that holds a table that can only produce one set of results. the reference variable may be specified in a template by setting the "container" attribute on the <template> element to the variable to use. the member variable may be specified in a similar way using the "member" attribute, or it may be specified in the first <action> body in th...
... of results. the reference variable may be specified in a template by setting the "container" attribute on the <template> element to the variable to use. the member variable may be specified in a similar way using the "member" attribute, or it may be specified in the first <action> body in the template as the value of a uri attribute on an element. a breadth-first search of the first action is per
formed to find this element. if unspecified, the default value of the reference variable is ?uri. for example, a query might have the following syntax: (?id, ?name, ?url) from bookmarks where parentfolder = ?start this query might generate a result for each bookmark within a given folder. the variable ?start would be the reference variable, while the variable ?id would be the member variable, since it...
XPCOM Interface Reference by grouping
dom device nsidomgeogeolocation nsidomgeoposition nsidomgeopositionaddress nsidomgeopositioncallback nsidomgeopositioncoords nsidomgeopositionerror nsidomgeopositionerrorcallback nsidomgeopositionoptions nsidomglobalpropertyinitializer element nsidomchromewindow nsidomclientrect nsidomelement nsidomhtmlaudioelement nsidomhtml
formelement nsidomhtmlmediaelement nsidomhtmlsourceelement nsidomhtmltimeranges nsidomjswindow nsidomnode nsidomnshtmldocument nsidomstorageitem nsidomstoragemanager nsidomwindow nsidomwindow2 nsidomwindowinternal nsidomwindowutils nsidynamiccontainer nsieditor event nsidomevent nsidomeventgroup nsidomeventlistener nsidome...
... nsixsltexception nsixsltprocessor download nsidownload nsidownloadmanager nsidownloadprogresslistener element internal nsiworker nsiworkerglobalscope nsiworkermessageevent nsiworkermessageport nsiworkerscope tree nsitreeboxobject nsitreecolumn nsitreecolumns nsitreecontentview nsitreeselection nsitreeview x
form nsix
formsmodelelement nsix
formsnsinstanceelement nsix
formsnsmodelelement xmlhttprequest nsixmlhttprequesteventtarget favicon nsifavicondatacallback nsifaviconservice frame nsichromeframemessagemanager nsiframeloader nsiframeloaderowner nsiframemessagelistener nsiframemessagemanager interface nsijsxmlhttprequest ...
Setting HTTP request headers
you can add your own http headers to any request the application makes, whether the request is initiated by your code explicitly opening an http channel, because of xmlhttprequest activity, an <img> element in content, or even from css. http channels when you deal with http requests and responses, typically you are doing this with an nsihttpchannel. the nsihttpchannel interface has a number of properties and methods, but the method that is of interest to us is setrequestheader. ...
...nel just before the http request is made we need to observe the "http-on-modify-request" topic. (and yes, "http-on-modify-request" is a string.) note: there are many topics, besides just "http-on-modify-request", that you can get notifications about, for example "http-on-examine-response" and "xpcom-shutdown". you can also make up your own topics and send out your own notifications. for more in
formation about notifications framework and a list of common notification topics, see observer notifications. observers to get notified about some topic (like "http-on-modify-request") we need to create an observer. an observer is a component implementing nsiobserver interface. and once the observer is registered for a topic, it will get notified about the topic by having its observe method called. b...
Frequently Asked Questions
're looking here just to learn about nscomptrs, you'll get a better introduction in the getting started guide. the faq is divided into sections to help you find what you're looking for faster. in most cases, the answer will just refer back into the reference manual, above. no need to explain things twice :-). buildtime errors the build just broke. it's not in your code, or it's not on your plat
form, but there's an nscomptr on the line where the error is and you're suspicious. you're looking in the right place. comparing an nscomptr to a raw xpcom interface pointer declaring an nscomptr to a forward-declared class not linking to xpcom not including nscomptr.h different settings of nscap_feature_debug_ptr_types runtime errors ns_assertion "queryinterface needed" may be caused by a cla...
...ize an nscomptr? release an nscomptr before it goes out of scope? assign 0 into it. whenever an nscomptr takes on a new value, it always releases its old value, if any. assigning in the value 0 is just like assigning in a raw pointer that happens to be null. the old referent will be released. [see initialization and assignment for more details] you should note, though, that there is a small per
formance penalty for this. the nscomptr will still exercize logic in its destructor to attempt to release the value it has at that time. the optimal solution is to arrange the lifetime of your nscomptr to correspond to exactly how long you want to hold the reference. e.g., using blocks as in this sample // the most efficient scheme is to scope your |nscomptr| to live exactly as long //...
Using nsIPasswordManager
th applications using toolkit 1.8 and below such as firefox 2.0.0.x and thunderbird 2.0.0.x. for similar functionality in toolkit 1.9, see using nsiloginmanager. working with password manager extensions often need to securely store passwords to external sites, web applications, and so on. to do so securely, they can use nsipasswordmanager, which provides for secure storage of sensitive password in
formation. getting nsipasswordmanager to get a component implementing nsipasswordmanager, use the following: var passwordmanager = components.classes["@mozilla.org/passwordmanager;1"] .getservice(components.interfaces.nsipasswordmanager); storing a password to store a password in the password manager, you need three things: a hostname/url (you'll need this to retrieve ...
... nsipasswordmanager, use the following: var passwordmanager = components.classes["@mozilla.org/passwordmanager;1"] .getservice(components.interfaces.nsipasswordmanager); storing a password to store a password in the password manager, you need three things: a hostname/url (you'll need this to retrieve the password again later), a username, and a password. of this in
formation, the password is the only data that will be stored securely. adding a password to the password manager is easy: passwordmanager.adduser('host', 'username', 'password'); since there's no provision to include names of html input fields, no password stored by this interface will be used to fill in passwords on web pages. nsiloginmanager, available in toolkit 1.9, does let you include input fie...
XPIDL Syntax
idl or idl in general. it is more focused on xpidl syntax and grammar. see xpidl main page for more links and introductory content. simplifications, conventions and notation the syntax is specified according to abnf as defined by rfc 5234, although a few productions use prose for clarity of understanding. lexically, tokens are delimited by whitespace (defined here as spaces, tabs, vertical tabs,
form feeds, line feeds, and carriage returns, or [ \t\v\f\r\n] in regular expression
form). libidl only considers a single line feed as a newline, and not carriage returns (although xpidl begs to differ). additionally, the use of both c-style (/* ... */) and c++-style (// ... end-of-line) comments are permitted between any two tokens. some productions can only occur at the beginning of lines; to simpl...
...*("," attribute) "]" attribute = (identifier / const) ["(" (identifier / iid) ")"] param = [attributes] ("in" / "out" / "inout") identifier identifier number = number / identifier number /= "(" number ")" number /= "-" number number /= number ("+" / "-" / "*") number number /= number ("<<" / >>") number number /= number "|" number ; lexical tokens, i'm going to specify these in regex
form number = /-?\d+|0x[0-9a-fa-f]+/ cdata = /%{[ ]*c\+\+[ ]*\n(.*?\n?)%}[ ]*(c\+\+)?/s include = /\#include[ \t]+"[^"\n]+"/ nativeid = /[^()\n]+(?=\))/ iid = /[0-9a-fa-f]{8}-[0-9a-fa-f]{4}-[0-9a-fa-f]{4}-[0-9a-fa-f]{12}/ identifier = /unsigned long long|unsigned short|unsigned long|long long|[a-za-z][a-za-z_0-9]*/ ...
Test-Info
the test-info task group runs per-commit, only on mozilla-central. each task generates one or more json-
formatted data files providing detailed in
formation on tests run in continuous integration, typically broken down by bugzilla component. data files are typically consumed by dashboards, like www.arewefissionyet.com. running test-info locally "test-info" is a mach command and can be run from any source tree. ...
... be run from any source tree. test-info has several sub-commands; the "report" sub-command is used by the test-info tasks mozilla-central$ mach help test-info report to reproduce test-info(all): mozilla-central$ mach test-info report --show-tests --show-summary --show-activedata running test-info on try to run these tasks on try, use something like: mach try fuzzy -q test-info contact in
formation test-info is maintained by :gbrown. bugs should be filed in testing :: general. ...
Testing Mozilla code
s memcheck tool) to find memory errors.firefox and address sanitizeraddress sanitizer (asan) is a fast memory error detector that detects use-after-free and out-of-bound bugs in c/c++ programs. it uses a compile-time instrumentation to check all reads and writes during the execution. in addition, the runtime part replaces the malloc and free functions to check dynamically allocated memory. more in
formation on how asan works can be found on the address sanitizer wiki. fuzzing interfacethe fuzzing interface is glue code living in mozilla-central in order to make it easier for developers and security researchers to test c/c++ code with either libfuzzer or afl-fuzz.measuring code coverage on firefoxcode coverage essentially is about measuring how often certain lines are hit, branches taken or ...
... ...
Mail client architecture overview
dule consists of the following basic building blocks account management - the account manager is the root object of the server/folder/message hierarchy. it manages individual accounts on mail servers and the identity of users as used to send mail. folders - mail folders contain messages and folders. all folders have folder indexes. messages - messages are always stored and streamed in rfc822
format. whenever multiple messages are stored in one file, the berkeley mailbox
format is used. datasources - datasources are the glue code that reflect mail data such as folders and messages into rdf. rdf will use the datasource to create user interfaces based on this data. datasources are also used to run commands that operate on this mail data. events - as data changes throughout the mail applica...
...urces are also used to run commands that operate on this mail data. events - as data changes throughout the mail application, the event system notifies key components such as datasources and the url system of these changes. mail window management - each mail window maintains a certain amount of state to aid in view navigation, progress display, etc. url display and dispatching - in order to per
form network operations such as downloading new mail, copying and moving messages, and displaying messages from a remote server, the url system interacts with necko and reflects it's state to the mail window. there are also a number of protocol independant subsystems that have a symbiotic relationship with base: libmime - for dealing with rfc822 messages and their mime parts. this library has the...
The libmime module
itself, and/or handing the input data off to one of its child objects. the definition of these classes is somewhat idiosyncratic and consists of an internally defined object system, instead of c++. 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. struct foobarclass { parentclass superclass; ...any callbacks or class-variables... }; class definit...
...is file needs to reference them by name; all references to these routines should be through the class object. extern int foobarmethod(foobar *); ...etc... class initialization function the mimedefclass macro expects us to define a function which will finish up any initialization of the class object that needs to happen before the first time it is instantiated. its name must be of the
form "<class>initialize", and it should initialize the various method slots in the class as appropriate. any methods or class variables which this class does not wish to override will be automatically inherited from the parent class (by virtue of its class-initialization function having been run first.) each class object will only be initialized once. static int foobarclassinitialize(fooba...
Adding items to the Folder Pane
each time the folder pane determines that it is necessary to invalidate all its data (because of too many changes, or more commonly because the folder pane's "mode" (aka view) has changed), a "rebuild" occurs. when this happens, the folder pane consults the map-generator for the current mode, and that generator returns the necessary data for the folder pane's display. this data is returned in the
form of an array of folder-tree-items. listening for folder pane rebuilds every time the folder pane rebuilds, it fires a "maprebuild" event, which is the ideal opportunity for extensions to step in and modify the display data. the following code snippet listens for that event: let gnumbersext = { load: function gne_load() { window.removeeventlistener("load", gnumbersext.load, false); let...
...ay of folder-tree-items. each item in this array satisfies the following interface: id (attribute) a unique string for this object. must persist over sessions text (attribute) the text to display in the tree level (attribute) the level in the tree to display the item at open (rw, attribute) whether or not this container is open children (attribute) an array of child items also con
forming to this spec getproperties (function) a call from getrowproperties or getcellproperties for this item will be passed into this function command (function) this function will be called when the item is double-clicked for our example extension, two different types of folder-tree-items will be defined. first, our "numbers" container looks like this: let containerrow = { _number...
Building a Thunderbird extension 1: introduction
thunderbird is a community managed open-source email application. it shares many of the technologies used by mozilla firefox, including javascript, the gecko layout engine, the xul xml user interface language and the xpcom cross-plat
form component object model. similar to firefox, thunderbird functionality can be enhanced and customized via extensions. warning: this content is for older versions of thunderbird. much of it may no longer be relevant. see developer.thunderbird.net for newer in
formation. this tutorial will introduce you to the components of a thunderbird extension and will show you how to build your own. the tutorial has the following pages: introduction (this page) the extension filesystem (setting up your local system) install manifest (the install.rdf file that co...
...rd. much of it may no longer be relevant. see developer.thunderbird.net for newer in
formation. this tutorial will introduce you to the components of a thunderbird extension and will show you how to build your own. ...
Building a Thunderbird extension 2: extension file layout
extensions are packaged and distributed in archive files (also known as bundles), with the xpi (pronounced “zippy”) file extension. at a minimum, they contain an install.rdf, the chrome.manifest and a chrome/ folder. a content/ folder sometimes contains the actual content files. these files contain the code that makes your extension actually do something. ...
... //created in step 6 /chrome/locale/* //building an extension# localization /chrome/skin/ /defaults/preferences/ //building an extension# defaults files the following tutorial pages will explain how to write each of these files (except locale/ and defaults/) and package them into an xpi (zippy) file. you can find in
formation about the locale/ and defaults/ folders in the more general "building an extension" documentation. to start with the tutorial, manually create the initial directory structure for the extension as it is depicted above in a folder called myfirstext@jen.zed. this directory could be created anywhere on your filesystem. « previous next » ...
Building a Thunderbird extension 6: Adding JavaScript
in this step we will create a small piece of javascript code that inserts the current date into our statusbar widget. the statusbar is usually displayed at the bottom of the thunderbird window. depending on the installed theme the result will look something like this: modify xul elements with javascript save the following javascript code into the content/ folder next to your myhelloworld.xul file and name it overlay.js. ...
...; mypanel.label = "date: " + datestring; } the first part registers a new event listener that will be executed automatically when thunderbird loads. the event listener then calls our startup function which gets our <statusbarpanel>-element with the id my-panel from the document's dom tree. it then uses javascript's date class to get the current date, which it converts into a string that has the
format of yyyy.mm.dd. because the month is zero-based we also need to add one to the month. finally the label of our panel is set to "date: " and concatenated with the date string that contains the
formatted date. we use the function window.setinterval to update the date in case thunderbird is left running for more than one day. this allows us to call the startup function repeatedly with an interval ...
Thunderbird extensions
d email client. there are similarities with firefox extensions, but there are also differences that may confound the starting thunderbird developer. this documention series focuses on thunderbird. need personalized help? see community / communications. warning: this content is for older versions of thunderbird. much of it may no longer be relevant. see developer.thunderbird.net for newer in
formation. documentation getting started with thunderbird a brave, young developer wants to develop an add-on for thunderbird. these links to help through this journey. start by reading the tutorial and learn how to build a thunderbird extension. also see thunderbird 57-60 add-ons guide for changes introduced in thunderbird 60. read about the main windows ...
.... etc. gloda is extremely powerful and is used heavily by add-ons such as thunderbird conversations. learn more about gloda: an overview of gloda how to create your first message query and read the gloda examples gloda internals: gloda debugging, gloda indexing more thunderbird-specific links some links may be out of date, but they still provide valuable in
formation on the codebase. an overview of thunderbird components developer reference docs: folder classes db views (message list) message summary database mailnews protocols mailnews filters error reporting tools steel library (obsolete as of thunderbird 52, use https://github.com/protz/thunderbird-stdlib) developin...
Thunderbird
thunderbird is a mail/messaging application managed and developed by the thunderbird community. these pages document thunderbird and the mailnews backend which is also used in other projects such as seamonkey and postbox. thunderbird is built on the same technical plat
form as the firefox web browser. currently one of the most popular open source email clients, it is used by tens of millions of people around the world to bring together all their email accounts, chat, newsgroup and feed reading in a familiar high-productivity environment. (from early 2007 to early 2011 thunderbird was developed by mozilla messaging, a subsidiary owned by mozilla.) documentation building thunderbird in
formation about building thunderbird with the comm-central repository. th...
...nd the world to bring together all their email accounts, chat, newsgroup and feed reading in a familiar high-productivity environment. (from early 2007 to early 2011 thunderbird was developed by mozilla messaging, a subsidiary owned by mozilla.) documentation building thunderbird in
formation about building thunderbird with the comm-central repository. there's also in
formation about how the review process works and how to use the mozilla symbol server to help with debugging. mailnews protocols rough documentation about mail protocols.. database views backend in
formation about nsimsgdbview and related interfaces. thunderbird api documentation thunderbird api documentation extension documentation tutorials and tips for buildin...
Using the Mozilla symbol server
\progra~1\mozill~1\* /s srv*c:\symcache\*https://symbols.mozilla.org/ note the \* after the mozilla directory. the output of this command should be similar to: symchk: fullsoft.dll failed - image is split correctly, but fullsoft.dbg is missing symchk: qfaservices.dll failed - qfaservices.pdb mismatched or not found symchk: talkback.exe failed - built without debugging in
formation. symchk: helper.exe failed - built without debugging in
formation. symchk: failed files = 4 symchk: passed + ignored files = 179 downloading symbols on linux / mac os x if you are on linux and running gdb 7.9 or newer, you can use this gdb python script to automatically fetch symbols. you will need to source this script before loading symbols (the part where it spends a few sec...
...a python script to download symbols from the mozilla symbol server for gdb, shark and other software that uses symbols. note that the symbol file for the xul library is very large and takes some time to download. this may make it appear as if the script has gotten stuck, but it will continue. symbol indices are named like so: symbols.mozilla.org/{lowercased:name}/{lowercased:name}-{version}-{plat
form}-{buildid}-symbols.txt. the plat
form is either 'darwin' (for mac) or 'linux'. the rest of values are based on the contents of the application.ini file under the [app] heading: for example, the thunderbird 3.1b2 release with name=thunderbird, version=3.1b2, buildid=20100430125415 would have a filename of "thunderbird-3.1b2-linux-20100430125415-symbols.txt" under the thunderbird directory at symbol...
Virtualenv
you are working on. you will obviate the need to have access to your system packages and you won't mess up your system packages with whatever code you install into the site-packages directory of the virtualenv. site-packages should mostly be for system-installed python and not python that you are installing as a user. this page is mostly a stub for how virtualenv is used at mozilla. for more in
formation on virtualenv in general, see the virtualenv web site. python packaging at mozilla is covered in python. getting virtualenv virtualenv is a python package. you can download it from its pypi package page or install it with easy_install. the github virtualenv repository is maintained by the python packaging authority (including mozilla's tarek ziade and ian bicking). if you have git instal...
...te_virtualenv.py script, when invoked, installs a list of packages, http://mxr.mozilla.org/mozilla-central/source/build/virtualenv/packages.txt , into the virtualenv via one of various methods. the mozilla build system mostly uses .pth files instead of the more typically used python setup.py develop or python setup.py install to install python modules in to the virtualenv's python path due to per
formance concerns (although such functionality is available via the setup.py keyword in a packages.txt file). when using this method, be aware that the parts of package installation invoked via setup.py, such as console-script creation and dependency resolution, will not be invoked. the virtualenv software, mirrored from a canonical version, lives in python/virtualenv. ...
Debugging Tips
printing cdata and ctype currently console.log doesn't show type in
formation of cdata. running the following code shows only partial value in
formation. let { ctypes } = components.utils.import("resource://gre/modules/ctypes.jsm", {}); let i = ctypes.int32_t(10); console.log(i); let point = ctypes.structtype("point", [{ x: ctypes.int32_t }, { y: ctypes.int32_t }]) let p = point(10, 20); console.log(p); let pp = p.address(); console.log(pp); the result will be as following: cdata { value: 10 } cdata { x: 10, y: 20 } cdata { contents: cdata } to see more descriptive in
formation, you can use .tosource(). let { ctypes } = components.utils.import("resource://gre/modules/ctypes.jsm", {}); let i = ctypes.int32_t(10); console.log(i.tosource()); let point = ctypes.structtype("point", [{ x...
... let { ctypes } = components.utils.import("resource://gre/modules/ctypes.jsm", {}); let i = ctypes.int32_t(10); console.log(i.constructor.tosource()); let point = ctypes.structtype("point", [{ x: ctypes.int32_t }, { y: ctypes.int32_t }]) let p = point(10, 20); console.log(p.constructor.tosource()); let pp = p.address(); cons...
CType
the specific properties and methods on each object vary depending on the data type represented. there are several kinds of types: primitive types these are typical unstructured data, such as the predefined types listed in predefined data types. big integer types the int64 and uint64 types provide access to 64-bit integer values, which javascript doesn't currently support. ...
...e(the_type[, n]). tosource() returns a javascript expression that evaluates to a ctype describing the same c type as this object. string tosource(); parameters none. return value a javascript expression that evaluates to a ctype describing the same c type as this object. example ctypes.uint32_t.tosource() returns "ctypes.uint32_t". tostring() returns a string identifying the type. the
format of this string is "type " + name. string tostring(); parameters none. return value a string identifying the data type. see also arraytype functiontype pointertype structtype type conversion ...
js-ctypes reference
the ctypes object also provides numerous predefined types that correspond to primitives and common typedefs in c. working with libraries to load a library, use ctypes.open(). ...
...distinctions are crucial, and understanding them will alleviate much of the confusion surrounding js-ctypes. calling a type constructor will return a ctype. calling a ctype will return a cdata. you declare the arguments and return value of a native function with ctype objects. you call a native function with cdata objects. other features error-handling js-ctypes supports both errno (on all plat
forms) and getlasterror (on windows plat
forms). callbacks you can pass regular javascript functions as callbacks to native functions. see the callbacks page for details. 64-bit integer handling because javascript number objects can't directly represent every possible 64-bit integer value, js-ctypes provides new types for these. see int64 and uint64. ...
Constants - Plugins
nstance or initiating higher-priority network operations. plug-in version constants constant value description np_version_major 0 major version number; changes with major code release number. np_version_minor 22 minor version number; changes with point release number. version feature constants npvers constant: version feature in
formation value description npvers_has_streamoutput 8 streaming data. npvers_has_notification 9 notification of completion. npvers_has_liveconnect 9 liveconnect. npvers_win16_has_liveconnect 9 liveconnect (win16). npvers_68k_has_liveconnect 11 liveconnect (68k). npvers_has_windowless 11 windowless plug-in. ...
...liveconnect. npvers_win16_has_liveconnect 9 liveconnect (win16). npvers_68k_has_liveconnect 11 liveconnect (68k). npvers_has_windowless 11 windowless plug-in. npvers_has_xpconnect_scripting 13 plug-in is scriptable using xpconnect. npvers_has_npruntime_scripting 14 plug-in is scriptable using npruntime. npvers_has_
form_values 15 nppv
formvalue nppvariables are supported. npvers_has_popups_enabled_state 16 the npn_pushpopupsenabledstate() and npn_poppopupsenabledstate() functions are supported. npvers_has_response_headers 17 npstreams have response headers for http streams. npvers_has_npobject_enum 18 the npclass in question has an enumerate field, which lets you...
Memory - Plugins
er and causes less fragmentation than the standard os memory functions. if the plug-in uses npn_memalloc, the browser is able to manage memory more efficiently because it knows how much memory the plug-in is using at any given time. mac os the mac os browser frequently fills its memory partition with cached data that is purged only as necessary. since npn_memalloc automatically frees cached in
formation if necessary to fulfill a request for memory, calls to npn_memalloc may succeed where direct calls to newptr fail. the npn_memalloc method has the following syntax: void *npn_memalloc (uint32 size); the size parameter is an unsigned long integer that represents the amount of memory, in bytes, to allocate in the browser's memory space. this function returns a pointer to the allocated memo...
... the ptr parameter represents a block of memory previously allocated using npn_memalloc. flushing memory (mac os only) the npn_memflush method frees a specified amount of memory. normally, plug-ins should use npn_memalloc, which automatically frees nonessential memory if necessary to fulfill the request. for communicator 4.0 and later versions, this function is not necessary for the mac os plat
form; npn_memalloc now per
forms memory flushing internally. you need to use npn_memflush only when it is not possible to call npn_memalloc, for example, when calling system methods that allocate memory indirectly. if npn_memalloc is called, calls to npn_memflush have no effect. for example, suppose that the plug-in calls newgworld, and that the call fails because of insufficient memory. the plug-in s...
Plugin Roadmap for Firefox - Plugins
npapi plugins are an obsolete technology, and mozilla has been moving toward a web which doesn't need plugins. the last remaining npapi plugin, adobe flash, has announced an end-of-life plan. to support the transition away from flash, firefox is working with other browsers to progressively and carefully make flash usage less common. below is the roadmap of past and future support for plugins in firefox. schedule june 2016 starting with firefox 47 in june 2016, all plugins other than adobe flash are click-to-activate. users choose which sites are allowed to activate each plugin. in addition, the 64-bit firefox for windows only supports the flash plugin. ...
...xtended support release 52 will continue to support non-flash plugins until early 2018. august 2017 starting with firefox 55 in august 2017, users must choose which sites are allowed to activate the flash plugin. users will have the choice to remember the flash setting per-site. this change will be rolled out progressively during august and september 2017. in order to improve security and per
formance, mozilla will maintain a list of sites which cannot use any plugins. september 2017 starting with firefox 56 in september 2017, firefox for android will remove all support for plugins (bug 1381916). 2019 in september 2019, firefox 69 will remove the "always activate" flash option so we always ask for user permission before activating flash on a website. 2020 in december 2020, flash supp...
Color vision simulation - Firefox Developer Tools
the simulator in the accessibility inspector in firefox developer tools lets you see what a web page would look like to users with various
forms of color vision deficiency (better known as "color blindness"), as well as contrast sensitivity loss. "color blindness" is a bit of a misnomer, since most people with these disorders can see colors, but do not see all of the distinctions that people with normal color vision can see; color vision deficiencies affect perception across the color spectrum, not only of specific colors like red or green. color vision deficiencies affect about 8% of men, and 0.5% of women. ...
...itivity loss. "color blindness" is a bit of a misnomer, since most people with these disorders can see colors, but do not see all of the distinctions that people with normal color vision can see; color vision deficiencies affect perception across the color spectrum, not only of specific colors like red or green. color vision deficiencies affect about 8% of men, and 0.5% of women. the most common
forms of color blindness (commonly lumped together as "red-green color blindness") affect more men than women, because they are due to a mutation in a gene in the x chromosome, which men usually have only one copy of. contrast sensitivity loss can be caused by cataracts, glaucoma, diabetic retinopathy, and other disorders of the retina; it can be age-related, congenital, or due to an injury. to ena...
Inspecting web app manifests - Firefox Developer Tools
your .webmanifest file: <link rel="manifest" href="/manifest.webmanifest"> the .webmanifest extension is recommended in the spec, and should be served with an application/manifest+json mime type, although browsers generally tend to support manifests with other appropriate extensions like .json (mime type: application/json). you also need to make sure the json inside the file is of the correct
format. you can test this using the web manifest validator. inspecting your manifest if your manifest is deployed successfully, you should end up with a display like the following on the manifest view: from here, you can inspect all the in
formation in the manifest in an easy-to-digest way, making sure that it is all correct. it provides a link to the manifest file at the top which when clicked on...
...ith a display like the following on the manifest view: from here, you can inspect all the in
formation in the manifest in an easy-to-digest way, making sure that it is all correct. it provides a link to the manifest file at the top which when clicked on brings up the json in a new tab. it also loads all the icon files into the view, so you can see the relative size of them all, and any other in
formation associated with them. list of manifest members we won't provide an exhaustive list of all the members that can appear in a web manifest here; you can already find that in our web manifest documentation. ...
Use a source map - Firefox Developer Tools
the javascript sources executed by the browser are often trans
formed in some way from the original sources created by a developer. for example: sources are often combined and minified to make delivering them from the server more efficient. javascript running in a page is often machine-generated, as when compiled from a language like coffeescript or typescript. in these situations, it's much easier to debug the original source, rather than the source in the trans
formed state that the browser has downloaded. a source map is a file that maps from the trans
formed source to the original source, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger. to enable the debugger to work with a source map, you must: generate the source map ...
...the comment's syntax is like this: //# sourcemappingurl=http://example.com/path/to/your/sourcemap.map in the video above we load https://mdn.github.io/devtools-examples/sourcemaps-in-console/index.html. this page loads a source called "main.js" that was originally written in coffeescript and compiled to javascript. ...
Set event listener breakpoints - Firefox Developer Tools
d in your browser. use event breakpoints to stop execution at the triggering event for the action that fails, then step through the code or watch the console to see what happens. logging on events in firefox 71 onwards, the “log” checkbox is available in the event listener breakpoints list. selecting this and then choosing some events to break on will mean that when you step through code, in
formation about events fired will be logged to the console instead of the devtools breaking on each one. so if we choose to log keyboard events, for example, the code no longer pauses as each event is fired: instead, we can then switch to the console, and whenever we press a key we are given a log of where related events were fired. there's an issue here — the console is showing that the keyp...
... list. 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. inline variable preview new in firefox 71, the source pane now gives you an instant preview of the variables on each line of code you've stepped through. see set a breakpoint > inline variable preview for more in
formation. ...
UI Tour - Firefox Developer Tools
he line number. conditional breakpoints have an orange arrow. if you're stopped at a breakpoint, the entire line gets a green overlay. in the screenshot below there are three breakpoints: line 82 has a normal breakpoint and execution is paused here line 85 has a logpoint which logs the contents of tablerow to the console line 100 has a conditional breakpoint the third column shows more in
formation about the breakpoints. for example, the logpoint at line 85 logs the value of the tablerow variable to the console and the conditional breakpoint at line 100 breaks if the contents of the todolist is undefined. toolbar at the top of the right-hand pane, there's a toolbar: the toolbar consists of: four buttons to control the debugger's movement through the script: play/pause (f...
...n the developer tools are closed (except in firefox 77, see bug 1640318). inline variable preview: enabled by default, this option displays variable values within the source pane when the debugger is paused. source maps: enabled by default, this option directs the debugger to load the original versions of files, and map them to the generated ones loaded in a page, to ease debugging of transl
formed sources. see use a source map for details. breakpoints list under the toolbar, you'll see all the breakpoints you've set. next to each breakpoint is a checkbox which you can use to enable/disable it: watch expressions you can add watch expressions in the right pane. they will be evaluated when code execution is paused: variable tooltip hover on a variable show a tooltip with its...
Debugger.Object - Firefox Developer Tools
about the referent, or null if none is available. the metadata object is in the same compartment as this debugger.object instance. the same metadata object is returned each time for a given debugger.object instance. a typical javascript embedding provides "host objects" to expose application-specific functionality to scripts. the hostannotations accessor consults the embedding for additional in
formation about the referent that might be of interest to the debugger. the returned object's properties' meanings are up to the embedding. for example, a web browser might provide host annotations for global objects to distinguish top-level windows, iframes, and internal javascript scopes. by convention, host annotation objects have a string-valued "type" property that, taken together with the obje...
...nments to un-writable data properties fail without notifying the debugger. extensionsprevented(frame) the referent has been made non-extensible, as if by a call to object.preventextensions. for all watchpoint handler methods: handler calls receive the handler object itself as the this value. theframe argument is the current stack frame, whose code is about to per
form the operation on the object being reported. if the method returns undefined, then spidermonkey makes the announced change to the object, and continues execution normally. if the method returns an object: if the object has a superseded property whose value is a true value, then spidermonkey does not make the announced change. if the object has a resume property, its valu...
All keyboard shortcuts - Firefox Developer Tools
w increment selected value by 0.1 alt + up arrow (ctrl + up arrow from firefox 60 onwards.) alt + up arrow alt + up arrow (ctrl + up arrow from firefox 60 onwards.) decrement selected value by 0.1 alt + down arrow (ctrl + down arrow from firefox 60 onwards). alt + down arrow alt + down arrow (ctrl + down arrow from firefox 60 onwards). ...
...arrow from firefox 60 onwards). show/hide more in
formation about current property (computed view only, when a property is selected) enter or space return or space enter or space open mdn reference page about current property (computed view only, when a property is selected) f1 f1 f1 open current css file in style editor (computed view only, when more in
formation is shown for a property and a css file reference is focused). enter return enter debugger command windows macos linux close current file ctrl + w cmd + w ctrl + w search for a string in the current file ctrl + f cmd + f ctrl + f search for a string in all files ctrl + shift + f cmd + shift + f ctrl + s...
Inspecting web sockets - Firefox Developer Tools
icates that the server is switching to a web socket connection. clicking on a web socket request opens the usual sidebar to reveal additional details. choose the reponse tab to inspect web socket frames sent and received through the selected connection. the live-updated table shows data for sent (green arrow) and received (red arrow) frames. each frame expands on click, so you can inspect the
formatted data. pausing web socket traffic you can use the pause/resume button in the network monitor toolbar to stop intercepting web socket traffic. this allows you to capture only the frames that you are interested in. filtering web socket frames to focus on specific messages, frames can be filtered using the filter at the top of the messages panel. there are also predefined filters, avail...
...ly messages received from the server (by default, except control messages). control (available starting in firefox 76). displays messages for control frames (ping, pong, or close). this filter can be combined with the others, to display, for example, only messages for control frames sent by the browser. columns in the response pane in the response pane, you can choose to show the following in
formation about each frame: data size time opcode maskbit finbit the data and time columns are visible by default, but you can customize the interface to see more columns by choosing which ones to show from the context menu that is opened by right-clicking in the table header. expanding each message selecting a message in the list shows a preview of the data being sent in that message, a...
Throttling - Firefox Developer Tools
ng dropdown, which allows you to throttle your network speed to emulate various different network speed conditions. simply choose an option from the menu, and it will persist across reloads. 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 per
formance measurements; it's intended to give an approximate idea of the user experience in different conditions. the speeds are expressed in multiples of bits per second. selection download speed upload speed minimum latency (ms) gprs 50 kbps 20 kbps 500 regular 2g 250 kbps 50 kbps 300 good 2g 450 kbps 150 kbps 150 r...
...kbps 250 kbps 100 good 3g 1.5 mbps 750 kbps 40 regular 4g/lte 4 mbps 3 mbps 20 dsl 2 mbps 1 mbps 5 wi-fi 30 mbps 15 mbps 2 network monitor features the following articles cover different aspects of using the network monitor: toolbar network request list network request details network traffic recording per
formance analysis ...
Edit fonts - Firefox Developer Tools
he section and entering a new value. once entered, all of the sample text will be set to the same custom value. variable font support in firefox developer tools firefox 62 added support for variable fonts and firefox 63 features support for editing the properties of variable fonts in the font editor. what are variable fonts? variable fonts, or opentype font variations, define a new font file
format that allows the font designer to include multiple variations of a typeface inside a single font file. that means you no longer have to apply several different web fonts to a single page to represent a complete typeface for which a variable font is available, provided it includes the desired values for the different characteristics you want to vary. variable fonts make it easy to vary font char...
...rent 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. variable fonts make it easy to vary font characteristics in a much more granular fashion because their allowable ranges are defined by axes of variation (see introducing the 'variation axis' for more in
formation). for example, font-weight can be set to any value between 1 and 1000 in variable fonts (although it is not guaranteed that a variable font will support this entire range). there are several registered axes. although it isn't required that these axes be defined for every font, if the font designer does implement a registered axis, its behavior must follow the defined behavior. all variable...
CSS Flexbox Inspector: Examine Flexbox layouts - Firefox Developer Tools
easy access to flexbox layout features. in the html pane in the html pane, an element laid out with flexbox has the word flex next to it as shown in the following image: click the word flex in the html pane to keep the overlay visible when you move the mouse away from the container. in the infobar when you hover over an element in the html pane, you will see a tooltip that gives you more in
formation about the element. when you hover over a flex container or flex item, the tooltip includes the appropriate in
formation. this header is a flex container: each navbar link is a flex item: the nav element within the header is both a flex item and a flex container which holds the navigation links: in the css pane in the css pane's rules view, any instance of a display: flex declaration ...
...d side of the flex container section will also toggle the overlay on and off. flex item properties the flex items within the flex container are displayed as a numbered list in the flex items section. each entry displays the item's selector. hover over an element to highlight it on the page. ...
Page inspector keyboard shortcuts - Firefox Developer Tools
w increment selected value by 0.1 alt + up arrow (ctrl + up arrow from firefox 60 onwards.) alt + up arrow alt + up arrow (ctrl + up arrow from firefox 60 onwards.) decrement selected value by 0.1 alt + down arrow (ctrl + down arrow from firefox 60 onwards). alt + down arrow alt + down arrow (ctrl + down arrow from firefox 60 onwards). ...
... enter return enter global shortcuts these shortcuts work in all tools that are hosted in the toolbox. ...
Sorting algorithms comparison - Firefox Developer Tools
iteratively (200 iterations) generates a randomized array and calls sort(). sort() calls each of bubblesort(), selectionsort(), quicksort() in turn and logs the result. bubblesort() implements a bubble sort, returning the sorted array. selectionsort() implements a selection sort, returning the sorted array. ...
...of course, you can generate your own profile, too, but the numbers will be a little different. ...
Flame Chart - Firefox Developer Tools
this gives you a way to know exactly which function was executing at any point during the recording, how long it ran for, and where it was called from. the call tree and the flame chart are both used to analyze your site's javascript, and they both use the same data: a sample of the javascript engine's stack, taken periodically during the recording. ...
...rs underneath bubblesort() are the calls to swap(). if you counted them all, the call tree view tells us that you'd see 253 of them. all the ones in this zoom are underneath bubblesort(), but according to the call tree view, the profile does contain one under selectionsort(). we can also see that two of the green markers are for selectionsort() and quicksort(), but we're also seeing calls to plat
form (gecko) code in between our calls to the sorting functions. it seems very likely that this is from the console.log() calls in sort(). ...
Settings - Firefox Developer Tools
is included in firefox and used by several developer tools, including scratchpad and the style editor. detect indentation auto-indent new lines based on the current indentation. autoclose brackets determines whether typing an opening character like [ or { will cause the editor to insert the matching closing character ] or } for you. ...
...racter ] or } for you. indent using spaces when checked, indentation will be per
formed using spaces, when off, the editor will use tabs instead. tab size the frequency of tab stops in the editor. select 2, 4, or 8. keybindings choose the default codemirror keybindings or keybindings from one of several popular editors: vim emacs sublime text advanced settings show gecko plat
form data a setting to control whether or not profiles should include gecko plat
form symbols. disable http cache disable the browser http cache to simulate first-load per
formance in all tabs that have the toolbox open. this setting persists, meaning that if it is set, caching will be disabled whenever you reopen the devtools. caching is re-enabled when the devtools are closed. note that service ...
Tips - Firefox Developer Tools
to create a tempn variable for it. cd switches the javascript evaluation context to a different iframe in the page. console.table() displays tabular data as table. help opens the mdn page describing the available commands. :screenshot <filename.png> --fullpage saves a screenshot to your downloads directory using the optional file name. if no filename is included, the file name will be in this
format: screen shot date at time.png the --fullpage parameter is optional. if you include it, the screenshot will be of the whole page, not just the section visible in the browser windows. the file name will have -fullpage appended to it as well. see web console helpers for all parameters. in the console output: click on the inspector icon () next to an element in the output to select i...
...t pane toggles the visibility of a style sheet. click an @media rule to apply it in responsive design mode. click the import button () to import a style sheet or the create button () to create a new one. click the options button in the style sheet pane and click "show original sources" to toggle the display of css preprocessor files. network monitor click the request summary to compare per
formance of cache vs. no-cache page loading. when a request is selected click "edit and resend" to modify its headers and send it again. check "enable persistent logs" in the settings to keep requests from before even after navigation. hover the "js" icon within the "cause" column to see the javascript stack trace, which caused the request. check "disable http cache (when toolbox is open)" in the ...
Validators - Firefox Developer Tools
d html. w3c css validator the w3c css validator will validate the css within any web page or external css files according to the w3c css standards. w3c rdf validator the rdf validator service will validate the rdf/xml contained on a given uri. link checker this tool will check links on a given web page. html tidy html tidy is a tool that can be used to report errors in an html page and to
format web pages for better reading. (some authoring software, such as html-kit, builds in html tidy which makes validation quick and easy.) html validator pro this is an automated html5 checker using the same validator as the w3c. provide a starting url and the tool will find and validate all pages in a website. accessibility services lynx viewer checks a web page using lynx visualization and al...
... ...
Rich output - Firefox Developer Tools
when the web console prints objects, it includes a richer set of in
formation than just the object's name. in particular, it: provides extra in
formation for certain types enables detailed examination of the object's properties provides richer in
formation 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. click on the trian...
... you get slightly different content. ...
The JavaScript input interpreter - Firefox Developer Tools
any_type is used. keys() given an object, returns a list of the keys (or property names) on that object. this is a shortcut for object.keys. values() given an object, returns a list of the values on that object; serves as a companion to keys(). clear() clears the console output area. inspect() given an object, opens the object inspector for that object. pprint() obsolete since gecko 74
formats the specified value in a readable way; this is useful for dumping the contents of objects and arrays. help()deprecated since gecko 62 :help displays help text. actually, in a delightful example of recursion, it will bring you to this page. cd() switch javascript evaluation context to a different iframe in the page. this helper accepts multiple different ways of identifying the frame to ...
... ...
AnalyserNode.fftSize - Web APIs
syntax var curvalue = analysernode.fftsize; analysernode.fftsize = newvalue; value an unsigned integer, representing the window size of the fft, given in number of samples. a higher value will result in more details in the frequency domain but fewer details in the time domain. must be a power of 2 between 252^5 and 2152^15, so one of: 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, and 32768. defaults to 2048. ...
...value is not a power of 2, or it is outside the specified range, a domexception with the name indexsizeerror is thrown. example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input. for more complete applied examples/in
formation, check out our voice-change-o-matic demo (see app.js lines 128–205 for relevant code). var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); ... analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount ; var dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscillo...
AnalyserNode.frequencyBinCount - Web APIs
. this generally equates to the number of data values you will have to play with for the visualization. syntax var arraylength = analysernode.frequencybincount; value an unsigned integer, equal to the number of values that analysernode.getbytefrequencydata() and analysernode.getfloatfrequencydata() copy into the provided typedarray. for technical reasons related to how the fast fourier trans
form is defined, it is always half the value of analysernode.fftsize. therefore, it will be one of 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, and 16384. example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style" output of the current audio input. ...
...lue of analysernode.fftsize. therefore, it will be one of 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, and 16384. example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style" output of the current audio input. for more complete applied examples/in
formation, check out our voice-change-o-matic demo (see app.js lines 128–205 for relevant code). var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); analyser.mindecibels = -90; analyser.maxdecibels = -10; ... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8ar...
AnalyserNode.getByteTimeDomainData() - Web APIs
if the array has fewer elements than the analysernode.fftsize, excess elements are dropped. if it has more elements than needed, excess elements are ignored. ...
...ess elements are dropped. if it has more elements than needed, excess elements are ignored. return value void | none example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input. for more complete applied examples/in
formation, check out our voice-change-o-matic demo (see app.js lines 128–205 for relevant code). const audioctx = new (window.audiocontext || window.webkitaudiocontext)(); const analyser = audioctx.createanalyser(); ... analyser.fftsize = 2048; const bufferlength = analyser.fftsize; const dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscillosco...
AnalyserNode.getFloatFrequencyData() - Web APIs
ta() method of the analysernode interface copies the current frequency data into a float32array array passed into it. each item in the array represents the decibel value for a specific frequency. the frequencies are spread linearly from 0 to 1/2 of the sample rate. for example, for 48000 sample rate, the last item of the array will represent the decibel value for 24000 hz. if you need higher per
formance and don't care about precision, you can use analysernode.getbytefrequencydata() instead, which works on a uint8array. syntax var audioctx = new audiocontext(); var analyser = audioctx.createanalyser(); var dataarray = new float32array(analyser.frequencybincount); // float32array should be the same length as the frequencybincount void analyser.getfloatfrequencydata(dataarray); // fill the f...
...oatfrequencydata() analyser.getfloatfrequencydata(mydataarray); drawing a spectrum the following example shows basic usage of an audiocontext to connect a mediaelementaudiosourcenode to an analysernode. while the audio is playing, we collect the frequency data repeatedly with requestanimationframe() and draw a "winamp bargraph style" to a <canvas> element. for more complete applied examples/in
formation, check out our voice-change-o-matic-float-data demo (see the source code too). <!doctype html> <body> <script> const audioctx = new audiocontext(); //create audio source //here, we use an audio file, but this could also be e.g. microphone input const audioele = new audio(); audioele.src = 'my-audio.mp3';//insert file name here audioele.autoplay = true; audioele.preload = 'auto'; const audi...
AnalyserNode.getFloatTimeDomainData() - Web APIs
if the array has fewer elements than the analysernode.fftsize, excess elements are dropped. if it has more elements than needed, excess elements are ignored. ...
...t, excess elements are dropped. if it has more elements than needed, excess elements are ignored. return value none. example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input. for more complete applied examples/in
formation, check out our voice-change-o-matic-float-data demo (see the source code too). var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); ... analyser.fftsize = 1024; var bufferlength = analyser.fftsize; console.log(bufferlength); var dataarray = new float32array(bufferlength); canvasctx.clearrect(0, 0, width, height); function d...
Animation.commitStyles() - Web APIs
the commitstyles() method of the web animations api's animation interface commits the end styling state of an animation to the element being animated, even after that animation has been removed. it will cause the end styling state to be written to the element being animated, in the
form of properties inside a style attribute. syntax animation.commitstyles(); parameters none. return value none. ...
...r that animation has been removed. it will cause the end styling state to be written to the element being animated, in the
form of properties inside a style attribute. syntax animation.commitstyles(); parameters none. return value none. examples const divelem = document.queryselector('div'); document.body.addeventlistener('mousemove', evt => { let anim = divelem.animate( { trans
form: `translate(${ evt.clientx}px, ${evt.clienty}px)` }, { duration: 500, fill: 'forwards' } ); anim.commitstyles(); }); specifications specification status comment web animationsthe definition of 'commitstyles()' in that specification. working draft ...
AudioConfiguration - Web APIs
tion dictionary of the media capabilities api defines the audio file being tested when calling mediacapabilities.encodinginfo() or mediacapabilities.decodinginfo() to query whether a specific audio configuration is supported, smooth, and/or power efficient. properties the audioconfiguration dictionary is made up of four audio properties, including: contenttype: a valid audio mime type, for in
formation on possible values and what they mean, see the web audio codec guide. channels: the number of channels used by the audio track. bitrate: the number of bits used to encode one second of the audio file. samplerate: the number of audio samples making up one second of the audio file. examples //create media configuration to be tested const mediaconfig = { type : 'file', // 'record', ...
... const mediaconfig = { type : 'file', // 'record', 'transmission', or 'media-source' audio : { contenttype : "audio/ogg", // valid content type channels : 2, // audio channels used by the track bitrate : 132700, // number of bits used to encode 1s of audio samplerate : 5200 // number of audio samples making up that 1s. ...
AudioTrackList.onchange - Web APIs
to determine the new state of media's tracks, you'll have to look at their audiotrack.enabled flags. note: you can also add a handler for the change event using addeventlistener(). ...
...to determine the new state of media's tracks, you'll have to look at their audiotrack.enabled flags. note: you can also add a handler for the change event using addeventlistener(). ...
AudioWorkletProcessor.process - Web APIs
t. the method should return false as soon as it's known that it will no longer produce an output. for example, take the audiobuffersourcenode — the processor behind such a node should return true from the process method while the buffer is playing, and start returning false when the buffer playing has ended (there's no way to call play on the same audiobuffersourcenode again). a node that trans
forms its input. a processor implementing such a node should return false from the process method to allow the presence of active input nodes and references to the node to determine whether it can be garbage-collected. an example of a node with this behaviour is the gainnode. as soon as there are no inputs connected and references retained, gain can no longer be applied to anything, so it can be safel...
...uch a node should return false from the process method to allow the presence of active input nodes and references to the node to determine whether it can be garbage-collected. an example of a node with this behaviour is the gainnode. as soon as there are no inputs connected and references retained, gain can no longer be applied to anything, so it can be safely garbage-collected. a node that trans
forms its input, but has a so-called tail-time — this means that it will produce an output for some time even after its inputs are disconnected or are inactive (producing zero-channels). a processor implementing such a node should return true from the process method for the period of the tail-time, beginning as soon as inputs are found that contain zero-channels. an example of such a node is the del...
AuthenticatorAssertionResponse.authenticatorData - Web APIs
syntax var authnrdata = authenticatorassertionresponse.authenticatordata; value an arraybuffer that has a arraybuffer.bytelength of at least 37 bytes, containing the following fields: rpidhash (32 bytes) - a sha256 hash of the relying party id that was seen by the browser. ...
... bytes of the authenticatordata if no attestedcredentialdata is present. signcount (4 bytes) - a signature count from the authenticator. the server will use this counter to detect authenticator cloning. attestedcredentialdata (variable length) - the credential that was created. this is only present during a navigator.credentials.create() call. this is a sequence of bytes with the following
format: aaguid (16 bytes) - authenticator attestation globally unique identifier, a unique number that identifies the model of the authenticator (not the specific instance of the authenticator) so that a relying party can understand the characteristics of the authenticator by looking up its metadata statement. credentialidlength (2 bytes) - the length of the credential id that immediately fol...
AuthenticatorAttestationResponse.attestationObject - Web APIs
esponse.authenticatordata field is used by both authenticatorattestationresponse and by authenticatorassertionresponse. when used in attestation, it contains an optional field, attestedcredentialdata. this field is not included when used in the authenticatorassertionresponse. the attestedcredentialdata field contains the credentialid and credentialpublickey. fmt a text string that indicates the
format of the attstmt. the webauthn specification defines a number of
formats; however,
formats may also be defined in other specifications and registered in an iana registry.
formats defined by webauthn are: "packed" "tpm" "android-key" "android-safetynet" "fido-u2f" "none" attstmt a an attestation statement that is of the
format defined by "fmt". for now, see the webauthn specif...
...thn specification defines a number of
formats; however,
formats may also be defined in other specifications and registered in an iana registry.
formats defined by webauthn are: "packed" "tpm" "android-key" "android-safetynet" "fido-u2f" "none" attstmt a an attestation statement that is of the
format defined by "fmt". for now, see the webauthn specification for details on each
format. examples var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(function (newcredentialinf...
BasicCardResponse - Web APIs
ate a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options. the first of these three (supportedinstruments in the example below) contains a data property that has to con
form to the structure defined by the basiccardrequest dictionary. var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supportedtypes: ['credit', 'debit'] } }]; var details = { total: {label: 'donation', amount: {currency: 'usd', value: '65.00'}}...
.../ do something with the error from request.show(). }); } catch (e) { // catch any other errors. } once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details. this has to con
form to the structure defined by the basiccardresponse dictionary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'mr. dick straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification...
BluetoothDevice - Web APIs
removed from chrome 52. bluetoothdevice.addata read only an instance of bluetoothadvertisingdata containing the most recent advertising data received for the device. bluetoothdevice.deviceclass read only a number representing the bluetooth devices "class of device". bluetoothdevice.vendoridsource read only the vendor id source field in the pnp_id characteristic in the device_in
formation service. bluetoothdevice.vendorid read only the 16-bit vendor id field in the pnp_id characteristic in the device_in
formation service. bluetoothdevice.productid read only the 16-bit product id field in the pnp_id characteristic in the device_in
formation service. bluetoothdevice.productversion read only the 16-bit product version field in the pnp_id characteristic in the dev...
... bluetoothdevice.paired read only a boolean value indicating whether the device is paired with the system. bluetoothdevice.gattserver read only a reference to the device's gatt server or null if the device is disconnected. ...
CSSStyleValue.parse() - Web APIs
alues and returns the first value as a cssstylevalue object. syntax cssstylevalue.parse(property, csstext) parameters property a css property to set. csstext a comma-separated string containing one or more values to apply to the provided property. return value a cssstylevalue object containing the first supplied value. ...
...arated string containing one or more values to apply to the provided property. return value a cssstylevalue object containing the first supplied value. example the code below parses a set of declarations for the trans
form property. the second code block shows the structure of the returned object as it would be rendered in a developer tools console. const css = cssstylevalue.parse( 'trans
form', 'translate3d(10px,10px,0) scale(0.5)'); csstrans
formvalue {0: csstranslate, 1: cssscale, length: 2, is2d: false} specifications specification status comment css typed om level 1the definition of 'parse()' in that specification. working draft initial definition. ...
Cache.matchAll() - Web APIs
hen(function(response) { // do something with the response array }); parameters request optional the request for which you are attempting to find responses in the cache. this can be a request object or a url. if this argument is omitted, you will get a copy of all responses in this cache. options optional an options object allowing you to set specific control options for the matching per
formed. the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url. if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when per
forming a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (norm...
...if the url matches you will get a match regardless of the response object having a vary header or not. it defaults to false. return value a promise that resolves to an array of all matching responses in the cache object. ...
Cache - Web APIs
are available via the storageestimate api. the browser does its best to manage disk space, but it may delete the cache storage for an origin. the browser will generally delete all of the data for an origin or none of the data for an origin. make sure to version caches by name and use the caches only from the version of the script that they can safely operate on. see deleting old caches for more in
formation. note: the key matching algorithm depends on the vary header in the value. so matching a new key requires looking at both key and value for entries in the cache. note: the caching api doesn't honor http caching headers. methods cache.match(request, options) returns a promise that resolves to the response associated with the first matching request in the cache object. cache.matcha...
...rty of the serviceworkerglobalscope. it holds the cachestorage object, by which it can access the cachestorage interface. this is an implementation of the windoworworkerglobalscope mixin. note: in chrome, visit chrome://inspect/#service-workers and click on the "inspect" link below the registered service worker to view logging statements for the various actions the service-worker.js script is per
forming. var cache_version = 1; var current_caches = { font: 'font-cache-v' + cache_version }; self.addeventlistener('activate', function(event) { // delete all caches that aren't named in current_caches. // while there is only one cache in this example, the same logic will handle the case where // there are multiple versioned caches. var expectedcachenamesset = new set(object.values(curre...
CanvasRenderingContext2D.translate() - Web APIs
parameters x distance to move in the horizontal direction. positive values are to the right, and negative to the left. y distance to move in the vertical direction. positive values are down, and negative are up. examples moving a shape this example draws a square that is moved from its default position by the translate() method. ...
...vas id="canvas"></canvas> javascript the translate() method translates the context by 110 horizontally and 30 vertically. the first square is shifted by those amounts from its default position. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // moved square ctx.translate(110, 30); ctx.fillstyle = 'red'; ctx.fillrect(0, 0, 80, 80); // reset current trans
formation matrix to the identity matrix ctx.settrans
form(1, 0, 0, 1, 0, 0); // unmoved square ctx.fillstyle = 'gray'; ctx.fillrect(0, 0, 80, 80); result the moved square is red, and the unmoved square is gray. specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.translate' in that specification. living standard ...
A basic ray-caster - Web APIs
the nifty <canvas> element i'd been reading about was not only soon to be supported in firefox, but was already supported in the current version of safari, i had to try a little experiment. the canvas overview and tutorial i found here at mdn are great, but nobody had written about animation yet, so i thought i'd try a port of a basic raycaster i'd worked on a while ago, and see what sort of per
formance we can expect from a javascript-controlled pixel buffer. how? the basic idea is to use setinterval() at some arbitrary delay that corresponds to a desired frame rate. after every interval an update function will repaint the canvas showing the current view. i know i could have started with a simpler example, but i'm sure the canvas tutorial will get to that, and i wanted to see if i could do...
...rizon line. the code i ended up with is a regurgitated amalgam of the raycaster chapters from an old andré lamothetricks of the game programming gurus book (isbn: 0672305070), and a java raycaster i found online, filtered through my compulsion to rename everything so it makes sense to me, and all the tinkering that had to be done to make things work well. results the canvas in safari 2.0.1 per
formed surprisingly well. with the blockiness factor cranked up to render slivers 8 pixels wide, i can run a 320 x 240 window at 24 fps on my apple mini. firefox 1.5 beta 1 is even faster; i can run 320 x 240 at 24 fps with 4 pixel slivers. not exactly a new member of the id software family, but pretty decent considering it's a fully interpreted environment, and i didn't have to worry about memory all...
Hit regions and accessibility - Web APIs
canvas content is not exposed to accessibility tools like semantic html is. in general, you should avoid using canvas in an accessible website or app. the following guidelines can help to make it more accessible. fallback content the content inside the <canvas> ... </canvas> tags can be used as a fallback for browsers which don't support canvas rendering. it's also very useful for assistive technology users (like screen readers) which can read and interpret the sub dom in it. ...
...e full circle can be seen underneath.</p> </canvas> see the video how nvda reads this example by steve faulkner. aria rules accessible rich internet applications (aria) defines ways to make web content and web applications more accessible to people with disabilities. you can use aria attributes to describe the behavior and purpose of the canvas element. see aria and aria techniques for more in
formation. <canvas id="button" tabindex="0" role="button" aria-pressed="false" aria-label="start game"></canvas> hit regions whether the mouse coordinates are within a particular area on the canvas, is a common problem to solve. the hit region api allows you to define an area of your canvas and provides another possibility to expose interactive content on a canvas to accessibility tools. it allows...
console.assert() - Web APIs
if the assertion is false, the message is written to the console. obj1 ... ...
...en to the console. obj1 ... objn a list of javascript objects to output. the string representations of each of these objects are appended together in the order listed and output. msg a javascript string containing zero or more substitution strings. subst1 ... substn javascript objects with which to replace substitution strings within msg. this parameter gives you additional control over the
format of the output. examples the following code example demonstrates the use of a javascript object following the assertion: const errormsg = 'the # is not even'; for (let number = 2; number <= 5; number += 1) { console.log('the # is ' + number); console.assert(number % 2 === 0, {number: number, errormsg: errormsg}); // or, using es2015 object property shorthand: // console.asser...
console.log() - Web APIs
eference to the object, which is not necessarily the 'value' of the object at the moment in time you call console.log(), but it is the value of the object at the moment you open the console. msg a javascript string containing zero or more substitution strings. subst1 ... substn javascript objects with which to replace substitution strings within msg. this gives you additional control over the
format of the output. see outputting text to the console in the documentation of console for details. difference between log() and dir() you might ask yourself what's the difference between console.dir() and console.log(). another useful difference in chrome exists when sending dom elements to the console. notice: console.log prints the element in an html-like tree console.dir prints the e...
...her useful difference in chrome exists when sending dom elements to the console. notice: console.log prints the element in an html-like tree console.dir prints the element in a json-like tree specifically, console.log gives special treatment to dom elements, whereas console.dir does not. this is often useful when trying to see the full representation of the dom js object. there's more in
formation in the chrome console api reference about this and other functions. logging objects don't use console.log(obj), use console.log(json.parse(json.stringify(obj))). this way you are sure you are seeing the value of obj at the moment you log it. otherwise, many browsers provide a live view that constantly updates as values change. this may not be what you want. specifications speci...
Console API - Web APIs
concepts and usage the console api started as a largely proprietary api, with different browsers implementing it, albeit it in inconsistent ways. the console api spec was created to define consistent behavior, and all modern browsers eventually settled on implementing this behavior — although some implementations still have their own additional proprietary functions. ...
...is behavior — although some implementations still have their own additional proprietary functions. find out about these at: google chrome devtools implementation safari devtools implementation usage is very simple — the console object — available via window.console, or workerglobalscope.console in workers; accessible using just console — contains many methods that you can call to per
form rudimentary debugging tasks, generally focused around logging various values to the browser's web console. by far the most commonly-used method is console.log, which is used to log the current value contained inside a specific variable. interfaces console provides rudimentary debugging functionality, including logging, stack traces, timers, and counters. examples let mystring = 'hello wo...
Content Index API - Web APIs
tent indexing. serviceworkerregistration.index read only returns a reference to the contentindex interface for indexing cached pages. serviceworkerglobalscope.oncontentdelete an event handler fired whenever a contentdelete event occurs. this happens when content is removed by the user agent. examples all the following examples assume a service worker has been registered. for more in
formation see the service worker api. feature detection and interface access here we get a reference to the serviceworkerregistration, then check for the index property, which gives us access to the content index interface. // reference registration const registration = await navigator.serviceworker.ready; // feature detection if ('index' in registration) { // content index api functionality ...
...registration, then check for the index property, which gives us access to the content index interface. // reference registration const registration = await navigator.serviceworker.ready; // feature detection if ('index' in registration) { // content index api functionality const contentindex = registration.index; } adding to the content index here we're declaring an item in the correct
format and creating an asynchronous function which uses the add() method to register it with the content index. // our content const item = { id: 'post-1', url: '/posts/amet.html', title: 'amet consectetur adipisicing', description: 'repellat et quia iste possimus ducimus aliquid a aut eaque nostrum.', icons: [{ src: '/media/dark.png', sizes: '128x128', type: 'image/png', }], ...
Crypto.getRandomValues() - Web APIs
the pseudo-random number generator algorithm (prng) may vary across user agents, but is suitable for cryptographic purposes. ...
...ning in a secure context. there is no minimum degree of entropy mandated by the web cryptography specification. user agents are instead urged to provide the best entropy they can when generating random numbers, using a well-defined, efficient pseudorandom number generator built into the user agent itself, but seeded with values taken from an external source of pseudorandom numbers, such as a plat
form-specific random number function, the unix /dev/urandom device, or other source of random or pseudorandom data. examples /* assuming that window.crypto.getrandomvalues is available */ var array = new uint32array(10); window.crypto.getrandomvalues(array); console.log("your lucky numbers:"); for (var i = 0; i < array.length; i++) { console.log(array[i]); } specification specificati...
DOMConfiguration - Web APIs
note: this interface has never been supported in gecko, and has been removed from the dom specification. ...
... removed from the dom specification. ...
DOMHighResTimeStamp - Web APIs
place. if the script's global object is a workerglobalscope (that is, the script is running as a web worker), the time origin is the moment at which the worker was created. in all other cases, the time origin is undefined. methods this type has no methods. ...
...fined. methods this type has no methods. usage notes you can get the current timestamp value—the time that has elapsed since the context was created—by calling the per
formance method now(). this method is available in both window and worker contexts. example to determine how much time has elapsed since a particular point in your code, you can do something like this: let starttime = per
formance.now(); /* ... do things for a while ... */ let elapsedtime = per
formance.now() - starttime; upon completion, the value of elapsedtime is the number of milliseconds that have elapsed since you recorded the starting time in line 1. specifications specification status comment high resolution time level 2the definition of 'domhighrestimestamp' in that specificati...
DOMMatrix() - Web APIs
the dommatrix constructor creates a new dommatrix object which represents 4x4 matrices, suitable for 2d and 3d operations.. syntax var dommatrix = new dommatrix([init]) parameters init optional a string containing a sequence of numbers or an array of numbers specifying the matrix you want to create, or a css trans
form string. example this example creates a dommatrix to use as an argument for calling point.matrixtrans
form(). ...
...example creates a dommatrix to use as an argument for calling point.matrixtrans
form(). var point = new dompoint(5, 4); var scalex = 2; var scaley = 3; var translatex = 12; var translatey = 8; var angle = math.pi / 2; var matrix = new dommatrix([ math.sin(angle) * scalex, math.cos(angle) * scalex, -math.sin(angle) * scaley, math.cos(angle) * scaley, translatex, translatey ]); var trans
formedpoint = point.matrixtrans
form(matrix); specifications specification status comment geometry interfaces module level 1the definition of 'dommatrix' in that specification. candidate recommendation initial definition. ...
DOMMatrixReadOnly.translate() - Web APIs
of the matrix being translated by the given vector. the original matrix is not modified. if a translation is applied about the z-axis, the resulting matrix will be a 4x4 3d matrix. ...
...one blue, each positioned at the document origin: <svg width="250" height="250" viewbox="0 0 50 50"> <rect width="25" height="25" fill="red" /> <rect id="trans
formed" width="25" height="25" fill="blue" /> </svg> the following javascript first creates an identity matrix, then uses the translate() method to create a new, translated matrix — which is then applied to the blue square as a trans
form. the red square is left in place. const matrix = new dommatrixreadonly().translate(25, 25); document.queryselector('#trans
formed').setattribute('trans
form', matrix.tostring()); screenshotlive sample specifications specification status comment geometry interfaces module level 1the definition of 'dommatrixreadonly.translate()' in that specification. candidate recomm...
DOMPointInit - Web APIs
rties dompointinit.x an unrestricted floating-point value indicating the x-coordinate of the point in space. this is generally the horizontal coordinate, with positive values being to the right and negative values to the left. the default value is 0. dompointinit.y an unrestricted floating-point number providing the point's y-coordinate. ...
...the default value is 0. ...
Binary strings - Web APIs
27). for instance, the string "hello world!" belongs to the ascii subset, while the string "ÀÈÌÒÙ" does not. a binary string is a concept similar to the ascii subset, but instead of limiting the range to 127, it allows code points until 255. its purpose however is not to represent characters, but binary data. the size of the data so represented is twice as big as it would be in normal binary
format, however this will not be visible to the final user, since the length of javascript strings is calculated using two bytes as the unit. binary strings are not part of the javascript language design. however at least one native function requires binary strings as its input, btoa(): invoking it on a string that contains codepoints greater than 255 will cause a character out of range error. the r...
...helpful for javascript code to be able to quickly and easily manipulate raw binary data. in the past, this had to be simulated by treating the raw data as a string and using the charcodeat() method to read the bytes from the data buffer (i.e., using binary strings). however, this is slow and error-prone, due to the need for multiple conversions (especially if the binary data is not actually byte-
format data, but, for example, 32-bit integers or floats). javascript typed arrays provide a mechanism for accessing raw binary data much more efficiently. the stringview non native constructor is one level above typed arrays and provides a c-like interface for strings. ...
DataTransfer.mozTypesAt() - Web APIs
if the index is not in the range from 0 to the number of items minus one, an empty string list is returned. example this example shows the use of the moztypesat() method in a drop event handler. ...
...pes that are stored for an item at the specified index. if the index is not in the range from 0 to the number of items minus one, an empty string list is returned. note: this method is gecko-specific. syntax nsivariant datatransfer.moztypesat(index); arguments index a unsigned long that is the index of the data for which to retrieve the types. return value nsivariant a list of data
formats (which are strings). if the index is not in the range from 0 to the number of items minus one, an empty string list is returned. example this example shows the use of the moztypesat() method in a drop event handler. function drop_handler(event) { var dt = event.datatransfer; var count = dt.mozitemcount; output("items: " + count + "\n"); for (var i = 0; i < count; i++) { output...
DisplayMediaStreamConstraints.video - Web APIs
stream returned by getdisplaymedia(). this value may simply be a boolean, where true specifies that a default selection of input source be made (typically the entire display area of the device in use, spanning every screen in a multiple screen configuration). since a video track must always be included, a value of false results in a typeerror exception being thrown. more precise control over the
format of the returned video track may be exercised by instead providing a mediatrackconstraints object, which is used to process the video data after obtaining it from the device but prior to adding it to the stream. syntax displaymediastreamconstraints.video = allowvideoflag; displaymediastreamconstraints.video = mediatrackconstraints; displaymediastreamconstraints = { video: allowvideoflag | m...
...eamconstraints.video = allowvideoflag; displaymediastreamconstraints.video = mediatrackconstraints; displaymediastreamconstraints = { video: allowvideoflag | mediatrackconstraints; } value the value may be either a boolean or a mediatrackconstraints object. if a boolean is specified, a value of true (the default) indicates that the stream returned by getdisplaymedia() should be in whatever
format the user agent feels is best. a value of false is not permitted and will throw a typeerror. if a mediatrackconstraints object is given instead, the video track will be processed to match the settings given in the constraints object. constraints specific to screen sharing these constraints apply to mediatrackconstraints objects specified as part of the displaymediastreamconstraints object's v...
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. processing in
formation is specified using mediatrackconstraints objects providing options which are applied to the track after the media data is received but before it is made available on the mediastream. properties audio a boolean or mediatrackconstraints value; if a boolean, this value simply indicates whether or not to include an audio track in the mediastream returned by getdisplaymedia(). if a mediatrackconstraints object is provided here, an audio track is included in the stream, but the audio is processed to match the specified constraints after ...
...s processed to match the specified constraints after being retrieved from the hardware but before being added to the mediastream. the default value is false. video if true (the default), the display contents are included in a mediastreamtrack within the stream provided by getdisplaymedia(). optionally, a mediatrackconstraints object may be given, providing options specifying processing to be per
formed on the video data before adding it to the stream. a value of false is not permitted, and results in a typeerror being thrown. specifications specification status comment unknownthe definition of 'displaymediastreamconstraints' in that specification. unknown initial definition ...
Document.contentType - Web APIs
note: this property is unaffected by <meta> elements. syntax contenttype = document.contenttype; value contenttype is a read-only property. ...
... note: this property is unaffected by <meta> elements. syntax contenttype = document.contenttype; value contenttype is a read-only property. ...
Document.createNSResolver() - Web APIs
space resolution. return value nsresolver is an xpathnsresolver object. notes adapts any dom node to resolve namespaces so that an xpath expression can be easily evaluated relative to the context of the node where it appeared within the document. this adapter works like the dom level 3 method lookupnamespaceuri on nodes in resolving the namespaceuri from a given prefix using the current in
formation available in the node's hierarchy at the time lookupnamespaceuri is called. also correctly resolves the implicit xml prefix. note, xpath defines qnames without prefix to match only elements in the null namespace. there is no way in xpath to pick up the default namespace as applied to a regular element reference (e.g., p[@id='_myid'] for xmlns='http://www.w3.org/1999/xhtml'). to match defaul...
...tly resolves the implicit xml prefix. note, xpath defines qnames without prefix to match only elements in the null namespace. there is no way in xpath to pick up the default namespace as applied to a regular element reference (e.g., p[@id='_myid'] for xmlns='http://www.w3.org/1999/xhtml'). to match default elements in a non-null namespace, you either have to refer to a particular element using a
form such as *namespace-uri()=http://www.w3.org/1999/xhtml and name()=p[@id='_myid'] (this approach works well for dynamic xpath expressions where the namespaces might not be known) or use prefixed name tests, and create a namespace resolver mapping the prefix to the namespace. read more on how to create a user defined namespace resolver if you wish to take the latter approach. creatensresolver was i...
Document.createProcessingInstruction() - Web APIs
new node usually will be inserted into an xml document in order to accomplish anything with it, such as with node.insertbefore. syntax pinode = document.createprocessinginstruction(target, data) parameters pinode is the resulting processinginstruction node. target is a string containing the first part of the processing instruction (i.e., <?target … ?>) data is a string containing any in
formation the processing instruction should carry, after the target. the data is up to you, but it can't contain ?>, since that closes the processing instruction. exceptions dom_invalid_character throws if either of the following are true: the processing instruction target is invalid — it should be a valid xml name that doesn't contain "xml", "xml", or any case combination of the two, othe...
... dom4the definition of 'createprocessinginstruction()' in that specification. obsolete added more explicit definition of how the data parameter is validated. document object model (dom) level 3 core specificationthe definition of 'createprocessinginstruction()' in that specification. obsolete added note that the namespace of the target name is not checked whether it is well-
formed, defined what is considered an illegal character for the target name and specified the returned processinginstruction object more precisely. document object model (dom) level 2 core specificationthe definition of 'createprocessinginstruction()' in that specification. obsolete no change document object model (dom) level 1 specificationthe definition of 'createprocessingin...
Document.evaluate() - Web APIs
2 headings in this document are:\n"; while (thisheading) { alerttext += thisheading.textcontent + "\n"; thisheading = headings.iteratenext(); } alert(alerttext); // alerts the text of all h2 elements note, in the above example, a more verbose xpath is preferred over common shortcuts such as //h2. generally, more specific xpath selectors as in the above example usually gives a significant per
formance improvement, especially on very large documents. this is because the evaluation of the query spends does not waste time visiting unnecessary nodes. using // is generally slow as it visits every node from the root and all subnodes looking for possible matches. further optimization can be achieved by careful use of the context parameter. for example, if you know the content you are looking for...
...cument.body has been used as the context instead of document so the xpath starts from the body element. (in this example, the "." is important to indicate that the querying should start from the context node, document.body. if the "." was left out (leaving //h2) the query would start from the root node (html) which would be more wasteful.) see introduction to using xpath in javascript for more in
formation. notes xpath expressions can be evaluated on html and xml documents. while using document.evaluate() works in ff2, in ff3 one must use somexmldoc.evaluate() if evaluating against something other than the current document. result types (merge with template:xpathresultconstants? these are supported values for the resulttype parameter of the evaluate method: result type va...
Document.write() - Web APIs
or example: <script> document.write("<h1>main title</h1>") </script> note: document.write() and document.writeln do not work in xhtml documents (you'll get an "operation is not supported" [ns_error_dom_not_supported_err] error in the error console). this happens when opening a local file with the .xhtml file extension or for any document served with an application/xhtml+xml mime type. more in
formation is available in the w3c xhtml faq. note: using document.write() in deferred or asynchronous scripts will be ignored and you'll get a message like "a call to document.write() from an asynchronously-loaded external script was ignored" in the error console. note: in edge only, calling document.write() more than once in an <iframe> causes the error "script70: permission denied". note: startin...
...t a message like "a call to document.write() from an asynchronously-loaded external script was ignored" in the error console. note: in edge only, calling document.write() more than once in an <iframe> causes the error "script70: permission denied". note: starting with version 55, chrome will not execute <script> elements injected via document.write() when specific conditions are met. for more in
formation, refer to intervening against document.write(). specifications specification status comment html living standardthe definition of 'document.write(...)' in that specification. living standard document object model (dom) level 2 html specificationthe definition of 'document.write(...)' in that specification. obsolete ...
How to create a DOM tree - Web APIs
...
... a web server (via xmlhttprequest), trans
formed using xslt, xlink, converted to a javascript object through a jxon algorithm, etc. you can use dom trees to model data which isn't well-suited for rdf (or perhaps you just don't like rdf). another application is that, since xul is xml, the ui of your application can be dynamically manipulated, downloaded, uploaded, saved, loaded, converted, or trans
formed quite easily. ...
EXT_color_buffer_half_float - Web APIs
the ext_color_buffer_half_float extension is part of the webgl api and adds the ability to render to 16-bit floating-point color buffers. webgl extensions are available using the webglrenderingcontext.getextension() method. for more in
formation, see also using extensions in the webgl tutorial. availability: this extension is available to webgl 1 contexts only. for webgl 2, use the ext_color_buffer_float extension. the oes_texture_half_float extension implicitly enables this extension. constants ext.rgba16f_ext rgba 16-bit floating-point color-renderable
format. ext.rgb16f_ext rgb 16-bit floating-point color-renderable
format. ext.framebuffer_attachment_component_type_ext ? ext.unsigned_normalized_ext ? extended methods this extension extends webglrenderingcontext.renderbuff...
...exture_half_float extension implicitly enables this extension. constants ext.rgba16f_ext rgba 16-bit floating-point color-renderable
format. ext.rgb16f_ext rgb 16-bit floating-point color-renderable
format. ext.framebuffer_attachment_component_type_ext ? ext.unsigned_normalized_ext ? extended methods this extension extends webglrenderingcontext.renderbufferstorage(): the internal
format parameter now accepts ext.rgba16f_ext and ext.rgba16f_ext. examples var ext = gl.getextension('ext_color_buffer_half_float'); gl.renderbufferstorage(gl.renderbuffer, ext.rbga16f_ext, 256, 256); specifications specification status comment ext_color_buffer_half_floatthe definition of 'ext_color_buffer_half_float' in that specification. recommendation initial d...
EXT_disjoint_timer_query.getQueryObjectEXT() - Web APIs
must be ext.query_result_ext or ext.query_result_available_ext. return value depends on pname: if pname is ext.query_result_ext: a gluint64ext containing the query result. ...
...must be ext.query_result_ext or ext.query_result_available_ext. return value depends on pname: if pname is ext.query_result_ext: a gluint64ext containing the query result. ...
EXT_float_blend - Web APIs
availability: this extension is available to both, webgl1 and webgl2 contexts. however, to use it, you need to enable the use of 32-bit floating-point draw buffers by enabling the extension webgl_color_buffer_float (for webgl1) or ext_color_buffer_float (for webgl2). ...
...or webgl_color_buffer_float are enabled. this ensures that content written before ext_float_blend was exposed by webgl will function as expected. ...
EXT_sRGB - Web APIs
the ext_srgb extension is part of the webgl api and adds srgb support to textures and framebuffer objects. webgl extensions are available using the webglrenderingcontext.getextension() method. for more in
formation, see also using extensions in the webgl tutorial. availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. the constants in webgl2 are: gl.srgb, gl.srgb8, gl.srgb8_alpha8 and gl.framebuffer_attachment_color_encoding. ...
...nality of this extension is available on the webgl2 context by default. the constants in webgl2 are: gl.srgb, gl.srgb8, gl.srgb8_alpha8 and gl.framebuffer_attachment_color_encoding. constants this extension exposes the following constants, which can be used in the teximage2d(), texsubimage2d(), renderbufferstorage() and getframebufferattachmentparameter() methods. ext.srgb_ext unsized srgb
format that leaves the precision up to the driver. ext.srgb_alpha_ext unsized srgb
format with unsized alpha component. ext.srgb8_alpha8_ext sized (8-bit) srgb and alpha
formats. ext.framebuffer_attachment_color_encoding_ext returns the framebuffer color encoding (gl.linear or ext.srgb_ext). examples var ext = gl.getextension('ext_srgb'); var texture = gl.createtexture(); gl.bindtexture(gl.t...
EffectTiming.easing - Web APIs
he point at which the change of values occur within the interval. if the second parameter is omitted, it is given the value end. step-start equivalent to steps(1, start) step-end equivalent to steps(1, end). ...
...lues occur within the interval. if the second parameter is omitted, it is given the value end. step-start equivalent to steps(1, start) step-end equivalent to steps(1, end). ...
Element: click event - Web APIs
sage notes the mouseevent object passed into the event handler for click has its detail property set to the number of times the target was clicked. in other words, detail will be 2 for a double-click, 3 for triple-click, and so forth. this counter resets after a short interval without any clicks occurring; the specifics of how long that interval is may vary from browser to browser and across plat
forms. the interval is also likely to be affected by user preferences; for example, accessibility options may extend this interval to make it easier to per
form multiple clicks with adaptive interfaces. internet explorer internet explorer 8 & 9 suffer from a bug where elements with a computed background-color of transparent that are overlaid on top of other element(s) won't receive click events. any ...
...ypically interactive element (e.g., <a>) instead of one that isn't typically interactive (e.g., <div>). stop using click event delegation. safari mobile considers the following elements to be typically interactive (and thus they aren't affected by this bug): <a> (but it must have an href) <area> (but it must have an href) <button> <img> <input> <label> (but it must be associated with a
form control) <textarea> this list is incomplete; you can help mdn by doing further testing/research and expanding it. examples this example displays the number of consecutive clicks on a <button>. html <button>click</button> javascript const button = document.queryselector('button'); button.addeventlistener('click', event => { button.innerhtml = `click count: ${event.detail}`; }); result...
Element.scrollHeight - Web APIs
en, these checks determine if the container can scroll: window.getcomputedstyle(element).overflowy === 'visible' window.getcomputedstyle(element).overflowy !== 'hidden' scrollheight demo associated with the onscroll event, this equivalence can be useful to determine whether a user has read a text or not (see also the element.scrolltop and element.clientheight properties). for example: html <
form name="registration"> <p> <textarea id="rules">lorem ipsum dolor sit amet, consectetur adipiscing elit. vestibulum at laoreet magna. aliquam erat volutpat. praesent molestie, dolor ut eleifend aliquam, mi ligula ultrices sapien, quis cursus neque dui nec risus. duis tincidunt lobortis purus eu aliquet. quisque in dignissim magna. aenean ac lorem at velit ultrices consequat. nulla luctus nisi...
...ger laoreet nisi a odio ornare non congue turpis eleifend. cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. cras vulputate libero sed arcu iaculis nec lobortis orci fermentum. ...
Element.tagName - Web APIs
mple, if the element is an <img>, its tagname property is "img" (for html documents; it may be cased differently for xml/xhtml documents). syntax elementname = element.tagname; value a string indicating the element's tag name. this string's capitalization depends on the document type: for dom trees which represent html documents, the returned tag name is always in the canonical upper-case
form. for example, tagname called on a <div> element returns "div". the tag names of elements in an xml dom tree are returned in the same case in which they're written in the original xml file. if an xml document includes a tag "<sometag>", then the tagname property's value is "sometag". for element objects, the value of tagname is the same as the value of the nodename property the element object i...
...if an xml document includes a tag "<sometag>", then the tagname property's value is "sometag". for element objects, the value of tagname is the same as the value of the nodename property the element object inherits from node. example html <span id="born">when i was born...</span> javascript var span = document.getelementbyid("born"); console.log(span.tagname); in xhtml (or any other xml
format), the original case will be maintained, so "span" would be output in case the original tag name was created lowercase. in html, "span" would be output instead regardless of the case used while creating the original document. specifications specification status comment domthe definition of 'element: tagname' in that specification. living standard ...
File - Web APIs
the file interface provides in
formation about files and allows javascript in a web page to access their content. file objects are generally retrieved from a filelist object returned as a result of a user selecting files using the <input> element, from a drag and drop operation's datatransfer object, or from the mozgetasfile() api on an htmlcanvaselement. a file object is a specific kind of a blob, and can be used in any context that a blob can. in particular, filereader, url.createobjecturl(), createimagebitmap(), and xmlhttprequest.send() accept both blobs and files. see using files from web applications for more in
formation and examples. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: midd...
...ns the size of the file in bytes. file.prototype.type read only returns the mime type of the file. instance methods the file interface doesn't define any methods, but inherits methods from the blob interface: blob.prototype.slice([start[, end[, contenttype]]]) returns a new blob object containing the data in the specified range of bytes of the source blob. blob.prototype.stream() trans
forms the file into a readablestream that can be used to read the file contents. blob.prototype.text() trans
forms the file into a stream and reads it to completion. it returns a promise that resolves with a usvstring (text). blob.prototype.arraybuffer() trans
forms the file into a stream and reads it to completion. it returns a promise that resolves with an arraybuffer. specifications s...
FileSystemEntry.getMetadata() - Web APIs
errorcallback optional an optional callback which is executed if an error occurs while looking up the metadata. there's a single parameter: a fileerror describing what went wrong. return value undefined. ...
... errorcallback optional an optional callback which is executed if an error occurs while looking up the metadata. there's a single parameter: a fileerror describing what went wrong. return value undefined. errors fileerror.not_found_err the filesystementry refers to an item which doesn't exist. ...
FileSystemEntrySync - Web APIs
warning: this api was never accepted and never became standardized. ...
...ent directory into one of its child directories. no_modification_allowed_err one of the following is not writable: the source entry, its parent directory, and the target directory. quota_exceeded_err the operation would cause the application to exceed its storage quota. you can ask for a larger persistent storage, which your user must explicitly grant. for more in
formation, see the article on basic concepts. tourl() returns a url that can be used to identify this entry. it exposes a new url scheme—filesystem:—that you can use to fill src or href attributes. for example, if you wanted to display an image and have its fileentry, calling tourl() gives you the image file's file system url. you get something like: filesystem:http://example.com/temporar...
Guide to the Fullscreen API - Web APIs
which you'll make fullscreen instead, and use css rules to adjust the inner element to match the appearance you want. notification when fullscreen mode is successfully engaged, the document which contains the element receives a fullscreenchange event. when fullscreen mode is exited, the document again receives a fullscreenchange event. note that the fullscreenchange event doesn't provide any in
formation itself as to whether the document is entering or exiting fullscreen mode, but if the document has a non null fullscreenelement, you know you're in fullscreen mode. when a fullscreen request fails it's not guaranteed that you'll be able to switch into fullscreen mode. for example, <iframe> elements have the allowfullscreen attribute in order to opt-in to allowing their content to be display...
...of opera however, no such warning is generated. note: fullscreen requests need to be called from within an event handler or otherwise they will be denied. getting out of full screen mode the user always has the ability to exit fullscreen mode of their own accord; see things your users want to know. you can also do so programmatically by calling the document.exitfullscreen() method. other in
formation the document provides some additional in
formation that can be useful when developing fullscreen web applications: documentorshadowroot.fullscreenelement the fullscreenelement property tells you the element that's currently being displayed fullscreen. if this is non-null, the document is in fullscreen mode. if this is null, the document is not in fullscreen mode. document.fullscreenenab...
Gamepad API - Web APIs
interfaces gamepad represents a gamepad/controller connected to the computer. ...
... controllers. gamepadevent the event object representing events fired that are related to gamepads. experimental gamepad extensions gamepadhapticactuator represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware. see also the extensions to the gamepad interface, for features that allow you to access the above in
formation. extensions to other interfaces navigator navigator.getgamepads() an extension to the navigator object that returns an array of gamepad objects, one for each connected gamepad. window events window.ongamepadconnected represents an event handler that will run when a gamepad is connected (when the gamepadconnected event fires). window.ongamepaddisconnected represents an event han...
GeolocationCoordinates.longitude - Web APIs
s located 5.3 arcseconds (102 meters / 335 feet) east of the greenwich meridian. this is the same standard used by the global positioning system (gps). examples in this simple example, we fetch the user's location and display the resulting coordinates once they're returned. javascript the javascript code below creates an event listener so that when the user clicks on a button, the location in
formation is retrieved and displayed. let button = document.getelementbyid("get-location"); let lattext = document.getelementbyid("latitude"); let longtext = document.getelementbyid("longitude"); button.addeventlistener("click", function() { navigator.geolocation.getcurrentposition(function(position) { let lat = position.coords.latitude; let long = position.coords.longitude; lattext.i...
...lattext.innertext = lat.tofixed(2); longtext.innertext = long.tofixed(2); }); }); after setting up variables to more conveniently reference the button element and the two elements into which the latitude and logitude will be drawn, the event listener is established by calling addeventlistener() on the <button> element. when the user clicks the button, we'll fetch and display the location in
formation. upon receiving a click event, we call getcurrentposition() to request the device's current position. this is an asynchronous request, so we provide a callback which receives as in put a geolocationposition object describing the determined position. from the geolocationposition object, we obtain the user's latitude and longitude using position.coords.latitude and position.coords.longitude ...
GlobalEventHandlers.onanimationcancel - Web APIs
:0; top:0; } to { left:calc(100% - var(--boxwidth)); top:calc(100% - var(--boxwidth)) } } since the animation is described as taking place an infinite number of times, alternating direction each time, the box will glide back and forth between the two corners until stopped or the page is closed. javascript before we get to the animation code, we define a function which logs in
formation to a box on the user's screen. we'll use this to show in
formation about the events we receive. note the use of animationevent.animationname and animationevent.elapsedtime to get in
formation about the event which occurred. function log(msg, event) { let logbox = document.getelementbyid("log"); logbox.innerhtml += msg; if (event) { logbox.innerhtml += " <code>"+ event.animationnam...
...elementbyid("log"); logbox.innerhtml += msg; if (event) { logbox.innerhtml += " <code>"+ event.animationname + "</code> at time " + event.elapsedtime.tofixed(2) + " seconds."; } logbox.innerhtml += "\n"; }; then we set up the handlecancelevent() function, which is called in response to the animationcancel event, as set up in the html above. all we do here is log in
formation to the console, but you might find other use cases, such as starting a new animation or effect, or terminating some dependent operation. function handlecancelevent(event) { log("animation canceled", event); }; then we add a method to handle toggle display between "flex" and "none" and establish it as the handler for a click event on the "hide/show" the box button: document.getelementby...
GlobalEventHandlers.onanimationend - Web APIs
slidebox; } @keyframes slidebox { from { left:0; top:0; } to { left:calc(100% - var(--boxwidth)); top:calc(100% - var(--boxwidth)) } } since the css describes the animation but doesn't connect it to the box, we'll need some javascript code to do that. we'll get to that shortly. javascript content before we get to the animation code, we define a function which logs in
formation to a box on the user's screen. we'll use this to show in
formation about the events we receive. note the use of animationevent.animationname and animationevent.elapsedtime to get in
formation about the event which occurred. function log(msg, event) { let logbox = document.getelementbyid("log"); logbox.innerhtml += msg; if (event) { logbox.innerhtml += " <code>"+ event.animationnam...
... result assembled together, you get this: specification specification status comment css animationsthe definition of 'onanimationend' in that specification. working draft ...
GlobalEventHandlers.onanimationstart - Web APIs
slidebox; } @keyframes slidebox { from { left:0; top:0; } to { left:calc(100% - var(--boxwidth)); top:calc(100% - var(--boxwidth)) } } since the css describes the animation but doesn't connect it to the box, we'll need some javascript code to do that. we'll get to that shortly. javascript content before we get to the animation code, we define a function which logs in
formation to a box on the user's screen. we'll use this to show in
formation about the events we receive. note the use of animationevent.animationname and animationevent.elapsedtime to get in
formation about the event which occurred. function log(msg, event) { let logbox = document.getelementbyid("log"); logbox.innerhtml += msg; if (event) { logbox.innerhtml += " <code>"+ event.animationnam...
... result assembled together, you get this: specification specification status comment css animationsthe definition of 'onanimationstart' in that specification. working draft ...
GlobalEventHandlers.oncontextmenu - Web APIs
ypically appears upon a right click. html <p>try opening the context menu. is it disabled?<p> javascript window.oncontextmenu = (e) => { e.preventdefault(); } result pausing an animation this example pauses a spinning shape whenever you open the context menu. ...
... html <p>try opening the context menu. is it disabled?<p> javascript window.oncontextmenu = (e) => { e.preventdefault(); } result pausing an animation this example pauses a spinning shape whenever you open the context menu. ...
GlobalEventHandlers.onerror - Web APIs
s raised (string) lineno: line number where error was raised (number) colno: column number for the line where the error occurred (number) error: error object (object) when the function returns true, this prevents the firing of the default event handler. window.addeventlistener('error') window.addeventlistener('error', function(event) { ... }) event of type errorevent contains all the in
formation about the event and the error. element.onerror element.onerror = function(event) { ... } element.onerror accepts a function with a single argument of type event. a good example for this is when you are using an image tag, and need to specify a backup image in case the one you need is not available on the server for any reason. <img src="imagenotfound.gif" onerror="this.onerror=null;thi...
...or any reason. <img src="imagenotfound.gif" onerror="this.onerror=null;this.src='imagefound.gif';" /> the reason we have the this.onerror=null in the function is that the browser will be stuck in an endless loop if the onerror image itself generates an error. notes when an error occurs in a script, loaded from a different origin, the details of the error are not reported to prevent leaking in
formation (see bug 363897). instead the error reported is simply "script error." this behavior can be overriden in some browsers using the crossorigin attribute on <script> and having the server send the appropriate cors http response headers. a workaround is to isolate "script error." and handle it knowing that the error detail is only viewable in the browser console and not accessible via javascrip...
GlobalEventHandlers.onmouseup - Web APIs
mouseevent object as its sole argument. example in this example, a piece of "toast" hides when you click down with the mouse, and reappears when you release. it uses the onmousedown and onmouseup event handlers. ...
...orld!</div> </div> css .container { position: absolute; left: 50%; bottom: 20px; trans
form: translate(-50%); } .toaster { width: 160px; height: 110px; background: #bbb; border-radius: 10px 10px 0 0; } .toast { position: absolute; left: 50%; top: 50%; z-index: -1; width: 100px; height: 50px; padding: 10px; background: #ed9; border-radius: 10px 10px 0 0; trans
form: translate(-50%, -90px); transition: trans
form .3s; } .depressed { trans
form: translate(-50%, -50%); } javascript function depress() { toast.classlist.add('depressed'); } function release() { toast.classlist.remove('depressed'); } const toaster = document.queryselector('.toaster'); const toast = document.queryselector('.toast'); toaster.onmousedown = depress; document.onmouseup = re...
HTMLCanvasElement.mozOpaque - Web APIs
this has been standardized as setting the alpha option to false when creating a drawing context with htmlcanvaselement.getcontext(). use of mozopaque should be avoided. firefox will stop supporting it in the future. ...
...f mozopaque should be avoided. firefox will stop supporting it in the future. syntax var opaque = canvas.mozopaque; canvas.mozopaque = true; examples given this <canvas> element: <canvas id="canvas" width="300" height="300" moz-opaque></canvas> you can get or set the mozopaque property. for example, you could conditionally set it to true if mimetype == 'image/jpeg', or similar, to gain per
formance in your application when translucency is not needed. var canvas = document.getelementbyid('canvas'); console.log(canvas.mozopaque); // true // deactivate it canvas.mozopaque = false; specifications not part of any standard. ...
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). the returned image is in a resolution of 96 dpi. if the height or width of the canvas is 0 or larger than the maximum canvas size, the string "data:," is returned. 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. syntax canvas.todataurl(type, encoderoptions); parameters type optional a domstring indicating the image
format. the default
format type is image/png. ...
...e/png, but the returned value starts with data:image/png, then the requested type is not supported. chrome also supports the image/webp type. syntax canvas.todataurl(type, encoderoptions); parameters type optional a domstring indicating the image
format. the default
format type is image/png. encoderoptions optional a number between 0 and 1 indicating the image quality to use for image
formats that use lossy compression such as image/jpeg and image/webp. if this argument is anything else, the default value for image quality is used. the default value is 0.92. other arguments are ignored. return value a domstring containing the requested data uri. exceptions securityerror the canvas's bitmap is not origin clean; at least some of its contents have or may have been loaded from...
HTMLCanvasElement - Web APIs
300 is used. if no [separate] css width is assigned to the <canvas>, then this value will also be used as the width of the canvas in the length-unit css pixel. htmlcanvaselement.mozopaque is a boolean reflecting the moz-opaque html attribute of the <canvas> element. it lets the canvas know whether or not translucency will be a factor. if the canvas knows there's no translucency, painting per
formance can be optimized. this is only supported in mozilla-based browsers; use the standardized canvas.getcontext('2d', { alpha: false }) instead. htmlcanvaselement.mozprintcallback is a function that is initially null. web content can set this to a javascript function that will be called when the canvas is to be redrawn while the page is being printed. when called, the callback is passed a "prin...
... is not supported. a drawing context lets you draw on the canvas. calling getcontext with "2d" returns a canvasrenderingcontext2d object, whereas calling it with "webgl" (or "experimental-webgl") returns a webglrenderingcontext object. this context is only available on browsers that implement webgl. htmlcanvaselement.todataurl() returns a data-url containing a representation of the image in the
format specified by the type parameter (defaults to png). the returned image is in a resolution of 96dpi. htmlcanvaselement.toblob() creates a blob object representing the image contained in the canvas; this file may be cached on the disk or stored in memory at the discretion of the user agent. htmlcanvaselement.transfercontroltooffscreen() transfers control to an offscreencanvas object, either ...
HTMLElement.click() - Web APIs
he htmlelement.click() method simulates a mouse click on an element. when click() is used with supported elements (such as an <input>), it fires the element's click event. this event then bubbles up to elements higher in the document tree (or event chain) and fires their click events. ...
...s (such as an <input>), it fires the element's click event. this event then bubbles up to elements higher in the document tree (or event chain) and fires their click events. syntax element.click() example simulate a mouse-click when moving the mouse pointer over a checkbox: html <
form> <input type="checkbox" id="mycheck" onmouseover="myfunction()" onclick="alert('click event occured')"> </
form> javascript // on mouse-over, execute myfunction function myfunction() { document.getelementbyid("mycheck").click(); } specification specification status comment html living standard living standard document object model (dom) level 2 html specification obsolete initial definition. ...
HTMLElement: transitionend event - Web APIs
in this example, to cancel the transition, stop hovering over the transitioning box before the transition ends. for...
...in this example, to cancel the transition, stop hovering over the transitioning box before the transition ends. for the transition end event to fire, stay hovered over the transition until the transition ends. co...
HTMLElement: transitionrun event - Web APIs
const el = document.queryselector('.transition'); const message = document.queryselector('.message'); el.addeventlistener('transitionrun', funct...
... const el = document.queryselector('.transition'); const message = document.queryselector('.message'); el.addeventlistener('transitionrun', function() { message.textcontent = 'transitionrun fired'; }); el.addeventlistener('transitionstart', ...
HTMLElement: transitionstart event - Web APIs
const transition = document.queryselector('.transition'); const message = document.queryselector('.message'); transition.addeventlistener('trans...
... const transition = document.queryselector('.transition'); const message = document.queryselector('.message'); transition.addeventlistener('transitionrun', function() { message.textcontent = 'transitionrun fired'; }); transition.addeventlist...
HTMLHtmlElement - Web APIs
="middle" alignment-baseline="middle">htmlhtmlelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlhtmlelement.version is a domstring representing the version of the html document type definition (dtd) that governs this document. this property should not be used any more as it is non-con
forming. simply omit it. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmlhtmlelement' in that specification. living standard html 5.1the definition of 'htmlhtmlelement' in that specification. recommendation no change since the last snapsh...
... comment html living standardthe definition of 'htmlhtmlelement' in that specification. living standard html 5.1the definition of 'htmlhtmlelement' in that specification. recommendation no change since the last snapshot html5the definition of 'htmlhtmlelement' in that specification. recommendation the version element has been removed, as it is non-con
forming. document object model (dom) level 2 html specificationthe definition of 'htmlhtmlelement' in that specification. obsolete reflecting the element change in html 4.01 specification, the version property is now deprecated. document object model (dom) level 1 specificationthe definition of 'htmlhtmlelement' in that specification. obsolete initial definition ...
HTMLImageElement.longDesc - Web APIs
for example, if the image is a png of a flowchart. ...
... for example, if the image is a png of a flowchart. the longdesc property could be used to provide an explanation of the flow of control represented by the chart, using only text. this can be used by readers both as an explanation, but also as a substitute for visually-impaired users. ...
HTMLImageElement.srcset - Web APIs
ating the url and the corresponding condition descriptor, are ignored; this includes both leading and trailing space, as well as space before or after each comma. if the condition descriptor is not provided (in other words, the image candidate provides only a url), the candidate is used as the fallback if none of the other candidates match. otherwise, the condition descriptor may take one of two
forms: to indicate that the image resource specified by the image candidate string should be used when the image is being rendered with a particular width in pixels, provide a width descriptor comprised the number giving that width in pixels followed by the lower case letter "w". for example, to provide an image resource to be used when the renderer needs a 450 pixel wide image, use the width descr...
...ondition at all, to be used for any other width. "icon32px.png 32w, icon64px.png 64w, icon-retina.png 2x icon-ultra.png 3x icon.svg" here, options are provided for an icon at widths of 32px and 64px, as well as at pixel densities of 2x and 3x. a fallback image is provided as an svg file that should be used in all other cases. notice that the candidates may use different image types. for more in
formation on what image
formats are available for use in the <img> element, see image file type and
format guide. example html the html below indicates that the default image is the 200 pixel wide version of the clock image we use in several places throughout our documentation. also specified by the srcset attribute is that the 200-pixel version should be used for 1x displays while the 400-pixel ve...
HTMLInputElement.setSelectionRange() - Web APIs
, you can specify the direction in which selection should be considered to have occurred. this lets you indicate, for example, that the selection was set by the user clicking and dragging from the end of the selected text toward the beginning. this method updates the htmlinputelement.selectionstart, selectionend, and selectiondirection properties in one call. 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 ty...
...reater than the length of the element's value is treated as pointing to the end of the value. selectionend the 0-based index of the character after the last selected character. an index greater than the length of the element's value is treated as pointing to the end of the value. selectiondirection optional a string indicating the direction in which the selection is considered to have been per
formed. possible values: "forward" "backward" "none" if the direction is unknown or irrelevant. default value. example click the button in this example to select the third, fourth, and fifth characters in the text box ("zil" in the word "mozilla"). html <input type="text" id="text-box" size="20" value="mozilla"> <button onclick="selecttext()">select text</button> javascript functio...
HTMLInputElement.stepDown() - Web APIs
, would have resulted in 16:45, as n defaults to 1. <!-- decrements by intervals of 900 seconds (15 minute) --> <input type="time" max="17:00" step="900"> <!-- decrements by intervals of 7 days (one week) --> <input type="date" max="2019-12-25" step="7"> <!-- decrements by intervals of 12 months (one year) --> <input type="month" max="2019-12" step="12"> 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 within the
form control. the default value for the parameter, if not is passed, is 1. the method will not cause the value to go below the min value set or defy the constraints set by the step attribute. a negative value for n will increment the value, but will not increment beyond the...
...use the value to go below the min value set or defy the constraints set by the step attribute. a negative value for n will increment the value, but will not increment beyond the max value. if the value before invoking the stepdown() method is invalid, for example, if it doesn't match the constraints set by the step attribute, invoking the stepdown() method will return a value that does match the
form controls constraints. if the
form control is non time, date, or numeric in nature, and therefore does not support the step attribute (see the list of supported input types in the the table above), or if the step value is set to any, an invalidstateerror exception is thrown. htmlinputelement.stepdown() decrements the value by (step * n), where n defaults to 1 if not specified. throws an inval...
HTMLKeygenElement - Web APIs
019 for details and status. the <keygen> elements expose the htmlkeygenelement interface, which provides special properties and methods (beyond the regular element object interface they also have available to them by inheritance) for manipulating the layout and presentation of keygen elements. properties autofocus is a boolean that reflects the autofocus html attribute, indicating that the
form control should have input focus when the page loads. challenge is a domstring that reflects the challenge html attribute, containing a challenge string that is packaged with the submitted key.
form read only is a html
formelement that indicates the control's
form owner, reflecting the
form html attribute if it is defined. keytype is a domstring that reflects the keytype html attribute, cont...
...orm html attribute if it is defined. keytype is a domstring that reflects the keytype html attribute, containing the type of key used. labels read only unimplemented (see bug 556743) is a nodelist that represents a list of label elements associated with this keygen element. name is a domstring that reflects the name html attribute, containing the name for the control that is submitted with
form data. type read only is a domstring that must be the value keygen. validationmessage read only is a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any). this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. validity read only ...
HTMLLegendElement - Web APIs
="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="406" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmllegendelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmllegendelement.
form read only is a html
formelement representing the
form that this legend belongs to. if the legend has a fieldset element as its parent, then this attribute returns the same value as the
form attribute on the parent fieldset element. otherwise, it returns null. htmllegendelement.accesskey is a domstring representing a single-character access key to give access to the element. htmllegendeleme...
... specifications specification status comment html living standardthe definition of 'htmllegendelement' in that specification. ...
HTMLLinkElement - Web APIs
this object inherits all of the properties and methods of the htmlelement interface. ...
...tails. htmllinkelement.disabled is a boolean which represents whether the link is disabled; currently only used with style sheet links. htmllinkelement.href is a domstring representing the uri for the target resource. htmllinkelement.hreflang is a domstring representing the language code for the linked resource. htmllinkelement.media is a domstring representing a list of one or more media
formats to which the resource applies. htmllinkelement.referrerpolicy is a domstring that reflects the referrerpolicy html attribute indicating which referrer to use. htmllinkelement.rel is a domstring representing the forward relationship of the linked resource from the document to the resource. htmllinkelement.rellist read only is a domtokenlist that reflects the rel html attribute, as a li...
HTMLMediaElement.play() - Web APIs
r the user agent (browser) or operating system doesn't allow playback of media in the current context or situation. this may happen, for example, if the browser requires the user to explicitly start media playback by clicking a "play" button. notsupportederror the media source (which may be specified as a mediastream, mediasource, blob, or file, for example) doesn't represent a supported media
format. other exceptions may be reported, depending on browser implementation details, media player implementation, and so forth. usage notes although the term "autoplay" is usually thought of as referring to pages that immediately begin playing media upon being loaded, web browsers' autoplay policies also apply to any script-initiated playback of media, including calls to play(). if the user age...
...ck of media, calling play() will cause the returned promise to be immediately rejected with a notallowederror. web sites should be prepared to handle this situation. for example, a site should not present a user interface that assumes playback has begun automatically, but should instead update their ui based on whether the returned promise is resolved or rejected. see the example below for more in
formation. note: the play() method may cause the user to be asked to grant permission to play the media, resulting in a possible delay before the returned promise is resolved. be sure your code doesn't expect an immediate response. for even more in-depth in
formation about autoplay and autoplay blocking, see our article autoplay guide for media and web audio apis. example this example demonstrate...
HTMLMediaElement.seekToNextFrame() - Web APIs
s part of an experimentation process around support for non-real-time access to media for tasks including filtering, editing, and so forth. you should not use this method in production code, because its implementation may change—or be removed outright—without notice. you are, however, invited to experiment with it. this method lets you access frames of video media without the media being per
formed in real time. this also lets you access media using frames as a seek unit rather than timecodes (albeit only by seeking one frame at a time until you get to the frame you want). possible uses for this method include filtering and editing of video content. this method returns immediately, returning a promise, whose fulfillment handler is called when the seek operation is complete. in addition, ...
...ked event occurs, followed immediately by an ended event. if there is no video on the media element, or the media isn't seekable, nothing happens. syntax var seekcompletepromise = htmlmediaelement.seektonextframe(); htmlmediaelement.seektonextframe(); return value a promise which is fulfilled once the seek operation has completed. firefox 49 returns undefined instead of a promise, and per
forms the seek operation synchronously. specifications not part of any specification. ...
HTMLOptionElement - Web APIs
an that contains the initial value of the selected html attribute, indicating whether the option is selected by default or not. htmloptionelement.disabled is a boolean representing the value of the disabled html attribute, which indicates that the option is unavailable to be selected. an option can also be disabled if it is a child of an <optgroup> element that is disabled. htmloptionelement.
form read only is a html
formelement representing the same value as the
form of the corresponding <select> element, if the option is a descendant of a <select> element, or null if none is found. htmloptionelement.index read only is a long representing the position of the option within the list of options it belongs to, in tree-order. if the option is not part of a list of options, like when it i...
...defaultselected, and the value of selected. the last three values are optional. specifications specification status comment html living standardthe definition of 'htmloptionelement' in that specification. living standard html5the definition of 'htmloptionelement' in that specification. recommendation a constructor, option(), has been added. the
form property can be the null value. document object model (dom) level 2 html specificationthe definition of 'htmloptionelement' in that specification. obsolete the selected property changed its meaning: it now indicates if the option is currently selected and no longer if it was initally selected. the defaultselected property is no longer read-only. document object model (...
HTMLSelectElement.item() - Web APIs
ist corresponds to the index given in the parameter, or null if there are none. in javascript, using the array bracket syntax with an unsigned long, like selectelt[index] is equivalent to selectelt.nameditem(index). syntax var item = collection.item(index); var item = collection[index]; parameters index is an unsigned long. return value item is a htmloptionelement. ...
... index given in the parameter, or null if there are none. in javascript, using the array bracket syntax with an unsigned long, like selectelt[index] is equivalent to selectelt.nameditem(index). syntax var item = collection.item(index); var item = collection[index]; parameters index is an unsigned long. return value item is a htmloptionelement. examples html <
form> <select id="my
formcontrol" type="textarea"> <option id="o1">opt 1</option> <option id="o2">opt 2</option> </select> </
form> javascript // returns the htmloptionelement representing #o2 elem1 = document.
forms[0]['my
formcontrol'][1]; specifications specification status comment html living standardthe definition of 'htmlselectelement.item()' in that specification. living stan...
HTMLStyleElement - Web APIs
the htmlstyleelement interface represents a <style> element. it inherits properties and methods from its parent, htmlelement, and from linkstyle. this interface doesn't allow to manipulate the css it contains (in most case). to manipulate css, see using dynamic styling in
formation for an overview of the objects used to manipulate specified css properties using the dom. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" ...
...family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlstyleelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement, and implements linkstyle. htmlstyleelement.media is a domstring representing the intended destination medium for style in
formation. htmlstyleelement.type is a domstring representing the type of style being applied by this statement. htmlstyleelement.disabled is a boolean value representing whether or not the stylesheet is disabled (true) or not (false). linkstyle.sheet read only returns the stylesheet object associated with the given element, or null if there is none htmlstyleelement.scoped is a boolean val...
HTMLTimeElement.dateTime - Web APIs
the htmltimeelement.datetime property is a domstring that reflects the datetime html attribute, containing a machine-readable
form of the element's date and time value. ...
... the htmltimeelement.datetime property is a domstring that reflects the datetime html attribute, containing a machine-readable
form of the element's date and time value. ...
HTMLTrackElement - Web APIs
the htmltrackelement interface represents an html <track> element within the dom. this element can be used as a child of either <audio> or <video> to specify a text track containing in
formation such as closed captions or subtitles. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" align...
...the texttrack but is also sent to the htmltrackelement if one is associated with the track. you may also use the oncuechange event handler to establish a handler for this event. usage notes loading of the track's text resource the webvtt or ttml data describing the actual cues for the text track isn't loaded if the track's mode is initially in the disabled state. if you need to be able to per
form any processing on the track after the <track> is set up, you should instead ensure that the track's mode is either hidden (if you don't want it to start out being presented to the user) or showing (to initially display the track). you can then change the mode as desired later. specifications specification status comment html living standardthe definition of 'htmltrackele...
HTMLVideoElement - Web APIs
the htmlvideoelement interface provides special properties and methods for manipulating video objects. it also inherits properties and methods of htmlmediaelement and htmlelement. the list of supported media
formats varies from one browser to the other. you should either provide your video in a single
format that all the relevant browsers supports, or provide multiple video sources in enough different
formats that all the browsers you need to support are covered. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/a...
...ereo 3-d or not. value set to true indicates source is stereo 3d. htmlvideoelement.mszoom controls whether the video frame is trimmed to fit the video display. methods inherits methods from its parent, htmlmediaelement, and from its ancestor htmlelement. htmlvideoelement.getvideoplaybackquality() returns a videoplaybackquality object that contains the current playback metrics. this in
formation includes things like the number of dropped or corrupted frames, as well as the total number of frames. events inherits methods from its parent, htmlmediaelement, and from its ancestor htmlelement. listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. specifications specification status comment ...
Headers - Web APIs
these actions include retrieving, setting, adding to, and removing headers from the list of the request's headers. a headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs. you can add to this using methods like append() (see examples.) in all methods of this interface, header names are matched by case-insensitive byte sequence. for security reasons, some headers can only be controlled by the user agent. these headers include the forbidden header names and forbidden response header names. ...
...equence. for security reasons, some headers can only be controlled by the user agent. these headers include the forbidden header names and forbidden response header names. a headers object also has an associated guard, which takes a value of immutable, request, request-no-cors, response, or none. this affects whether the set(), delete(), and append() methods will mutate the header. for more in
formation see guard. you can retrieve a headers object via the request.headers and response.headers properties, and create a new headers object using the headers.headers() constructor. an object implementing headers can directly be used in a for...of structure, instead of entries(): for (var p of myheaders) is equivalent to for (var p of myheaders.entries()). note: you can find more out about the ...
IDBDatabase.transaction() - Web APIs
nes are equivalent: var transaction = db.transaction(['my-store-name']); var transaction = db.transaction('my-store-name'); if you need to access all object stores in the database, you can use the property idbdatabase.objectstorenames: var transaction = db.transaction(db.objectstorenames); passing an empty array will throw an exception. mode optional the types of access that can be per
formed in the transaction. transactions are opened in one of three modes: readonly, readwrite and readwriteflush (non-standard, firefox-only.) versionchange mode can't be specified here. if you don't provide the parameter, the default access mode is readonly. to avoid slowing things down, don't open a readwrite transaction unless you actually need to write into the database. if you need to open the o...
...cess mode is readonly. to avoid slowing things down, don't open a readwrite transaction unless you actually need to write into the database. if you need to open the object store in readwrite mode to change data, you would use the following: var transaction = db.transaction('my-store-name', "readwrite"); as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase per
formance (see bug 1112702), which is the same behaviour as other indexeddb-supporting browsers. previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. in firefox 40+ the complete event is fired after the os has been told to write the data but potentially before that data has actually been flushed to disk. the complete e...
IDBFactory.open() - Web APIs
if the operation is successful, a success event is fired on the request object that is returned from this method, with its result attribute set to the new idbdatabase object for the connection. if an error occurs while the database connection is being opened, then an error event is fired on the request object returned from this method. may trigger upgradeneeded, blocked or versionchange events. ...
...a non-standard options object as a parameter of idbfactory.open that contains the version number of the database, plus a storage value that specifies whether you want to use persistent or temporary storage. warning: the storage attribute is deprecated and will soon be removed from gecko. you should use storagemanager.persist() to get persistent storage instead. note: you can find out more in
formation on the different available storage types, and how firefox handles client-side data storage, at browser storage limits and eviction criteria. return value a idbopendbrequest object on which subsequent events related to this request are fired. exceptions this method may raise a domexception of the following types: exception description typeerror the value of v...
IDBObjectStore.createIndex() - Web APIs
ue, the index will not allow duplicate values for a single key. multientry if true, the index will add an entry in the index for each array element when the keypath resolves to an array. if false, it will add one single entry containing the array. locale currently firefox-only (43+), this allows you to specify a locale for the index. ...
...rray. locale currently firefox-only (43+), this allows you to specify a locale for the index. any sorting operations per
formed on the data via key ranges will then obey sorting rules of that locale (see locale-aware sorting.) you can specify its value in one of three ways: string: a string containing a specific locale code, e.g. en-us, or pl. auto: the plat
form default locale will be used (may be changed by user agent settings.) null or undefined: if no locale is specified, normal javascript sorting will be used — not locale-aware. return value an idbindex object: the newly created index. exceptions this method may raise a domexception of one of the following types: exception description const...
IDBRequest - Web APIs
the idbrequest interface of the indexeddb api provides access to results of asynchronous requests to databases and database objects using event handler attributes. each reading and writing operation on a database is done using a request. the request object does not initially contain any in
formation about the result of the operation, but once in
formation becomes available, an event is fired on the request, and the in
formation becomes available through the properties of the idbrequest instance. all asynchronous operations immediately return an idbrequest instance. each request has a readystate that is set to the 'pending' state; this changes to 'done' when the request is completed or fails. when the state is set to done, every request returns a result and an error, and an event is fired on ...
...uest. when the state is still pending, any attempt to access the result or error raises an invalidstateerror exception. in plain words, all asynchronous methods return a request object. if the request has been completed successfully, the result is made available through the result property and an event indicating success is fired at the request (idbrequest.onsuccess). if an error occurs while per
forming the operation, the exception is made available through the result property and an error event is fired (idbrequest.onerror). the interface idbopendbrequest is derived from idbrequest. note: this feature is available in web workers. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overfl...
IDBTransaction - Web APIs
t() on the error event on the request. an explicit abort() call from script. an uncaught exception in the request's success/error handler. an i/o error (e.g. an actual failure to write to disk, or other os/hardware failure). quota exceeded. a user agent crash. firefox durability guarantees note that as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase per
formance (see bug 1112702.) previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. in firefox 40+ the complete event is fired after the os has been told to write the data but potentially before that data has actually been flushed to disk. the complete event may thus be delivered quicker than before, however, there exist...
... constant value description read_only "readonly" (0 in chrome) allows data to be read but not changed. read_write "readwrite" (1 in chrome) allows reading and writing of data in existing data stores to be changed. version_change "versionchange" (2 in chrome) allows any operation to be per
formed, including ones that delete and create object stores and indexes. this mode is for updating the version number of transactions that were started using the setversion() method of idbdatabase objects. transactions of this mode cannot run concurrently with other transactions. transactions in this mode are known as "upgrade transactions." even if these constants are now deprecated, you can s...
IDBTransactionSync - Web APIs
es (idbdatabaseexception); attributes attribute type description db idbdatabasesync the database connection that this transaction is associated with. static boolean if true, this transaction is static; if false, this transaction is dynamic. methods abort() call this method to signal a need to cancel the effects of the operations per
formed by this transaction. when this method is called, the browser ignores all the changes per
formed to the objects of this database since this transaction was created. void abort( ) raises (idbdatabaseexception); exceptions this method can raise an idbdatabaseexception with the following code: non_transient_err if this transaction has already been committed or aborted. commit() call this ...
...s created. void abort( ) raises (idbdatabaseexception); exceptions this method can raise an idbdatabaseexception with the following code: non_transient_err if this transaction has already been committed or aborted. commit() call this method to signal that the transaction has completed normally and satisfactorily. when this method is called, the browser durably stores all the changes per
formed to the objects of the database since this transaction was created. void commit( ) raises (idbdatabaseexception); exceptions this method can raise an idbdatabaseexception with the following codes: non_transient_err if this transaction has already been committed or aborted. recoverable_err if this transaction's scope is dynamic, and the browser cannot commit all of the changes due to an...
IdleDeadline.didTimeout - Web APIs
nterface is a boolean value which indicates whether or not the idle callback is being invoked because the timeout interval specified when window.requestidlecallback() was called has expired. if didtimeout is true, the idledeadline object's timeremaining() method will return approximately 0. ...
...ack() was called has expired. if didtimeout is true, the idledeadline object's timeremaining() method will return approximately 0. idle callbacks support the concept of a timeout in order to ensure that whatever task they're meant to per
form actually happens, even if the user agent never has enough idle time available. your callback will typically check the value of didtimeout if it needs to per
form an action even if the browser is too busy to grant you the time; you should react by per
forming the needed task or, ideally, a minimal amount of work that can be done to keep things moving along, then schedule a new callback to try again to get the rest of the work done. syntax var timedout = idledeadline.didtimeout; value a boolean which is true if the callback is running due to the callback...
Browser storage limits and eviction criteria - Web APIs
ata of one kind or another on the client-side (i.e., on your local disk). the process by which the browser works out how much space to allocate to web data storage and what to delete when that limit is reached is not simple, and differs between browsers. this article describes how browsers determine what local content to purge and when in order to free up needed local storage space. note: the in
formation below should be fairly accurate for most modern browsers, but browser specifics are called out where known. opera and chrome should behave the same in all cases. opera mini (still presto-based, server-side rendering) doesn't store any data on the client. what technologies use browser data storage? in firefox, the following technologies make use of browser data storage to store data when r...
...imit, despite the minimum group limit mentioned above. if you had a really low memory situation where the global limit was, say, 8 mb, then the group limit would also be 8 mb. note: if the group limit is exceeded, or if origin eviction couldn't free enough space, the browser will throw a quotaexceedederror. note: in chrome the soft and hard storage quota limits has changed since m66. more in
formation can be found here. lru policy when the available disk space is filled up, the quota manager will start clearing out data based on an lru policy — the least recently used origin will be deleted first, then the next one, until the browser is no longer over the limit. we track the "last access time" for each origin using temporary storage. once the global limit for temporary storage is re...
InputEvent.inputType - Web APIs
for a complete list of the available input types, see the attributes section of the input events level 1 spec. examples this example logs the inputtype for input events on an editable <div>. ...
...for a complete list of the available input types, see the attributes section of the input events level 1 spec. examples this example logs the inputtype for input events on an editable <div>. ...
IntersectionObserver.rootMargin - Web APIs
the intersectionobserver interface's read-only rootmargin property is a string with syntax similar to that of the css margin property. each side of the rectangle represented by rootmargin is added to the corresponding side in the root element's bounding box before the intersection test is per
formed. this lets you, for example, adjust the bounds outward so that the target element is considered 100% visible even if a certain number of pixels worth of width or height is clipped away, or treat the target as partially hidden if an edge is too close to the edge of the root's bounding box. see the root element and root margin in intersection observer api for a more in-depth look at the root margin and how it works with the root's bounding box. syntax var marginstring = intersectionobser...
...umber of pixels worth of width or height is clipped away, or treat the target as partially hidden if an edge is too close to the edge of the root's bounding box. see the root element and root margin in intersection observer api for a more in-depth look at the root margin and how it works with the root's bounding box. syntax var marginstring = intersectionobserver.rootmargin; value a string,
formatted similarly to the css margin property's value, which contains offsets for one or more sides of the root's bounding box. these offsets are added to the corresponding values in the root's bounding box before the intersection between the resulting rectangle and the target element's bounds. the string returned by this property may not match the one specified when the intersectionobserver was ins...
InterventionReportBody - Web APIs
the interventionreportbody interface of the reporting api represents the body of an intervention report (the return value of its report.body property). an intervention report is generated when usage of a feature in a web document has been blocked by the browser for reasons such as security, per
formance, or user annoyance. ...
...been stopped because it was significantly slowing down the browser, or the browser's autoplay policy blocked audio from playing without a user gesture to trigger it. properties id a string representing the intervention that generated the report. this can be used to group reports by deprecated feature. message a string containing a human-readable description of the intervention, including in
formation such how the intervention could be avoided. this typically matches the message a browser will display in its devtools console when an intervention is imposed, if one is available. sourcefile a string containing the path to the source file where the intervention occurred, if known, or null otherwise. linenumber a number representing the line in the source file in which the intervention oc...
KeyboardEvent.code - Web APIs
* (math.pi/180); position.x += (math.sin(rad) * offset); position.y -= (math.cos(rad) * offset); if (position.x < 0) { position.x = 399; } else if (position.x > 399) { position.x = 0; } if (position.y < 0) { position.y = 399; } else if (position.y > 399) { position.y = 0; } } the refresh() function handles applying the rotation and position by using an svg trans
form. ...
... position.x = 399; } else if (position.x > 399) { position.x = 0; } if (position.y < 0) { position.y = 399; } else if (position.y > 399) { position.y = 0; } } the refresh() function handles applying the rotation and position by using an svg trans
form. function refresh() { let x = position.x - (shipsize.width/2); let y = position.y - (shipsize.height/2); let trans
form = "translate(" + x + " " + y + ") rotate(" + angle + " 15 15) "; spaceship.setattribute("trans
form", trans
form); } finally, the addeventlistener() method is used to start listening for keydown events, acting on each key by updating the ship position and rotation angle, then calling refresh() to draw the ship at its new position and angle. window.addeventlistener("keydown", function(event) {...
KeyboardEvent - Web APIs
at the dom level 3 specification says should happen. there are some caveats, however, as described below. auto-repeat on some gtk environments such as ubuntu 9.4 in some gtk-based environments, auto-repeat dispatches a native key-up event automatically during auto-repeat, and there's no way for gecko to know the difference between a repeated series of keypresses and an auto-repeat. on those plat
forms, then, an auto-repeat key will generate the following sequence of events: keydown keypress keyup keydown keypress keyup <<repeating until the user releases the key>> keyup in these environments, unfortunately, there's no way for web content to tell the difference between auto-repeating keys and keys that are just being pressed repeatedly. auto-repeat handling prior to gecko 5.0 bef...
... keypress keyup <<repeating until the user releases the key>> keyup in these environments, unfortunately, there's no way for web content to tell the difference between auto-repeating keys and keys that are just being pressed repeatedly. auto-repeat handling prior to gecko 5.0 before gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2), keyboard handling was less consistent across plat
forms. windows auto-repeat behavior is the same as in gecko 4.0 and later. mac after the initial keydown event, only keypress events are sent until the keyup event occurs; the inter-spaced keydown events are not sent. linux the event behavior depends on the specific plat
form. it will either behave like windows or mac depending on what the native event model does. note: manually firing an eve...
KeyframeEffect.target - Web APIs
the target property of a keyframeeffect interface represents the element or pseudo-element being animated. it may be null for animations that do not target a specific element. it per
forms as both a getter and a setter, except with animations and transitions generated by css. syntax var targetelement = document.getelementbyid("elementtoanimate"); var keyframes = new keyframeeffect( targetelement, keyframeblock, timingoptions ); // returns #elementtoanimate keyframes.target; // assigns keyframes a new target keyframes.target = newtargetelement; value an element, csspseudoelement, or null. examples in the follow the white rabbit example, whiterabbit sets the target element to be animated: var whiterabbit = document.getelementbyid("rabbit"); var rabbitdownkeyframes = new ke...
.../ returns #elementtoanimate keyframes.target; // assigns keyframes a new target keyframes.target = newtargetelement; value an element, csspseudoelement, or null. examples in the follow the white rabbit example, whiterabbit sets the target element to be animated: var whiterabbit = document.getelementbyid("rabbit"); var rabbitdownkeyframes = new keyframeeffect( whiterabbit, [ { trans
form: 'translatey(0%)' }, { trans
form: 'translatey(100%)' } ], { duration: 3000, fill: 'forwards' } ); // returns <div id="rabbit">click the rabbit's ears!</div> rabbitdownkeyframes.target; specifications specification status comment web animationsthe definition of 'keyframeeffect' in that specification. working draft editor's draft. ...
LargestContentfulPaint - Web APIs
size of the element returned as the area (width * height). largestcontentfulpaint.id the id of the element. this property returns an empty string when there is no id. largestcontentfulpaint.url if the element is an image, the request url of the image. methods largestcontentfulpaint.tojson() returns the above properties as json. examples the following example shows how to create a per
formanceobserver that listens for largest-contentful-paint entries and logs the lcp value to the console. this example also demonstrates how to include buffered entries (those that ocurred before observer() was called), which is done by setting the buffered option to true. note that in this example data is only sent to the server when the user leaves the tab. // catch errors since some browsers thr...
...nstrates how to include buffered entries (those that ocurred before observer() was called), which is done by setting the buffered option to true. note that in this example data is only sent to the server when the user leaves the tab. // catch errors since some browsers throw when using the new `type` option. // https://bugs.webkit.org/show_bug.cgi?id=209216 try { let lcp; const po = new per
formanceobserver((entrylist) => { const entries = entrylist.getentries(); const lastentry = entries[entries.length - 1]; // update `lcp` to the latest value, using `rendertime` if it's available, // otherwise using `loadtime`. (note: `rendertime` may not be available on // image elements loaded cross-origin without the `timing-allow-origin` header.) lcp = lastentry.rendertime ...
LayoutShift - Web APIs
returns the impact fraction (fraction of the viewport that was shifted) times the distance fraction (distance moved as a fraction of viewport). layoutshift.hadrecentinput returns true if there was a user input in the past 500 milliseconds. layoutshift.lastinputtime returns the time of the most recent user input. layoutshift.sources returns an array of layoutshiftattribution objects with in
formation on the elements that were shifted. methods layoutshift.tojson() converts the properties to json. examples the following example shows how to capture layout shifts and log them to the console. note that in this example data is only sent to the server when the user leaves the tab. // catch errors since some browsers throw when using the new `type` option. // https://bugs.webkit.org/...
...rties to json. examples the following example shows how to capture layout shifts and log them to the console. note that in this example data is only sent to the server when the user leaves the tab. // catch errors since some browsers throw when using the new `type` option. // https://bugs.webkit.org/show_bug.cgi?id=209216 try { let cumulativelayoutshiftscore = 0; const observer = new per
formanceobserver((list) => { for (const entry of list.getentries()) { // only count layout shifts without recent user input. if (!entry.hadrecentinput) { cumulativelayoutshiftscore += entry.value; } } }); observer.observe({type: 'layout-shift', buffered: true}); document.addeventlistener('visibilitychange', () => { if (document.visibilitystate === 'hidden') { // for...
LocalFileSystem - Web APIs
le systems: one that's temporary and one that's persistent. (to learn more about the storage types, see the basic concepts article.) in most cases, you need to create only one file system, but in a few cases, it might be useful to create a second one. for example, if you were to create a mail app, you might create a temporary storage for caching assets (like images and attachments) to speed up per
formance, while creating persistent storage for unique data—such as drafts of emails that were composed while offline—that should not be lost before they are backed up into the cloud. using persistent storage the requestfilesystem() method lets you ask for persistent or temporary storage. persistent storage is storage that stays in the browser unless the app or the user removes it, but the use...
...is stackoverflow answer. (an older version of the api is described at managing html5 offline storage.) working within a single origin the file system is sandboxed to a single origin. this means that your app cannot read, or write the files of another app's files. your app cannot access files in an arbitrary folder (such as, my pictures, my documents) on the user's hard drive either. for more in
formation about restrictions, see the basic concepts article. example the following is a code snippet that shows how you can request a file system storage. //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 nee...
Long Tasks API - Web APIs
p that exceeds 50 ms. culprit browsing context container the "culprit browsing context container", or "the container" for short, is the top level page, iframe, embed or object that the task occurred within. attributions a list of containers that the task occurred within. for tasks that don't occur within the top level page, the containerid, containername and containersrc fields may provide in
formation as to the source of the task. usage var observer = new per
formanceobserver(function(list) { var perfentries = list.getentries(); for (var i = 0; i < perfentries.length; i++) { // process long task notifications: // report back for analytics and monitoring // ... } }); // register observer for long task notifications observer.observe({entrytypes: ["longta...
... for (var i = 0; i < perfentries.length; i++) { // process long task notifications: // report back for analytics and monitoring // ... } }); // register observer for long task notifications observer.observe({entrytypes: ["longtask"]}); // long script execution after this will result in queueing // and receiving "longtask" entries in the observer. interfaces per
formancelongtasktiming reports instances of long tasks. taskattributiontiming returns in
formation about the work involved in a long task and its associate frame context. specifications specification status comment long tasks api 1 working draft initial definition. ...
MediaCapabilities - Web APIs
the mediacapabilities interface of the media capabilities api provides in
formation about the decoding abilities of the device, system and browser. the api can be used to query the browser about the decoding abilities of the device based on codecs, profile, resolution, and bitrates. the in
formation can be used to serve optimal media streams to the user and determine if playback should be smooth and power efficient. the in
formation is accessed through the mediacapabilities property of the navigator interface. methods mediacapabilities.encodinginfo() when passed a valid media configuration, it returns a promise with in
formation as to whether the media type is supported, and whether encoding such media would be smooth and power efficient. mediacapabilities.decodinginfo() when passed a ...
... mediacapabilities property of the navigator interface. methods mediacapabilities.encodinginfo() when passed a valid media configuration, it returns a promise with in
formation as to whether the media type is supported, and whether encoding such media would be smooth and power efficient. mediacapabilities.decodinginfo() when passed a valid media configuration, it returns a promise with in
formation as to whether the media type is supported, and whether decoding such media would be smooth and power efficient. specifications specification status comment media capabilitiesthe definition of 'mediacapabilities' in that specification. draft initial definition ...
MediaDevices.getUserMedia() - Web APIs
the error */ } } similarly, using the raw promises directly, the code looks like this: navigator.mediadevices.getusermedia(constraints) .then(function(stream) { /* use the stream */ }) .catch(function(err) { /* handle the error */ }); note: if the current document isn't loaded securely, navigator.mediadevices will be undefined, and you cannot use getusermedia(). see security for more in
formation on this and other security issues related to using getusermedia(). 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. the constraints parameter is a mediastreamconstraints object with two members: video and audio, describ...
...onstraints given, then the returned promise is rejected with notfounderror. the following requests both audio and video without any specific requirements: { audio: true, video: true } if true is specified for a media type, the resulting stream is required to have that type of track in it. if one cannot be included for any reason, the call to getusermedia() will result in an error. while in
formation about a user's cameras and microphones are inaccessible for privacy reasons, an application can request the camera and microphone capabilities it needs and wants, using additional constraints. the following expresses a preference for 1280x720 camera resolution: { audio: true, video: { width: 1280, height: 720 } } the browser will try to honour this, but may return other resolutions i...
MediaDevices.ondevicechange - Web APIs
happens whenever the set of media devices available to the user agent and, by extension, to the web site or app has changed. you can at any time use enumeratedevices() to get the updated list of available devices. syntax mediadevices.ondevicechange = eventhandler; value a function you provide which accepts as input a event object describing the devicechange event that occurred. there is no in
formation about the change included in the event object; to get the updated list of devices, you'll have to use enumeratedevices(). example in this example, we create a function called updatedevicelist(), which is called once when mediadevices.getusermedia() successfully obtains a stream, and then is called any time the device list changes. it displays in the browser window two lists: one of audio d...
...e used to list the audio and video devices: let audiolist = document.getelementbyid("audiolist"); let videolist = document.getelementbyid("videolist"); getting and drawing the device list now let's take a look at updatedevicelist() itself. this method is called any time we want to fetch the current list of media devices and then update the displayed lists of audo and video devices using that in
formation. 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> (...
MediaError.message - Web APIs
syntax var errormessage = mediaerror.message; value a domstring providing a detailed, specific explanation of what went wrong and possibly how it might be fixed. ...
...borted: s += "the user canceled the audio."; break; case mediaerror.media_err_network: s+= "a network error occurred while fetching the audio."; break; case mediaerror.media_err_decode: s+= "an error occurred while decoding the audio."; break; case mediaerror.media_err_src_not_supported: s+= "the audio is missing or is in a
format not supported by your browser."; break; default: s += "an unknown error occurred."; break; } let message = err.message; if (message && message.length) { s += " " + message; } displayerrormessage("<strong>error " + err.code + ":</strong> " + s + "<br>"); }; this gets the mediaerror object describing the error from the error property o...
MediaPositionState.duration - Web APIs
the mediapositionstate dictionary's duration property is used when calling the mediasession method setpositionstate() to provide the user agent with the overall total duration in seconds of the media currently being per
formed. this in
formation can then, in turn, be used by the user agent to provide a user interface which displays media playback in
formation to the viewer. for example, a browser might use this in
formation along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls. syntax let positionstate = { duration: durationinseconds }; let durationinseconds = positionstate.duration; ...
..., as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls. syntax let positionstate = { duration: durationinseconds }; let durationinseconds = positionstate.duration; value a floating-point value indicating the overall duration, in seconds, of the media being per
formed. this value should always be positive. to indicate media of unknown or indeterminate length, such as an ongoing live stream, specify a value of positive infinity (infinity). example in this example, an app per
forming a live stream provides in
formation to the browser by preparing a mediapositionstate object and submitting it by calling navigator.mediasession.setpositionstate(). let positionst...
MediaPositionState.playbackRate - Web APIs
the mediapositionstate dictionary's playbackrate property is used when calling the mediasession method setpositionstate() to tell the user agent the rate at which media is currently being played. this in
formation can then, in turn, be used by the user agent to provide a user interface which displays media playback in
formation to the viewer. for example, a browser might use this in
formation along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls. syntax let positionstate = { playbackrate: rate }; let playbackrate = positionstate.playbackrate; value a floating-point value specifyin...
...ession's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls. syntax let positionstate = { playbackrate: rate }; let playbackrate = positionstate.playbackrate; value a floating-point value specifying a multiplier corresponding to the current relative rate at which the media being per
formed is playing. a value of 1.0 indicates the media is playing forward at normal speed, while higher values indicate that the media is being played faster than normal. lower values indicate the media is being played more slowly. negative values can be specified to indicate the media is playing in reverse, with decreasing values then indicating faster and faster reverse playback. note: a value of 0...
MediaPositionState.position - Web APIs
the mediapositionstate dictionary's position property is used when calling the mediasession method setpositionstate() to provide the user agent with the current playback position, in seconds, of the currently-playing media. this in
formation is then, in turn, used by the user agent to provide a user interface which displays media playback in
formation to the viewer. for example, a browser might use this in
formation along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls. syntax let positionstate = { position: timeinseconds }; let duration = positionstate.duration; value a floating-...
...ate, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls. syntax let positionstate = { position: timeinseconds }; let duration = positionstate.duration; value a floating-point value indicating the current playback position within the media currently being per
formed, in seconds. this value should always be zero or more. example in this example, a player for a non-standard media file
format, written in javascript, uses setinterval() to establish a callback which fires once per second to refresh the position in
formation by calling setpositionstate(). if the media is still playing when the interval is fired, setpositionstate() is called with an object that ...
MediaPositionState - Web APIs
properties duration a floating-point value giving the total duration of the current media in seconds. this should always be a positive number, with positive infinity (infinity) indicating media without a defined end, such as a live stream. ...
... properties duration a floating-point value giving the total duration of the current media in seconds. this should always be a positive number, with positive infinity (infinity) indicating media without a defined end, such as a live stream. ...
MediaRecorder.mimeType - Web APIs
the mimetype read-only property returns the mime media type that was specified when creating the mediarecorder object, or, if none was specified, which was chosen by the browser. this is the file
format of the file that would result from writing all of the recorded data to disk. keep in mind that not all codecs are supported by a given container; if you write media using a codec that is not supported by a given media container, the resulting file may not work reliably if at all when you try to play it back. see our media type and
format guide for in
formation 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. mdn web docs content uses the terms interchangeably. synt...
...this string may include the codecs parameter, giving details about the codecs and the codec configurations used by the media recorder. the media type strings are standardized by the internet assigned numbers authority (iana). ...
MediaRecorder.onerror - Web APIs
e user denies permission to use an input device. this also happens when a mediastreamtrack within the stream is marked as isolated due to the peeridentity constraint on the source stream. notsupportederror an attempt was made to instantiate a mediarecorder using a mime type that isn't supported on the user's device; one or more of the requested container, codecs, or profiles as well as other in
formation may be invalid. unknownerror an non-security related error occurred that cannot otherwise be categorized. recording stops, the mediarecorder's state becomes inactive, one last dataavailable event is sent to the mediarecorder with the remaining received data, and finally a stop event is sent. these errors may occur either directly because of a call to a mediarecorder method, or indirectly...
... one last dataavailable event is sent to the mediarecorder with the remaining received data, and finally a stop event is sent. these errors may occur either directly because of a call to a mediarecorder method, or indirectly due to a problem arising during the recording process. example this example creates a new mediarecorder instance and starts recording using the user agent's default media
format. it returns either the mediarecorder or the name of the error that occurred if any exceptions are thrown during the setup process. function recordstream(stream) { let recorder = null; let bufferlist = []; try { recorder = new mediarecorder(stream); } catch(err) { return err.name; /* return the error name */ } recorder.ondataavailable = function(event) { bufferlis...
MediaStream - Web APIs
the mediastream interface represents a stream of media content. a stream consists of several tracks such as video or audio tracks. each track is specified as an instance of mediastreamtrack.you can obtain a mediastream object either by using the constructor or by calling mediadevices.getusermedia(). some user agents subclass this interface to provide more precise in
formation or functionality, like in canvascapturemediastream. constructor mediastream() creates and returns a new mediastream object. you can create an empty stream, a stream which is based upon an existing stream, or a stream that contains a specified list of tracks (specified as an array of mediastreamtrack objects). properties this interface inherits properties from its parent, eventtarget. mediastream.active read on...
...the specification; you should instead check the value of mediastreamtrack.readystate to see if its value is ended for the track or tracks you want to ensure have finished playing. mediastream.id read only a domstring containing 36 characters denoting a universally unique identifier (uuid) for the object. event handlers mediastream.onaddtrack an eventhandler containing the action to per
form when an addtrack event is fired when a new mediastreamtrack object is added. mediastream.onremovetrack an eventhandler containing the action to per
form when a removetrack event is fired when a mediastreamtrack object is removed from it. methods this interface inherits methods from its parent, eventtarget. mediastream.addtrack() stores a copy of the mediastreamtrack given as argument. if ...
Recording a media element - Web APIs
ment (namely <audio> or <video>) as the source of the mediastream to be recorded. in this article, we'll look at an example that does just that. html content <p>click the "start" button to begin video recording for a few seconds. you can stop the video by clicking the creatively-named "stop" button. the "download" button will download the received data (although it's in a raw, unwrapped
form that isn't very useful). </p> <br> let's start by looking at the key bits of the html. there's a little more than this, but it's just in
formational rather than being part of the core operation of the app. <div class="left"> <div id="startbutton" class="button"> start </div> <h2>preview</h2> <video id="preview" width="160" height="120" autoplay muted></video> </div> we present...
...e are references to elements we need to work with. the last, recordingtimems, is set to 5000 milliseconds (5 seconds); this specifies the length of the videos we'll record. utility functions next, we create some utility functions that will get used later. function log(msg) { logelement.innerhtml += msg + "\n"; } the log() function is used to output text strings to a <div> so we can share in
formation with the user. not very pretty but it gets the job done for our purposes. function wait(delayinms) { return new promise(resolve => settimeout(resolve, delayinms)); } the wait() function returns a new promise which resolves once the specified number of milliseconds have elapsed. it works by using an arrow function which calls window.settimeout(), specifying the promise's resolution handl...
MediaTrackConstraints.deviceId - Web APIs
value of the deviceid constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.deviceid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this in
formation, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { deviceid: constraint }; constraintsobject.deviceid = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) device ids which are acceptable as the source of media content. device ids are unique for a g...
...bject based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) device ids which are acceptable as the source of media content. device ids are unique for a given origin, and are guaranteed to be the same across browsing sessions on the same origin. however, the value of the deviceid is determined by the source of the track's content, and there's no particular
format mandated by the specification (although some kind of guid is recommended). that means that a given track will only return one value for the deviceid when you call getcapabilities(). because of this, there's no use for the device id when calling mediastreamtrack.applyconstraints(), since there is only one possible value; however, you can record a deviceid and use it to ensure that you get the s...
MediaTrackConstraints.latency - Web APIs
e value of the latency constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.latency as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this in
formation, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { latency: constraint }; constraintsobject.latency = constraint; value a constraindouble describing the acceptable or required value(s) for an audio track's latency, with values specified in seconds. in audio processing, latency is the time between the start of processing...
...ble describing the acceptable or required value(s) for an audio track's latency, with values specified in seconds. in audio processing, latency is the time between the start of processing (when sound occurs in the real world, or is generated by a hardware device) and the data being made available to the next step in the audio input or output process. in most cases, low latency is desirable for per
formance and user experience purposes, but when power consumption is a concern, or delays are otherwise acceptable, higher latency might be acceptable. if this property's value is a number, the user agent will attempt to obtain media whose latency tends to be as close as possible to this number given the capabilities of the hardware and the other constraints specified. otherwise, the value of this co...
MediaTrackSettings.deviceId - Web APIs
provided when calling either getusermedia(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.deviceid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this in
formation, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var deviceid = mediatracksettings.deviceid; value a domstring whose value is an origin-unique identifier for the track's source. this id is valid across multiple browsing sessions for the same origin and is guaranteed to be different for all other origins, so you can safely use it to request the ...
...value is an origin-unique identifier for the track's source. this id is valid across multiple browsing sessions for the same origin and is guaranteed to be different for all other origins, so you can safely use it to request the same source be used for multiple sessions, for example. the actual value of the string, however, is determined by the source of the track, and there is no guarantee what
form it will take, although the specification does recommend it be a guid. since there is a one-to-one pairing of id with each source, all tracks with the same source will share the same id for any given origin, so mediastreamtrack.getcapabilities() will always return exactly one value for deviceid. that makes the device id not useful for any changes to constraints when calling mediastreamtrack.apply...
MediaTrackSupportedConstraints - Web APIs
the mediatracksupportedconstraints dictionary establishes the list of constrainable properties recognized by the user agent or browser in its implementation of the mediastreamtrack object. an object con
forming to mediatracksupportedconstraints is returned by mediadevices.getsupportedconstraints(). because of the way interface definitions in webidl work, if a constraint is requested but not supported, no error will occur. ...
...d by mediadevices.getsupportedconstraints(). because of the way interface definitions in webidl work, if a constraint is requested but not supported, no error will occur. instead, the specified constraints will be applied, with any unrecognized constraints stripped from the request.that can lead to confusing and hard to debug errors, so be sure to use getsupportedconstraints() to retrieve this in
formation before attempting to establish constraints if you need to know the difference between silently ignoring a constraint and a constraint being accepted. an actual constraint set is described using an object based on the mediatrackconstraints dictionary. to learn more about how constraints work, see capabilities, constraints, and settings. properties some combination—but not necessarily al...
MerchantValidationEvent() - Web APIs
h uses the merchantvalidationevent interface. options optional an optional dictionary which may contain zero or more of the following properties: methodname optional a domstring containing the payment method identifier for the payment handler being used. this is an empty string by default. validationurl optional the url from which to retrieve payment handler specific verification in
formation used to validate the merchant. this is an empty string by default. return value a newly-created merchantvalidationevent providing the in
formation that needs to be delivered to the client-side code to present to the user agent by calling complete(). exceptions typeerror the string specified as validationurl could not be parsed as a url. rangeerror the specified methodname does n...
...efault. return value a newly-created merchantvalidationevent providing the in
formation that needs to be delivered to the client-side code to present to the user agent by calling complete(). exceptions typeerror the string specified as validationurl could not be parsed as a url. rangeerror the specified methodname does not correspond to a known and supported merchant or is not a well-
formed standard payment method identifier. specifications specification status comment payment request apithe definition of 'merchantvalidationevent()' in that specification. candidate recommendation initial definition. ...
MerchantValidationEvent.complete() - Web APIs
all you have to do is call complete() from your handler for the merchantvalidation event, passing in the data fetched from the validationurl. syntax merchantvalidationevent.complete(validationdata); merchantvalidationevent.complete(merchantsessionpromise); parameters validationdata or merchantsessionpromise an object containing the data needed to complete the merchant validation process, or a promise which resolves to the validation data. return value undefined. ...
...lves to the validation data. return value undefined. exceptions this exception may be passed into the rejection handler for the promise: invalidstateerror the event did not come directly from the user agent, but was instead dispatched by other code. another payment request is currently being processed, the current payment request is not currently being displayed to the user, or payment in
formation is currently being updated. example in this example, we see the client-side code needed to support merchant validation for a payment request called payrequest: payrequest.onmerchantvalidation = event => { const validationdatapromise = getvalidationdata(event.validationurl); event.complete(validationdatapromise); } function getvalidationdata(url) { /* ...retrieve the validation dat...
MimeType - Web APIs
the mimetype interface provides contains in
formation about a mime type associated with a particular plugin. navigatorplugins.mimetypes returns an array of this object. properties mimetype.type returns the mime type of the associated plugin. mimetype.description returns a description of the associated plugin or an empty string if there is none. mimetype.suffixes a string containing valid file extensions for the data displayed by the plugin, or an empty string if an extension is not valid for the particular module. for example, a browser's content decryption module may appear in the plugin list but support more file extensions than can be anticipated. it might therefore return an empty string. ...
...ing containing valid file extensions for the data displayed by the plugin, or an empty string if an extension is not valid for the particular module. for example, a browser's content decryption module may appear in the plugin list but support more file extensions than can be anticipated. it might therefore return an empty string. mimetype.enabledplugin returns an instance of plugin containing in
formation about the plugin itself. specifications specification status comment html living standardthe definition of 'mimetype' in that specification. living standard initial definition. ...
MouseEvent.pageX - Web APIs
pixels of the left side of the document are scrolled out of view, and the mouse is clicked 100 pixels inward from the left edge of the view, the value returned by pagex will be 300. originally, this property was defined as a long integer. the cssom view module redefined it as a double float. see the browser compatibility section for details. see page in coordinate systems for some additional in
formation about coordinates specified in this fashion. syntax var pagex = mouseevent.pagex; value a floating-point number of pixels from the left edge of the document at which the mouse was clicked, regardless of any scrolling or viewport positioning that may be in effect. this property was originally specified in the touch events specification as a long integer, but was redefined in the cssom vi...
...l precision. even though numeric types both are represented by number in javascript, they may be handled differently internally in the browser's code, resulting in potential behavior differences. see browser compatibility to learn which browsers have been updated to use the revised data type. example more examples you can also see an example that demonstrates how to access the mouse position in
formation in every available coordinate system. let's take a look at a simple example that shows you the mouse's position relative to the page's origin. since this example is presented in an <iframe>, that top-left corner is the top-left corner of the frame, not the browser window. javascript var box = document.queryselector(".box"); var pagex = document.getelementbyid("x"); var pagey = document.ge...
msIsBoxed - Web APIs
or every user. there may also be large incompatibilities between implementations and the behavior may change in the future. msisboxed is a property which gets or sets when the video player control is in boxed (letterbox or pillarbox) mode. this proprietary property is specific to internet explorer and microsoft edge. returns true if the video is in letterbox or pillarbox mode. ...
...or may change in the future. msisboxed is a property which gets or sets when the video player control is in boxed (letterbox or pillarbox) mode. this proprietary property is specific to internet explorer and microsoft edge. returns true if the video is in letterbox or pillarbox mode. letterbox
format displays black bars on the top and bottom of a video to fill in between the wide screen
format of a video, and the aspect ratio of the screen. typically the video's left and right edges go to the full width of the screen. pillarbox
format displays black bars on the left and right of a video to fill in the difference between a video and a wider screen. with pillarbox
format, the top and bottom edges of the video go to the full height of the screen. syntax isboxed = object.msisboxed ...
Navigator.getBattery() - Web APIs
the getbattery() method provides in
formation about the system's battery. it returns a battery promise, which is resolved in a batterymanager object providing also some new events you can handle to monitor the battery status. this implements the battery status api; see that documentation for additional details, a guide to using the api, and sample code. note: in some browsers access to this feature is controlled by feature-policy directive battery. syntax var batterypromise = navigator.getbattery(); return value a promise which, when resolved, calls its fulfillment handler with a single parameter: a batterymanager object which you can use to get in
formation about the battery's state. exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, pass...
... note: old versions of some user agents might allow use of this feature in insecure contexts. ...
Navigator.mediaCapabilities - Web APIs
syntax mediacapabilitiesobj = globalobj.navigator.mediacapabilities value a mediacapabilities object. ...
... syntax mediacapabilitiesobj = globalobj.navigator.mediacapabilities value a mediacapabilities object. ...
Navigator.mediaSession - Web APIs
in addition, the mediasession interface provides the setactionhandler() method, which lets you receive events when the user engages device controls such as either onscreen or physical play, pause, seek, and other similar controls. ...
...ice controls such as either onscreen or physical play, pause, seek, and other similar controls. an internet radio app, for example, can use setactionhandler() to let fhe media controls on a keyboard or elsehwere on the user's device be used to control the app's media playback. syntax let mediasession = navigator.mediasession; value a mediasession object the current document can use to share in
formation about media it's playing and its current playback status. this in
formation can include typical metadata such as the title, artist, and album name of the song being played as well as potentially one or more images containing things like album art, artist photos, and so forth. example in this example, metadata is submitted to the mediasession object. note that the code begins by ensuring tha...
Navigator.oscpu - Web APIs
the navigator.oscpu property returns a string that identifies the current operating system. syntax oscpuinfo = navigator.oscpu value a domstring providing a string which identifies the operating system on which the browser is running. ...
... specifications specification status comment html living standardthe definition of 'navigatorid: oscpu' in that specification. living standard initial definition ...
Web-based protocol handlers - Web APIs
e resultant url. the user friendly name for the protocol handler. when a browser executes this code, it should display a prompt to the user, asking permission to allow the web application to register as a handler for the protocol. firefox displays a prompt in the notification bar area: note:the url template supplied when registering must be of the same domain as the webpage attempting to per
form the registration or the registration will fail. for example, http://example.com/homepage.html can register a protocol handler for http://example.com/handle_mailto/%s, but not for http://example.org/handle_mailto/%s. registering the same protocol handler more than once will pop up a different notification, indicating that the protocol handler is already registered. therefore, it is a good idea to...
...c "-//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. the browser extracts the href from the activated link, combines it with the url template supplied during handler registration and per
forms an http get on the url. so, using the above examples, the browser would per
form a get on this url: http://www.google.co.uk/?uri=web+burger:cheeseburger server side code can extract the query string parameters and per
form the desired action. note:the server side code is passed the entire contents of the href. this means the server side code will have to parse out the protocol from the data. ...
NavigatorPlugins.plugins - Web APIs
ve flash plugin. function getflashversion() { var flash = navigator.plugins.nameditem('shockwave flash'); if (typeof flash != 'object') { // flash is not present return undefined; } if(flash.version){ return flash.version; } else { //no version property (e.g. in chrome) return flash.description.replace(/shockwave flash /,""); } } the following example displays in
formation about the installed plugin(s). var pluginslength = navigator.plugins.length; document.body.innerhtml = pluginslength + " plugin(s)<br>" + '<table id="plugintable"><thead>' +'<tr><th>name</th><th>filename</th><th>description</th><th>version</th></tr>' +'</thead><tbody></tbody></table>'; var table = document.getelementbyid('plugintable'); for(var i = 0; i < pluginslength; i++) { le...
...a list of plugins is also available by entering about:plugins in the browser's location bar. specifications specification status comment html living standardthe definition of 'navigatorplugins.plugins' in that specification. living standard initial definition. ...
Node - Web APIs
realistic usage the following demonstrates a real-world use of the eachnode() function: searching for text on a web-page. we use a wrapper function named grep to do the searching: function grep(parentnode, pattern) { const matches = [] let endscan = false eachnode(parentnode, function(no...
... <span>bar</span> <span>baz</span> </div> const box = document.getelementbyid("box") eachnode(box, function(node) { if (null != node.textcontent) { console.log(node.textcontent) } }) the above will result in the following strings printing to the user's console: "\n\t", "foo", "\n\t", "bar", "\n\t", "baz" note: whitespace
forms part of a text node, meaning indentation and newlines
form separate text between the element nodes. realistic usage the following demonstrates a real-world use of the eachnode() function: searching for text on a web-page. we use a wrapper function named grep to do the searching: function grep(parentnode, pattern) { const matches = [] let endscan = false eachnode(parentnode, function(node){ if (endscan) { return false } // igno...
Notification - Web APIs
constructor notification() creates a new instance of the notification object. properties static properties these properties are available only on the notification object itself. ...
... constructor notification() creates a new instance of the notification object. properties static properties these properties are available only on the notification object itself. ...
NotificationAction - Web APIs
properties instance properties these properties are available only on instances of the notification object. ...
...scribing the action that is displayed to the user. notificationaction.icon read only the url of the image used to represent the notification when there is not enough space to display the notification itself. example notifications can fire notificationclick events on the serviceworkerglobalscope. here a service worker shows a notification with a single "archive" action, allowing users to per
form this common task from the notification without having to open the website. the user can also click the main body of the notification to open their inbox instead. self.registration.shownotification("new mail from alice", { actions: [ { action: 'archive', title: 'archive' } ] }); self.addeventlistener('notificationclick', function(event) { event.notification.close(); i...
OES_standard_derivatives - Web APIs
availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. in webgl 2, the constant is available as gl.fragment_shader_derivative_hint and it requires glsl #version 300 es. ...
... recommendation ini...
OES_texture_half_float - Web APIs
availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. the constant in webgl2 is gl.half_float. constants ext.half_float_oes half floating-point type (16-bit). ...
...ar, and use half floating-point textures, the texture will be marked as incomplete. to use linear filtering on half floating-point textures, enable the oes_texture_half_float_linear extension in addition to this extension. half floating-point color buffers this extension implicitly enables the ext_color_buffer_half_float extension (if supported), which allows rendering to 16-bit floating point
formats. examples var ext = gl.getextension('oes_texture_half_float'); var texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); gl.teximage2d(gl.texture_2d, 0, gl.rgba, gl.rgba, ext.half_float_oes, image); specifications specification status comment oes_texture_half_floatthe definition of 'oes_texture_half_float' in that specification. recommendation ...
OVR_multiview2 - Web APIs
the ovr_multiview2 extension is part of the webgl api and adds support for rendering into multiple views simultaneously. this especially useful for virtual reality (vr) and webxr. for more in
formation, see also: multiview on webxr three.js multiview demo multiview in babylon.js optimizing virtual reality: understanding multiview multiview webgl rendering for oculus browser 6.0+ webgl extensions are available using the webglrenderingcontext.getextension() method. for more in
formation, see also using extensions in the webgl tutorial. availability: support depends on the system's graphics driver (windows+angle and android are supported; windows+gl, mac, linux are not supported). this extension is only available to webgl 2 contexts as it needs glsl 3.00 and texture arrays. currently...
...array, 1, gl.depth32f_stencil8, 512, 512, 2); ext.framebuffertexturemultiviewovr(gl.draw_framebuffer, gl.depth_stencil_attachment, depthstenciltex, 0, 0, 2); gl.drawelements(...); // draw will be broadcasted to the layers of colortex and depthstenciltex. shader code #version 300 es #extension gl_ovr_multiview2 : require precision mediump float; layout (num_views = 2) in; in vec4 inpos; uni
form mat4 u_viewmatrices[2]; void main() { gl_position = u_viewmatrices[gl_viewid_ovr] * inpos; } specifications specification status ovr_multiview2 community approved ...
OscillatorNode.OscillatorNode() - Web APIs
if the default values of the properties are acceptable, you can optionally use the audiocontext.createoscillator() factory method instead. syntax var oscillatornode = new oscillatornode(context, options) parameters inherits parameters from the audionodeoptions dictionary. context a reference to an audiocontext. ...
...properties omitted from the object will take on the default value as documented. type the shape of the wave produced by the node. valid values are 'sine', 'square', 'sawtooth', 'triangle' and 'custom'. the default is 'sine'. detune a detuning value (in cents) which will offset the frequency by the given amount. its default is 0. frequency the frequency (in hertz) of the periodic wave
form. its default is 440. periodicwave an arbitrary period wave
form described by a periodicwave object. return value a new oscillatornode object instance. specifications specification status comment web audio apithe definition of 'oscillatornode()' in that specification. working draft initial definition. ...
OscillatorNode.type - Web APIs
the type property of the oscillatornode interface specifies what shape of wave
form the oscillator will output. there are several common wave
forms available, as well as an option to specify a custom wave
form shape. the shape of the wave
form will affect the tone that is produced. syntax oscillatornode.type = type; value a domstring specifying the shape of oscillator wave. the different available values are: sine a sine wave. this is the default value. square a square wave with a duty cycle of 0.5; that is, the signal is "high" for half of each period. sawtooth a sawtooth wave. triangle a triangle wave. custom a custom wave
form. you never set type to custom manually; instead, use the setperiodicwave() method to provide the data representing the wave
form. doing so automatically ...
...doing so automatically sets the type for you. example the following example shows basic usage of an audiocontext to create an oscillator node. for an applied example, check out our violent theremin demo (see app.js for relevant code). ...
PannerNode.setVelocity() - Web APIs
the setvelocity() method of the pannernode interface defines the velocity vector of the audio source — how fast it is moving and in what direction. this method was removed from the specification because of gaps in its design and implementation problems. the velocity relative to the listener is used to control the pitch change needed to con
form with the doppler effect due to the relative speed. as the vector controls both the direction of travel and its velocity, the three parameters x, y and z are expressed in meters per second. the default value of the velocity vector is (0, 0, 0). syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setvelocity(0,0,17); returns void. example in the following example, you can see an example of how the createpann...
...m box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
ParentNode.querySelector() - Web APIs
yselector(), documentfragment.queryselector() and element.queryselector(). syntax element = parentnode.queryselector(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid compound selector list supported by the browser; if it's not, a syntaxerror exception is thrown. ...
... return value the first element that matches at least one of the specified selectors or null if no such element is found. note: if the specified selectors include a css pseudo-element, the returned value is always null. exceptions syntaxerror the syntax of the specified selectors string is not valid. ...
PasswordCredential - Web APIs
the data in the objects will be added to the request body and sent to the remote endpoint with the credentials. ...
...class may be passed in the credential member of the init object for global fetch. note: this interface is restricted to top-level contexts and cannot be used from an <iframe>. constructor passwordcredential()secure context creates a new passwordcredential object. properties inherits properties from its ancestor, credential. passwordcredential.additionaldata secure context one of a
formdata instance, a urlsearchparams instance, or null. the data in the objects will be added to the request body and sent to the remote endpoint with the credentials. passwordcredential.iconurl read only secure context a usvstring containing a url pointing to an image for an icon. this image is intended for display in a credential chooser. the url must be accessible without authentication. passwor...
Path2D.addPath() - Web APIs
(technically a dommatrixinit object). examples adding a path to an existing path this example adds one path to another. html <canvas id="canvas"></canvas> javascript first, we create two separate path2d objects, each of which contains a rectangle made using the rect() method. we then create a matrix using document.createelementns() and createsvgmatrix(). ...
...ve the second path to the right. finally, we draw the first path (which now contains both rectangles) using fill(). ...
PaymentDetailsUpdate - Web APIs
properties the paymentdetailsupdate dictionary is based on the paymentdetailsbase dictionary, and inherits its properties, which are included in the list below. ...
... properties the paymentdetailsupdate dictionary is based on the paymentdetailsbase dictionary, and inherits its properties, which are included in the list below. ...
PaymentMethodChangeEvent.methodName - Web APIs
er are described by the paymentmethodchangeevent. syntax var methodname = paymentmethodchangeevent.methodname; value a domstring which uniquely identifies the currently-selected payment handler. this may be a string chosen from the list of standardized payment method identifiers, or a url used by the payment processing service. see payment method identifiers in payment request api for more in
formation. the default value is the empty string, "". example this example uses the paymentmethodchange event to watch for changes to the payment method selected for apple pay, in order to compute a discount if the user chooses to use a visa card as their payment method. request.onpaymentmethodchange = function(ev) { const { type: cardtype } = ev.methoddetails; const newstuff = {}; if (ev.me...
...te a discount if the user chooses to use a visa card as their payment method. request.onpaymentmethodchange = function(ev) { const { type: cardtype } = ev.methoddetails; const newstuff = {}; if (ev.methodname === "https://apple.com/apple-pay") { switch (cardtype) { case "visa": // do apple pay specific handling for visa card... // methoddetails contains the card in
formation const result = calculatediscount(ev.methoddetails); object.assign(newstuff, result); break; } } // finally... ev.updatewith(newstuff); }; const response = await request.show(); specifications specification status comment payment request apithe definition of 'paymentmethodchangeevent.methodname' in that specification. candidate re...
PaymentRequest: paymentmethodchange event - Web APIs
look at an example. this code creates a new paymentrequest, adds a handler for the paymentmethodchange event by calling the request's addeventlistener(), then calls show() to present the payment interface to the user. the code assumes the existence of a method detailsforshipping(), which returns a paymentdetailsupdate object containing the shipping options for the ground shipping method, in the
form found in the paymentshippingoption dictionary. by doing so, the payment
form defaults to the ground shipping method. const options = { requestshipping: true }; const paymentrequest = new paymentrequest(paymentmethods, detailsforshipping("ground"), options); paymentrequest.addeventlistener("paymentmethodchange", handlepaymentchange, false); paymentrequest.show() .then(response => respo...
... before the event handler returns, it calls the event's paymentmethodchangeevent.updatewith.updatewith() m...
PaymentRequestUpdateEvent - Web APIs
those events are: shippingaddresschange secure context dispatched whenever the user changes their shipping address. also available using the onshippingaddresschange event handler property. shippingoptionchange secure context dispatched whenever the user changes a shipping option. also available using the onshippingoptionchange event handler property. constructor paymentrequestupdateevent() secure context creates a new paymentrequestupdateevent object. ...
...questupdateevent() secure context creates a new paymentrequestupdateevent object. properties provides only the properties inherited from its parent interface, event. methods in addition to methods inherited from the parent interface, event, paymentrequestupdateevent offers the following methods: paymentrequestupdateevent.updatewith() secure context if the event handler determines that in
formation included in the payment request needs to be changed, or that new in
formation needs to be added, it calls updatewith() with the in
formation that needs to be replaced or added. specifications specification status comment payment request apithe definition of 'paymentrequestupdateevent' in that specification. candidate recommendation initial definition. ...
PaymentResponse.complete() - Web APIs
epts the payment request and the promise returned by the paymentrequest.show() method is resolved. syntax completepromise = paymentrequest.complete(result); parameters result optional a domstring indicating the state of the payment operation upon completion. it must be one of the following: success the payment was successfully processed. the user agent may or may not present some
form of "payment successful" indication to the user. fail the payment was not successfully processed. the failure may or may not be announced to the user by the user agent, depending on its design. unknown the success or failure status of the transaction is unknown or irrelevant, and the user agent should not present any notification, even if it normally would. this is the default value. ...
...eptions aborterror the document in which the payment request is taking place became inactive while the user interface was shown. invalidstateerror the payment has already completed, or complete() was called while a request to retry the payment is pending. you can't treat a payment as complete after requesting that the payment be tried again. examples the following example sends payment in
formation to a secure server using the fetch api. it calls complete() with an answer appropriate to the status in the response. // initialization of paymentrequest arguments are excerpted for the // sake of brevity. var payment = new paymentrequest(supportedinstruments, details, options); payment.show().then(function(paymentresponse) { var fetchoptions = { method: 'post', credentials: in...
PaymentResponse.details - Web APIs
the details read-only property of the paymentresponse interface returns a json-serializable object that provides a payment method specific message used by the merchant to process the transaction and determine a successful funds transfer. this data is returned by the payment app that satisfies the payment request, and must con
form to the structure defined in the basiccardresponse dictionary. syntax var detailsobject = paymentresponse.details; example the following example extracts the details from the paymentresponse object to the promise returned from paymentrequest.show(). in a real-world implementation this data would then be sent to a payment server. payment.show().then(paymentresponse => { var paymentdata = { // payment method string method: paymentresponse.methodname, ...
...om the paymentresponse object to the promise returned from paymentrequest.show(). in a real-world implementation this data would then be sent to a payment server. payment.show().then(paymentresponse => { var paymentdata = { // payment method string method: paymentresponse.methodname, // payment details as you requested details: paymentresponse.details, // shipping address in
formation address: todict(paymentresponse.shippingaddress) }; // send in
formation to the server }); specifications specification status comment payment request api candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please chec...
PaymentResponse.methodName - Web APIs
t method identifiers or a url used by the payment handler to process payments. syntax var methodname = paymentresponse.methodname; value a domstring uniquely identifying the payment handler being used to process the payment. this may be either a standardized identifier, or a url used by the payment processor to handle payments. see merchant validation in payment processing concepts for more in
formation. example the following example extracts the method name from the paymentresponse object to the promise returned from paymentrequest.show(). in a real-world implementation this data would then be sent to a payment server. payment.show().then(paymentresponse => { var paymentdata = { // payment method string method: paymentresponse.methodname, // payment details as you requeste...
...om the paymentresponse object to the promise returned from paymentrequest.show(). in a real-world implementation this data would then be sent to a payment server. payment.show().then(paymentresponse => { var paymentdata = { // payment method string method: paymentresponse.methodname, // payment details as you requested details: paymentresponse.details, // shipping address in
formation address: todict(paymentresponse.shippingaddress) }; // send in
formation to the server }); specifications specification status comment payment request api candidate recommendation initial definition. ...
PaymentResponse.onpayerdetailchange - Web APIs
the paymentresponse object's onpayerdetailchange property is an event handler which is called to handle the payerdetailchange event, which is sent to the paymentresponse when the user makes changes to their personal in
formation while filling out a payment request
form. syntax paymentresponse.onpayerdetailchange = eventhandlerfunction; value an event handler function which is called to handle the payerdetailchange event when the user makes changes to their personal in
formation while editing a payment request
form. ...
...orm. syntax paymentresponse.onpayerdetailchange = eventhandlerfunction; value an event handler function which is called to handle the payerdetailchange event when the user makes changes to their personal in
formation while editing a payment request
form. examples in the example below, onpayerdetailchange is used to set up a listener for the payerdetailchange event in order to validate the in
formation entered by the user, requesting that any mistakes be corrected // options for paymentrequest(), indicating that shipping address, // payer email address, name, and phone number all be collected. const options = { requestshipping: true, requestpayeremail: true, requestpayername: true, requestpayerphone: true, }; const request = new paymentrequest(methods, details, options); const re...
PaymentResponse - Web APIs
a payment request. properties paymentresponse.details read only secure context returns a json-serializable object that provides a payment method specific message used by the merchant to process the transaction and determine successful fund transfer. the contents of the object depend on the payment method being used; for example, if the basic card payment method is used, this object must con
form to the structure defined in the basiccardresponse dictionary. paymentresponse.methodname read only secure context returns the payment method identifier for the payment method that the user selected, for example, visa, mastercard, paypal, etc.. paymentresponse.payeremail read only secure context returns the email address supplied by the user. this option is only present when the requestpaye...
.... this causes any remaining user interface to be closed. this method should only be called after the promise returned by the paymentrequest.show() method. events listen to this event using addeventlistener() or by assigning an event listener to the oneventname property of this interface. payerdetailchange secure context fired during a retry when the user makes changes to their personal in
formation while filling out a payment request
form. allows the developer to revalidate any requested user data (e.g., the phone number or the email address) if it changes. also available via the onpayerdetailchange property. specifications specification status comment payment request apithe definition of 'paymentresponse' in that specification. candidate recommendation ...
PaymentValidationErrors - Web APIs
the paymentvalidationerrors dictionary represents objects providing in
formation about any and all errors that occurred while processing a payment request. when validation of the paymentresponse returned by the paymentrequest.show() or paymentresponse.retry() methods fails, your code creates a paymentvalidationerrors object to pass into retry() so that the user agent knows what needs to be fixed and what if any error messages to display to the user. properties error optional a general description of a payment error from which the user may attempt to recover by retrying the payment, possibly after correcting mistakes in the payment in
formation. error can be provided all by itself to provide only a generic error message, or in concert with the other properties to serve as an overview whil...
... payer optional a payererrors compliant object which provides appropriate error messages for any of the fields describing the payer which failed validation. ...
Point - Web APIs
point is an interface, which existed only briefly in the css trans
forms level 1 specification, which represents a point in 2-dimensional space. it is non-standard, not broadly compatible, and should not be used. although it is not directly related to this defunct interface, you are probably looking for dompoint, which is part of the geometry interfaces module level 1 specification. properties x a floating-point value specifying the point's position with respect to the x (horizontal) axis. y a floating-point value specifying the point's position with respect to the y (vertical) axis. ...
... for dompoint, which is part of the geometry interfaces module level 1 specification. properties x a floating-point value specifying the point's position with respect to the x (horizontal) axis. y a floating-point value specifying the point's position with respect to the y (vertical) axis. specifications this class was specified in the defunct 20 march 2009 working draft of css 2d trans
forms module level 3. it is not present in the current working draft of the css trans
forms level 1 specification. ...
Pointer Lock API - Web APIs
it gives you access to raw mouse movement, locks the target of mouse events to a single element, eliminates limits on how far mouse movement can go in a single direction, and removes the cursor from view. it is ideal for first person 3d games, for example. more than that, the api is useful for any applications that require significant mouse input to control movements, rotate objects, and change entries, for example allowing users to control the viewing angle simply by moving the mouse around without any button clicking. the buttons are then freed up for other actions. ...
...ll(); } iframe limitations pointer lock can only lock one iframe at a time. if you lock one iframe, you cannot try to lock another iframe and transfer the target to it; pointer lock will error out. to avoid this limitation, first unlock the locked iframe, and then lock the other. while iframes work by default, "sandboxed" iframes block pointer lock. the ability to avoid this limitation, in the
form of the attribute/value combination <iframe sandbox="allow-pointer-lock">, is expected to appear in chrome soon. specifications specification status comment pointer lock candidate recommendation initial specification. ...
PromiseRejectionEvent() - Web APIs
ible (non-synthetic) promiserejectionevent events that user agents can actually fire). options an object specifying details about the rejection which occurred: promise the promise that was rejected. reason any value or object which represents the reason the promise was rejected. ...
...tailed in
formation describing the situation resulting in the promise being rejected. return value a new promiserejectionevent configured as specified by the parameters. examples this example creates a new unhandledrejection event for the promise mypromise with the reason being the string "my house is on fire". the reason could just as easily be a number, or even an object with detailed in
formation including the home address, how serious the fire is, and the phone number of an emergency contact who should be notified. let myrejectionevent = new promiserejectionevent("unhandledrejection", { promise : mypromise, reason : "my house is on fire" }); specifications specification status comment html living standardthe definition of 'the promiserejectionevent...
PromiseRejectionEvent.reason - Web APIs
this could be anything from an error code to an object with text, links, and whatever else you might wish to include. ...
...this could be anything from an error code to an object with text, links, and whatever else you might wish to include. ...
PublicKeyCredential - Web APIs
it inherits from credential, and was created by the web authentication api extension to the credential management api. other interfaces that inherit from credential are passwordcredential and federatedcredential. note: this api is restricted to top-level contexts. use from within an <iframe> element will not have any effect. properties publickeycredential.type read only secure context inherited from credential. always set to public-key for publickeycredential instances. ...
... 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. methods publickeycredential.getclientextensionresults()secure context if any extensions were requested, this method will return the results of processing those extensions. publickeycredential.isuserverifyingplat
formauthenticatoravailable()secure context a static method returning a promise which resolves to true if an authenticator bound to the plat
form is capable of verifying the user. with the current state of implementation, this method only resolves to true when windows hello is available on the system. examples creating a new instance of publickeycredential here, we use navigator.credentials.create(...
PushManager.subscribe() - Web APIs
nserverkey: a base64-encoded domstring or arraybuffer containing an ecdsa p-256 public key that the push server will use to authenticate your application server. if specified, all messages from your application server must use the vapid authentication scheme, and include a jwt signed with the corresponding private key. this key is not the same ecdh key that you use to encrypt the data. for more in
formation, see "using vapid with webpush". note: this parameter is required in some browsers like chrome and edge. returns a promise that resolves to a pushsubscription object. example this.onpush = function(event) { console.log(event.data); // from here we can write the data to indexeddb, send it to any open // windows, display a notification, etc. } navigator.serviceworker.regi...
...le.log(pushsubscription.endpoint); // the push subscription details needed by the application // server are now available, and can be sent to it using, // for example, an xmlhttprequest. }, function(error) { // during development it often helps to log errors to the // console. in a production environment it might make sense to // also report in
formation about errors back to the // application server. console.log(error); } ); }); responding to user gestures subscribe() calls should be done in response to a user gesture, such as clicking a button, for example: btn.addeventlistener('click', function() { serviceworkerregistration.pushmanager.subscribe(options) .then(function(pushsubscription) { // handle s...
RTCConfiguration.certificates - Web APIs
t rtcconfiguration.certificates = [ cert1... ]; let certificates = rtcconfiguration.certificates; value an array of rtccertificate objects, each specifying one security certificate available for use when connecting to a remote peer. if this property isn't specified, the browser will automatically generate and use a certificate to secure the connection. see using certificates below for more in
formation on why you might want to—or not to—explicitly provide certificates. description if this property isn't included in the configuration, a set of certificates is automatically generated for each instance of rtcpeerconnection. although a given dtls connection only uses a single certificate, providing multiple options in the certificates list may improve the odds of establishing a connectio...
...algorithms it and the remote peer support, as determined during dtls handshake. if you don't provide certificates, new ones are generated automatically. one obvious benefit to providing your own is identity key continuity—if you use the same certificate for subsequent calls, the remote peer can tell you're the same caller. this also avoids the cost of generating new keys. <<<--- add link to in
formation about identity --->>> examples specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcconfiguration.certificates' in that specification. candidate recommendation initial definition. ...
RTCErrorEvent - Web APIs
the webrtc api's rtcerrorevent interface represents an error sent to a webrtc object. it's based on the standard event interface, but adds rtc-specific in
formation describing the error, as shown below. constructor rtcerrorevent() creates and returns a new rtcerrorevent object. 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, in
formation about where the error occurred (such as which line number in the sdp or what sctp cause code was at issue). methods no additional methods are provided beyond any found on the parent interface, event. description there are other data types use...
...the most common of these is probably rtcpeerconnectioniceerrorevent, used by the icecandidateerror event, which signals an error that has occurred while gathering ice candidates during connection negotiation. ...
RTCIceCandidate.RTCIceCandidate() - Web APIs
the rtcicecandidate() constructor creates and returns a new rtcicecandidate object, which can be configured to represent a single ice candidate. syntax candidate = new rtcicecandidate([candidateinfo]); parameters candidateinfo optional an optional rtcicecandidateinit object providing in
formation about the candidate; if this is provided, the candidate is initialized configured to represent the described candidate. return value a newly-created rtcicecandidate object, optionally configured based on the specified object based on the rtcicecandidateinit dictionary. if candidateinfo is provided, the new rtcicecandidate is initialized as follows: each member of the rtcicecandidateinit object is initialized to the value of the property by the same name from rtcicecandidateinit. this inc...
... an exception. the default value of candidate is the empty string, which indicates that the candidate is an "end-of-candidates" message. the following fields are initialized to null if they are not included in the rtcicecandidate.candidate property: foundation, component, priority , ip, protocol, port, type, tcptype, relatedaddress, and relatedport. note: parsing of the candidate string is per
formed using the candidate-attribute grammar from the webrtc specification. exceptions typeerror the specified rtcicecandidateinit has values of null in both the sdpmid and sdpmlineindex properties. usage notes this constructor does not do complete validation of the specified candidateinfo object or string. specifications specification status comment webrtc 1.0: real...
RTCIceCandidate.address - Web APIs
didate interface's read-only address property is a string providing the address of the device which is the source of the candidate. address is null by default if not otherwise specified. the address field's value is set when the rtcicecandidate() constructor is used. you can't specify the address in the options object, but the address is automatically extracted from the candidate a-line, if it's
formatted properly. syntax var address = rtcicecandidate.address; value a domstring providing the ip address from which the candidate comes. note: if port is null — and port is supported by the user agent — passing the candidate to addicecandidate() will fail, throwing an operationerror exception. security notes it's important to note here that although webrtc does not require the two pee...
...ndidate comes. note: if port is null — and port is supported by the user agent — passing the candidate to addicecandidate() will fail, throwing an operationerror exception. security notes it's important to note here that although webrtc does not require the two peers on an rtcpeerconnection to know one another's true ip addresses, the address property on rtcicecandidate can expose more in
formation about the source of the remote peer than the user expects. the ip address can be used to derive in
formation about the remote device's location, network topology, and so forth. it can also be used for fingerprinting purposes. the candidate ip addresses are always exposed to the application through address, and unsavory applications can in turn potentially reveal the address to the user. this...
RTCIceCandidate.protocol - Web APIs
he candidate uses udp or tcp as its transport protocol. protocol is null by default if not specified properly in the sdp, but this is an error condition and will result in a thrown exception when you call rtcpeerconnection.addicecandidate(). the protocol property's value is set when the rtcicecandidate() constructor is used. ...
...tracted from the candidate a-line, if it's
formatted properly. syntax var protocol = rtcicecandidate.protocol; value a domstring which indicates what network protocol the candidate uses, udp or tcp. these values are defined by the enumerated type rtciceprotocol: tcp the candidate, if selected, would use tcp as the transport protocol for its data. the tcptype property provides additional in
formation about the kind of tcp candidate represented by the object. udp the candidate will use the udp transport protocol for its data. this is the preferred protocol for media interactions because of its better per
formance profile. note: if protocol is null — and protocol is supported by the user agent — passing the candidate to addicecandidate() will fail, throwing an operationerror except...
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. syntax var type = rtcicecandidate.type; value a domstring whose value is one of those defined by the rtcicecandidatetype enumerated type. these candidate types are listed in order of priority; the higher in the list they are, the more efficient they are. 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. srflx t...
...idate's peer anonymously. prflx the candidate is a peer reflexive candidate; the ip is an intermediary address assigned by the stun server to represent the candidate's peer anonymously. relay the candidate is a relay candidate, obtained from a turn server. the relay candidate's ip address is an address the turn server uses to forward the media between the two peers. if type is null, that in
formation was missing from the candidate's a-line, which will cause rtcpeerconnection.addicecandidate() to throw an operationerror exception. example in this example, the candidate's type is used to present a modified user interface for host candidates (those where the ip refers directly to the remote peer, rather than an intermediary). if (candidate.type == "host") { showhostcontrols(); } else {...
RTCIceCandidateStats.transportId - Web APIs
this can be used to compare candidates that would use the same transport, for example. ...
...this can be used to compare candidates that would use the same transport, for example. ...
RTCIceCandidateStats - Web APIs
red the candidate to the local peer. example this example features a function, isusablenetworktype(), whose job it is to look at an rtcicecandidatestats object's networktype and determine whether or not the type of network is acceptable for use. this function is then called for rtcstats objects whose type is local-candidate, indicating that the object is in fact an rtcicecandidatestats with in
formation about a local ice candidate. const isusablenetworktype = stats => { switch(stats.networktype) { case "ethernet": case "vpn": return true; case "bluetooth": case "cellular": case "wimax": case "unknown": default: return false; } } if (rtcstats && rtcstats.type === "local-candidate") { if (!isusablenetworktype(rtcstats)) { abortconnection();...
... specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatestats' in that specification. candidate recommendation initial specification. ...
RTCInboundRtpStreamStats.fecPacketsReceived - Web APIs
the fecpacketsreceived property of the rtcinboundrtpstreamstats dictionary indicates how many forward error correction (fec) packets have been received by this rtp receiver from the remote peer. an fec packet provides parity in
formation which can be used to attempt to reconstruct rtp data packets which have been corrupted in transit. syntax var fecpacketsreceived = rtcinboundrtpstreamstats.fecpacketsreceived; value an unsigned integer value which indicates the total number of fec packets which have been recieved from the remote peer during this rtp session. ...
...
formation which can be used to attempt to reconstruct rtp data packets which have been corrupted in transit. syntax var fecpacketsreceived = rtcinboundrtpstreamstats.fecpacketsreceived; value an unsigned integer value which indicates the total number of fec packets which have been recieved from the remote peer during this rtp session. forward error correction uses an exclusive-or method to per
form parity checks on the received data. by using the fec parity in
formation to attempt to reconstruct damaged packets, it is possible to avoid the need to retransmit damaged packets, which in turn helps to reduce lag, or the need to skip damaged frames entirely. note: this counter may also be incremented when fec packets arrive in-band along with media content; this can happen with opus, for examp...
RTCPeerConnection.getStats() - Web APIs
tcrtpsender or rtcrtpreceiver whose track matches the specified selector, or selector matches more than one sender or receiver. obsolete syntax previously, getstats() used success and failure callbacks to report the results to you, instead of using a promise. this version of getstats() is obsolete; in addition, the data it returns is entirely different from the current specification, and the
form of that data was never documented. this
form of getstats() has been or will soon be removed from most browsers; you should not use it, and should update existing code to use the new promise-based version. check the browser compatibility table to verify the state of this method. promise = rtcpeerconnection.getstats(selector, successcallback, failurecallback) parameters selector optional a ...
...urecallback a function to call when an error occurs while attempting to collect statistics. the callback receives as input the exception (a domexception object describing the error which occurred. no return value is expected from the callback. example this example creates a periodic function using setinterval() that collects statistics for an rtcpeerconnection every second, generating an html-
formatted report and inserting it into a specific element in the dom. 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 ...
RTCPeerConnection.setConfiguration() - Web APIs
otiation could begin. renegotiation of the connection is needed, and a different set of ice servers needs to be used for some reason. perhaps the user has moved into a new region, so using new regional ice servers is necessary, for example. in this situation, one might call setconfiguration() to switch to new regional ice servers, then initiate an ice restart. you cannot change the identity in
formation for a connection once it's already been set. syntax rtcpeerconnection.setconfiguration(configuration); parameters configuration an rtcconfiguration object which provides the options to be set. the changes are not additive; instead, the new values completely replace the existing ones. exceptions invalidaccesserror one or more of the urls specified in configuration.iceservers is ...
...eady been set. syntax rtcpeerconnection.setconfiguration(configuration); parameters configuration an rtcconfiguration object which provides the options to be set. the changes are not additive; instead, the new values completely replace the existing ones. exceptions invalidaccesserror one or more of the urls specified in configuration.iceservers is a turn server, but complete login in
formation is not provided (that is, either the rtciceserver.username or rtciceserver.credentials is missing). this prevents successful login to the server. invalidmodificationerror the configuration includes changed identity in
formation, but the connection already has identity in
formation specified. this happens if configuration.peeridentity or configuration.certificates is set and their values diff...
RTCRtpCodecCapability - Web APIs
the webrtc api's rtcrtpcodeccapability dictionary provides in
formation describing the capabilities of a single media codec. properties channels optional an unsigned integer value indicating the maximum number of channels supported by the codec; for example, a codec that supports only mono sound would have a value of 1; stereo codecs would have a 2, etc. clockrate an unsigned long integer specifying the codec's clock rate in hertz (hz). the iana maintains a list of codecs and their parameters, including their clock rates. mimetype a domstring indicating the codec's mime media type and subtype. see codecs used by webrtc for details about potential codecs that might be referenced here. ...
...ave a 2, etc. clockrate an unsigned long integer specifying the codec's clock rate in hertz (hz). the iana maintains a list of codecs and their parameters, including their clock rates. mimetype a domstring indicating the codec's mime media type and subtype. see codecs used by webrtc for details about potential codecs that might be referenced here. sdpfmtpline optional a domstring giving the
format specific parameters field from the a=fmtp line in the sdp which corresponds to the codec, if such a line exists. if there is no parameters field, this property is left out. description rtcrtpcodeccapabilities describes the basic parameters for a single codec supported by the user's device. an array of objects of this type is returned in the codecs property of the rtcrtpcapabilities object re...
RTCRtpCodecParameters - Web APIs
elds in this property take values which are defined and maintained by the internet assigned numbers authority (iana). references to relevant iana documents are provided in the see also section at the end of this article. properties payloadtype optional the rtp payload type used to identify this codec. mimetype optional the codec's mime media type and subtype specified as a domstring of the
form "type/subtype". iana maintains a registry of valid mime types. clockrate optional an unsigned long integer value specifying the codec's clock rate in hertz (hz). the clock rate is the rate at which the codec's rtp timestamp advances. most codecs have specific values or ranges of values they permit; see the iana payload
format media type registry for details. channels optional an unsigned shor...
...p timestamp advances. most codecs have specific values or ranges of values they permit; see the iana payload
format media type registry for details. channels optional an unsigned short integer indicating the number of channels the codec should support. for example, for audio codecs, a value of 1 specifies monaural sound while 2 indicates stereo. sdpfmtpline optional a domstring containing the
format-specific parameters field from the "a=fmtp" line in the codec's sdp, if one is present; see section 5.8 of the ietf specification for jsep. note: on an rtcrtpreceiver, the
format-specific parameters come from the sdp sent by the remote peer, while for rtcrtpsender, they're provided by the local description. ...
RTCRtpSender - Web APIs
you can also obtain access to an rtcdtmfsender which can be used to send dtmf codes (to simulate the user pressing buttons on a telephone's dial pad) to the remote peer. ...
...his rtcrtpsender. rtcrtpsender.setparameters() applies changes to parameters which configure how the track is encoded and transmitted to the remote peer. rtcrtpsender.setstreams() sets the mediastream(s) associated with the track being transmitted by this sender. rtcrtpsender.replacetrack() attempts to replace the track currently being sent by the rtcrtpsender with another track, without per
forming renegotiation. this method can be used, for example, to toggle between the front- and rear-facing cameras on a device. static methods rtcrtpsender.getcapabilities() returns an rtcrtpcapabilities object describing the system's capabilities for sending a specified kind of media data. specifications specification status comment webrtc 1.0: real-time communication ...
RTCSessionDescription() - Web APIs
the rtcsessiondescription() constructor creates a new rtcsessiondescription with its properties initialized as described in the specified object. this constructor has been deprecated because rtcpeerconnection.setlocaldescription() and other methods which take sdp as input now directly accept an object con
forming to the rtcsessiondescriptioninit dictionary, so you don't have to instantiate an rtcsessiondescription yourself. syntax sessiondescription = new rtcsessiondescription(rtcsessiondescriptioninit); values rtcsessiondescriptioninit optional an object providing the default values for the session description; the object con
forms to the rtcsessiondescriptioninit dictionary. that dictionary has the following properties: type required. a string which is a member of the rtcs...
... sdp a string containing a sdp message describing the session. this value is an empty string ("") by default and may not be null. example this example uses the constructor to convert an sdp offer into an rtcsessiondescription object. this is no longer necessary, however; rtcpeerconnection.setlocaldescription() and other methods which take sdp as input now directly accept an object con
forming to the rtcsessiondescriptioninit dictionary, so you don't have to instantiate an rtcsessiondescription yourself. navigator.getusermedia({video: true}, function(stream) { pc.onaddstream({stream: stream}); // adding a local stream won't trigger the onaddstream callback pc.addstream(stream); pc.createoffer(function(offer) { pc.setlocaldescription(new rtcsessiondescription(offer), f...
RTCStats - Web APIs
type a domstring indicating the type of statistics the object contains, taken from the enum type rtcstatstype. ...
... statistics type hierarchy the various dictionaries that are used to define the contents of the objects that contain each of the various types of statistics for webrtc are structured in such a way that they build upon the core rtcstats dictionary, each layer adding more relevant in
formation. rtcstats is the foundation of all webrtc statistics objects rtcrtpstreamstats adds to rtcstats in
formation that applies to all rtp endpoints (that is, both local and remote endpoints, and regardless of whether the endpoint is a sender or a receiver) rtcreceivedrtpstreamstats further adds statistics measured at the receiving end of an rtp stream, regardless of whether it's local or remote. rtcinboundrtpstreamstats contains statistics that can only be measured on a receive...
RTCStatsIceCandidatePairState - Web APIs
the rtcstatsicecandidatepairstate enumerated type represents the set of string values which are possible for the rtcicecandidatepairstats object's state property. this represents the state of this candidate pair within the ice check list for the rtcpeerconnection. see ice check lists in rtcicecandidatepairstats.state for further in
formation about how ice check lsits work. values failed a check for this pair has been per
formed but failed. a failure can occur either because no response was received or because the response indicated that an unrecoverable error occurred. frozen no check has been per
formed yet for this candidate pair, and per
forming the check is blocked until another check is successful. once that check has succeeded, this pair will unfreeze and move into the waiting state...
... specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcstatsicecandidatepairstate' in that specification. candidate recommendation initial specification. ...
RadioNodeList.value - Web APIs
s returned as a string. if the collection does not contain any radio buttons or none of the radio buttons in the collection is in checked state, the empty string is returned. on setting the value property, the first radio button input element whose value property is equal to the new value will be set to checked. ...
...e, the empty string is returned. on setting the value property, the first radio button input element whose value property is equal to the new value will be set to checked. syntax value = radionodelist.value; radionodelist.value = string; example html <
form> <label><input type="radio" name="color" value="blue">blue</label> <label><input type="radio" name="color" value="red">red</label> </
form> javascript // get the
form const
form = document.
forms[0]; // get the
form's radio buttons const radios =
form.elements['color']; // choose the "red" option radios.value = 'red'; result specifications specification status comments html living standardthe definition of 'radionodelist.value' in that specification. living standard initial definition. ...
Request - Web APIs
as been used in a response yet. methods request.clone() creates a copy of the current request object. request implements body, so it also has the following methods available to it: body.arraybuffer() returns a promise that resolves with an arraybuffer representation of the request body. body.blob() returns a promise that resolves with a blob representation of the request body. body.
formdata() returns a promise that resolves with a
formdata representation of the request body. body.json() returns a promise that resolves with a json representation of the request body. body.text() returns a promise that resolves with an usvstring (text) representation of the request body. note: the body functions can be run only once; subsequent calls will resolve with empty strings/arraybuf...
... you could then fetch this api request by passing the request object in as a parameter to a windoworworkerglobalscope.fetch() call, for example and get the response: fetch(request) .then(response => { if (response.status === 200) { return response.jso...
SVGPatternElement - Web APIs
an svganimatedenumeration corresponding to the patternunits attribute of the given <pattern> element. takes one of the constants defined in svgunittypes. svgpatternelement.patterncontentunits read only an svganimatedenumeration corresponding to the patterncontentunits attribute of the given <pattern> element. takes one of the constants defined in svgunittypes. svgpatternelement.patterntrans
form read only an svganimatedtrans
formlist corresponding to the patterntrans
form attribute of the given <pattern> element. svgpatternelement.x read only an svganimatedenumeration corresponding to the x attribute of the given <pattern> element. svgpatternelement.y read only an svganimatedenumeration corresponding to the y attribute of the given <pattern> element. svgpatternelement.width read o...
...ent interface, svgelement and implements the ones from svgfittoviewbox and svgurireference. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgpatternelement' in that specification. candidate recommendation removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtrans
formable. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgpatternelement' in that specification. recommendation initial definition ...
SVGTextContentElement - Web APIs
returns a long representing the total number of addressable characters available for rendering within the current element, regardless of whether they will be rendered. svgtextcontentelement.getcomputedtextlength() returns a float representing the computed length for the text within the element. svgtextcontentelement.getsubstringlength() returns a float representing the computed length of the
formatted text advance distance for a substring of text within the element. note that this method only accounts for the widths of the glyphs in the substring and any extra spacing inserted by the css 'letter-spacing' and 'word-spacing' properties. visual spacing adjustments made by the 'x' attribute is ignored. svgtextcontentelement.getstartpositionofchar() returns a dompoint representing the positi...
...he element. note that this method only accounts for the widths of the glyphs in the substring and any extra spacing inserted by the css 'letter-spacing' and 'word-spacing' properties. visual spacing adjustments made by the 'x' attribute is ignored. svgtextcontentelement.getstartpositionofchar() returns a dompoint representing the position of a typographic character after text layout has been per
formed. note: in svg 1.1 this method returned an svgpoint. svgtextcontentelement.getendpositionofchar() returns a dompoint representing the trailing position of a typographic character after text layout has been per
formed. note: in svg 1.1 this method returned an svgpoint. svgtextcontentelement.getextentofchar() returns a domrect representing the computed tight bounding box of the glyph cell...
Screen Capture API - Web APIs
e user select a screen or portion of a screen (such as a window) to capture as a media stream. this stream can then be recorded or shared with others over the network. screen capture api concepts and usage the screen capture api is relatively simple to use. its sole method is mediadevices.getdisplaymedia(), whose job is to ask the user to select a screen or portion of a screen to capture in the
form of a mediastream. to start capturing video from the screen, you call getdisplaymedia() on the instance of media navigator.mediadevices: capturestream = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); the promise returned by getdisplaymedia() resolves to a mediastream which streams the captured media. see the article using the screen capture api for a more in-depth look at h...
...screen capture api doesn't have any interfaces of its own; instead, it adds one method to the existing mediadevices interface. mediadevices interface mediadevices.getdisplaymedia() the getdisplaymedia() method is added to the mediadevices interface. similar to getusermedia(), this method creates a promise that resolves with a mediastream containing the display area selected by the user, in a
format that matches the specified options. additions to existing dictionaries the screen capture api adds properties to the following dictionaries defined by other specifications. mediatrackconstraints mediatrackconstraints.cursor a constraindomstring indicating whether or not the cursor should be included in the captured display surface's stream, and if it should always be visible or if it sh...
SourceBuffer.changeType() - Web APIs
return value undefined. ...
... return value undefined. exceptions typeerror the specified string is empty, rather than indicating a valid mime type. invalidstateerror the sourcebuffer is not a member of the parent media source's sourcebuffers list, or the buffer's updating property indicates that a previously queued appendbuffer() or remove() is still being processed. ...
SourceBuffer - Web APIs
or they have to be kept in a strict sequence. sourcebuffer.texttracks read only a list of the text tracks currently contained inside the sourcebuffer. sourcebuffer.timestampoffset controls the offset applied to timestamps inside media segments that are subsequently appended to the sourcebuffer. sourcebuffer.trackdefaults specifies the default values to use if kind, label, and/or language in
formation is not available in the initialization segment of the media to be appended to the sourcebuffer. sourcebuffer.updating read only a boolean indicating whether the sourcebuffer is currently being updated — i.e. whether an sourcebuffer.appendbuffer(), sourcebuffer.appendstream(), or sourcebuffer.remove() operation is currently in progress. sourcebuffer.videotracks read only a list of the...
...fferasync() starts the process of asynchronously appending the specified buffer to the sourcebuffer. returns a promise which is fulfilled once the buffer has been appended. sourcebuffer.appendstream() appends media segment data from a readablestream object to the sourcebuffer. sourcebuffer.changetype() changes the mime type that future calls to appendbuffer() will expect the new data to con
form to. sourcebuffer.remove() removes media segments within a specific time range from the sourcebuffer. sourcebuffer.removeasync() starts the process of asynchronously removing media segments in the specified range from the sourcebuffer. returns a promise which is fulfilled once all matching segments have been removed. examples the following simple example loads a video chunk by chunk as fa...
SpeechGrammarList - Web APIs
constructor speechgrammarlist.speechgrammarlist() creates a new speechgrammarlist object. properties speechgrammarlist.length read only returns the number of speechgrammar objects contained in the speechgrammarlist. ...
... constructor speechgrammarlist.speechgrammarlist() creates a new speechgrammarlist object. properties speechgrammarlist.length read only returns the number of speechgrammar objects contained in the speechgrammarlist. ...
SpeechSynthesis.speak() - Web APIs
the speak() method of the speechsynthesis interface adds an utterance to the utterance queue; it will be spoken when any other utterances queued before it have been spoken. syntax speechsynthesisinstance.speak(utterance); returns void. parameters utterance a speechsynthesisutterance object. examples this snippet is excerpted from our speech synthesiser demo. ...
...erance); returns void. parameters utterance a speechsynthesisutterance object. examples this snippet is excerpted from our speech synthesiser demo. when a
form containing the text we want to speak is submitted, we (amongst other things) create a new utterance containing this text, then speak it by passing it into speak() as a parameter. var synth = window.speechsynthesis; ... ...
SpeechSynthesisVoice - Web APIs
properties speechsynthesisvoice.default read only a boolean indicating whether the voice is the default voice for the current app language (true), or not (false.) speechsynthesisvoice.lang read only returns a bcp 47 language tag indicating the language of the voice. ...
... + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } } populatevoicelist(); if (speechsynthesis.onvoiceschanged !== undefined) { speechsynthesis.onvoiceschanged = populatevoicelist; } input
form.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } utterthis.pitch = pitch.value; utterthis.rate = rate.value; syn...
StorageEstimate - Web APIs
see the individual property pages for details. ...
...see the individual property pages for details. ...
StorageQuota - Web APIs
storagequota.requestpersistentquota requests persistent storage for the requesting application and returns a promise to an instance of storageinfo. ...
... storagequota.requestpersistentquota requests persistent storage for the requesting application and returns a promise to an instance of storageinfo. there is no guarantee that the requested space will be granted by the user agent. ...
Streams API - Web APIs
ssets to be shown on webpages — videos buffer and more is gradually available to play, and sometimes you'll see images display gradually as more is loaded. but this has never been available to javascript before. previously, if we wanted to process a resource of some kind (be it a video, or a text file, etc.), we'd have to download the entire file, wait for it to be deserialized into a suitable
format, then process the whole lot after it is fully received. with streams being available to javascript, this all changes — you can now start processing raw data with javascript bit by bit as soon as it is available on the client-side, without needing to generate a buffer, string, or blob. there are more advantages too — you can detect when streams start or end, chain streams together, handl...
...ead them back out again. simple tee example: this example extends the simple random stream example, showing how a stream can be teed and both resulting streams can be read independently. simple writer: this example shows how to to write to a writable stream, then decode the stream and write the contents to the ui. unpack chunks of a png: this example shows how pipethrough() can be used to trans
form a readablestream into a stream of other data types by trans
forming a data of a png file into a stream of png chunks. examples from other developers: progress indicators with streams, service workers, & fetch. specifications specification status comment streams living standard initial definition. ...
Text - Web APIs
new documents have a single text node for each block of text. over time, more text nodes may be created as the document's content changes. ...
... new documents have a single text node for each block of text. over time, more text nodes may be created as the document's content changes. ...
TextEncoder - Web APIs
coder interface doesn't inherit any method. textencoder.prototype.encode() takes a usvstring as input, and returns a uint8array containing utf-8 encoded text. textencoder.prototype.encodeinto() takes a usvstring to encode and a destination uint8array to put resulting utf-8 encoded text into, and returns a dictionary object indicating the progress of the encoding. this is potentially more per
formant than the older encode() method. polyfill the below polyfill is compliant with the standard and therefore only supports utf-8. it is designed to work in ie5 "out of the box". however, in ie5-ie9, it will return a regular array instead of a typedarray. in those cases a polyfill might be impractical for large strings. finally, note that you should run the below code through a minifier (especia...
... point = str.charcodeat(i), i += 1; if (point >= 0xd800 && point <= 0xdbff) { if (i === len) { resarr[respos += 1] = 0xef/*0b11101111*/; resarr[respos += 1] = 0xbf/*0b10111111*/; resarr[respos += 1] = 0xbd/*0b10111101*/; break; } // https://mathiasbynens.be/notes/javascript-encoding#surrogate-
formulae nextcode = str.charcodeat(i); if (nextcode >= 0xdc00 && nextcode <= 0xdfff) { point = (point - 0xd800) * 0x400 + nextcode - 0xdc00 + 0x10000; i += 1; if (point > 0xffff) { resarr[respos += 1] = (0x1e/*0b11110*/<<3) | (point>>>18); resarr[respos += 1] = (0...
TextTrack.mode - Web APIs
mode is disabled, unless the default boolean attribute is specified, in which case the default mode is showing. when a text track is loaded in the disabled state, the corresponding webvtt file is not loaded until the state changes to either showing or hidden. this way, the resource fetch and memory usage are avoided unless the cues are actually needed. ...
...ctually needed. however, that means that if you wish to per
form any actions involving the track's cues while handling, for example, the load event—in order to process some aspect of the cues upon page load—and the track mode was initially disabled, you'll have to change the mode to either hidden or showing in order to trigger loading of the cues. when the mode is showing, text tracks are per
formed. the exact appearance and manner of that per
formance varies depending on each text track's kind. in general: tracks whose kind is "subtitles" or "captions" are rendered with the cues overlaid over the top of the video. tracks whose kind is "descriptions" are presented in a non-visual
form (for example, the text might be spoken to describe the action in the video). tracks whose kind is "cha...
TextTrackCue - Web APIs
properties this interface also inherits properties from eventtarget. ...
... properties this interface also inherits properties from eventtarget. texttrackcue.track read only the texttrack that this cue belongs to, or null if it doesn't belong to any. ...
TimeEvent - Web APIs
the timeevent interface, a part of svg smil animation, provides specific contextual in
formation associated with time events. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4d...
...for this event type, indicates the repeat number for the animation. timeevent.view read only is a windowproxy that identifies the window from which the event was generated. methods inittimeevent(domstring typearg, abstractview viewarg, long detailarg) the inittimeevent method is used to initialize the value of a timeevent created...
Touch.radiusX - Web APIs
touch.screenx. this value, in combination with touch.radiusy and touch.rotationangle constructs an ellipse that approximates the size and shape of the area of contact between the user and the screen. this may be a relatively large ellipse representing the contact between a fingertip and the screen or a small area representing the tip of a stylus, for example. note: this attribute has not been
formally standardized. it is specified in the touch events – level 2 draft specification and not in touch events recommendation. this attribute is not widely implemented. syntax var xradius = touchitem.radiusx; return value xradius the x radius of the ellipse that most closely circumscribes the area of contact with the touch surface. example this example illustrates using the touch inter...
... ...
TrackDefault - Web APIs
a trackdefault object is provided to a sourcebuffer object by setting its sourcebuffer.trackdefaults property. constructor trackdefault() constructs and returns a new trackdefault object. properties trackdefault.type read only returns the type of track that this sourcebuffer's media segment data relates to (i.e. audio, video, or text track.) trackdefault.bytestreamtrackid read only returns the id of the specific track that the sourcebuffer should apply to. ...
... trackdefault.type read only returns the type of track that this sourcebuffer's media segment data relates to (i.e. audio, video, or text track.) trackdefault.bytestreamtrackid read only returns the id of the specific track that the sourcebuffer should apply to. trackdefault.language read only returns the default language to use when an initialization segment does not contain language in
formation for a new track. trackdefault.label read only returns the default label to use when an initialization segment does not contain label in
formation for a new track. trackdefault.kinds read only returns the default kinds used when an initialization segment does not contain kind in
formation for a new track. ...
UIEvent.initUIEvent() - Web APIs
zed in this way must have been created with the document.createevent() method. this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent(). once dispatched, it doesn't do anything anymore. do not use this method anymore as it is deprecated. instead use specific event constructors, like uievent(). the page on creating and triggering events gives more in
formation about the way to use these. syntax event.inituievent(type, canbubble, cancelable, view, detail) parameters type is a domstring defining the type of event. canbubble is a boolean deciding whether the event should bubble up through the event chain or not. once set, the read-only property event.bubbles will give its value. cancelable is a boolean defining whether the event can be c...
...oolean deciding whether the event should bubble up through the event chain or not. once set, the read-only property event.bubbles will give its value. cancelable is a boolean defining whether the event can be canceled. once set, the read-only property event.cancelable will give its value. view is the windowproxy associated with the event. detail is an unsigned long specifying some detail in
formation about the event, depending on the type of event. for mouse events, it indicates how many times the mouse has been clicked on a given screen location. example var e = document.createevent("uievent"); // creates a click event that bubbles, can be cancelled, // and with its view and detail property initialized to window and 1, // respectively e.inituievent("click", true, true, window, 1); ...
sourceCapabilities - Web APIs
if no input device was responsible for the event, it returns null. when a single user interaction with an input device generates a series of different input events, the sourcecapabilities property for all of them will point to the same instance of inputdevicecapabilities. for example, when a user lifts their finger off of a touchscreen, several uievents may be generated including touchend, mousedown, click, and focus. ...
...tance of inputdevicecapabilities. for example, when a user lifts their finger off of a touchscreen, several uievents may be generated including touchend, mousedown, click, and focus. all of these events must have the same sourcecapabilities representing the touchscreen. a device is considered "responsible" for an event only when that interaction is part of the abstraction provided by the web plat
form. for example, many user agents allow a window to be resized with a mouse or a keyboard, but this detail is not exposed to the web plat
form in any way, and so the sourcecapabilities of a resize event will typically be null. syntax var idc = event.sourcecapabilities value an instance of inputdevicecapabilities. specifications specification status comment inputdevicecap...
URLSearchParams() - Web APIs
a leading '?' character is ignored. a sequence of usvstring pairs, representing names/values. a record of usvstring keys and usvstring values. return value a urlsearchparams object instance. ...
...a leading '?' character is ignored. a sequence of usvstring pairs, representing names/values. a record of usvstring keys and usvstring values. return value a urlsearchparams object instance. ...
USBAlternateInterface - Web APIs
properties usbalternateinterface.alternatesettingread only returns the alternate setting number of this interface. ...
... properties usbalternateinterface.alternatesettingread only returns the alternate setting number of this interface. this is equal to the balternatesetting field of the interface descriptor defining this interface. ...
USBEndpoint - Web APIs
properties usbendpoint.endpointnumber returns this endpoint's "endpoint number" which is a value from 1 to 15 extracted from the bendpointaddress field of the endpoint descriptor defining this endpoint. this value is used to identify the endpoint when calling methods on usbdevice. ...
... properties usbendpoint.endpointnumber returns this endpoint's "endpoint number" which is a value from 1 to 15 extracted from the bendpointaddress field of the endpoint descriptor defining this endpoint. this value is used to identify the endpoint when calling methods on usbdevice. ...
USBInterface - Web APIs
properties usbinterface.interfacenumberread only returns the interface number of this interface. this is equal to the binterfacenumber field of the interface descriptor defining this interface. ...
... properties usbinterface.interfacenumberread only returns the interface number of this interface. this is equal to the binterfacenumber field of the interface descriptor defining this interface. ...
ValidityState.patternMismatch - Web APIs
the read-only patternmismatch property of a validitystate object indicates if the value of an <input>, after having been edited by the user, does not con
form to the constraints set by the element's pattern attribute. if the field supports the pattern attribute -- which means the <input> is of type text, tel, email, url, password, or search -- and the pattern value is set to a valid regular expression, if the value don't doesn't con
form to the constraints set by the pattern value, the patternmismatch property will be true. ...
...attribute. if the field supports the pattern attribute -- which means the <input> is of type text, tel, email, url, password, or search -- and the pattern value is set to a valid regular expression, if the value don't doesn't con
form to the constraints set by the pattern value, the patternmismatch property will be true. ...
ValidityState.rangeOverflow - Web APIs
given the following: <input type="number" min="20" max="40" step="2"/> if value > 40, rangeoverflow 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
given the following: <input type="number" min="20" max="40" step="2"/> if value < 20, rangeunderflow will be true. ...
... given the following: <input type="number" min="20" max="40" step="2"/> if value < 20, rangeunderflow will be true. ...
VideoTrackList.onchange - Web APIs
to determine the new state of media's tracks, you'll have to look at their videotrack.selected flags. note: you can also add a handler for the change event using addeventlistener(). ...
...to determine the new state of media's tracks, you'll have to look at their videotrack.selected flags. note: you can also add a handler for the change event using addeventlistener(). ...
WEBGL_color_buffer_float - Web APIs
the webgl_color_buffer_float extension is part of the webgl api and adds the ability to render to 32-bit floating-point color buffers. webgl extensions are available using the webglrenderingcontext.getextension() method. for more in
formation, see also using extensions in the webgl tutorial. availability: this extension is available to webgl 1 contexts only. for webgl 2, use the ext_color_buffer_float extension. the oes_texture_float extension implicitly enables this extension. constants ext.rgba32f_ext rgba 32-bit floating-point color-renderable
format. ext.rgb32f_ext ( ) rgb 32-bit floating-point color-renderable
format. ext.framebuffer_attachment_component_type_ext ? ext.unsigned_normalized_ext ? extended methods this extension extends webglrenderingcontext.renderbufferst...
...texture_float extension implicitly enables this extension. constants ext.rgba32f_ext rgba 32-bit floating-point color-renderable
format. ext.rgb32f_ext ( ) rgb 32-bit floating-point color-renderable
format. ext.framebuffer_attachment_component_type_ext ? ext.unsigned_normalized_ext ? extended methods this extension extends webglrenderingcontext.renderbufferstorage(): the internal
format parameter now accepts ext.rgba32f_ext and ext.rgb32f_ext ( ). examples var ext = gl.getextension('webgl_color_buffer_float'); gl.renderbufferstorage(gl.renderbuffer, ext.rbga32f_ext, 256, 256); specifications specification status comment webgl_color_buffer_floatthe definition of 'webgl_color_buffer_float' in that specification. recommendation initial definit...
WEBGL_compressed_texture_atc - Web APIs
the webgl_compressed_texture_atc extension is part of the webgl api and exposes 3 atc compressed texture
formats. atc is a proprietary compression algorithm for compressing textures on handheld devices. compressed textures reduce the amount of memory needed to store a texture on the gpu, allowing for higher resolution textures or more of the same resolution textures. webgl extensions are available using the webglrenderingcontext.getextension() method. for more in
formation, see also using extensions in the webgl tutorial. availability: atc compression is typically available on mobile devices with adreno gpus, that are currently only built into qualcomm snapdragon devices. ...
... ext.compressed_rgb_atc_webgl compresses rgb textures with no alpha channel. ...
WEBGL_compressed_texture_etc - Web APIs
the webgl_compressed_texture_etc extension is part of the webgl api and exposes 10 etc/eac compressed texture
formats. compressed textures reduce the amount of memory needed to store a texture on the gpu, allowing for higher resolution textures or more of the same resolution textures. webgl extensions are available using the webglrenderingcontext.getextension() method. for more in
formation, see also using extensions in the webgl tutorial. availability: this extension is available to both, webgl1 and webgl2 contexts. constants the compressed texture
formats are exposed by 10 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d(). ext.compressed_r11_eac one-channel (red) unsigned
format compression. ext.compressed_signed_r11_eac one-channel...
...ions in the webgl tutorial. availability: this extension is available to both, webgl1 and webgl2 contexts. constants the compressed texture
formats are exposed by 10 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d(). ext.compressed_r11_eac one-channel (red) unsigned
format compression. ext.compressed_signed_r11_eac one-channel (red) signed
format compression. ext.compressed_rg11_eac two-channel (red and green) unsigned
format compression. ext.compressed_signed_rg11_eac two-channel (red and green) signed
format compression. ext.compressed_rgb8_etc2 compresses rgb8 data with no alpha channel. ext.compressed_rgba8_etc2_eac compresses rgba8 data. the rgb part is encoded the same as rgb_etc2, but the alpha part is encoded separately.
WEBGL_compressed_texture_s3tc - Web APIs
the webgl_compressed_texture_s3tc extension is part of the webgl api and exposes four s3tc compressed texture
formats. compressed textures reduce the amount of memory needed to store a texture on the gpu, allowing for higher resolution textures or more of the same resolution textures. webgl extensions are available using the webglrenderingcontext.getextension() method. for more in
formation, see also using extensions in the webgl tutorial. availability: this extension is available to both, webgl1 and webgl2 contexts. constants the compressed texture
formats are exposed by four constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d(). ext.compressed_rgb_s3tc_dxt1_ext a dxt1-compressed image in an rgb image
format. ext.compressed_rgba_s3tc_dxt1...
...ailability: this extension is available to both, webgl1 and webgl2 contexts. constants the compressed texture
formats are exposed by four constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d(). ext.compressed_rgb_s3tc_dxt1_ext a dxt1-compressed image in an rgb image
format. ext.compressed_rgba_s3tc_dxt1_ext a dxt1-compressed image in an rgb image
format with a simple on/off alpha value. ext.compressed_rgba_s3tc_dxt3_ext a dxt3-compressed image in an rgba image
format. compared to a 32-bit rgba texture, it offers 4:1 compression. ext.compressed_rgba_s3tc_dxt5_ext a dxt5-compressed image in an rgba image
format. it also provides a 4:1 compression, but differs to the dxt3 compression in how the alpha compression is done. examples var ext =...
WEBGL_compressed_texture_s3tc_srgb - Web APIs
the webgl_compressed_texture_s3tc_srgb extension is part of the webgl api and exposes four s3tc compressed texture
formats for the srgb colorspace. compressed textures reduce the amount of memory needed to store a texture on the gpu, allowing for higher resolution textures or more of the same resolution textures. webgl extensions are available using the webglrenderingcontext.getextension() method. for more in
formation, see also using extensions in the webgl tutorial. availability: this extension is available to both webgl1 and webgl2 contexts. constants the compressed texture
formats are exposed by four constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d(). ext.compressed_srgb_s3tc_dxt1_ext a dxt1-compressed image in an srgb image
format. ...
...ty: this extension is available to both webgl1 and webgl2 contexts. constants the compressed texture
formats are exposed by four constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d(). ext.compressed_srgb_s3tc_dxt1_ext a dxt1-compressed image in an srgb image
format. ext.compressed_srgb_alpha_s3tc_dxt1_ext a dxt1-compressed image in an srgb image
format with a simple on/off alpha value. ext.compressed_srgb_alpha_s3tc_dxt3_ext a dxt3-compressed image in an srgba image
format. ext.compressed_srgb_alpha_s3tc_dxt5_ext a dxt5-compressed image in an srgba image
format. examples var ext = gl.getextension('webgl_compressed_texture_s3tc_srgb'); var texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); gl.compressedteximage2d(gl...
WaveShaperNode.oversample - Web APIs
ng is a technique for creating more samples (up-sampling) before applying a distortion effect to the audio signal. once applied, the number of samples is reduced to its initial numbers. this leads to better results by avoiding some aliasing, but comes at the expense of a lower precision shaping curve. the possible oversample values are: value effect 'none' do not per
form any oversampling. '2x' double the amount of samples before applying the shaping curve. '4x' multiply by 4 the amount of samples before applying the shaping curve. syntax distortion.oversample = enumeratedvalue; values distortion is a waveshapernode. enumeratedvalue is one of 'none', '2x', or '4x'. example the following example shows basic usage of an audio...
...les before applying the shaping curve. '4x' multiply by 4 the amount of samples before applying the shaping curve. syntax distortion.oversample = enumeratedvalue; values distortion is a waveshapernode. enumeratedvalue is one of 'none', '2x', or '4x'. example the following example shows basic usage of an audiocontext to create a wave shaper node. for applied examples/in
formation, check out our voice-change-o-matic demo (see app.js for relevant code). note: sigmoid functions are commonly used for distortion curves because of their natural properties. their s-shape, for instance, helps create a smoother sounding result. we found the below distortion curve code on stack overflow. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var distortio...
WebGL2RenderingContext.bindBufferRange() - Web APIs
the webgl2renderingcontext.bindbufferrange() method of the webgl 2 api binds a range of a given webglbuffer to a given binding point (target) at a given index. syntax void gl.bindbufferrange(target, index, buffer, offset, size); parameters target a glenum specifying the target for the bind operation. possible values: gl.trans
form_feedback_buffer gl.uni
form_buffer index a gluint specifying the index of the target. ...
... editor's draft initial definition for webgl. opengl es 3.0the definition of 'glbindbufferrange' in that specification. ...
WebGL2RenderingContext.compressedTexSubImage3D() - Web APIs
the webgl2renderingcontext.compressedtexsubimage3d() method of the webgl api specifies a three-dimensional sub-rectangle for a texture image in a compressed
format. syntax // read from the buffer bound to gl.pixel_unpack_buffer void gl.compressedtexsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth,
format, imagesize, offset); void gl.compressedtexsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth,
format, arraybufferview srcdata, optional srcoffset, optional srclengthoverride); parameters target a glenum specifying the binding point (target) of the active texture. possible values: gl.texture_3d: a three-dimensional texture. gl.texture_2d_array: a two-dimensional array texture. level a glint specifying the level of d...
...set a glint specifying the x offset within the compressed texture image. yoffset a glint specifying the y offset within the compressed texture image. zoffset a glint specifying the z offset within the compressed texture image. width a glsizei specifying the width of the texture. height a glsizei specifying the height of the texture. depth a glsizei specifying the depth of the texture.
format a glenum specifying the compressed image
format. possible values: gl.compressed_r11_eac gl.compressed_signed_r11_eac gl.compressed_rg11_eac gl.compressed_signed_rg11_eac gl.compressed_rgb8_etc2 gl.compressed_rgba8_etc2_eac gl.compressed_srgb8_etc2 gl.compressed_srgb8_alpha8_etc2_eac gl.compressed_rgb8_punchthrough_alpha1_etc2 gl.compressed_srgb8_punchthrough_alpha1_etc2 ...
WebGL2RenderingContext.getBufferSubData() - Web APIs
binding point (target). possible values: gl.array_buffer: buffer containing vertex attributes, such as vertex coordinates, texture coordinate data, or vertex color data. gl.element_array_buffer: buffer used for element indices. gl.copy_read_buffer: buffer for copying from one buffer object to another. gl.copy_write_buffer: buffer for copying from one buffer object to another. gl.trans
form_feedback_buffer: buffer for trans
form feedback operations. gl.uni
form_buffer: buffer used for storing uni
form blocks. gl.pixel_pack_buffer: buffer used for pixel transfer operations. gl.pixel_unpack_buffer: buffer used for pixel transfer operations. srcbyteoffset a glintptr specifying the byte offset from which to start reading from the buffer. dstdata an arraybuffer or sharedarrayb...
...ying the element index offset where to start reading the buffer. length optional a gluint defaulting to 0. return value none. exceptions an invalid_value error is generated if: offset + returneddata.bytelength would extend beyond the end of the buffer returneddata is null offset is less than zero. an invalid_operation error is generated if: zero is bound to target target is trans
form_feedback_buffer, and any trans
form feedback object is currently active. examples var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, new float32array(vertices), gl.static_draw); var arrbuffer = new arraybuffer(vertices.length * float32array.bytes_per_element); gl.getbuffersubdata(gl.array_buffer, 0, arrbuffer); specifications spec...
WebGL2RenderingContext.getIndexedParameter() - Web APIs
the webgl2renderingcontext.getindexedparameter() method of the webgl 2 api returns indexed in
formation about a given target. syntax any gl.getindexedparameter(target, index); parameters target a glenum specifying the target for which to return in
formation. possible values: gl.trans
form_feedback_buffer_binding: returns a webglbuffer. gl.trans
form_feedback_buffer_size: returns a glsizeiptr. gl.trans
form_feedback_buffer_start: returns a glintptr. gl.uni
form_buffer_binding: returns a webglbuffer. gl.uni
form_buffer_size: returns a glsizeiptr. gl.uni
form_buffer_start: returns a glintptr. index a gluint specifying the index of the target that is queried. return value depends on the requested in
formation (as specified with target). examples var binding = gl.g...
... editor's draft initial definition for webgl. opengl es 3.0the definition of 'glget' in that specification. ...
WebGL2RenderingContext.texStorage2D() - Web APIs
the webgl2renderingcontext.texstorage2d() method of the webgl api specifies all levels of two-dimensional texture storage. syntax void gl.texstorage2d(target, levels, internal
format, width, height); parameters target a glenum specifying the binding point (target) of the active texture. possible values: gl.texture_2d: a two-dimensional texture. gl.texture_cube_map: a cube-mapped texture. levels a glint specifying the number of texture levels. internal
format a glenum specifying the texture store
format. possible values: gl.r8 gl.r16f gl.r32f gl.r8ui gl.rg8 gl.rg16f gl.rg32f gl.rg8ui gl.rgb8 gl.srgb8 gl.rgb565 gl.r11f_g11f_b10f gl.rgb9_e5 gl.rgb16f gl.rgb32f gl.rgb8ui gl.rgba8 gl.srgb8_aplha8 gl.rgb5_a1 gl.rgba4 gl.rgba1...
...you might be able to enable them via the webgl_compressed_texture_etc extension, though. ...
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. size a glint specifying the number of components per vertex attribute. must be 1, 2, 3, or 4. type a glenum specifying the data type of each component in the array. must be one of: gl.byte, gl.unsigned_byte, gl.short, gl.unsigned_short, gl.int, or gl.unsigned_int. ...
...ices, 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 uni
form mat4 mvmatrix; uni
form 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] * vec4(position, 1.0) * boneweights.p + bo...
WebGLQuery - Web APIs
disjoint timer queries are available with the ext_disjoint_timer_query extension only. ...
...disjoint timer queries are available with the ext_disjoint_timer_query extension only. ...
WebGLRenderingContext.bindBuffer() - Web APIs
ributes, such as vertex coordinates, texture coordinate data, or vertex color data. gl.element_array_buffer: buffer used for element indices. when using a webgl 2 context, the following values are available additionally: gl.copy_read_buffer: buffer for copying from one buffer object to another. gl.copy_write_buffer: buffer for copying from one buffer object to another. gl.trans
form_feedback_buffer: buffer for trans
form feedback operations. gl.uni
form_buffer: buffer used for storing uni
form blocks. gl.pixel_pack_buffer: buffer used for pixel transfer operations. gl.pixel_unpack_buffer: buffer used for pixel transfer operations. buffer a webglbuffer to bind. return value none. exceptions only one target can be bound to a given webglbuffer. an att...
...tion initial definition for webgl. opengl es 2.0the definition of 'glbindbuffer' in that specification. standard man page of the (similar) opengl es 2 api. webgl 2.0the definition of 'bindbuffer' in that specification. editor's draft updated definition for webgl 2. adds new target buffers: gl.copy_read_buffer, gl.copy_write_buffer, gl.trans
form_feedback_buffer, gl.uni
form_buffer, gl.pixel_pack_buffer, gl.pixel_unpack_buffer opengl es 3.0the definition of 'glbindbuffer' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.bufferSubData() - Web APIs
ributes, such as vertex coordinates, texture coordinate data, or vertex color data. gl.element_array_buffer: buffer used for element indices. when using a webgl 2 context, the following values are available additionally: gl.copy_read_buffer: buffer for copying from one buffer object to another. gl.copy_write_buffer: buffer for copying from one buffer object to another. gl.trans
form_feedback_buffer: buffer for trans
form feedback operations. gl.uni
form_buffer: buffer used for storing uni
form blocks. gl.pixel_pack_buffer: buffer used for pixel transfer operations. gl.pixel_unpack_buffer: buffer used for pixel transfer operations. dstbyteoffset a glintptr specifying an offset in bytes where the data replacement will start. srcdata optional an arraybuf...
...n initial definition for webgl. opengl es 2.0the definition of 'glbuffersubdata' in that specification. standard man page of the opengl es 2 api. opengl es 3.0the definition of 'glbuffersubdata' in that specification. standard man page of the (similar) opengl es 3 api. adds new target buffers: gl.copy_read_buffer, gl.copy_write_buffer, gl.trans
form_feedback_buffer, gl.uni
form_buffer, gl.pixel_pack_buffer, gl.pixel_unpack_buffer. ...
WebGLRenderingContext.copyTexImage2D() - Web APIs
possible values: gl.texture_2d: a two-dimensional texture. gl.texture_cube_map_positive_x: positive x face for a cube-mapped texture. gl.texture_cube_map_negative_x: negative x face for a cube-mapped texture. ...
...e for a cube-mapped texture. gl.texture_cube_map_negative_y: negative y face for a cube-mapped texture. gl.texture_cube_map_positive_z: positive z face for a cube-mapped texture. gl.texture_cube_map_negative_z: negative z face for a cube-mapped texture. level a glint specifying the level of detail. level 0 is the base image level and level n is the nth mipmap reduction level. internal
format a glenum specifying the color components in the texture. possible values: gl.alpha: discards the red, green and blue components and reads the alpha component. gl.rgb: discards the alpha components and reads the red, green and blue components. gl.rgba: red, green, blue and alpha components are read from the color buffer. gl.luminance: each color component is a luminance component, alp...
WebGLRenderingContext.getRenderbufferParameter() - Web APIs
the webglrenderingcontext.getrenderbufferparameter() method of the webgl api returns in
formation about the renderbuffer. syntax any gl.getrenderbufferparameter(target, pname); parameters target a glenum specifying the target renderbuffer object. possible values: gl.renderbuffer: buffer data storage for single images in a renderable internal
format. pname a glenum specifying the in
formation to query. possible values: gl.renderbuffer_width: returns a glint indicating the width of the image of the currently bound renderbuffer. gl.renderbuffer_height: returns a glint indicating the height of the image of the currently bound renderbuffer. gl.renderbuffer_internal_
format: returns a glenum indicating the internal
format of the currently bound renderbuffer. the default is gl...
... the depth component. gl.renderbuffer_stencil_size: returns a glint that is the resolution size (in bits) for the stencil component. when using a webgl 2 context, the following value is available additionally: gl.renderbuffer_samples: returns a glint indicating the number of samples of the image of the currently bound renderbuffer. return value depends on the requested in
formation (as specified with pname). either a glint or a glenum. examples gl.getrenderbufferparameter(gl.renderbuffer, gl.renderbuffer_width); specifications specification status comment webgl 1.0the definition of 'getrenderbufferparameter' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetrenderbufferpa...
WebGLRenderingContext.getVertexAttrib() - Web APIs
possible values: gl.vertex_attrib_array_buffer_binding: returns the currently bound webglbuffer. gl.vertex_attrib_array_enabled: returns a glboolean that is true if the vertex attribute is enabled at this index. otherwise false. gl.vertex_attrib_array_size: returns a glint indicating the size of an element of the vertex array. ...
...ribute array at the given index. gl.vertex_attrib_array_divisor: returns a glint describing the frequency divisor used for instanced rendering. when using the angle_instanced_arrays extension: ext.vertex_attrib_array_divisor_angle: returns a glint describing the frequency divisor used for instanced rendering. return value returns the requested vertex attribute in
formation (as specified with pname). examples gl.getvertexattrib(0, gl.vertex_attrib_array_buffer_binding); specifications specification status comment webgl 1.0the definition of 'getvertexattrib' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetvertexattrib' in that specification. standard man pa...
WebGLShader - Web APIs
i and can either be a vertex or a fragment shader. a webglprogram requires both types of shaders. description to create a webglshader use webglrenderingcontext.createshader, then hook up the glsl source code using webglrenderingcontext.shadersource(), and finally invoke webglrenderingcontext.compileshader() to finish and compile the shader. at this point the webglshader is still not in a usable
form and must still be attached to a webglprogram. 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...
...// 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. \n\n' + info; } return shader; } see webglprogram for in
formation on attaching the shaders. examples creating a vertex shader note that there are many other strategies for writing and accessing shader source code strings. these example are for illustration purposes only. var vertexshadersource = 'attribute vec4 position;\n' + 'void main() {\n' + ' gl_position = position;\n' + '}\n'; //use the createshader function from the example above var v...
Clearing with colors - Web APIs
r color is just the first of many you will get to know. this is why webgl/opengl is often called a state machine. by tweaking those "dials" and "switches" you can modify the internal state of the webgl machine, which in turn changes how input (in this case, a clear command) translates into output (in this case, all pixels are set to green). finally, we note that color in webgl is usually in rgba
format, that is four numerical components for red, green, blue and alpha (opacity). therefore, clearcolor() takes four arguments. <p>a very simple webgl program that shows some color.</p> <!-- text within a canvas element is displayed only if canvas is not supported. --> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display...
...removes // itself, because it only needs to run once. window.removeeventlistener(evt.type, setupwebgl, false); // references to the document elements. var paragraph = document.queryselector("p"), canvas = document.queryselector("canvas"); // getting the webgl rendering context. var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); // if failed, in
form user of failure. otherwise, initialize // the drawing buffer (the viewport) and clear the context // with a solid color. if (!gl) { paragraph.innerhtml = "failed to get webgl context. " + "your browser or device may not support webgl."; return; } paragraph.innerhtml = "congratulations! your browser supports webgl. "; gl.viewport(0, 0, gl.drawingbufferwidth, gl.dr...
Using shaders to apply color in WebGL - Web APIs
you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. applying color to the vertices in webgl objects are built using sets of vertices, each of which has a position and a color. ...
... containing four 4-value vectors, one for each vertex color. then a new webgl buffer is allocated to store these colors, and the array is converted into floats and stored into the buffer. to use these colors, the vertex shader needs to be updated to pull the appropriate color from the color buffer: const vssource = ` attribute vec4 avertexposition; attribute vec4 avertexcolor; uni
form mat4 umodelviewmatrix; uni
form mat4 uprojectionmatrix; varying lowp vec4 vcolor; void main(void) { gl_position = uprojectionmatrix * umodelviewmatrix * avertexposition; vcolor = avertexcolor; } `; the key difference here is that for each vertex, we pass its color using a varying to the fragment shader. coloring the fragments as a refresher, here's what our frag...
A simple RTCDataChannel sample - Web APIs
emotedescription(). the catch() calls a routine that handles any errors that occur. note: once again, this process is not a real-world implementation; in normal usage, there's two chunks of code running on two machines, interacting and negotiating the connection. a side channel, commonly called a “signalling server,” is usually used to exchange the description (which is in application/sdp
form) between the two peers. handling successful peer connection as each side of the peer-to-peer connection is successfully linked up, the corresponding rtcpeerconnection's icecandidate event is fired. these handlers can do whatever's needed, but in this example, all we need to do is update the user interface: function handlelocaladdcandidatesuccess() { connectbutton.disabled = true; } ...
...y begin typing another message. receiving messages when a "message" event occurs on the remote channel, our handlereceivemessage() method is called as the event handler. function handlereceivemessage(event) { var el = document.createelement("p"); var txtnode = document.createtextnode(event.data); el.appendchild(txtnode); receivebox.appendchild(el); } this method simply per
forms some basic dom injection; it creates a new <p> (paragraph) element, then creates a new text node containing the message text, which is received in the event's data property. this text node is appended as a child of the new element, which is then inserted into the receivebox block, thereby causing it to draw in the browser window. disconnecting the peers when the user clicks the "disconnect" bu...
Writing WebSocket client applications - Web APIs
ol implemented using packets of json-encapsulated data: // send text to all users through the server function sendtext() { // construct a msg object containing the data the server needs to process the message from the chat client. var msg = { type: "message", text: document.getelementbyid("text").value, id: clientid, date: date.now() }; // send the msg object as a json-
formatted string. examplesocket.send(json.stringify(msg)); // blank the text input element, ready to receive the next line of text from the user. document.getelementbyid("text").value = ""; } receiving messages from the server websockets is an event-driven api; when messages are received, a message event is sent to the websocket object. to handle it, add an event listener for the message eve...
....users.length; i++) { ul += msg.users[i] + "<br>"; } document.getelementbyid("userlistbox").innerhtml = ul; break; } if (text.length) { f.write(text); document.getelementbyid("chatbox").contentwindow.scrollbypages(1); } }; here we use json.parse() to convert the json object back into the original object, then examine and act upon its contents. text data
format text received over a websocket connection is in utf-8
format. closing the connection when you've finished using the websocket connection, call the websocket method close(): examplesocket.close(); it may be helpful to examine the socket's bufferedamount attribute before attempting to close the connection to determine if any data has yet to be transmitted on the network. if this value isn't...
WebXR application life cycle - Web APIs
e the new xrsession to manage the webxr session for the duration of the webxr experience. this will involve managing inputs, animations, and rendering. call the xrsession method requestanimationframe() to schedule the first frame render for the xr device. if your scene is complex, you should consider creating a worker—or using one that you've previously created for this purpose—to per
form the computations needed for each frame to be rendered. this will reduce the chance that the rendering process will noticeably stall the app. each requestanimationframe() callback should use the in
formation provided about the objects located in the 3d world to render the frame using webgl. each time the callback is invoked, it should call requestanimationframe() again in order to let the bro...
...r know that the callback needs to be run again when it's time to render the next frame. when the time comes (such as when the user exits your app or navigates away from your site), end the xr session; otherwise, continue the loop until the user chooses to exit xr mode. to end the xr session yourself, call xrsession.end(). include a handler for the xrsession event end event to be in
formed when the session is ending, regardless of whether your code, the user, or the browser initiated the termination of the session. ...
Targeting and hit detection - Web APIs
hatever 3d graphics engine you're using offers hit testing, especially if it's designed specifically for game development. simplified representative objects one common solution is to overlay simplified, invisible objects atop the objects in your scene. these objects then serve a s. for instance, if you have a more-or-less rectangular object, use a rectangle as a surrogate for the object when per
forming hit testing. likewise, if an object is essentially round, use the radius of the minimum enclosing circle to establish a colision test object. real-world hit testing the acronym "lidar" has multiple definitions depending on specifics of how it's implemented, but the end result is the same. most commonly, it refers to "laser imaging, detection, and ranging" or "light detection and ranging"). ...
...only interpreting the imagery from the device's camera (if available) but also potentially multiple additional sensors. some devices include infrared sensors to help range objects, and others provide powerful lidar systems, which use lasers (usually infrared lasers, which can't be seen by the human eye) to determine range to objects in the world. the details of how to work with an individual plat
form's ranging system is beyond the scope of this article. however, there's hope: a proposal has been floated for a webxr hit test module that would layer atop webxr to provide an api for per
forming hit testing and collision detection. ...
Controlling multiple parameters with ConstantSourceNode - Web APIs
becomes the node's constant output value, which is fed into all of its outputs, which are, as set above, gainnode2 and gainnode3. while this is an extremely simple example, imagine having a 32 oscillator synthesizer with multiple linked parameters in play across a number of patched nodes. being able to shorten the number of operations to adjust them all will prove invaluable for code size and per
formance both. starting the oscillators when the user clicks the play/pause toggle button while the oscillators aren't playing, the startoscillators() function gets called. function startoscillators() { oscnode1 = context.createoscillator(); oscnode1.type = "sine"; oscnode1.frequency.value = 261.625565300598634; // middle c oscnode1.connect(gainnode1); oscnode2 = context.createoscillator...
...or(); oscnode3.type = "sine"; oscnode3.frequency.value = 391.995435981749294 // g oscnode3.connect(gainnode3); oscnode1.start(); oscnode2.start(); oscnode3.start(); playing = true; } each of the three oscillators is set up the same way: create the oscillatornode by calling audiocontext.createoscillator(). set the oscillator's type to "sine" to use a sine wave as the audio wave
form. set the oscillator's frequency to the desired value; in this case, oscnode1 is set to a middle c, while oscnode2 and oscnode3 round out the chord by playing the e and g notes. connect the new oscillator to the corresponding gain node. once all three oscillators have been created, they're started by calling each one's constantsourcenode.start() method in turn, and playing is set to true to tr...
Using IIR filters - Web APIs
ere. a biquad filter is actually a specific type of infinite impulse response filter. it's a commonly-used type and we already have it as a node in the web audio api. if you choose this node the hard work is done for you. for instance, if you want to filter lower frequencies from your sound, you can set the type to highpass and then set which frequency to filter from (or cut off). there's more in
formation on how biquad filters work here. when you are using an iirfilternode instead of a biquadfilternode you are creating the filter yourself, rather than just choosing a pre-programmed type. so you can create a highpass filter, or a lowpass filter, or a more bespoke one. and this is where the iir filter node is useful — you can create your own if none of the alaready available settings is righ...
...andpass filter within it, you could just use one iir filter node in place of the two biquad filter nodes you would otherwise need for this. with the iirfilter node it's up to you to set what feedforward and feedback values the filter needs — this determines the characteristics of the filter. the downside is that this involves some complex maths. if you are looking to learn more there's some in
formation about the maths behind iir filters here. this enters the realms of signal processing theory — don't worry if you look at it and feel like it's not for you. if you want to play with the iir filter node and need some values to help along the way, there's a table of already calculated values here; on pages 4 & 5 of the linked pdf the an values refer to the feedforward values and the bn value...
Web Workers API - Web APIs
web workers concepts and usage a worker is an object created using a constructor (e.g. worker()) that runs a named javascript file — this file contains the code that will run in the worker thread; workers run in another global context that is different from the current window. ...
...resents the scope of a shared worker, inheriting from workerglobalscope and adding some dedicated features. workernavigator represents the identity and state of the user agent (the client): examples we have created a couple of simple demos to show basic usage: basic dedicated worker example (run dedicated worker). basic shared worker example (run shared worker). you can find out more in
formation on how these demos work in using web workers. specifications specification status comment html living standardthe definition of 'web workers' in that specification. living standard initial definition. ...
Window.devicePixelRatio - Web APIs
ixelratio changes (which can happen, for example, if the user drags the window to a display with a different pixel density). see the example below. syntax value = window.devicepixelratio; value a double-precision floating-point value indicating the ratio of the display's resolution in physical pixels to the resolution in css pixels. a value of 1 indicates a classic 96 dpi (76 dpi on some plat
forms) display, while a value of 2 is expected for hidpi/retina displays. other values may be returned as well in the case of unusually low resolution displays or, more often, when a screen has a higher pixel depth than simply double the standard resolution of 96 or 76 dpi. examples correcting resolution in a <canvas> a <canvas> can appear too blurry on retina screens. use window.devicepixelratio ...
...with up to two decimal places. then the updatepixelratio() function is called once to display the starting value, after which the media query is created using matchmedia() and addeventlistener() is called to set up updatepixelratio() as a handler for the change event. html the html creates the boxes containing the instructions and the pixel-ratio box that will display the current pixel ratio in
formation. <div class="container"> <div class="inner-container"> <p>this example demonstrates the effect of zooming the page in and out (or moving it to a screen with a different scaling factor) on the value of the property <code>window.devicepixelratio</code>. try it and watch what happens!</p> </div> <div class="pixel-ratio"></div> </div> css body { font: 22px...
Privileged features - Web APIs
imize system command icon in the titlebar and it will be minimizable. any non-dialog window is always minimizable and minimizable=no will be ignored. dependent if on, the new window is said to be dependent of its parent window. a dependent window closes when its parent window closes. a dependent window is minimized on the windows task bar only when its parent window is minimized. on windows plat
forms, a dependent window does not show on the task bar. a dependent window also stays in front of the parent window. dependent windows are not implemented on macos x, this option will be ignored. the dependent feature is currently under revision to be removed (bug 214867) in msie 6, the nearest equivalent to this feature is the showmodelessdialog() method. chrome if on, the page is loaded as win...
...rpose is to only notify info and to be dismissed, closed. on mac systems, dialog windows have a different window border and they may get turned into a sheet. modal if on, the new window is said to be modal. the user cannot return to the main window until the modal window is closed. a typical modal window is created by the alert() function. the exact behavior of modal windows depends on the plat
form and on the mozilla release version. note: as of gecko 1.9, the internet explorer equivalent to this feature is the window.showmodaldialog() method. for compatibility reasons, it's now supported in firefox. note also that starting in gecko 2.0, you can use window.showmodaldialog() without universalbrowserwrite privileges. titlebar by default, all new secondary windows have a titlebar. if ...
window.requestIdleCallback() - Web APIs
functions are generally called in first-in-first-out order; however, callbacks which have a timeout specified may be called out-of-order if necessary in order to run them before the timeout elapses. you can call requestidlecallback() within an idle callback function to schedule another callback to take place no sooner than the next pass through the event loop. ...
... run because the timeout period expired. options optional contains optional configuration parameters. currently only one property is defined: timeout: if timeout is specified and has a positive value, and the callback has not already been called by the time timeout milliseconds have passed, the callback will be called during the next idle period, even if doing so risks causing a negative per
formance impact. example see our complete example in the article cooperative scheduling of background tasks api. specifications specification status comment cooperative scheduling of background tasks proposed recommendation initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to co...
Window: unhandledrejection event - Web APIs
s allowing the unhandledrejection event to bubble will eventually result in an error message being output to the console. you can prevent this by calling preventdefault() on the promiserejectionevent; see preventing default handling below for an example. examples here we have a few examples showing ways you can make use of the unhandledrejection event. the event includes two useful pieces of in
formation: promise the actual promise which was rejected with no handler available to deal with the rejection. reason the reason that would have been passed into the rejection handler if one had existed. see catch() for details. basic error logging this example simply logs in
formation about the unhandled promise rejection to the console. window.addeventlistener("unhandledrejection", event =>...
...p the event listener: window.onunhandledrejection = event => { console.warn(`unhandled promise rejection: ${event.reason}`); }; preventing default handling many environments (such as node.js) report unhandled promise rejections to the console by default. you can prevent that from happening by adding a handler for unhandledrejection events that—in addition to any other tasks you wish to per
form—calls preventdefault() to cancel the event, preventing it from bubbling up to be handled by the runtime's logging code. this works because unhandledrejection is cancelable. window.addeventlistener('unhandledrejection', function (event) { // ...your code here to handle the unhandled rejection... // prevent the default handling (such as outputting the // error to the console) event.pre...
WindowOrWorkerGlobalScope.fetch() - Web APIs
igin header is not set on fetch requests with a method of head or get. (this behavior was corrected in firefox 65 — see bug 1508661). headers any headers you want to add to your request, contained within a headers object or an object literal with bytestring values. note that some names are forbidden. body any body that you want to add to your request: this can be a blob, buffersource,
formdata, urlsearchparams, usvstring, or readablestream object. note that a request using the get or head method cannot have a body. mode the mode you want to use for the request, e.g., cors, no-cors, or same-origin. credentials the request credentials you want to use for the request: omit, same-origin, or include. to automatically send cookies for the current domain, this option must be provi...
...beacon() api. signal an abortsignal object instance; allows you to communicate with a fetch request and abort it if desired via an abortcontroller. return value a promise that resolves to a response object. exceptions aborterror the request was aborted due to a call to the abortcontroller method abort() method. typeerror the specified url string includes user credentials. this in
formation should instead be provided using an authorization header. examples in our fetch request example (see fetch request live) we create a new request object using the relevant constructor, then fetch it using a fetch() call. 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 disp...
Worker.prototype.postMessage() - Web APIs
the postmessage() method of the worker interface sends a message to the worker's inner scope. this accepts a single parameter, which is the data to send to the worker. the data may be any value or javascript object handled by the structured clone algorithm, which includes cyclical references. the worker can send back in
formation to the thread that spawned it using the dedicatedworkerglobalscope.postmessage method. syntax worker.postmessage(message, [transfer]); parameters message the object to deliver to the worker; this will be in the data field in the event delivered to the dedicatedworkerglobalscope.onmessage handler. this may be any value or javascript object handled by the structured clone algorithm, which includes cyclical references. if the message parameter is not provided, a...
...the context it was sent from and becomes available only to the worker it was sent to. transferable objects are instances of classes like arraybuffer, messageport or imagebitmap objects that can be transferred. null is not an acceptable value for transfer. returns void. example the following code snippet shows the creation of a worker object using the worker() constructor. when either of two
form inputs (first and second) have their values changed, change events invoke postmessage() to send the value of both inputs to the current worker. var myworker = new worker('worker.js'); first.onchange = function() { myworker.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.postmessage([first.value,second.value]); ...
WorkerGlobalScope.navigator - Web APIs
ent of self.console.log(self.navigator);, as these are being called on the worker scope, which can be referenced with workerglobalscope.self), you will get a workernavigator object written to the console — something like the following: object {online: true, useragent: "mozilla/5.0 (macintosh; intel mac os x 10_10_1) ap…ml, like gecko) chrome/40.0.2214.93 safari/537.36", product: "gecko", plat
form: "macintel", appversion: "5.0 (macintosh; intel mac os x 10_10_1) applewebki…ml, like gecko) chrome/40.0.2214.93 safari/537.36"…} appcodename: "mozilla" appname: "netscape" appversion: "5.0 (macintosh; intel mac os x 10_10_1) applewebkit/537.36 (khtml, like gecko) chrome/40.0.2214.93 safari/537.36" hardwareconcurrency: 4 online: true plat
form: "macintel" product: "...
...tel mac os x 10_10_1) applewebkit/537.36 (khtml, like gecko) chrome/40.0.2214.93 safari/537.36" hardwareconcurrency: 4 online: true plat
form: "macintel" product: "gecko" useragent: "mozilla/5.0 (macintosh; intel mac os x 10_10_1) applewebkit/537.36 (khtml, like gecko) chrome/40.0.2214.93 safari/537.36" __proto__: object you could use this navigator object to return more in
formation about the runtime envinronment, as you might do with a normal navigator object. specifications specification status comment html living standardthe definition of 'navigator' in that specification. living standard ...
WorkerGlobalScope - Web APIs
each workerglobalscope has its own event loop. this interface is usually specialized by each worker type: dedicatedworkerglobalscope for dedicated workers, sharedworkerglobalscope for shared workers, and serviceworkerglobalscope for serviceworker. the self property returns the specialized scope for each context. ...
...balscope itself. most of the time it is a specific scope like dedicatedworkerglobalscope, sharedworkerglobalscope or serviceworkerglobalscope. workerglobalscope.location read only returns the workerlocation associated with the worker. it is a specific location object, mostly a subset of the location for browsing scopes, but adapted to workers. non-standard properties workerglobalscope.per
formance read only returns the per
formance associated with the worker. it is a regular per
formance object, except that only a subset of its property and methods are available to workers. workerglobalscope.console read only returns the console associated with the worker. properties implemented from elsewhere windoworworkerglobalscope.caches read only returns the cachestorage object asso...
WorkerNavigator - Web APIs
such an object is initialized for each worker and is available via the workerglobalscope.navigator property obtained by calling window.self.navigator. properties the workernavigator interface implements properties from the navigatorid, navigatorlanguage, navigatoronline, navigatordatastore, and navigatorconcurrenthardware interfaces. workernavigator.connectionread only provides a networkin
formation object containing in
formation about the network connection of a device. workernavigator.locks read only returns a lockmanager object which provides methods for requesting a new lock object and querying for an existing lock object. workernavigator.permissions read only returns a permissions object that can be used to query and update permission status of apis covered by the permission...
...anguage.languageread only returns a domstring representing the language version of the browser. the null value is returned when this is unknown. navigatorlanguage.languagesread only returns an array of domstrings representing the languages known to the user, in order of preference. navigatoronline.onlineread only returns a boolean indicating whether the browser is online. navigatorid.plat
form read only returns a string representing the plat
form of the browser. do not rely on this property to return the correct value. navigatorid.product read only always returns 'gecko', on any browser. this property is kept only for compatibility purposes. navigatorid.useragentread only returns the user agent string for the current browser. methods the workernavigator interface implements...
Worklet - Web APIs
worklet types worklets are restricted to specific use cases; they cannot be used for arbitrary computations like web workers. the worklet interface abstracts properties and methods common to all kind of worklets, and cannot be created directly. ...
...orklet for programmatically generating an image where a css property expects a file. access this interface through css.paintworklet. chrome: main thread gecko: paint thread css painting api audioworklet for audio processing with custom audionodes. web audio render thread web audio api animationworklet for creating scroll-linked and other high per
formance procedural animations. compositor thread css animation worklet api layoutworklet for defining the positioning and dimensions of custom elements. css layout api for 3d rendering with webgl, you don't use worklets. instead, you write vertex shaders and fragment shaders using glsl code, and those shaders will then run on the graphics card. properties the workle...
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
here is a an example javascript function that prints the security details of an xmlhttprequest sent over ssl. the function is passed the channel property of an xmlhttprequest to extract the following in
formation: was the connection secure? was the used ssl certificate valid and what are its details (owner, expiration, certificate authority, etc.)? notes: this code requires elevated privileges to run; you can only call it from a browser extension or from a xulrunner application. the channel property becomes available only after the request is sent and the connection was established, that is, on readystate loaded, interactive or completed. by setting the mozbackgroundrequest property of the request object and modifying the example appropriately, you can create your own alert dial...
...t(errname); return error; // xxx: errtype goes unused } function dumpsecurityinfo(xhr, error) { let channel = xhr.channel; try { dump("connection status:\n"); if (!error) { dump("\tsucceeded\n"); } else { dump("\tfailed: " + error.name + "\n"); } let secinfo = channel.securityinfo; // print general connection security state dump("security in
formation:\n"); if (secinfo instanceof ci.nsitransportsecurityinfo) { secinfo.queryinterface(ci.nsitransportsecurityinfo); dump("\tsecurity state of connection: "); // check security state flags if ((secinfo.securitystate & ci.nsiwebprogresslistener.state_is_secure) == ci.nsiwebprogresslistener.state_is_secure) { dump("secure connection\n"); } els...
Sending and Receiving Binary Data - Web APIs
t8view.length; i++) { longint8view[i] = i % 256; } var xhr = new xmlhttprequest; xhr.open("post", url, false); xhr.send(myarray); this is building a 512-byte array of 8-bit integers and sending it; you can use any binary data you'd like, of course. note: support for sending arraybuffer objects using xmlhttprequest was added to gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6). add in
formation about other browsers' support here. submitting
forms and uploading files please, read this paragraph. firefox-specific examples this example transmits binary content asynchronously, using the post method, and firefox's non-standard sendasbinary(). var req = new xmlhttprequest(); req.open("post", url, true); // set headers and mime-type appropriately req.setrequestheader("content-length"...
...is non-standard sendasbinary method is considered deprecated as of gecko 31 (firefox 31 / thunderbird 31 / seamonkey 2.28) and will be removed soon. the standard send(blob data) method can be used instead as explained above. you can also send binary content by passing an instance of the nsifileinputstream to send(). in that case, you don't have to set the content-length header yourself, as the in
formation is fetched from the stream automatically: // make a stream from a file. var stream = components.classes["@mozilla.org/network/file-input-stream;1"] .createinstance(components.interfaces.nsifileinputstream); stream.init(file, 0x04 | 0x08, 0644, 0x04); // file is an nsifile instance // try to determine the mime type of the file var mimetype = "text\/plain"; try { var...
Synchronous and asynchronous requests - Web APIs
synchronous requests block the execution of code which causes "freezing" on the screen and an unresponsive user experience. asynchronous request if you use an asynchronous xmlhttprequest, you receive a callback when the data has been received. this lets the browser continue to work as normal while your request is being handled. example: send a file to the console log this is the simplest usage of asynchronous xmlhttprequest. ...
...httprequest(); client.open("post", "/log", false); // third parameter indicates sync xhr. :( 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 per
formance of the next navigation. the following example shows a theoretical analytics code pattern that submits data to a server by using the sendbeacon() method. window.addeventlistener('unload', logdata, false); function logdata() { navigator.sendbeacon("/log", analyticsdata); } ...
XMLHttpRequest.send() - Web APIs
ull. if no accept header has been set using the setrequestheader(), an accept header with the type "*/*" (any type) is sent. syntax xmlhttprequest.send(body) parameters body optional a body of data to be sent in the xhr request. this can be: a document, in which case it is serialized before being sent. an xmlhttprequestbodyinit, which per the fetch spec can be a blob, buffersource,
formdata, urlsearchparams, or usvstring object. null if no value is specified for the body, a default value of null is used. the best way to send binary content (e.g. in file uploads) is by using an arraybufferview or blob in conjunction with the send() method. return value undefined. exceptions exception description invalidstateerror send() has already been invo...
...not get. example: get var xhr = new xmlhttprequest(); xhr.open('get', '/server', true); xhr.onload = function () { // request finished. do processing here. }; 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 in
formation along with the request xhr.setrequestheader("content-type", "application/x-www-
form-urlencoded"); xhr.onreadystatechange = function() { // call a function when the state changes. if (this.readystate === xmlhttprequest.done && this.status === 200) { // request finished. do processing here. } } xhr.send("foo=bar&lorem=ipsum"); // xhr.send(new int8array()); // xhr.send(document...
XRFrame - Web APIs
events which communicate the tracking state of objects also provide an xrframe reference as part of their structure. ...
...his frame is to be rendered, the getviewerpose() method is provided to obtain the xrviewerpose describing the viewer's position and orientation in space, and getpose() can be used to create an xrpose describing the relative position of one xrspace relative to another. properties session read only the xrsession that for which this xrframe describes the tracking details for all objects. the in
formation about a specific object can be obtained by calling one of the methods on the object. methods getpose() returns an xrpose object representing the spatial relationship between the two specified xrspace objects. getviewerpose() returns an xrviewerpose describing the viewer's position and orientation in a given xrreferencespace. specifications specification status comme...
XRHandedness - Web APIs
assuming that's then valid...
...lly, depending on the degree of smoothness required and any per
formance constraints), scans the list of input sources looking for any which have a gripspace which isn't null. if a gripspace is present, that means the input source is a hand-held device of some sort, so it should be rendered visibly if possible. if gripspace is non-null, the function proceeds to get the pose for the gripspace trans
formed into the current reference space. assuming that's then valid, a function called myrenderhandobject() is called with the grip's pose and the value of handedness. with these values in hand (no pun intended), myrenderhandobject() can draw the appropriate model positioned and
formed for the correct hand. specifications specification status comment webxr device apithe defin...
XRInputSource.handedness - Web APIs
assuming that's then valid...
...lly, depending on the degree of smoothness required and any per
formance constraints), scans the list of input sources looking for any which have a gripspace which isn't null. if a gripspace is present, that means the input source is a hand-held device of some sort, so it should be rendered visibly if possible. if gripspace is non-null, the function proceeds to get the pose for the gripspace trans
formed into the current reference space. assuming that's then valid, a function called myrenderhandobject() is called with the grip's pose and the value of handedness. with these values in hand (no pun intended), myrenderhandobject() can draw the appropriate model positioned and
formed for the correct hand. specifications specification status comment webxr device apithe defin...
XRInputSource.profiles - Web APIs
represented by the xrinputsource object. each input profile specifies the preferred visual representation and behavior of the input source. usage notes input profile names an input profile name is a string describing a visual representation and behavior the input source may be configured to use. ...
...ation and behavior the input source may be configured to use. each string: has no spaces; instead, words are separated by hyphen ("-") characters if the plat
form makes it available, the usb vendor and product id may be provided but cannot be relied upon does not uniquely identify a specific device; rather, it identifies a configuration that the product is capable of using does not provide in
formation about handedness of the device, if applicable the webxr input profiles registry is used by device developers and browser developers to attempt to ensure that a given device will report the same profile strings regardless of which browser or other user agent you use. specifications specification status comment webxr device apithe definition of 'xrinputsource.profil...
XRInputSource.targetRayMode - Web APIs
ze the user is using a gaze-tracking system (or gaze input) which detects the direction in which the user is looking. the target ray will be drawn originating at the viewer's eyes and will follow the direction in which they're looking. screen the direction of the target ray is indicated using a tap on a touch screen, mouse, or other tactile input device. tracked-pointer targeting is being per
formed using a handheld device or hand-tracking system which the user points in the direction of the target. the target ray extends from the hand (or the object in the hand) in the targeted direction. the direction is determined using plat
form-specific rules, though if no such rules exist, the direction is chosen by assuming the user is pointing their index finger straight out from their hand. usage...
...mple looks for inputs whose targetraymode is tracked-pointer, indicating that the input is in fact intended to represent a targeting device rather than a gazing device, screen tap, or mouse click. for tracked pointers, a function myrendertargetrayasbeam() is called to render a beam from the input controller's virtual position outward in the direction it's pointing. the code should continue to per
form tasks such as drawing controllers or any objects representative of the user's hands' positions in the virtual space, as well as any other input-related tasks. function updateinputsources(session, frame, refspace) { for (let source of session.getinputsources()) { let targetraypose = frame.getpose(inputsource.targetrayspace, refspace); if (targetraypose) { if (source.targetraymode...
XRInputSource.targetRaySpace - Web APIs
allow for future enhancements to the api. the target ray space reported by tracked pointer inputs (targetraymode of tracked-pointer) is actually based upon the true spatial position and orientation of the input device. to determine the position and orientation of the target ray while rendering a frame, pass it into the xrframe method getpose() method, then use the returned xrpose object's trans
form to gather the spatial in
formation you need. example this fragment of code shows part of a function to be called once every frame. it looks for inputs which have a non-null targetrayspace. inputs which have a value for this property represent inputs that project a target ray outward from the user. for each such input, this example looks for inputs whose targetraymode is tracked-pointer, indicat...
...mple looks for inputs whose targetraymode is tracked-pointer, indicating that the input is in fact intended to represent a targeting device rather than a gazing device, screen tap, or mouse click. for tracked pointers, a function myrendertargetrayasbeam() is called to render a beam from the input controller's virtual position outward in the direction it's pointing. the code should continue to per
form tasks such as drawing controllers or any objects representative of the user's hands' positions in the virtual space, as well as any other input-related tasks. function updateinputsources(session, frame, refspace) { for (let source of session.getinputsources()) { let targetraypose = frame.getpose(inputsource.targetrayspace, refspace); if (targetraypose) { if (source.targetraymode...
XRInputSource - Web APIs
properties gamepad read only a gamepad object describing the state of the buttons and axes on the xr input source, if it is a gamepad or comparable device. ...
... properties gamepad read only a gamepad object describing the state of the buttons and axes on the xr input source, if it is a gamepad or comparable device. ...
XRInputSourceArray.forEach() - Web APIs
ch is the value of the item from within the xrinputsourcearray which is currently being processed. currentindex optional an integer value providing the index into the array at which the element given by currentvalue is located. if you don't need to know the index number, you can omit this. sourcelist optional the xrinputsourcearray object which is being processed. if you don't need this in
formation, you may omit this. thisarg optional the value to be used for this while executing the callback. note that if you use arrow function notation (=>) to provide the callback, you can omit thisarg, since all arrow functions lexically bind this. return value undefined. examples this example snippet gets the list of inputs for a session and tries to handle each type of input device it s...
...operty, as an input for other devices, we look for tracked-pointer devices in the player's main hand, dispatching those to a handlemainhandinput() method. specifications specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in in
formation contained in a webidl file for in
formation on how an iterable declaration in an interface definition causes entries(), foreach(), keys(), and values() methods to be exposed from objects that implement the interface. ...
XRInputSourceEvent.frame - Web APIs
urrent point of view; the results of calling getviewerpose() will be an xrviewerpose with an empty views list. examples this code shows a handler for the selectstart event which gets the target ray's pose from the frame, mapping the pose representing the ray (event.inputsource.targetrayspace) to the overall reference space myrefspace. ...
... result isn't null, the target ray pose's trans
form is passed into a function called mycheckandhandlehit() to see if the ray was pointing at anything when the select was triggered. xrsession.onselectstart = event => { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { checkandhandlehit(targetraypose.trans
form); } }; specifications specification status comment webxr device apithe definition of 'xrinputsourceevent.frame' in that specification. working draft initial definition. ...
XRInputSourceEvent - Web APIs
ey represent a change in the state of an xrinputsource. to learn more about handling inputs in a webxr project, see the article inputs and input sources. constructor xrinputsourceevent() creates and returns a new xrinputsourceevent object whose properties match those provided in the eventinitdict dictionary provided. properties frame read only an xrframe object providing the needed in
formation about the event frame during which the event occurred. this frame may have been rendered in the past rather than being a current frame. because this is an event frame, not an animation frame, you cannot call the xrframe method getviewerpose() on it; instead, use getpose(). inputsource read only an xrinputsource object indicating which input source generated the input event. methods the...
...e, or grip the controller. examples the code below sets up handlers for primary action events in order to determine when the user clicks on (shoots at/pokes at/whatever) objects in the scene. xrsession.addeventlistener("select", event => { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { let hit = myhittest(targetraypose.trans
form); if (hit) { /* handle the hit */ } } }); specifications specification status comment webxr device apithe definition of 'xrinputsourceevent' in that specification. working draft initial definition. ...
XRPermissionDescriptor.optionalFeatures - Web APIs
erence spaces the app rquires to be available. the reference space returned by xrsession.requestreferencespace() is either xrreferencespace or xrboundedreferencespace. the "interface" column in the table below indicates which of the two types is returned for each reference space type constant.. reference space descriptors the types of reference space are listed in the table below, with brief in
formation about their use cases and which interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native or...
...rface 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. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying plat
form and implementation. the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case. for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment. xrreferencespace local-floor similar to the local type, except the starting position is...
XRPermissionStatus.granted - Web APIs
navigator.permissions.query() method was called. syntax grantedfeatures = xrpermissionstatus.granted; value an array of domstring objects, each identifying a single webxr feature which the app or site has been granted permission to use. currently, all of these strings come from the xrreferencespacetype enumerated type. the types of reference space are listed in the table below, with brief in
formation about their use cases and which interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native or...
...rface 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. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying plat
form and implementation. the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case. for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment. xrreferencespace local-floor similar to the local type, except the starting position is...
XRReferenceSpaceEvent - Web APIs
eferencespaceevent with the specified type and configured using the values in the given xrreferencespaceeventinit dictionary. properties in addition to inheriting the properties available on the parent interface, event, xrreferencespaceevent objects include the following properties: referencespace read only an xrreferencespace indicating the reference space that generated the event. trans
form read only an xrrigidtrans
form object indicating the position and orientation of the specified referencespace's native origin after the event, defined relative to the coordinate system before the event. methods while xrreferencespaceevent does not define any methods, it inherits the methods of its parent interface, event. event types reset the reset event is sent to a reference space whe...
...ned relative to the coordinate system before the event. methods while xrreferencespaceevent does not define any methods, it inherits the methods of its parent interface, event. 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. this is an opportunity for your app to update any stored trans
forms, position/orientation in
formation, or the like—or to dump any cached values based on the reference's space's origin so you can recompute them as needed. specifications specification status comment webxr device apithe definition of 'xrreferencespaceevent' in that specification. working draft initial definition. ...
XRReferenceSpaceEventInit - Web APIs
tionary is used when calling the xrreferencespaceevent() constructor to provide the values for its properties. since the properties are read-only, this is the only opportunity available to set their values. you will not usually need to use this, since these events are created by the webxr infrastructure. properties referencespace the xrreferencespace from which the event originated. trans
form an xrrigidtrans
form which maps the old coordinate system (from before the changes indicated by this event) to the new coordiante system. usage notes all of this dictionary's properties must have valid values set on them before calling the xrreferencespaceevent() constructor. examples this simple snippet calls the constructor to create a new reference space event of type reset. let refspace...
...ted by this event) to the new coordiante system. usage notes all of this dictionary's properties must have valid values set on them before calling the xrreferencespaceevent() constructor. examples this simple snippet calls the constructor to create a new reference space event of type reset. let refspaceevent = new xrreferencespaceevent("reset", { referencespace: myrefspace, trans
form: mytrans
form }); specifications specification status comment webxr device apithe definition of 'xrreferencespaceeventinit' in that specification. working draft initial definition. ...
XRReferenceSpaceType - Web APIs
in a reference space for an xrsession. values the reference space returned by xrsession.requestreferencespace() is either xrreferencespace or xrboundedreferencespace. the "interface" column in the table below indicates which of the two types is returned for each reference space type constant.. reference space descriptors the types of reference space are listed in the table below, with brief in
formation about their use cases and which interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native or...
...rface 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. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying plat
form and implementation. the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case. for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment. xrreferencespace local-floor similar to the local type, except the starting position is...
XRSession.onsqueeze - Web APIs
nds somewhat on the previous example by demonstrating a way to implement the ability for the user to drop an object that was previously picked up by the user.. this is just a snippet of code, but should establish the general idea. after checking that the event occurred on the user's dominant hand, the pose's target ray is obtained. then we pass the currently held object and the target ray's trans
form matrix into a function we call dropobjectusingray() to drop the object, using the target ray to determine the surface upon which the object should be placed. this also clears the value of heldobject so we know that there's no longer an object in hand. xrsession.onsqueeze = event => { if (event.inputsource.handedness == user.handedness) { let targetraypose = event.frame.getpose(event.inputs...
...should be placed. this also clears the value of heldobject so we know that there's no longer an object in hand. xrsession.onsqueeze = event => { if (event.inputsource.handedness == user.handedness) { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (user.heldobject && targetraypose) { dropobjectusingray(user.heldobject, targetraypose.trans
form.matrix): } } }; see the examples in the onsqueezestart and onsqueezeend event handlers for the reset of the event handling related to this approach. specifications specification status comment webxr device apithe definition of 'xrsession.onsqueeze' in that specification. working draft initial definition. ...
XRSession.onsqueezestart - Web APIs
receives a squeezestart event. examples this snippet of code adds a simple handler for the squeezestart event, which responds only to events on the user's dominant hand by getting the target ray, then calling a function findobjectusingray() to identify the object that the user is pointing at. ...
...ointing at. this object is then stored in a heldobject variable in the user object we're using to represent user in
formation. xrsession.onsqueezestart = event => { if (event.inputsource.handedness == user.handedness) { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace; if (targetraypose) { user.heldobject = findobjectusingray(targetraypose.trans
form); } } }; specifications specification status comment webxr device apithe definition of 'xrsession.onsqueezestart' in that specification. working draft initial definition. ...
XRSession.requestReferenceSpace() - Web APIs
in the xrreferencespacetype enumerated type. the reference space returned by xrsession.requestreferencespace() is either xrreferencespace or xrboundedreferencespace. the "interface" column in the table below indicates which of the two types is returned for each reference space type constant.. reference space descriptors the types of reference space are listed in the table below, with brief in
formation about their use cases and which interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a tracking space whose native or...
...rface 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. xrboundedreferencespace local a tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying plat
form and implementation. the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case. for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment. xrreferencespace local-floor similar to the local type, except the starting position is...
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. the mybegintracking() function would presumably start the presentation of the object-dragging process, using the trans
form to per
form a hit test, determining which object to pick up. mybegintracking() returns an object representing the object the user has begun to drag. upon receiving a squeeze event, the mydropobject() function is called with the target object and the current target ray pose trans
form as inputs. this places the object into its new position in the world and triggers any effects that may arise from d...
...d with the target object and the current target ray pose trans
form as inputs. this places the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the squeezeend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's trans
form. xrsession.addeventlistener("squeezestart", onsqueezeevent); xrsession.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.targetrayspac...
XRTargetRayMode - Web APIs
ze the user is using a gaze-tracking system (or gaze input) which detects the direction in which the user is looking. the target ray will be drawn originating at the viewer's eyes and will follow the direction in which they're looking. screen the direction of the target ray is indicated using a tap on a touch screen, mouse, or other tactile input device. tracked-pointer targeting is being per
formed using a handheld device or hand-tracking system which the user points in the direction of the target. the target ray extends from the hand (or the object in the hand) in the targeted direction. the direction is determined using plat
form-specific rules, though if no such rules exist, the direction is chosen by assuming the user is pointing their index finger straight out from their hand. examp...
...mple looks for inputs whose targetraymode is tracked-pointer, indicating that the input is in fact intended to represent a targeting device rather than a gazing device, screen tap, or mouse click. for tracked pointers, a function myrendertargetrayasbeam() is called to render a beam from the input controller's virtual position outward in the direction it's pointing. the code should continue to per
form tasks such as drawing controllers or any objects representative of the user's hands' positions in the virtual space, as well as any other input-related tasks. function updateinputsources(session, frame, refspace) { for (let source of session.getinputsources()) { let targetraypose = frame.getpose(inputsource.targetrayspace, refspace); if (targetraypose) { if (source.targetraymode...
XRViewerPose - Web APIs
user, or it may represent another device or interface which may serve as the source of a position and orientation that make up a view upon the scene. for example, every player in a mmorpg might have an instance of xrviewerpose to provide a way to calculate what they can see; if the game provides a mechanism that tells the player if another player sees them, or that they see another player, this in
formation becomes crucial. an xrviewerpose is always obtained and referenced relative to an existing xrreferencespace. this ensures that positions and orientations are reported using the expected relative coordinate system. to render a scene using the xrviewerpose representing the user's head, one would iterate over the views in the views array, rendering them one after another. by calling viewport(...
...s head, one would iterate over the views in the views array, rendering them one after another. by calling viewport() on the webgl context, specifying the xrview as input, you can get the viewport to use when rendering in order to draw the frame for that eye into the correct part of the drawing surface. also, when rendering the scene for spectators or other players in a multiplayer game, the trans
form of the xrviewerpose can be used to determine both placement and facing direction of the other players in the game, so that they can be drawn in the correct place with the correct facing. the viewer's pose for the animation frame represented by xrframe can be obtained by calling the frame's getviewerpose() method, specifying the reference space in which the origin's position should be computed. t...
XRWebGLLayerInit.antialias - Web APIs
the boolean antialias property, if present and set to true in the xrwebgllayerinit object provided as the xrwebgllayer() constructor's layerinit parameter, requests that the new webgl rendering layer support anti-aliasing. if this property is missing or is false, anti-aliasing is not desired. there is no way to request a specific anti-aliasing
format or level; this decision is left up to the user agent. syntax let layerinit = { antialias: boolvalue }; let gllayer = new xrwebgllayer(xrsession, gl, layerinit); let gllayer = new xrwebgllayer(xrsession, gl, { antialias: boolvalue }); value a boolean value which can be set to true to request anti-aliasing support in the new webgl rendering layer. if false, anti-aliasing is not desired. usage notes the state of anti-aliasing for the co...
...support; this is passed into the constructor. let options = { antialias: getpreferencevalue("antialiasing") }; let gllayer = new xrwebgllayer(xrsession, gl, options); if (gllayer) { xrsession.updaterenderstate({ baselayer: gllayer }); } offering the user features such as the ability to enable or disable things like anti-aliasing can provide them with optiions to try when your app isn't per
forming as well as they'd like. disabling anti-aliasing may improve per
formance to some extent. specifications specification status comment webxr device apithe definition of 'xrwebgllayerinit.antialias' in that specification. working draft initial definition. ...
XRWebGLLayerInit - Web APIs
properties alpha optional the frame buffer's color buffer will be established with an alpha channel if the alpha boolean property is true. otherwise, the color buffer will not have an alpha channel. the default value is true. ...
...he new layer include a stencil buffer. otherwise, no stencil buffer is allocated. the default is false. examples given an xrsession, xrsession, and a webgl rendering context, gl, this snippet sets the rendering layer for the session, specifying the ignoredepthvalues option, indicating that the depth buffer should not be used (or should not exist at all), and that the only source for distance in
formation of any given point is its position relative to the viewer. const layeroptions = { ignoredepthvalues: true }; xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, layeroptions); }); specifications specification status comment webxr device apithe definition of 'xrwebgllayerinit' in that specification. working draft initial definition. ...
Introduction - Web APIs
rst ways proposed by the w3c. css is a simple way to apply style rules to a web document. these style rules define how the document (the content) should be laid out. however, it has several limitations, such as lack of programming structures and ability to create complex layout models. css also has limited support for changing the position of an element. xsl (extensible stylesheet language) trans
formations are composed of two parts: xsl elements, which allow the trans
formation of an xml tree into another markup tree and xpath, a selection language for trees. xslt takes an xml document (the content) and creates a brand new document based on the rules in the xsl stylesheet. this allows xslt to add, remove and reorganize elements from the original xml document and thus allows more fine-grain con...
...each template matches (using xpath) a certain fragment of the input xml document and then applies the substitution part on that fragment to create the new resulting document. ...
msWriteProfilerMark - Web APIs
tary method is specific to internet explorer and microsoft edge. syntax window.mswriteprofilermark("start-render"); parameters bstrprofilermarkname[in] an event name. type = string. this parameter may be null. return value type: hresult. if this method succeeds, it returns s_ok. otherwise, it returns an hresult error code. notes mswriteprofilermark enables you to inject dom based per
formance markers in addition to existing javascript api to learn exactly when parts of the page are being rendered, building a waterfall view for every one of our impressions showing latency per object, which can be useful for more accurately debugging real users perf issues. internet explorer 10. this method is also available in the web worker global scope. for windows xp, this method sends an even...
... this method sends an event to an event tracing session with traceevent; for systems after windows xp, this method writes an event with eventwrite. the event includes a pointer to a window object, current markup, and the event name passed as bstrprofilermarkname. the bstrprofilermarkname property has a 32-character limit when called from script. this method is useful to profile real website per
formance by using the operating system metrics as a baseline. example if (mswriteprofilermark) { mswriteprofilermark("mark1"); } see also microsoft api extensions ...
ARIA Screen Reader Implementors Guide - Accessibility
imeout before presenting atomic region changes, in order to avoid presenting the region twice for two changes that occur quickly one after the other. include labels when presenting changes: if the change occurs in something with a semantic label of some kind, speak the label. this is particularly important for changes in data cells, where the column and row headers provide important contextual in
formation. ideas for settings and heuristics allow for a different voice (in text-to-speech) or other varying presentational characteristics to set live changes apart. when no wai-aria markup is present, automatically present some changes unless the user configures all live changes to off. for example, automatically speak changes that are caused by the user's own input, as part of the context of t...
...ria markup is present, automatically present some changes unless the user configures all live changes to off. for example, automatically speak changes that are caused by the user's own input, as part of the context of that input. allow global settings to turn off the presentation of live changes, present all live changes, use markup, or be "smart" (use heuristics) details for processing via plat
form accessibility apis we hope browser manufacturers will work to provide consistent implementations. the most complete implementation of live regions currently is in firefox 3. here is how wai-aria live regions are exposed in firefox 3. ...
ARIA Technique Template - Accessibility
description possible effects on user agents and assistive technology note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. ...
... description possible effects on user agents and assistive technology note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. ...
Using the aria-activedescendant attribute - Accessibility
odel. it makes do with the overhead of having all or more than one child focusable. as the name specifies, it helps in managing the current active child of the composite widget. possible effects on user agents and assistive technology the user agent, which is any software that retrieves, renders and facilitates end user interaction with web content, uses the aria-activedescendant property to in
form the assistive technology about the active child which has focus. this active child using the aria-activedescendant property must always be visible on screen and must be a descendant of the container in the document object model. note: opinions may differ on how assistive technology should handle this technique. the in
formation provided below is one of those opinions and therefore not normative. ...
...le on screen and must be a descendant of the container in the document object model. note: opinions may differ on how assistive technology should handle this technique. the in
formation provided below is one of those opinions and therefore not normative. ...
Using the aria-label attribute - Accessibility
label is not visible on the screen. if there is visible text labeling the element, use aria-labelledby instead. this attribute can be used with any typical html element; it is not limited to elements that have an aria role assigned. value string possible effects on user agents and assistive technology note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: multiple labels in the example below, a button is styled to look like a typical "close" button, with an x in the middle. since there is nothing indicating that the purpose of the button is to close the dialog, the aria-label attribute is used to provide the label to any assistive technologies. <but...
..."close" onclick="mydialog.close()">x</button> notes the most common accessibility api mapping for a label is the accessible name property. ...
Using the aria-orientation attribute - Accessibility
tion attribute is used to indicate whether an element is oriented horizontally or vertically. value vocabulary vertical the element is oriented vertically. horizontal (default) the element is oriented horizontally. possible effects on user agents and assistive technology note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: the snippet below shows a simple slider that is oriented vertically. <a href="#" id="handle_zoomslider" role="slider" aria-orientation="vertical" aria-valuemin="0" aria-valuemax="17" aria-valuenow="14" > <span>11</span> </a> working examples: slider e...
...id="handle_zoomslider" role="slider" aria-orientation="vertical" aria-valuemin="0" aria-valuemax="17" aria-valuenow="14" > <span>11</span> </a> working examples: slider example notes used with aria roles scrollbar listbox combobox menu tree separator slider tablist toolbar related aria techniques compatibility tbd: add support in
formation for common ua and at product combinations additional resources wai-aria specification for the aria-orientation attribute ...
Using the aria-valuemax attribute - Accessibility
nbutton. value string representation of a number possible effects on user agents and assistive technology if the aria-valuemax is indeterminate, or if aria-valuemin is not less than or equal to the value of aria-valuemax, this creates an error condition that will be handled by the assistive technology. note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: the snippet below shows a simple slider with a maximum value of 10. <div role="slider" aria-valuenow="4" aria-valuemin="1" aria-valuemax="10"> working examples: progressbar example slider example spinbutton example notes used with aria roles progressbar scrollbar slider spinbutton ...
... below shows a simple slider with a maximum value of 10. ...
Using the aria-valuemin attribute - Accessibility
ttribute of role slider, scrollbar and spinbutton. value string representation of a number possible effects on user agents and assistive technology if aria-valuemin is not less than or equal to the value of aria-valuemax, this creates an error condition that will be handled by the assistive technology. note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: the snippet below shows a simple slider with a minimum value of 1. <div role="slider" aria-valuenow="4" aria-valuemin="1" aria-valuemax="10"> working examples: progressbar example slider example spinbutton example notes used with aria roles progressbar scrollbar slider spinbutton ...
...t below shows a simple slider with a minimum value of 1. ...
Using the aria-valuenow attribute - Accessibility
s should render the actual value as a percentage, calculated as a position on the range from aria-valuemin to aria-valuemax if both are defined, otherwise the actual value with a percent indicator. for elements with role slider and spinbutton, assistive technologies should render the actual value to users. note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: the snippet below shows a simple slider with a current value of 4. <div role="slider" aria-valuenow="4" aria-valuemin="1" aria-valuemax="10"> working examples: progressbar example slider example spinbutton example notes used with aria roles progressbar scrollbar slider spinbutton ...
...t below shows a simple slider with a current value of 4. ...
Using the aria-valuetext attribute - Accessibility
le effects on user agents and assistive technology if the aria-valuetext attribute is absent, assistive technologies will rely solely on the aria-valuenow attribute for the current value. if aria-valuetext is specified, assistive technologies should render that value instead of the value of aria-valuenow. note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: the snippet below shows a simple slider for selecting a day of the week. the value of the slider is numeric, and the aria-valuetext attribute is used to provide the name of the day. the application would programmatically update aria-valuetext depending on aria-valuenow. <div role="slider" aria-value...
...d to provide the name of the day. the application would programmatically update aria-valuetext depending on aria-valuenow. ...
Using the link role - Accessibility
oducts should listen for such an event and notify the user accordingly: screen readers should announce the text of the link or its label when it is focused, along with the fact that it is a link. aria links should be included in the screen reader's “list links” function just like ordinary links, and actions in this dialogue list, such as “activate link” or “move to link”, should per
form the same as they do with ordinary links. screen magnifiers may enlarge links. note: opinons may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples this example shows how to implement a fake link using a <span> element. this includes javascript to grab the location and handle navigat...
...e still problems with this approach: it is very difficult to detect whether the target of the fake link has been visited before, and therefore use :visited styles (e.g. the default purple color for visited links). opening a page using the open() method counts as being a popup, and certain browsers may issue a warning when you try to activate it, or make you explicitly agree to allowing popups
form the domain it exists on. html <h1>role="link" example</h1> <span data-href="https://mozilla.org" tabindex="0" id="link1" role="link" class="link"> fake accessible link created using a span </span> <p><a href="https://mozilla.org" target="_blank">actual real link</a></p> css span[role="link"] { color: blue; text-decoration: underline; cursor: pointer; } span[role="link"]:focus { ...
Using the presentation role - Accessibility
plied to the table element to remove any semantic meaning from the table element and any of its table related children elements, such as table headers and table data elements. non-table related elements should retain their semantic meaning, however. possible effects on user agents and assistive technology note: opinions may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: <ul role="tablist"> <li role="presentation"> <a role="tab" href="#">tab 1</a> </li> <li role="presentation"> <a role="tab" href="#">tab 2</a> </li> <li role="presentation"> <a role="tab" href="#">tab 3</a> </li> </ul> working examples: notes aria attributes used relate...
...efore not normative. ...
Using the progressbar role - Accessibility
riate for this calculation. note: elements with the role progressbar have an implicit aria-readonly value of true. possible effects on user agents and assistive technology screen readers should announce the progress updates as they occur. if the progress bar is labeled, the label text should be mentioned as well. note: opinions may differ on how assistive technology should handle this. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: basic progressbar with percentage values <div role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">20 %</div> example 2: using aria-valuetext <div role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuetext="step 2: copying files... " aria-valuemax="100"> step...
...</div> example 2: using aria-valuetext <div role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuetext="step 2: copying files... " aria-valuemax="100"> step 2: copying files... </div> working examples: notes aria attributes used progressbar aria-valuenow aria-valuemin aria-valuemax aria-valuetext related aria techniques compatibility tbd: add support in
formation for common ua and at product combinations additional resources ...
Using the radio role - Accessibility
description this technique demonstrates how to use the radio role and describes the effect it has on browsers and assistive technology. possible effects on user agents and assistive technology note: opinons may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. examples example 1: example from the basic
form hints mdn page. <h3 id="rg1_label">lunch options</h3> <ul class="radiogroup" id="rg1" role="radiogroup" aria-labelledby="rg1_label"> <li id="r1" tabindex="-1" role="radio" aria-checked="false"> <img role="presentation" src="radio-unchecked.gif" /> thai </li> <li id="r2" tabindex="-1" role="radio" aria-checked="false"> <img role="presentation" src="radio-uncheck...
... </li> <li id="r2" tabindex="-1" role="radio" aria-checked="false"> <img role="presentation" src="radio-unchecked.gif" /> subway </li> <li id="r3" tabindex="0" role="radio" aria-checked="true"> <img role="presentation" src="radio-checked.gif" /> radio maria </li> </ul> working examples: notes aria attributes used related aria techniques compatibility tbd: add support in
formation for common ua and at product combinations additional resources ...
Using the toolbar role - Accessibility
description this technique demonstrates how to use the toolbar role and describes the effect it has on browsers and assistive technology. possible effects on user agents and assistive technology note: opinons may differ on how assistive technology should handle this technique. ...
...gy. possible effects on user agents and assistive technology note: opinons may differ on how assistive technology should handle this technique. the in
formation provided above is one of those opinions and therefore not normative. ...
Using ARIA: Roles, states, and properties - Accessibility
elements, with these divided into roles (defining a type of user interface element) and states and properties that are supported by a role. authors must assign an aria role and the appropriate states and properties to an element during its life-cycle, unless the element already has appropriate aria semantics (via use of an appropriate html element). addition of aria semantics only exposes extra in
formation to a browser's accessibility api, and does not affect a page's dom. roles widget roles button checkbox gridcell link menuitem menuitemcheckbox menuitemradio option progressbar radio scrollbar searchbox separator (when focusable) slider spinbutton switch tab tabpanel textbox treeitem composite roles the techniques below describe each composite role as well as the...
...see radio role) tablist (including tab and tabpanel roles) tree treegrid document structure roles application article cell columnheader definition directory document feed figure group heading img list listitem math none note presentation row rowgroup rowheader separator table term textbox toolbar tooltip landmark roles banner complementary contentinfo
form main navigation region search live region roles alert log marquee status timer window roles alertdialog dialog states and properties widget attributes aria-autocomplete aria-checked aria-current aria-disabled aria-errormessage aria-expanded aria-haspopup aria-hidden aria-invalid aria-label aria-level aria-modal aria-multiline aria-multiselectable aria-...
ARIA: cell role - Accessibility
to be supported, the cell must be nested in an element with the role of row. <div role="row"> <span role="cell">france</span> <span role="cell">67 million</span> </div> a better, more semantic way of writing the cells above would be to use the semantic <td> element. ...
...ithin a grid, table or treegrid within a static tabular structure. using native html <td> elements, whenever possible, is strongly encouraged. each element with role="cell" must be nested in a container element with role="row". that row, in turn, can be nested within an element with role="rowgroup", and should be nested within a grid, table or treegrid. if a cell contains column or row header in
formation, use the colheader or rowheader roles, respecitively. if the cell does not contain header in
formation and is nested in a grid or treegrid, the role of gridcell may be more appropriate. a cell can contain a number of property attributes clarifying the cell's position within the tabular data structure, including aria-colindex, aria-colspan, aria-rowindex, and aria-rowspan. using the nativ...
Web accessibility for seizures and physical reactions - Accessibility
ers-reduced-transparency the prefers-reduced-transparency media feature is used to detect if the user has requested the system minimize the amount of transparent or translucent layer effects it uses. mediaquerylist interface section 4.2 from the csswg.org drafts integrates with the event loop defined in html. [html] for the mediaquerylist object. see the mdn document, mediaquerylist for more in
formation. personalization help and support the requirement for the literal property is taken from section 23 non-literal text and images requirement: some users cannot understand non-literal text and icons such as metaphors, idioms etc. the literal property is intended to identify text or images as non-literal and allows the author to explain non-literal text and images to users. transitions (for...
...itions [css-transitions-1], css animations [css-animations-1], and svg [svg11]. see also mdn accessibility: what users can to to browse more safely accessibility: understanding color and luminance applying svg effects to html content basic animations (canvas tutorial) canvas api canvasrenderingcontext2d.drawimage() <color> document object model mediaquerylist using dynamic styling in
formation webgl: 2d and 3d graphics for the web color color tutorial: describing color tom jewett.
formula to determine brightness of rgb color stack exchange discussion thread how the color red influences our behavior scientific american by susana martinez-conde, stephen l. macknik on november 1, 2014 discussions problems with wcag 2.0 flash definition #553 wcag 2.1 understanding 2.3.1 ...
Accessibility
vel to improve accessibility. accessible multimedia another category of content that can create accessibility problems is multimedia — video, audio, and image content need to be given proper textual alternatives so they can be understood by assistive technologies and their users. this article shows how. mobile accessibility with web access on mobile devices being so popular, and popular plat
forms such as ios and android having fully-fledged accessibility tools, it is important to consider the accessibility of your web content on these plat
forms. this article looks at mobile-specific accessibility considerations. other documentation understanding the web content accessibility guidelines this set of articles provides quick explanations to help you understand the steps that need t...
... android having fully-fledged accessibility tools, it is important to consider the accessibility of your web content on these plat
forms. this article looks at mobile-specific accessibility considerations. other documentation understanding the web content accessibility guidelines this set of articles provides quick explanations to help you understand the steps that need to be taken to con
form to the recommendations outlined in the w3c web content accessibility guidelines 2.0 (wcag 2.0 or just wcag, for the purposes of this writing). keyboard-navigable javascript widgets until now, web developers who want to make their styled <div> and <span> based widgets accessible have lacked the proper techniques. keyboard accessibility is part of the minimum accessibility requirements which a ...
-moz-context-properties - CSS: Cascading Style Sheets
ies: inherit; -moz-context-properties: initial; -moz-context-properties: unset; values fill expose the fill value set on the image to the embedded svg. stroke expose the stroke value set on the image to the embedded svg. fill-opacity expose the fill-opacity value set on the image to the embedded svg. stroke-opacity expose the stoke-opacity value set on the image to the embedded svg. ...
.... fill-opacity expose the fill-opacity value set on the image to the embedded svg. stroke-opacity expose the stoke-opacity value set on the image to the embedded svg.
formal definition initial valuenoneapplies toany element that can have an image applied to it, for example as a background-image, border-image, or list-style-image.inheritedyescomputed valueas specifiedanimation typediscrete
formal syntax none | [ fill | fill-opacity | stroke | stroke-opacity ]# examples exposing fill and stroke to an svg image in this example we have a simple svg embedded using an <img> element. you first need to specify on the embedding element the properties whose values you wish to expose to the embedded svg, using the -moz-context-properties property. for example: .img1 { width: 100px; heig...
-moz-float-edge - CSS: Cascading Style Sheets
e height and width properties include the content, padding and border but not the margin. content-box the height and width properties include the content, but not the padding, border or margin. margin-box the height and width properties include the content, padding, border and margin. padding-box the height and width properties include the content and padding but not the border or margin. ...
...roperties include the content, but not the padding, border or margin. margin-box the height and width properties include the content, padding, border and margin. padding-box the height and width properties include the content and padding but not the border or margin.
formal definition initial valuecontent-boxapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax border-box | content-box | margin-box | padding-box examples html <div class="box"> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> </div> css .box { display: block; height: 5px; margin: 0.5em auto 0.5em auto; color: gray; -moz-float-edge: margin-box; box-sizing: border-box; } result specifications not part of any standard. ...
-moz-force-broken-image-icon - CSS: Cascading Style Sheets
image icon to be shown even when a broken image has an alt attribute. syntax values <integer> a value of 1 means that the broken image icon is shown even if the image has an alt attribute. when the value 0 is used the image will act as usual and only display the alt attribute. note: even if the value is set to 1 the alt attribute will still be displayed, alongside the broken image icon. ...
...f 1 means that the broken image icon is shown even if the image has an alt attribute. when the value 0 is used the image will act as usual and only display the alt attribute. note: even if the value is set to 1 the alt attribute will still be displayed, alongside the broken image icon.
formal definition initial value0applies toimagesinheritednocomputed valueas specifiedanimation typediscrete
formal syntax <integer> examples html <img src='/broken/image/link.png' alt='broken image link'> css img { -moz-force-broken-image-icon: 1; height: 100px; width: 100px; } result screenshotlive sample note: unless the image has a specified height and width the broken image icon will not be displayed but the alt attribute will also be hidden if -moz-force-broken-image-icon is set to 1. n...
-moz-orient - CSS: Cascading Style Sheets
element is rendered in the same direction as the axis of the text: horizontally for horizontal writing modes, vertically for vertical writing modes. block the element is rendered orthogonally to the axis of the text: vertically for horizontal writing modes, horizontal for vertical writing modes. horizontal the element is rendered horizontally. vertical the element is rendered vertically. ...
...he text: vertically for horizontal writing modes, horizontal for vertical writing modes. horizontal the element is rendered horizontally. vertical the element is rendered vertically. ...
-moz-outline-radius-bottomleft - CSS: Cascading Style Sheets
ng dimensions of the border box. the calc() function may be used as well. values <length> the radius of the circle defining the curvature of the bottom and left edges of the element, specified as a css <length>. <percentage> the radius of the circle defining the rounding of the bottom-left corner of the element, specified as the percentages of the bottom and left sides of the border box. ...
...ss <length>. <percentage> the radius of the circle defining the rounding of the bottom-left corner of the element, specified as the percentages of the bottom and left sides of the border box.
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc();
formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples rounding a outline since this is a firefox-only property, this example will not display the desired effect if you are viewing this in a browser other than firefox. html <p>look at this paragraph's bottom-left corner.</p> css p { margin: 10px; border: solid cyan; outline: dotted green; -moz-outline-r...
-moz-outline-radius-bottomright - CSS: Cascading Style Sheets
dimensions of the border box. the calc() function may be used as well. values <length> the radius of the circle defining the curvature of the bottom and right edges of the element, specified as a css <length>. <percentage> the radius of the circle defining the rounding of the bottom-right corner of the element, specified as the percentages of the bottom and right sides of the border box. ...
... <length>. <percentage> the radius of the circle defining the rounding of the bottom-right corner of the element, specified as the percentages of the bottom and right sides of the border box.
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc();
formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples html <p>look at this paragraph's bottom-right corner.</p> css p { margin: 5px; border: solid cyan; outline: dotted red; -moz-outline-radius-bottomright: 2em; } result the example above will not display the desired effect if you are viewing this in a browser other than firefox. specifications n...
-moz-outline-radius-topleft - CSS: Cascading Style Sheets
rresponding dimensions of the border box. the calc() function may be used as well. values <length> the radius of the circle defining the curvature of the top and left edges of the element, specified as a css <length>. <percentage> the radius of the circle defining the rounding of the top-left corner of the element, specified as the percentages of the top and left sides of the border box. ...
...as a css <length>. <percentage> the radius of the circle defining the rounding of the top-left corner of the element, specified as the percentages of the top and left sides of the border box.
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc();
formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples the example below will not display the desired effect if you are viewing this in a browser other than firefox. html <p>look at this paragraph's top-left corner.</p> css p { margin: 5px; border: solid cyan; outline: dotted red; -moz-outline-radius-topleft: 2em; } result specifications not part of...
-moz-outline-radius-topright - CSS: Cascading Style Sheets
sponding dimensions of the border box. the calc() function may be used as well. values <length> the radius of the circle defining the curvature of the top and right edges of the element, specified as a css <length>. <percentage> the radius of the circle defining the rounding of the top-right corner of the element, specified as the percentages of the top and right sides of the border box. ...
... a css <length>. <percentage> the radius of the circle defining the rounding of the top-right corner of the element, specified as the percentages of the top and right sides of the border box.
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc();
formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples html <p>look at this paragraph's top-right corner.</p> css p { margin: 5px; border: solid cyan; outline: dotted red; -moz-outline-radius-topright: 2em; } result the example above will not display the desired effect if you are viewing this in a browser other than firefox. specifications not par...
-moz-outline-radius - CSS: Cascading Style Sheets
and bottom-left corners. if three values are set, the first one applies to the top-left corner, the second one to the top-right and bottom-left corners and the third one to the bottom-right corner. if four values are set, the first one applies to the top-left corner, the second one to the top-right corner, the third one to the bottom-right corner and the fourth one to the bottom-left corner. ...
... html <p>this element has a rounded outline!</p> css p { margin: 5px; border: 1px solid black; outline: dotted red; -moz-outline-radius...
-moz-user-focus - CSS: Cascading Style Sheets
x from taking keyboard focus by setting its tab index to -1, and from taking mouse focus by preventing the default action of mousedown events. syntax values ignore the element does not accept the keyboard focus and will be skipped in the tab order. normal the element can accept the keyboard focus. ...
...on of mousedown events. syntax values ignore the element does not accept the keyboard focus and will be skipped in the tab order. normal the element can accept the keyboard focus. select-after ? select-before ? select-menu ? select-same ? select-all ? none ?
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. a similar property, user-focus, was proposed in early drafts of a predecessor of the css3 ui specification, but was ...
-webkit-border-before - CSS: Cascading Style Sheets
writing-mode, direction, and text-orientation. it relates to -webkit-border-after, -webkit-border-start, and -webkit-border-end, which define the other borders of the element. this property is on the standard track as border-block-start. ...
...nborder-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 specifiedcolor: if the value is translucent, the computed value will be the rgba() corresponding one. if it isn't, it will be the rgb() corresponding one. ...
-webkit-box-reflect - CSS: Cascading Style Sheets
x-reflect: unset; note: this feature is not intended to be used by web sites. to achieve reflection on the web, the standard way is to use the css element() function. syntax values above, below, right, left are keywords indicating in which direction the reflection is to happen. <length> indicates the size of the reflection. <image> describes the mask to be applied to the reflection. ...
...tandard way is to use the css element() function. syntax values above, below, right, left are keywords indicating in which direction the reflection is to happen. <length> indicates the size of the reflection. <image> describes the mask to be applied to the reflection. ...
-webkit-mask-composite - CSS: Cascading Style Sheets
d. destination-atop the pixels of the source mask image are rendered. the pixels of the destination mask image are rendered only if they overlap a nontransparent portion of the destination mask image. this causes the destination mask image to have no effect. xor overlapping pixels in the source mask image and the destination mask image become fully transparent if they are both fully opaque. ...
...only if they overlap a nontransparent portion of the destination mask image. this causes the destination mask image to have no effect. xor overlapping pixels in the source mask image and the destination mask image become fully transparent if they are both fully opaque.
formal definition initial valuesource-overapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax <composite-style>#where <composite-style> = clear | copy | source-over | source-in | source-out | source-atop | destination-over | destination-in | destination-out | destination-atop | xor examples compositing with xor .example { -webkit-mask-image: url(mask1.png), url('mask2.png'); -webkit-mask-composite: xor, source-over; } specifications not part of any standard. this prope...
-webkit-mask-position-x - CSS: Cascading Style Sheets
the box's left padding edge. percentages are calculated against the horizontal dimension of the box padding area. that means, a value of 0% means the left edge of the image is aligned with the box's left padding edge and a value of 100% means the right edge of the image is aligned with the box's right padding edge. left equivalent to 0%. center equivalent to 50%. right equivalent to 100%. ...
...dding edge and a value of 100% means the right edge of the image is aligned with the box's right padding edge. left equivalent to 0%. center equivalent to 50%. right equivalent to 100%.
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
ge relative to the box's top padding edge. percentages are calculated against the vertical dimension of the box padding area. a value of 0% means the top edge of the image is aligned with the box's top padding edge and a value of 100% means the bottom edge of the image is aligned with the box's bottom padding edge. top equivalent to 0%. bottom equivalent to 100%. center equivalent to 50%. ...
...ing edge and a value of 100% means the bottom edge of the image is aligned with the box's bottom padding edge. top equivalent to 0%. bottom equivalent to 100%. center equivalent to 50%.
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-mask-repeat-x - CSS: Cascading Style Sheets
pace increases in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added. when the next image is added, all of the current ones compress to allow room. example: an image with an original width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added. they will then compress to 225px. ...
...d. when the next image is added, all of the current ones compress to allow room. example: an image with an original width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added. they will then compress to 225px. ...
-webkit-mask-repeat-y - CSS: Cascading Style Sheets
s in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added. when the next image is added, all of the current ones compress to allow room. example: an image with an original height of 260px, repeated three times, might stretch until each repetition is 300px high, and then another image will be added. they will then compress to a height of 225px. ...
... compress to allow room. example: an image with an original height of 260px, repeated three times, might stretch until each repetition is 300px high, and then another image will be added. they will then compress to a height of 225px. ...
-webkit-tap-highlight-color - CSS: Cascading Style Sheets
is a non-standard css property that sets the color of the highlight that appears over a link while it's being tapped. the highlighting indicates to the user that their tap is being successfully recognized, and indicates which element they're tapping on. -webkit-tap-highlight-color: red; -webkit-tap-highlight-color: transparent; /* for removing the highlight */ syntax values a <color value>. ...
...e highlighting indicates to the user that their tap is being successfully recognized, and indicates which element they're tapping on. -webkit-tap-highlight-color: red; -webkit-tap-highlight-color: transparent; /* for removing the highlight */ syntax values a <color value>. ...
-webkit-text-fill-color - CSS: Cascading Style Sheets
property is not set, the value of the color property is used. /* <color> values */ -webkit-text-fill-color: red; -webkit-text-fill-color: #000000; -webkit-text-fill-color: rgb(100, 200, 0); /* global values */ -webkit-text-fill-color: inherit; -webkit-text-fill-color: initial; -webkit-text-fill-color: unset; syntax values <color> the foreground fill color of the element's text content. ...
...ll-color: #000000; -webkit-text-fill-color: rgb(100, 200, 0); /* global values */ -webkit-text-fill-color: inherit; -webkit-text-fill-color: initial; -webkit-text-fill-color: unset; syntax values <color> the foreground fill color of the element's text content. ...
-webkit-text-stroke-color - CSS: Cascading Style Sheets
rs of text. if this property is not set, the value of the color property is used. /* <color> values */ -webkit-text-stroke-color: red; -webkit-text-stroke-color: #e08ab4; -webkit-text-stroke-color: rgb(200, 100, 0); /* global values */ -webkit-text-stroke-color: inherit; -webkit-text-stroke-color: initial; -webkit-text-stroke-color: unset; syntax values <color> the color of the stroke. ...
...: red; -webkit-text-stroke-color: #e08ab4; -webkit-text-stroke-color: rgb(200, 100, 0); /* global values */ -webkit-text-stroke-color: inherit; -webkit-text-stroke-color: initial; -webkit-text-stroke-color: unset; syntax values <color> the color of the stroke. ...
-webkit-text-stroke-width - CSS: Cascading Style Sheets
ebkit-text-stroke-width: medium; -webkit-text-stroke-width: thick; /* <length> values */ -webkit-text-stroke-width: 2px; -webkit-text-stroke-width: 0.1em; -webkit-text-stroke-width: 1mm; -webkit-text-stroke-width: 5pt; /* global values */ -webkit-text-stroke-width: inherit; -webkit-text-stroke-width: initial; -webkit-text-stroke-width: unset; values <line-width> the width of the stroke. ...
...-webkit-text-stroke-width: 0.1em; -webkit-text-stroke-width: 1mm; -webkit-text-stroke-width: 5pt; /* global values */ -webkit-text-stroke-width: inherit; -webkit-text-stroke-width: initial; -webkit-text-stroke-width: unset; values <line-width> the width of the stroke. ...
-webkit-text-stroke - CSS: Cascading Style Sheets
/* global values */ -webkit-text-stroke: inherit; -webkit-text-stroke: initial; -webkit-text-stroke: unset; text-stroke: inherit; text-stroke: initial; text-stroke: unset; constituent properties this property is a shorthand for the following css properties: -webkit-stroke-color -webkit-stroke-width syntax values <length> the width of the stroke. <color> the color of the stroke. ...
...) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rg...
-webkit-touch-callout - CSS: Cascading Style Sheets
the -webkit-touch-callout css property controls the display of the default callout shown when you touch and hold a touch target. when a target is touched and held on ios, safari displays a callout in
formation about the link. this property allows disabling that behavior. /* keyword values */ -webkit-touch-callout: default; -webkit-touch-callout: none; /* global values */ -webkit-touch-callout: initial; -webkit-touch-callout: inherit; -webkit-touch-callout: unset; syntax values default the default callout is displayed. none the callout is disabled. ...
... ios, safari displays a callout in
formation about the link. this property allows disabling that behavior. /* keyword values */ -webkit-touch-callout: default; -webkit-touch-callout: none; /* global values */ -webkit-touch-callout: initial; -webkit-touch-callout: inherit; -webkit-touch-callout: unset; syntax values default the default callout is displayed. none the callout is disabled.
formal definition initial valuedefaultapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax default | none examples turn off touch callout .example { -webkit-touch-callout: none; } specifications not part of any standard. apple has a description in the safari css reference. ...
::before (:before) - CSS: Cascading Style Sheets
in css, ::before creates a pseudo-element that is the first child of the selected element. it is often used to add cosmetic content to an element with the content property. it is inline by default. /* add a heart before links */ a::before { content: "♥"; } note: the pseudo-elements generated by ::before and ::after are contained by the element's
formatting box, and thus don't apply to replaced elements such as <img>, or to <br> elements. syntax /* css3 syntax */ ::before /* css2 syntax */ :before note: css3 introduced the ::before notation (with two colons) to distinguish pseudo-classes from pseudo-elements. browsers also accept :before, introduced in css2. examples adding quotation marks one simple example of using ::before pseudo-elements is to provide quotation marks. here...
...note that there are no icons used, and the check-mark is actually the ::before that has been styled in css. go ahead and get s...
::first-line (:first-line) - CSS: Cascading Style Sheets
syntax /* css3 syntax */ ::first-line /* css2 syntax */ :first-line examples html <p>styles will only be applied to the first line of this paragraph. after that, all text will be styled like normal. see what i mean?</p> <span>the first line of this text w...
...l-align. syntax /* css3 syntax */ ::first-line /* css2 syntax */ :first-line examples html <p>styles will only be applied to the first line of this paragraph. after that, all text will be styled like normal. see what i mean?</p> <span>the first line of this text will not receive special styling because it is not a block-level element.</span> css ::first-line { color: blue; text-trans
form: uppercase; /* warning: do not use these */ /* many properties are invalid in ::first-line pseudo-elements */ margin-left: 20px; text-indent: 20px; } result specifications specification status comment css pseudo-elements level 4the definition of '::first-line' in that specification. working draft defines more strictly where ::first-letter can occur...
:active - CSS: Cascading Style Sheets
h as a button) that is being activated by the user. when using a mouse, "activation" typically starts when the user presses down the primary mouse button. /* selects any <a> that is being activated */ a:active { color: red; } the :active pseudo-class is commonly used on <a> and <button> elements. other common targets of this pseudo-class include elements that contain an activated element, and
form elements that are being activated through their associated <label>. styles defined by the :active pseudo-class will be overridden by any subsequent link-related pseudo-class (:link, :hover, or :visited) that has at least equal specificity. to style links appropriately, put the :active rule after all other link-related rules, as defined by the lvha-order: :link — :visited — :hover — :active...
... you click on it.</a> the paragraph will get a gray background while you click on it or the link. </p> css a:link { color: blue; } /* unvisited links */ a:visited { color: purple; } /* visited links */ a:hover { background: yellow; } /* hovered links */ a:active { color: red; } /* active links */ p:active { background: #eee; } /* active paragraphs */ result active
form elements html <
form> <label for="my-button">my button: </label> <button id="my-button" type="button">try clicking me or my label!</button> </
form> css
form :active { color: red; }
form button { background: white; } result specifications specification status comment html living standardthe definition of ':active' in that specification. living standa...
:indeterminate - CSS: Cascading Style Sheets
the :indeterminate css pseudo-class represents any
form element whose state is indeterminate, such as checkboxes which have their html indeterminate attribute set to true, radio buttons which are members of a group in which all radio buttons are unchecked, and indeterminate <progress> elements. ...
...which all radio buttons are unchecked, and indeterminate <progress> elements. /* selects any <input> whose state is indeterminate */ input:indeterminate { background: lime; } elements targeted by this selector are: <input type="checkbox"> elements whose indeterminate property is set to true by javascript <input type="radio"> elements, when all radio buttons with the same name value in the
form are unchecked <progress> elements in an indeterminate state syntax :indeterminate examples checkbox & radio button this example applies special styles to the labels associated with indeterminate
form fields. html <div> <input type="checkbox" id="checkbox"> <label for="checkbox">this label starts out lime.</label> </div> <div> <input type="radio" id="radio"> <label for="radio">thi...
:nth-child() - CSS: Cascading Style Sheets
. even represents elements whose numeric position in a series of siblings is even: 2, 4, 6, etc. functional notation <an+b> represents elements in a list whose indices match those found in a custom pattern of numbers, defined by an+b, where: a is an integer step size, b is an integer offset, n is all positive integers, starting from 0. it can be read as the an+bth element of a list. ...
... examples example selectors tr:nth-child(odd) or tr:nth-child(2n+1) represents the odd rows of an html table: 1, 3, 5, etc. tr:nth-child(even) or tr:nth-child(2n) represents the even rows of an html table: 2, 4, 6, etc. :nth-child(7) represents the seventh element. :nth-child(5n) represents elements 5 [=5×1], 10 [=5×2], 15 [=5×3], etc. the first one to be returned as a result of the
formula is 0 [=5x0], resulting in a no-match, since the elements are indexed from 1, whereas n starts from 0. this may seem weird at first, but it makes more sense when the b part of the
formula is >0, like in the next example. :nth-child(n+7) represents the seventh and all following elements: 7 [=0+7], 8 [=1+7], 9 [=2+7], etc. :nth-child(3n+4) represents elements 4 [=(3×0)+4], 7 [=(3×1)+4], 10 ...
:read-only - CSS: Cascading Style Sheets
the :read-only css pseudo-class represents an element (such as input or textarea) that is not editable by the user. input:read-only, textarea:read-only { background-color: #ccc; } p:read-only { background-color: #ccc; } syntax :read-only examples confirming
form in
formation in read-only/read-write controls one use of readonly
form controls is to allow the user to check and verify in
formation that they may have entered in an earlier
form (for example, shipping details), while still being able to submit the in
formation along with the rest of the
form. we do just this in the example below. the :read-only pseudo-class is used to remove all the styling that makes the inputs look like clickable fields, making them look more like read-only paragraphs.the :read-write pseudo-class on the ...
...to the editable <textarea>. input:-moz-read-only, textarea:-moz-read-only, input:read-only, textarea:read-only { border: 0; box-shadow: none; background-color: white; } textarea:-moz-read-write, textarea:read-write { box-shadow: inset 1px 1px 3px #ccc; border-radius: 5px; } you can find the full source code at readonly-confirmation.html; this renders like so: styling read-only non-
form controls this selector doesn't just select <input>/<textarea> elements — it will select any element that cannot be edited by the user. <p contenteditable>this paragraph is editable; it is read-write.</p> <p>this paragraph is not editable; it is read-only.</p> p { font-size: 150%; padding: 5px; border-radius: 5px; } p:read-only { background-color: red; color: white; } p:read-writ...
:read-write - CSS: Cascading Style Sheets
the :read-write css pseudo-class represents an element (such as input or textarea) that is editable by the user. input:read-write, textarea:read-write { background-color: #bbf; } p:read-write { background-color: #bbf; } syntax :read-write examples confirming
form in
formation in read-only/read-write controls one use of readonly
form controls is to allow the user to check and verify in
formation that they may have entered in an earlier
form (for example, shipping details), while still being able to submit the in
formation along with the rest of the
form. we do just this in the example below. the :read-only pseudo-class is used to remove all the styling that makes the inputs look like clickable fields, making them look more like read-only paragraphs.the :read-write pseudo-class on the...
...o the editable <textarea>. input:-moz-read-only, textarea:-moz-read-only, input:read-only, textarea:read-only { border: 0; box-shadow: none; background-color: white; } textarea:-moz-read-write, textarea:read-write { box-shadow: inset 1px 1px 3px #ccc; border-radius: 5px; } you can find the full source code at readonly-confirmation.html; this renders like so: styling read-write non-
form controls this selector doesn't just select <input>/<textarea> elements — it will select any element that can be edited by the user, such as a <p> element with contenteditable set on it. <p contenteditable>this paragraph is editable; it is read-write.</p> <p>this paragraph is not editable; it is read-only.</p> p { font-size: 150%; padding: 5px; border-radius: 5px; } p:read-only { ba...
:required - CSS: Cascading Style Sheets
the :required css pseudo-class represents any <input>, <select>, or <textarea> element that has the required attribute set on it. /* selects any required <input> */ input:required { border: 1px dashed red; } this pseudo-class is useful for highlighting fields that must have valid data before a
form can be submitted. note: the :optional pseudo-class selects optional
form fields. syntax :required examples see :invalid for an example. ...
...typically, descriptive text and/or an icon are used. ...
:where() - CSS: Cascading Style Sheets
quest. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:where()chrome full support 72disabled full support 72disabled disabled from version 72: this feature is behind the #enable-experimental-web-plat
form-features preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags.edge no support nofirefox full support 78 full support 78 full support 77notes disabled notes enabled by default in...
...to change preferences in chrome, visit chrome://flags.firefox android no support noopera android no support nosafari ios no support nosamsung internet android no support ...
additive-symbols - CSS: Cascading Style Sheets
ntaining a symbol and a non-negative integer weight. the additive system is used to construct sign-value numbering systems such as roman numerals. syntax additive-symbols: 3 "0"; additive-symbols: 3 "0", 2 "\2e\20"; additive-symbols: 3 "0", 2 url(symbol.png); when the system descriptor is cyclic, numeric, alphabetic, symbolic, or fixed, use the symbols descriptor instead of additive-symbols. ...
...t sign-value numbering systems such as roman numerals. syntax additive-symbols: 3 "0"; additive-symbols: 3 "0", 2 "\2e\20"; additive-symbols: 3 "0", 2 url(symbol.png); when the system descriptor is cyclic, numeric, alphabetic, symbolic, or fixed, use the symbols descriptor instead of additive-symbols. ...
fallback - CSS: Cascading Style Sheets
ecified, it defaults to decimal. a couple of scenarios where a fallback style will be used are: when the range descriptor is specified for a counter style, the fallback style will be used to represent values that fall outside the range. when the fixed system is used and there are not enough symbols to cover all the list items, the fallback style will be used for the rest of the list items. ...
... when the range descriptor is specified for a counter style, the fallback style will be used to represent values that fall outside the range. when the fixed system is used and there are not enough symbols to cover all the list items, the fallback style will be used for the rest of the list items. ...
negative - CSS: Cascading Style Sheets
representation; and a second symbol if specified, will be appended to the representation. the negative descriptor has effect only if the system value is symbolic, alphabetic, numeric, additive, or extends, if the extended counter style itself uses a negative sign. if the negative descriptor is specified for other systems that don't support negative counter values, then the descriptor is ignored. ...
...scriptor has effect only if the system value is symbolic, alphabetic, numeric, additive, or extends, if the extended counter style itself uses a negative sign. if the negative descriptor is specified for other systems that don't support negative counter values, then the descriptor is ignored. ...
pad - CSS: Cascading Style Sheets
er will be padded with the specified pad symbol. marker representations longer than the pad length are constructed as normal. pad descriptor takes the minimum marker length as an integer and a symbol to be used for padding as the second parameter. a common usage of the pad descriptor is when you need your list to start numbering from 01 and go through 02, 03 and so on, instead of just 1, 2, 3... ...
...ength are constructed as normal. pad descriptor takes the minimum marker length as an integer and a symbol to be used for padding as the second parameter. a common usage of the pad descriptor is when you need your list to start numbering from 01 and go through 02, 03 and so on, instead of just 1, 2, 3... ...
prefix - CSS: Cascading Style Sheets
ptor of the @counter-style rule specifies content that will be prepended to the marker representation. if not specified, the default value will be "" (an empty string). syntax /* <symbol> values */ prefix: "»"; prefix: "page "; prefix: url(bullet.png); values <symbol> specifies a <symbol> that is prepended to the marker representation. it may be a <string>, <image>, or <custom-ident>. ...
...specified, the default value will be "" (an empty string). syntax /* <symbol> values */ prefix: "»"; prefix: "page "; prefix: url(bullet.png); values <symbol> specifies a <symbol> that is prepended to the marker representation. it may be a <string>, <image>, or <custom-ident>. ...
range - CSS: Cascading Style Sheets
e systems, auto will result in the range 0 to positive infinity. for extends systems, the range is whatever auto will produce for the extended system. when range is specified as integers, the value infinite can be used to denote infinity. if infinite is specified as the first value in a range, then it is interpreted as negative infinity. if used as upper bound, it is taken as positive infinity. ...
...ge is whatever auto will produce for the extended system. when range is specified as integers, the value infinite can be used to denote infinity. if infinite is specified as the first value in a range, then it is interpreted as negative infinity. if used as upper bound, it is taken as positive infinity. ...
suffix - CSS: Cascading Style Sheets
the suffix descriptor of the@counter-style rule specifies content that will be appended to the marker representation. syntax /* <symbol> values */ suffix: ""; suffix: ") "; suffix: url(bullet.png); values <symbol> specifies a <symbol> that is appended to the marker representation. it may be a <string>, <image>, or <custom-ident>.
formal definition related at-rule@counter-styleinitial value". ...
...hat will be appended to the marker representation. syntax /* <symbol> values */ suffix: ""; suffix: ") "; suffix: url(bullet.png); values <symbol> specifies a <symbol> that is appended to the marker representation. it may be a <string>, <image>, or <custom-ident>.
formal definition related at-rule@counter-styleinitial value". ...
symbols - CSS: Cascading Style Sheets
"\24b6" "\24b7" "\24b8" d e; symbols: "0" "1" "2" "4" "5" "6" "7" "8" "9"; symbols: url('first.svg') url('second.svg') url('third.svg'); symbols: indic-numbers; the symbols descriptor must be specified when the value of the system descriptor is cyclic, numeric, alphabetic, symbolic, or fixed. when the additive system is used, use the additive-symbols descriptor instead to specify the symbols. ...
...rst.svg') url('second.svg') url('third.svg'); symbols: indic-numbers; the symbols descriptor must be specified when the value of the system descriptor is cyclic, numeric, alphabetic, symbolic, or fixed. when the additive system is used, use the additive-symbols descriptor instead to specify the symbols. ...
@import - CSS: Cascading Style Sheets
( supports-query ) list-of-media-queries; where: url is a <string> or a <url> representing the location of the resource to import. the url may be absolute or relative. note that the url for a mozilla package need not actually specify a file; it can just specify the package name and part, and the appropriate file is chosen automatically (e.g. chrome://communicator/skin/). see here for more in
formation. list-of-media-queries is a comma-separated list of media queries conditioning the application of the css rules defined in the linked url. if the browser does not support any these queries, it does not load the linked resource. supports-query is either a <supports-condition> or a <declaration>. description imported rules must precede all other types of rules, except @charset rules; as...
...ted 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. these conditional imports specify comma-separated media queries after the url. in the absence of any media query, the import is unconditional. specifying all for the medium has the same effect. ...
@keyframes - CSS: Cascading Style Sheets
the @keyframes css at-rule controls the intermediate steps in a css animation sequence by defining styles for keyframes (or waypoints) along the animation sequence. this gives more control over the intermediate steps of the animation sequence than transitions. syntax @keyframes slidein { from { trans
form: translatex(0%); } to { trans
form: translatex(100%); } } values <custom-ident> a name identifying the keyframe list. this must match the identifier production in css syntax. from a starting offset of 0%. to an ending offset of 100%. <percentage> a percentage of the time through the animation sequence at which the specified keyframe should occur. description javascript can access the @keyframes at-rule with the css object model interface csskeyframesrule. to u...
...ant in a keyframe declarations in a keyframe qualified with !important are ignored. @keyframes important1 { from { margin-top: 50px; } 50% { margin-top: 150px !important; } /* ignored */ to { margin-top: 100px; } } @keyframes important2 { from { margin-top: 50px; margin-bottom: 100px; } to { margin-top: 150px !important; /* ignored */ margin-bottom: 50px; } }
formal syntax @keyframes <keyframes-name> { <keyframe-block-list> }where <keyframes-name> = <custom-ident> | <string><keyframe-block-list> = <keyframe-block>+where <keyframe-block> = <keyframe-selector># { <declaration-list> }where <keyframe-selector> = from | to | <percentage> examples css animation examples see using css animations for examples. specifications specification sta...
prefers-reduced-motion - CSS: Cascading Style Sheets
infinite both; } /* tone down the animation to avoid vestibular motion triggers like scaling or panning large objects. ...
...the animation to avoid vestibular motion triggers like scaling or panning large objects. */ @media (prefers-reduced-motion) { .animation { animation-name: dissolve; } } .animation { background-color: #306; color: #fff; font: 1.2em sans-serif; width: 10em; padding: 1em; border-radius: 1em; text-align: center; } @keyframes pulse { 0% { trans
form: scale(1); } 25% { trans
form: scale(.9); } 50% { trans
form: scale(1); } 75% { trans
form: scale(1.1); } 100% { trans
form: scale(1); } } @keyframes dissolve { 0% { opacity: 1; } 50% { opacity: 0.8; } 100% { opacity: 1; } } result specifications specification status comment media queries level 5the definition of 'prefers-reduced-motion' in that specification. editor's draft ...
@media - CSS: Cascading Style Sheets
a query syntax, please see using media queries. 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. all suitable for all devices. print intended for paged material and documents viewed on a screen in print preview mode. (please see paged media for in
formation about
formatting issues that are specific to these
formats.) screen intended primarily for screens. speech intended for speech synthesizers. 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. the aural type has been rep...
...ers. because of this potential, a browser may opt to fudge the returned values in some manner in order to prevent them from being used to precisely identify a computer. a browser might also offer additional measures in this area; for example, if firefox's "resist fingerprinting" setting is enabled, many media queries report default values rather than values representing the actual device state. ...
size - CSS: Cascading Style Sheets
this correspond to the jis standard dimensions: 257mm x 364mm. letter this keyword is a equivalent to the dimensions of letter paper in north america i.e. 8.5in x 11in. legal this keyword is a equivalent to the dimensions of legal papers in north america i.e. 8.5in x 14in. ledger this keyword is a equivalent to the dimensions of ledger pages in north america i.e. 11in x 17in. ...
...north america i.e. 8.5in x 11in. legal this keyword is a equivalent to the dimensions of legal papers in north america i.e. 8.5in x 14in. ledger this keyword is a equivalent to the dimensions of ledger pages in north america i.e. 11in x 17in.
formal definition related at-rule@pageinitial valueautocomputed valueas specified, but with relative lengths converted into absolute lengths
formal syntax <length>{1,2} | auto | [ <page-size> | [ portrait | landscape ] ] examples specifying size and orientation @page { size: 4in 6in landscape; } nesting inside a @media rule @media print { @page { size: 50mm 150mm; } } specifications specification status comment css paged media module level 3the definition of 'size' in that specification. w...
height - CSS: Cascading Style Sheets
auto; height: 320px; height: 15em; /* two values */ height: 320px 200px; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width or height of the initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. must be non-negative.
formal definition related at-rule@viewportinitial valueas each of the properties of the shorthand:min-height: automax-height: nonepercentagesas each of the properties of the shorthand:min-height: the percentage is calculated with respect to the height of the generated box's containing block. if the height of the containing block is not specified explicitly (i.e., it depends on content height), and th...
...containing block. if the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as none.computed valueas each of the properties of the shorthand:min-height: the percentage as specified or the absolute lengthmax-height: the percentage as specified or the absolute length or none
formal syntax <viewport-length>{1,2}where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting minimum and maximum height @viewport { height: 500px; } specifications specification status comment css device adaptationthe definition of '"height" descriptor' in that specification. working draft initial...
max-height - CSS: Cascading Style Sheets
gth> values */ max-height: 400px; max-height: 50em; max-height: 20cm; /* <percentage> value */ max-height: 75%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the height of the initial viewport at zoom factor 1.0 for vertical lengths. must be non-negative. ...
...ercentage> a percentage value relative to the height of the initial viewport at zoom factor 1.0 for vertical lengths. must be non-negative.
formal definition related at-rule@viewportinitial valueautopercentagesrefer to the height of the initial viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto
formal syntax <viewport-length>where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting viewport max height in pixels @viewport { max-height: 600px; } specifications specification status comment css device adaptationthe definition of '"max-height" descriptor' in that specification. working draft i...
max-width - CSS: Cascading Style Sheets
ength> values */ max-width: 600px; max-width: 80em; max-width: 15cm; /* <percentage> value */ max-width: 75%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width of the initial viewport at zoom factor 1.0 for horizontal lengths. must be non-negative. ...
...ercentage> a percentage value relative to the width of the initial viewport at zoom factor 1.0 for horizontal lengths. must be non-negative.
formal definition related at-rule@viewportinitial valueautopercentagesrefer to the width of the initial viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto
formal syntax <viewport-length>where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting viewport max width in pixels @viewport { max-width: 600px; } specifications specification status comment css device adaptationthe definition of '"max-width" descriptor' in that specification. working draft in...
max-zoom - CSS: Cascading Style Sheets
ed out. syntax /* keyword value */ max-zoom: auto; /* <number> values */ max-zoom: 0.8; max-zoom: 2.0; /* <percentage> value */ max-zoom: 150%; values auto the user agent will set the document's upper zoom factor limit. <number> a non-negative number limiting the maximum value of the zoom factor. <percentage> a non-negative percentage limiting the maximum value of the zoom factor. ...
...the user agent will set the document's upper zoom factor limit. <number> a non-negative number limiting the maximum value of the zoom factor. <percentage> a non-negative percentage limiting the maximum value of the zoom factor.
formal definition related at-rule@viewportinitial valueautopercentagesthe zoom factor itselfcomputed valueauto, or a non-negative number or percentage as specified
formal syntax auto | <number> | <percentage> examples setting max-zoom @viewport { max-zoom: 1.5; } specifications specification status comment css device adaptationthe definition of '"max-zoom" descriptor' in that specification. working draft initial definition ...
min-height - CSS: Cascading Style Sheets
gth> values */ min-height: 120px; min-height: 20em; min-height: 10cm; /* <percentage> value */ min-height: 25%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the height of the initial viewport at zoom factor 1.0 for vertical lengths. must be non-negative. ...
...ercentage> a percentage value relative to the height of the initial viewport at zoom factor 1.0 for vertical lengths. must be non-negative.
formal definition related at-rule@viewportinitial valueautopercentagesrefer to the height of the initial viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto
formal syntax <viewport-length>where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting viewport min height in pixels @viewport { min-height: 200px; } specifications specification status comment css device adaptationthe definition of '"min-height" descriptor' in that specification. working draft i...
min-width - CSS: Cascading Style Sheets
in-width: 40em; min-width: 5cm; /* <percentage> value */ min-width: 25%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width or height of the initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. must be non-negative. ...
...ve to the width or height of the initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. must be non-negative.
formal definition related at-rule@viewportinitial valueautopercentagesrefer to the width of the initial viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto
formal syntax <viewport-length>where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting viewport min width in pixels @viewport { min-width: 200px; } specifications specification status comment css device adaptationthe definition of '"min-width" descriptor' in that specification. working draft init...
min-zoom - CSS: Cascading Style Sheets
ed out. syntax /* keyword value */ min-zoom: auto; /* <number> values */ min-zoom: 0.8; min-zoom: 2.0; /* <percentage> value */ min-zoom: 150%; values auto the user agent will set the document's lower zoom factor limit. <number> a non-negative number limiting the minimum value of the zoom factor. <percentage> a non-negative percentage limiting the minimum value of the zoom factor. ...
...the user agent will set the document's lower zoom factor limit. <number> a non-negative number limiting the minimum value of the zoom factor. <percentage> a non-negative percentage limiting the minimum value of the zoom factor.
formal definition related at-rule@viewportinitial valueautopercentagesthe zoom factor itselfcomputed valueauto, or a non-negative number or percentage as specified
formal syntax auto | <number> | <percentage> examples setting min zoom factor @viewport { min-zoom: 2.0; } specifications specification status comment css device adaptationthe definition of '"min-zoom" descriptor' in that specification. working draft initial definition ...
orientation - CSS: Cascading Style Sheets
automatically, typically based on the device's orientation as determined by an accelerometer (if the device has such a hardware sensor), although there is often a user-controlled, os-level "lock orientation" setting that will trump the accelerometer reading. portrait the document should be locked into portrait orientation. landscape the document should be locked into landscape orientation. ...
...sor), although there is often a user-controlled, os-level "lock orientation" setting that will trump the accelerometer reading. portrait the document should be locked into portrait orientation. landscape the document should be locked into landscape orientation.
formal definition related at-rule@viewportinitial valueautopercentagesrefer to the size of bounding boxcomputed valueas specified
formal syntax auto | portrait | landscape examples setting viewport orientation @viewport { orientation: landscape; } specifications specification status comment css device adaptationthe definition of '"orientation" descriptor' in that specification. working draft initial definition ...
width - CSS: Cascading Style Sheets
mple with two viewport values: */ @viewport { width: 320px, 120px; } values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width or height of the initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. must be non-negative. ...
... working draft initia...
zoom - CSS: Cascading Style Sheets
/* <number> values */ zoom: 0.8; zoom: 2.0; /* <percentage> values */ zoom: 150%; values auto the user agent will set the document's initial zoom factor. the user agent may use the size of canvas area on which the document is rendered to determine that factor. <number> a non-negative number used as the zoom factor. <percentage> a non-negative percentage value used as the zoom factor. ...
...ser agent may use the size of canvas area on which the document is rendered to determine that factor. <number> a non-negative number used as the zoom factor. <percentage> a non-negative percentage value used as the zoom factor.
formal definition related at-rule@viewportinitial valueautopercentagesthe zoom factor itselfcomputed valueauto, or a non-negative number or percentage as specified
formal syntax auto | <number> | <percentage> examples setting viewport zoom factor @viewport { zoom: 2.0; } specifications specification status comment css device adaptationthe definition of '"zoom" descriptor' in that specification. working draft initial specification ...
Border-image generator - CSS: Cascading Style Sheets
: none; user-select: none; } .ui-input-slider * { float: left; height: 100%; line-height: 100%; } /* input slider */ .ui-input-slider > input { margin: 0; padding: 0; width: 50px; text-align: center; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-input-slider-info { width: 90px; padding: 0px 10px 0px 0px; text-align: right; text-trans
form: lowercase; } .ui-input-slider-left, .ui-input-slider-right { width: 16px; cursor: pointer; background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center left no-repeat; } .ui-input-slider-right { background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center right no-repeat; } .ui-input-slider-name { width: 90px; padding: 0 10px 0 0; text-align: right; tex...
...case; } .ui-input-slider-left, .ui-input-slider-right { width: 16px; cursor: pointer; background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center left no-repeat; } .ui-input-slider-right { background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center right no-repeat; } .ui-input-slider-name { width: 90px; padding: 0 10px 0 0; text-align: right; text-trans
form: lowercase; } .ui-input-slider-btn-set { width: 25px; background-color: #2c9fc9; border-radius: 5px; color: #fff; font-weight: bold; line-height: 14px; text-align: center; } .ui-input-slider-btn-set:hover { background-color: #379b4a; cursor: pointer; } /*************************************************************************************/ /*********************************************...
Border-radius generator - CSS: Cascading Style Sheets
ser-select: none; } .ui-input-slider-container * { float: left; height: 100%; line-height: 100%; } /* input slider */ .ui-input-slider > input { margin: 0; padding: 0; width: 50px; text-align: center; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-input-slider-info { width: 90px; padding: 0px 10px 0px 0px; text-align: right; text-trans
form: lowercase; } .ui-input-slider-left, .ui-input-slider-right { width: 16px; cursor: pointer; background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center left no-repeat; } .ui-input-slider-right { background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center right no-repeat; } .ui-input-slider-name { width: 90px; padding: 0 10px 0 0; text-align: right; tex...
...case; } .ui-input-slider-left, .ui-input-slider-right { width: 16px; cursor: pointer; background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center left no-repeat; } .ui-input-slider-right { background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center right no-repeat; } .ui-input-slider-name { width: 90px; padding: 0 10px 0 0; text-align: right; text-trans
form: lowercase; } .ui-input-slider-btn-set { width: 25px; background-color: #2c9fc9; border-radius: 5px; color: #fff; font-weight: bold; line-height: 14px; text-align: center; } .ui-input-slider-btn-set:hover { background-color: #379b4a; cursor: pointer; } /* * ui component */ /* checkbox */ .ui-checkbox { text-align: center; font-size: 16px; font-family: "segoe ui", arial, helveti...
CSS Basic Box Model - CSS: Cascading Style Sheets
css basic box model is a module of css that defines the rectangular boxes—including their padding and margin—that are generated for elements and laid out according to the visual
formatting model. reference properties properties controlling the flow of content in a box overflow overflow-x overflow-y properties controlling the size of a box height width max-height max-width min-height min-width properties controlling the margins of a box margin margin-bottom margin-left margin-right margin-top margin-trim properties controlling the paddings of a box padding padding-bottom padding-left padding-right padding-top other properties visibility guides introduction to the css box model explains one of the fundamental concept of css: the bo...
...des introduction to the css box model explains one of the fundamental concept of css: the box model. this model defines how css lays out elements, including their content, padding, border, and margin areas. mastering margin collapsing sometimes, two adjacent margins are collapsed into one. this article describes the rules that govern when and why this happens, and how to control it. visual
formatting model explains the visual
formatting model. specifications specification status comment css basic box model working draft added margin-trim css level 2 (revision 1) recommendation css level 1 recommendation initial definition. ...
CSS Display - CSS: Cascading Style Sheets
css display is a module of css that defines how the css
formatting box tree is generated from the document element tree and defines properties controlling it. ...
...rom the document element tree and defines properties controlling it. ...
Flow Layout and Overflow - CSS: Cascading Style Sheets
en scrollbars will be added. comparing the next example with the example for overflow: scroll you should see overflow scroll has horizontal and vertical scrollbars when it only needs vertical scrolling. the auto example below only adds the scrollbar in the direct we need to scroll. as we have already learned, using any of these values, other than the default of visible, will create a new block
formatting context. note: in the working draft of overflow level 3, there is an additional value overflow: clip. this will act like overflow: hidden however it does not allow for programmatic scrolling, the box becomes non-scrollable. in addition it does not create a block
formatting context. the overflow property is in reality a shorthand for the overflow-x and overflow-y properties. if you specify...
...eight boxes which only take a limited amount of text. it may not be obvious to the reader that there is more content to click through to when clicking the box or the title. an ellipsis indicates clearly the fact there is more content. the specification would allow a string of content or a regular ellipsis to be inserted. summary whether you are in continuous media on the web or in a paged media
format such as print or epub, understanding how content overflows is useful when dealing with any layout method. by understanding how overflow works in normal flow, you should find it easier to understand the implications of overflow content in layout methods such as grid and flexbox. ...
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
strates the third possible value for writing-mode — vertical-lr. this gives you a left-to-right block flow direction and a vertical inline direction. boxes with a different writing mode to their parent when a nested box is assigned a different writing mode to its parent, then an inline level box will display as if it has display: inline-block. 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 is shown in the next example where the box which displays as horizontal-tb contains a float which is contained due to its parent establishing a new bfc. replaced elements replaced elements such as images will not change their orientation based on the writing-mode propert...
...ner display type would be flow, it will get a computed display type of flow-root. this is shown in the next example where the box which displays as horizontal-tb contains a float which is contained due to its parent establishing a new bfc. replaced elements replaced elements such as images will not change their orientation based on the writing-mode property. however, replaced elements such as
form controls which include text, should match the writing mode in use. logical properties and values once you are working in writing modes other than horizontal-tb many of the properties and values that are mapped to the physical dimensions of the screen seem strange. for example, if you give a box a width of 100px, in horizontal-tb that would control the size in the inline direction. in vertical...
In Flow and Out of Flow - CSS: Cascading Style Sheets
the container has an outside display type of block. all of the elements can be said to be in flow. appearing on the page in the order that they are in the source. taking an item out of flow all elements are in-flow apart from: floated items items with position: absolute (including position: fixed which acts in the same way) the root element (html) out of flow items create a new block
formatting context (bfc) and therefore everything inside them can be seen as a mini layout, separate from the rest of the page. the root element therefore is out of flow, as the container for everything in our document, and establishes the block
formatting context for the document. floated items in this example i have a div, and then two paragraphs. i’ve added a background colour to the paragraphs...
...: absolute does not sit on top of some other content. for this reason methods which remove elements from being in-flow should be used with understanding of the effect that they have. 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. in the next guide we will look at a related issue, that of creating a block
formatting context, in
formatting contexts explained. see also learn layout: positioning ...
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
in addition to the ability to place items accurately onto a created grid, the css grid layout specification contains rules that control what happens when you create a grid and do not place some or all of the child items. you can see auto-placement in action in the simplest of ways by creating a grid on a set of items. if you give the items no placement in
formation they will position themselves on the grid, one in each grid cell. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px...
...id-row-end: span 2; background-color: #ffa94d; } .wrapper div:nth-child(2) { grid-column: 3; grid-row: 2 / 4; } .wrapper div:nth-child(5) { grid-column: 1 / 3; grid-row: 1 / 3; } filling in the gaps so far, other than items we have specifically placed, grid is always progressing forward and keeping items in dom order. this is generally what you want, if you are laying out a
form for example you wouldn’t want the labels and fields to become jumbled up in order to fill in some gap. however sometimes, we are laying things out that don’t have a logical order and we would like to create a layout that doesn’t have gaps in it. to do this, add the property grid-auto-flow with a value of dense to the container. this is the same property you use to change the flow order to ...
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
rough links on your site and suddenly find themselves jumping from the top to the bottom of the document due to a reordered item being next in line. the specification warns authors (the csswg term for web developers) not to do this reordering. authors must use order and the grid-placement properties only for visual, not logical, reordering of content. style sheets that use these features to per
form logical reordering are non-con
forming. what does this mean for designing with grid layout in practice? visual not logical re-ordering any time you reorder things with grid layout – or with flexbox – you only per
form visual reordering. the underlying source is what controls things like text to speech, and the tab order of the document. you can see how this works with a very simple example.
...tainer, that ul becomes a grid item – the child <li> elements do not. if the subgrid value of display becomes implemented, it would be possible to make these children of a grid item participate in the overall grid layout by declaring the ul element a subgrid. currently the only way to do this is to use display: contents to cause the box generated by the ul to disappear from the dom. for more in
formation about this interaction see the guide on the relationship of grid layout to other layout methods and the section on display: contents. given that interoperable support for display: contents is limited and we do not yet have subgrids, there is a definite temptation when developing a site using css grid layout to flatten out the markup, to remove semantic elements in order to make it simpler t...
The stacking context - CSS: Cascading Style Sheets
y z-axis relative to the user, who is assumed to be facing the viewport or the webpage. html elements occupy this space in priority order based on element attributes. the stacking context in the previous part of this article, using z-index, the rendering order of certain elements is influenced by their z-index value. this occurs because these elements have special properties which cause them to
form a stacking context. a stacking context is
formed, anywhere in the document, by any element in the following scenarios: root element of the document (<html>). element with a position value absolute or relative and z-index value other than auto. element with a position value fixed or sticky (sticky for all mobile browsers, but not older desktop). element that is a child of a flex (flexbox) c...
...element that is a child of a flex (flexbox) container, with z-index value other than auto. element that is a child of a grid (grid) container, with z-index value other than auto. element with a opacity value less than 1 (see the specification for opacity). element with a mix-blend-mode value other than normal. element with any of the following properties with value other than none: trans
form filter perspective clip-path mask / mask-image / mask-border element with a isolation value isolate. element with a -webkit-overflow-scrolling value touch. element with a will-change value specifying any property that would create a stacking context on non-initial value (see this post). element with a contain value of layout, or paint, or a composite value that includes eithe...
Understanding CSS z-index - CSS: Cascading Style Sheets
are arranged on the page without overlapping. in this case, there is a single rendering flow, and all elements are aware of the space taken by others. the z-index attribute lets you adjust the order of the layering of objects when rendering content. in css 2.1, each box has a position in three dimensions. in addition to their horizontal and vertical positions, boxes lie along a "z-axis" and are
formatted one on top of the other. z-axis positions are particularly relevant when boxes overlap visually. (from css 2.1 section 9.9.1 - layered presentation) this means that css style rules allow you to position boxes on layers in addition to the normal rendering layer (layer 0). the z position of each layer is expressed as an integer representing the stacking order for rendering. greater numbers ...
...e handled with stacking. using z-index: how to use z-index to change default stacking. the stacking context: notes on the stacking context. stacking context example 1: 2-level html hierarchy, z-index on the last level stacking context example 2: 2-level html hierarchy, z-index on all levels stacking context example 3: 3-level html hierarchy, z-index on the second level original document in
formation author(s): paolo lombardi this article is the english translation of an article i wrote in italian for yappy. i grant the right to share all the content under the creative commons: attribution-sharealike license. last updated date: july 9, 2005 author's note: thanks to wladimir palant and rod whiteley for the review. ...
CSS Ruby Layout - CSS: Cascading Style Sheets
they are typically used in east asian documents to indicate pronunciation or to provide a short annotation. ...
...they are typically used in east asian documents to indicate pronunciation or to provide a short annotation. ...
Using the :target pseudo-class in selectors - CSS: Cascading Style Sheets
all rights reserved. note: this reprinted article was originally part of the devedge site. ...
...sion in cases where a fragment identifier points to a portion of the document, readers may become confused about which part of the document they're supposed to be reading. by styling the target of a uri, reader confusion can be reduced or eliminated. see also :target original document in
formation author(s): eric meyer, standards evangelist, netscape communications original copyright in
formation: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
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> <posi...
... see also css units and values introduction to css: values and units ...
Value definition syntax - CSS: Cascading Style Sheets
in addition to this syntax, the set of valid values can be further restricted by semantic constraints (for example, for a number to be strictly positive). the definition syntax describes which values are allowed and the interactions between them. a component can be a keyword, some characters considered as a literal, or a value of a given css data type or of another css property. component value types keywords generic keywords a keyword with a predefined meaning appears literally, without quotation marks. for example: auto, smaller or ease-in. ...
... the same name of a property. these data types are very close to the basic data types. they only differ from the basic data types in the physical location of their definition. in this case, the definition is usually physically very close to the definition of the property using them. component value combinators brackets brackets enclose several entities, combinators, and multipliers, then trans
form them as a single component. they are used to group components to bypass the precedence rules. bold [ thin && <length> ] this example matches the following values: bold thin 2vh bold 0 thin bold thin 3.5em but not: thin bold 3em, as bold is juxtaposed with the component defined by the brackets, it must appear before it. juxtaposition placing several keywords, literals or data types,...
Actual value - CSS: Cascading Style Sheets
the actual value of a css property is the used value of that property after any necessary approximations have been applied. for example, a user agent that can only render borders with a whole-number pixel width may round the thickness of the border to the nearest integer. ...
...s actual (final) value: first, the specified value is determined based on the result of cascading, inheritance, or using the initial value. next, the computed value is calculated according to the specification (for example, a span with position: absolute will have its computed display changed to block). then, layout is calculated, resulting in the used value. finally, the used value is trans
formed according to the limitations of the local environment, resulting in the actual value. specifications specification status comment css level 2 (revision 1)the definition of 'actual value' in that specification. recommendation initial definition. ...
align-content - CSS: Cascading Style Sheets
side an alignment keyword. if the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes of the item and alignment container and whether overflow which causes data loss might happen, the given alignment value is honored. ...
...nstead aligned as if the alignment mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes of the item and alignment container and whether overflow which causes data loss might happen, the given alignment value is honored. ...
align-items - CSS: Cascading Style Sheets
side an alignment keyword. if the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes of the item and alignment container and whether overflow which causes data loss might happen, the given alignment value is honored. ...
... the item is instead aligned as if the alignment mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes of the item and alignment container and whether overflow which causes data loss might happen, the given alignment value is honored. ...
align-self - CSS: Cascading Style Sheets
ax-width (or equivalent functionality), so that the combined size of all auto-sized items exactly fills the alignment container along the cross axis. safe if the size of the item overflows the alignment container, the item is instead aligned as if the alignment mode were start. unsafe regardless of the relative sizes of the item and alignment container, the given alignment value is honored.
formal definition initial valueautoapplies toflex items, grid items, and absolutely-positioned boxesinheritednocomputed valueauto computes to itself on absolutely-positioned elements, and to the computed value of align-items on the parent (minus any legacy keywords) on all other boxes, or start if the box has no parent. its behavior depends on the layout model, as described for justify-self. otherwis...
... items, grid items, and absolutely-positioned boxesinheritednocomputed valueauto computes to itself on absolutely-positioned elements, and to the computed value of align-items on the parent (minus any legacy keywords) on all other boxes, or start if the box has no parent. its behavior depends on the layout model, as described for justify-self. ...
all - CSS: Cascading Style Sheets
to the user-agent level, so that the specified values are calculated as if no author-level or user-level rules were specified for the element. author origin rolls back the cascade to the user level, so that the specified values are calculated as if no author-level rules were specified for the element. for purposes of revert, the author origin includes the override and animation origins. ...
...</blockquote> phasellus eget velit sagittis. ...
animation-direction - CSS: Cascading Style Sheets
unset; values normal the animation plays forwards each cycle. in other words, each time the animation cycles, the animation will reset to the beginning state and start over again. this is the default value. reverse the animation plays backwards each cycle. in other words, each time the animation cycles, the animation will reset to the end state and start over again. animation steps are per
formed backwards, and timing functions are also reversed. for example, an ease-in timing function becomes ease-out. alternate the animation reverses direction each cycle, with the first iteration being played forwards. the count to determine if a cycle is even or odd starts at one. alternate-reverse the animation reverses direction each cycle, with the first iteration being played backwards. the c...
...ate-reverse the animation reverses direction each cycle, with the first iteration being played backwards. the count to determine if a cycle is even or odd starts at one. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more in
formation, see setting multiple animation property values.
formal definition initial valuenormalapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax <single-animation-direction>#where <single-animation-direction> = normal | reverse | alternate | alternate-reverse examples see css animations for examples. specifica...
animation-fill-mode - CSS: Cascading Style Sheets
-reverse 100% or to both the animation will follow the rules for both forwards and backwards, thus extending the animation properties in both directions. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. ...
...follow the rules for both forwards and backwards, thus extending the animation properties in both directions. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more in
formation, see setting multiple animation property values.
formal definition initial valuenoneapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax <single-animation-fill-mode>#where <single-animation-fill-mode> = none | forwards | backwards | both examples you can see the effect of animation-fill-mode in the following example. it demonstrates how, for an animation that runs ...
aspect-ratio - CSS: Cascading Style Sheets
with an intrinsic aspect ratio use that aspect ratio, otherwise the box has no preferred aspect ratio. size calculations involving intrinsic aspect ratio always work with the content box dimensions. <ratio> the box’s preferred aspect ratio is the specified ratio of width / height. size calculations involving preferred aspect ratio work with the dimensions of the box specified by box-sizing. ...
...he content box dimensions. <ratio> the box’s preferred aspect ratio is the specified ratio of width / height. size calculations involving preferred aspect ratio work with the dimensions of the box specified by box-sizing.
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. this appears in the browser's internal ua stylesheet. chrome is also shipping this feature. in firefox, the internal stylesheet rule looks li...
backdrop-filter - CSS: Cascading Style Sheets
lter: saturate(80%); /* multiple filters */ backdrop-filter: url(filters.svg#filter) blur(4px) saturate(150%); /* global values */ backdrop-filter: inherit; backdrop-filter: initial; backdrop-filter: unset; syntax values none no filter is applied to the backdrop. <filter-function-list> a space-separated list of <filter-function>s or an svg filter that will be applied to the backdrop. ...
... none no filter is applied to the backdrop. <filter-function-list> a space-separated list of <filter-function>s or an svg filter that will be applied to the backdrop. ...
background-attachment - CSS: Cascading Style Sheets
ement has a scrolling mechanism, the background scrolls with the element's contents, and the background painting area and background positioning area are relative to the scrollable area of the element rather than to the border framing them. scroll the background is fixed relative to the element itself and does not scroll with its contents. ...
...llable area of the element rather than to the border framing them. scroll the background is fixed relative to the element itself and does not scroll with its contents. (it is effectively attached to the element's border.)
formal definition initial valuescrollapplies toall elements. 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. </p> css p { background-image: url("https://mdn.mozill...
background-blend-mode - CSS: Cascading Style Sheets
nd/or truncated until lengths match. syntax /* one value */ background-blend-mode: normal; /* two values, one per background */ background-blend-mode: darken, luminosity; /* global values */ background-blend-mode: initial; background-blend-mode: inherit; background-blend-mode: unset; values <blend-mode> the blending mode to be applied. there can be several values, separated by commas. ...
...lend-mode: unset; values <blend-mode> the blending mode to be applied. there can be several values, separated by commas.
formal definition initial valuenormalapplies toall elements. in svg, it applies to container elements, graphics elements, and graphics referencing elements.. ...
background-clip - CSS: Cascading Style Sheets
set; values border-box the background extends to the outside edge of the border (but underneath the border in z-ordering). padding-box the background extends to the outside edge of the padding. no background is drawn beneath the border. content-box the background is painted within (clipped to) the content box. text the background is painted within (clipped to) the foreground text. ...
...de edge of the padding. no background is drawn beneath the border. content-box the background is painted within (clipped to) the content box. text the background is painted within (clipped to) the foreground text.
formal definition initial valueborder-boxapplies toall elements. ...
background-origin - CSS: Cascading Style Sheets
*/ background-origin: inherit; background-origin: initial; background-origin: unset; the background-origin property is specified as one of the keyword values listed below. values border-box the background is positioned relative to the border box. padding-box the background is positioned relative to the padding box. content-box the background is positioned relative to the content box. ...
...es border-box the background is positioned relative to the border box. padding-box the background is positioned relative to the padding box. content-box the background is positioned relative to the content box.
formal definition initial valuepadding-boxapplies toall elements. ...
background-position-x - CSS: Cascading Style Sheets
<percentage> the offset of the given background image's horizontal position relative to the container. a value of 0% means that the left edge of the background image is aligned with the left edge of the container, and a value of 100% means that the right edge of the background image is aligned with the right edge of the container, thus a value of 50% horizontally centers the background image. ...
...container, thus a value of 50% horizontally centers the background image.
formal definition initial valueleftapplies toall elementsinheritednopercentagesrefer to width of background positioning area minus height of background imagecomputed valuea list, each item consisting of: an offset given as a combination of an absolute length and a percentage, plus an origin keywordanimation typediscrete
formal syntax [ center | [ [ left | right | x-start | x-end ]? <length-percentage>? ]! ]#where <length-percentage> = <length> | <percentage> examples basic example the following example shows a simple background image implementation, with background-position-x and background-position-y used to define the image's horizontal and vertical positions separately. html <div></div> css div { width: ...
background-position-y - CSS: Cascading Style Sheets
t). <percentage> the offset of the given background image's vertical position relative to the container. a value of 0% means that the top edge of the background image is aligned with the top edge of the container, and a value of 100% means that the bottom edge of the background image is aligned with the bottom edge of the container, thus a value of 50% vertically centers the background image. ...
...e container, thus a value of 50% vertically centers the background image.
formal definition initial valuetopapplies toall elementsinheritednopercentagesrefer to height of background positioning area minus height of background imagecomputed valuea list, each item consisting of: an offset given as a combination of an absolute length and a percentage, plus an origin keywordanimation typediscrete
formal syntax [ center | [ [ top | bottom | y-start | y-end ]? <length-percentage>? ]! ]#where <length-percentage> = <length> | <percentage> examples basic example the following example shows a simple background image implementation, with background-position-x and background-position-y used to define the image's horizontal and vertical positions separately. html <div></div> css div { width: ...
background-repeat - CSS: Cascading Style Sheets
epeated three times, might stretch until each repetition is 300px wide, and then another image will be added. they will then compress to 225px. no-repeat the image is not repeated (and hence the background image painting area will not necessarily be entirely covered). the position of the non-repeated background image is defined by the background-position css property. ...
...ge painting area will not necessarily be entirely covered). the position of the non-repeated background image is defined by the background-position css property.
formal definition initial valuerepeatapplies toall elements. ...
block-size - CSS: Cascading Style Sheets
the height of the element. a related property is inline-size, which defines the other dimension of the element. initial valueautoapplies tosame as width and heightinheritednopercentagesblock-size of containing blockcomputed valuesame as width and heightanimation typea length, percentage or calc(); syntax values the block-size property takes the same values as the width and height properties. ...
...ing 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. editor'...
border-block-color - CSS: Cascading Style Sheets
er-right-color and border-left-color property depending on the values defined for writing-mode, direction, and text-orientation. border-block-color: yellow; border-block-color: #f5f6f7; the border color in the other dimension can be set with border-inline-color which sets border-inline-start-color, and border-inline-end-color. syntax values <'color'> the color of the border. see color. ...
... border-block-color: yellow; border-block-color: #f5f6f7; the border color in the other dimension can be set with border-inline-color which sets border-inline-start-color, and border-inline-end-color. syntax values <'color'> the color of the border. see color. ...
border-block-end-color - CSS: Cascading Style Sheets
ve examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax border-block-end-color: yellow; border-block-end-color: #f5f6f7; related properties are border-block-start-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element. values <'color'> the color of the border. see color. ...
...end-color: yellow; border-block-end-color: #f5f6f7; related properties are border-block-start-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element. values <'color'> the color of the border. see color. ...
border-block-end-style - CSS: Cascading Style Sheets
d send us a pull request. syntax /* <'border-style'> values */ border-block-end-style: dashed; border-block-end-style: dotted; border-block-end-style: groove; related properties are border-block-start-style, border-inline-start-style, and border-inline-end-style, which define the other border styles of the element. values <'border-style'> the line style of the border. see border-style. ...
...: dotted; border-block-end-style: groove; related properties are border-block-start-style, border-inline-start-style, and border-inline-end-style, which define the other border styles of the element. values <'border-style'> the line style of the border. see border-style. ...
border-block-end-width - CSS: Cascading Style Sheets
://github.com/mdn/interactive-examples and send us a pull request. syntax /* <'border-width'> values */ border-block-end-width: 5px; border-block-end-width: thick; related properties are border-block-start-width, border-inline-start-width, and border-inline-end-width, which define the other border widths of the element. values <'border-width'> the width of the border. see border-width. ...
...-width, border-inline-start-width, and border-inline-end-width, which define the other border widths of the element. values <'border-width'> the width of the border. see border-width. ...
border-block-end - CSS: Cascading Style Sheets
properties are border-block-start, border-inline-start, and border-inline-end, which define the other borders of the element. values the border-block-end is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <perce...
border-block-start-color - CSS: Cascading Style Sheets
te to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax border-block-start-color: blue; border-block-start-color: #4c5d21; related properties are border-block-end-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element. ...
...ntax border-block-start-color: blue; border-block-start-color: #4c5d21; related properties are border-block-end-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element. ...
border-block-start-style - CSS: Cascading Style Sheets
nd us a pull request. syntax /* <'border-style'> values */ border-block-start-style: dashed; border-block-start-style: dotted; border-block-start-style: groove; related properties are border-block-end-style, border-inline-start-style, and border-inline-end-style, which define the other border styles of the element. values <'border-style'> the line style of the border. see border-style. ...
...: dotted; border-block-start-style: groove; related properties are border-block-end-style, border-inline-start-style, and border-inline-end-style, which define the other border styles of the element. values <'border-style'> the line style of the border. see border-style. ...
border-block-start-width - CSS: Cascading Style Sheets
re border-block-end-width, border-inline-start-width, and border-inline-end-width, which define the other border widths of the element. 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. see border-width. ...
...idth of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length values <'border-width'> the width of the border. see border-width. ...
border-block-start - CSS: Cascading Style Sheets
properties are border-block-end, border-inline-start, and border-inline-end, which define the other borders of the element. values the border-block-start is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <perce...
border-block-style - CSS: Cascading Style Sheets
for writing-mode, direction, and text-orientation. /* <'border-style'> values */ border-block-style: dashed; border-block-style: dotted; border-block-style: groove; the border style in the other dimension can be set with border-inline-style, which sets border-inline-start-style, and border-inline-end-style. syntax values <'border-style'> the line style of the border. see border-style. ...
...lock-style: dotted; border-block-style: groove; the border style in the other dimension can be set with border-inline-style, which sets border-inline-start-style, and border-inline-end-style. syntax values <'border-style'> the line style of the border. see border-style. ...
border-block-width - CSS: Cascading Style Sheets
perty depending on the values defined for writing-mode, direction, and text-orientation. /* <'border-width'> values */ border-block-width: 5px; border-block-width: thick; the border width in the other dimension can be set with border-inline-width, which sets border-inline-start-width, and border-inline-end-width. syntax values <'border-width'> the width of the border. see border-width. ...
...sion can be set with border-inline-width, which sets border-inline-start-width, and border-inline-end-width. syntax values <'border-width'> the width of the border. see border-width. ...
border-block - CSS: Cascading Style Sheets
roperty is a shorthand for the following css properties: border-block-color border-block-style border-block-width syntax values the border-block is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <perce...
border-bottom-color - CSS: Cascading Style Sheets
olor: #ffbb00; border-bottom-color: rgb(255, 0, 0); border-bottom-color: hsla(100%, 50%, 25%, 0.75); border-bottom-color: currentcolor; border-bottom-color: transparent; /* global values */ border-bottom-color: inherit; border-bottom-color: initial; border-bottom-color: unset; the border-bottom-color property is specified as a single value. values <color> the color of the bottom border.
formal definition initial valuecurrentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valuecomputed coloranimation typea color
formal syntax <'border-top-color'> examples a simple div with a border html <div class="mybox"> <p>this is a box with a border around it. note which side of the box is <span class="redtext">red</span>.</p> </div> css .myb...
... css level 2 (revision 1)the definition of 'border-bottom-color' in that specification. recommendation initial definition ...
border-bottom-left-radius - CSS: Cascading Style Sheets
rder in that corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid.
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sani...
...lements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typea length, percentage or calc();
formal syntax <length-percentage>{1,2}where <length-percentage> = <length> | <percentage> examples live example code . an arc of circle is used as the border div { border-bottom-left-radius: 40px 40px; } . an arc of ellipse is used as the border div { border-bottom-left-radius: 40px 20px; } ...
border-bottom-right-radius - CSS: Cascading Style Sheets
rder in that corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid.
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sani...
...lements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typea length, percentage or calc();
formal syntax <length-percentage>{1,2}where <length-percentage> = <length> | <percentage> examples live example code . an arc of circle is used as the border div { border-bottom-right-radius: 40px 40px; } . an arc of ellipse is used as the border div { border-bottom-right-radius: 40px 20px; } ...
border-bottom-style - CSS: Cascading Style Sheets
ottom-style: solid; border-bottom-style: double; border-bottom-style: groove; border-bottom-style: ridge; border-bottom-style: inset; border-bottom-style: outset; /* global values */ border-bottom-style: inherit; border-bottom-style: initial; border-bottom-style: unset; the border-bottom-style property is specified as a single keyword chosen from those available for the border-style property. ...
...outset; /* global values */ border-bottom-style: inherit; border-bottom-style: initial; border-bottom-style: unset; the border-bottom-style property is specified as a single keyword chosen from those available for the border-style property.
formal definition initial valuenoneapplies toall elements. ...
border-bottom-width - CSS: Cascading Style Sheets
ium a medium border thick a thick border note: because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. ...
...result when using one of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document.
formal definition initial valuemediumapplies toall elements. ...
border-bottom - CSS: Cascading Style Sheets
ies: border-bottom-color border-bottom-style border-bottom-width syntax border-bottom: 1px; border-bottom: 2px dotted; border-bottom: medium dashed blue; the three values of the shorthand property can be specified in any order, and one or two of them may be omitted. values <br-width> see border-bottom-width. <br-style> see border-bottom-style. <color> see border-bottom-color.
formal definition initial valueas each of the properties of the shorthand:border-bottom-width: mediumborder-bottom-style: noneborder-bottom-color: currentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-bottom-style: as specifie...
...) | rgb( <number>{3} [...
border-collapse - CSS: Cascading Style Sheets
/* global values */ border-collapse: inherit; border-collapse: initial; border-collapse: unset; the border-collapse property is specified as a single keyword, which may be chosen from the list below. values collapse adjacent cells have shared borders (the collapsed-border table rendering model). separate adjacent cells have distinct borders (the separated-border table rendering model). ...
...a single keyword, which may be chosen from the list below. values collapse adjacent cells have shared borders (the collapsed-border table rendering model). separate adjacent cells have distinct borders (the separated-border table rendering model). ...
border-end-end-radius - CSS: Cascading Style Sheets
ius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid.
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sani...
...lements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. ...
border-end-start-radius - CSS: Cascading Style Sheets
ius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid.
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sani...
...lements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. ...
border-image-outset - CSS: Cascading Style Sheets
left in that order (clockwise). values <length> the size of the border-image outset as a dimension — a number with a unit. <number> the size of the border-image outset as a multiple of the element's corresponding border-widths. for example, if an element has border-width: 1em 2px 0 1.5rem, and border-image-outset: 2, the final border-image-outset would be calculated as 2em 4px 0 3rem. ...
... 0 1.5rem, and border-image-outset: 2, the final border-image-outset would be calculated as 2em 4px 0 3rem.
formal definition initial value0applies toall elements, except internal table elements when border-collapse is collapse. ...
border-image-repeat - CSS: Cascading Style Sheets
he gap between each border. tiles may be clipped to achieve the proper fit. round the source image's edge regions are tiled (repeated) to fill the gap between each border. tiles may be stretched to achieve the proper fit. space the source image's edge regions are tiled (repeated) to fill the gap between each border. extra space will be distributed in between tiles to achieve the proper fit. ...
... space the source image's edge regions are tiled (repeated) to fill the gap between each border. extra space will be distributed in between tiles to achieve the proper fit.
formal definition initial valuestretchapplies toall elements, except internal table elements when border-collapse is collapse. ...
border-image-source - CSS: Cascading Style Sheets
age-source: none; /* <image> values */ border-image-source: url(image.jpg); border-image-source: linear-gradient(to top, red, yellow); /* global values */ border-image-source: inherit; border-image-source: initial; border-image-source: unset; values none no border image is used. the appearance defined by border-style is displayed instead. <image> image reference to use for the border. ...
...s none no border image is used. the appearance defined by border-style is displayed instead. <image> image reference to use for the border.
formal definition initial valuenoneapplies toall elements, except internal table elements when border-collapse is collapse. ...
border-image-width - CSS: Cascading Style Sheets
ets. must not be negative. <number> the width of the border, specified as a multiple of the corresponding border-width. must not be negative. auto the width of the border is made equal to the intrinsic width or height (whichever is applicable) of the corresponding border-image-slice. if the image does not have the required intrinsic dimension, the corresponding border-width is used instead. ...
...corresponding border-width is used instead.
formal definition initial value1applies toall elements, except internal table elements when border-collapse is collapse. it also applies to ::first-letter.inheritednopercentagesrefer to the width or height of the border image areacomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typeby computed value type
formal syntax [ <length-percentage> | <number> | auto ]{1,4}where <length-percentage> = <length> | <percentage> examples tiling a border image this example creates a border image using the following ".png" file, which is 90 by 90 pixels: thus, each circle in the source image is 30 by 30 pixels. html <p>lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor i...
border-inline-color - CSS: Cascading Style Sheets
der-right-color and border-left-color property depending on the values defined for writing-mode, direction, and text-orientation. border-inline-color: yellow; border-inline-color: #f5f6f7; the border color in the other dimension can be set with border-block-color which sets border-block-start-color, and border-block-end-color. syntax values <'color'> the color of the border. see color. ...
... border-inline-color: yellow; border-inline-color: #f5f6f7; the border color in the other dimension can be set with border-block-color which sets border-block-start-color, and border-block-end-color. syntax values <'color'> the color of the border. see color. ...
border-inline-end-color - CSS: Cascading Style Sheets
rder-inline-end-color: rebeccapurple; border-inline-end-color: #663399; related properties are border-block-start-color, border-block-end-color, and border-inline-start-color, which define the other border colors of the element. initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color values <'color'> the color of the border. see color. ...
...r-block-end-color, and border-inline-start-color, which define the other border colors of the element. initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color values <'color'> the color of the border. see color. ...
border-inline-end-style - CSS: Cascading Style Sheets
send us a pull request. syntax /* <'border-style'> values */ border-inline-end-style: dashed; border-inline-end-style: dotted; border-inline-end-style: groove; related properties are border-block-start-style, border-block-end-style, and border-inline-start-style, which define the other border styles of the element. values <'border-style'> the line style of the border. see border-style. ...
...: dotted; border-inline-end-style: groove; related properties are border-block-start-style, border-block-end-style, and border-inline-start-style, which define the other border styles of the element. values <'border-style'> the line style of the border. see border-style. ...
border-inline-end-width - CSS: Cascading Style Sheets
e border-block-start-width, border-block-end-width, and border-inline-start-width, which define the other border widths of the element. 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. see border-width. ...
...idth of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length values <'border-width'> the width of the border. see border-width. ...
border-inline-end - CSS: Cascading Style Sheets
roperties 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. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <perce...
border-inline-start-color - CSS: Cascading Style Sheets
ve examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax border-inline-start-color: red; border-inline-start-color: #ee4141; related properties are border-block-start-color, border-block-end-color, and border-inline-end-color, which define the other border colors of the element. values <'color'> the color of the border. see color. ...
...-start-color: red; border-inline-start-color: #ee4141; related properties are border-block-start-color, border-block-end-color, and border-inline-end-color, which define the other border colors of the element. values <'color'> the color of the border. see color. ...
border-inline-start-style - CSS: Cascading Style Sheets
-inline-start-style: dotted; border-inline-start-style: groove; related properties are border-block-start-style, border-block-end-style, and border-inline-end-style, which define the other border styles of the element. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete values <'border-style'> the line style of the border. see border-style. ...
...er-block-end-style, and border-inline-end-style, which define the other border styles of the element. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete values <'border-style'> the line style of the border. see border-style. ...
border-inline-start-width - CSS: Cascading Style Sheets
github.com/mdn/interactive-examples and send us a pull request. syntax /* <'border-width'> values */ border-inline-start-width: 5px; border-inline-start-width: thick; related properties are border-block-start-width, border-block-end-width, and border-inline-end-width, which define the other border widths of the element. values <'border-width'> the width of the border. see border-width. ...
...art-width, border-block-end-width, and border-inline-end-width, which define the other border widths of the element. values <'border-width'> the width of the border. see border-width. ...
border-inline-start - CSS: Cascading Style Sheets
properties are border-block-start, border-block-end, and border-inline-end, which define the other borders of the element. values the border-inline-start is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <perce...
border-inline-style - CSS: Cascading Style Sheets
for writing-mode, direction, and text-orientation. /* <'border-style'> values */ border-inline-style: dashed; border-inline-style: dotted; border-inline-style: groove; the border style in the other dimension can be set with border-block-style, which sets border-block-start-style, and border-block-end-style. syntax values <'border-style'> the line style of the border. see border-style. ...
...inline-style: dotted; border-inline-style: groove; the border style in the other dimension can be set with border-block-style, which sets border-block-start-style, and border-block-end-style. syntax values <'border-style'> the line style of the border. see border-style. ...
border-inline-width - CSS: Cascading Style Sheets
defined for writing-mode, direction, and text-orientation. /* <'border-width'> values */ border-inline-width: 5px 10px; border-inline-width: 5px; border-inline-width: thick; the border width in the other dimension can be set with border-block-width, which sets border-block-start-width, and border-block-end-width. syntax values <'border-width'> the width of the border. see border-width. ...
...mension can be set with border-block-width, which sets border-block-start-width, and border-block-end-width. syntax values <'border-width'> the width of the border. see border-width. ...
border-inline - CSS: Cascading Style Sheets
operty 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. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <perce...
border-left-style - CSS: Cascading Style Sheets
le: dashed; border-left-style: solid; border-left-style: double; border-left-style: groove; border-left-style: ridge; border-left-style: inset; border-left-style: outset; /* global values */ border-left-style: inherit; border-left-style: initial; border-left-style: unset; the border-left-style property is specified as a single keyword chosen from those available for the border-style property. ...
...-style: outset; /* global values */ border-left-style: inherit; border-left-style: initial; border-left-style: unset; the border-left-style property is specified as a single keyword chosen from those available for the border-style property.
formal definition initial valuenoneapplies toall elements. ...
border-left-width - CSS: Cascading Style Sheets
ium a medium border thick a thick border note: because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. ...
...e result when using one of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document.
formal definition initial valuemediumapplies toall elements. ...
border-left - CSS: Cascading Style Sheets
owing css properties: border-left-color border-left-style border-left-width syntax border-left: 1px; border-left: 2px dotted; border-left: medium dashed green; the three values of the shorthand property can be specified in any order, and one or two of them may be omitted. values <br-width> see border-left-width. <br-style> see border-left-style. <color> see border-left-color.
formal definition initial valueas each of the properties of the shorthand:border-left-width: mediumborder-left-style: noneborder-left-color: currentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-left-style: as specifiedborder-left...
...ll elements. ...
border-radius - CSS: Cascading Style Sheets
em; /* ... is equivalent to: */ border-top-left-radius: 1em 5em; border-top-right-radius: 1em 5em; border-bottom-right-radius: 1em 5em; border-bottom-left-radius: 1em 5em; border-radius: 4px 3px 6px / 2px 4px; /* ... is equivalent to: */ border-top-left-radius: 4px 2px; border-top-right-radius: 3px 4px; border-bottom-right-radius: 6px 2px; border-bottom-left-radius: 3px 4px;
formal definition initial valueas each of the properties of the shorthand:border-top-left-radius: 0border-top-right-radius: 0border-bottom-right-radius: 0border-bottom-left-radius: 0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies ...
...t-radius: two absolute <length>s or <percentage>sborder-top-right-radius: two absolute <length>s or <percentage>sanimation typeas each of the properties of the shorthand:border-top-left-radius: a length, percentage or calc();border-top-right-radius: a length, percentage or calc();border-bottom-right-radius: a length, percentage or calc();border-bottom-left-radius: a length, percentage or calc();
formal syntax <length-percentage>{1,4} [ / <length-percentage>{1,4} ]?where <length-percentage> = <length> | <percentage> examples border: solid 10px; /* the border will curve into a 'd' */ border-radius: 10px 40px 40px 10px; border: groove 1em red; border-radius: 2em; background: gold; border: ridge gold; border-radius: 13em/3em; border: none; border-radius: 40px 10px; ...
border-right-style - CSS: Cascading Style Sheets
; border-right-style: solid; border-right-style: double; border-right-style: groove; border-right-style: ridge; border-right-style: inset; border-right-style: outset; /* global values */ border-right-style: inherit; border-right-style: initial; border-right-style: unset; the border-right-style property is specified as a single keyword chosen from those available for the border-style property. ...
...le: outset; /* global values */ border-right-style: inherit; border-right-style: initial; border-right-style: unset; the border-right-style property is specified as a single keyword chosen from those available for the border-style property.
formal definition initial valuenoneapplies toall elements. ...
border-right-width - CSS: Cascading Style Sheets
ium a medium border thick a thick border note: because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. ...
... result when using one of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document.
formal definition initial valuemediumapplies toall elements. ...
border-right - CSS: Cascading Style Sheets
properties: border-right-color border-right-style border-right-width syntax border-right: 1px; border-right: 2px dotted; border-right: medium dashed green; the three values of the shorthand property can be specified in any order, and one or two of them may be omitted. values <br-width> see border-right-width. <br-style> see border-right-style. <color> see border-right-color.
formal definition initial valueas each of the properties of the shorthand:border-right-width: mediumborder-right-style: noneborder-right-color: currentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-right-style: as specifiedborde...
...ents. ...
border-start-end-radius - CSS: Cascading Style Sheets
ius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid.
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sani...
...lements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. ...
border-start-start-radius - CSS: Cascading Style Sheets
ius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid.
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sani...
...lements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. ...
border-style - CSS: Cascading Style Sheets
ent appear embedded. it is the opposite of outset. when applied to a table cell with border-collapse set to collapsed, this value behaves like groove. outset displays a border that makes the element appear embossed. it is the opposite of inset. when applied to a table cell with border-collapse set to collapsed, this value behaves like ridge.
formal definition initial valueas each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: noneapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-bottom-style: as specifiedborder-left-style: as specifiedborder-right-style: as specifiedborder-top-st...
...e properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: noneapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-bottom-style: as specifiedborder-left-style: as specifiedborder-right-style: as specifiedborder-top-style: as specifiedanimation typediscrete
formal syntax <line-style>{1,4}where <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset examples table with all property values here is an example of all the property values. html <table> <tr> <td class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">...
border-top-left-radius - CSS: Cascading Style Sheets
rder in that corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid.
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sani...
...lements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. ...
border-top-right-radius - CSS: Cascading Style Sheets
rder in that corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid.
formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sani...
...lements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. ...
border-top-style - CSS: Cascading Style Sheets
er-top-style: dashed; border-top-style: solid; border-top-style: double; border-top-style: groove; border-top-style: ridge; border-top-style: inset; border-top-style: outset; /* global values */ border-top-style: inherit; border-top-style: initial; border-top-style: unset; the border-top-style property is specified as a single keyword chosen from those available for the border-style property. ...
...-top-style: outset; /* global values */ border-top-style: inherit; border-top-style: initial; border-top-style: unset; the border-top-style property is specified as a single keyword chosen from those available for the border-style property.
formal definition initial valuenoneapplies toall elements. ...
border-top-width - CSS: Cascading Style Sheets
ium a medium border thick a thick border note: because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. ...
...se result when using one of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document.
formal definition initial valuemediumapplies toall elements. ...
border-top - CSS: Cascading Style Sheets
the following css properties: border-top-color border-top-style border-top-width syntax border-top: 1px; border-top: 2px dotted; border-top: medium dashed green; the three values of the shorthand property can be specified in any order, and one or two of them may be omitted. values <br-width> see border-top-width. <br-style> see border-top-style. <color> see border-top-color.
formal definition initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-style: noneborder-top-color: currentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-top-style: as specifiedborder-top-color:...
...ies toall elements. ...
border-width - CSS: Cascading Style Sheets
ium a medium border thick a thick border note: because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document.
formal definition initial valueas each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-wid...
...th: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the absolute length or 0 if border-top-style is none or hiddenanimation typeas each of the properties of the shorthand:border-bottom-width: a lengthborder-left-width: a lengthborder-right-width: a lengthborder-top-width: a length
formal syntax <line-width>{1,4}where <line-width> = <length> | thin | medium | thick examples a mix of values and lengths html <p id="sval"> one value: 6px wide border on all 4 sides</p> <p id="bival"> two different values: 2px wide top and bottom border, 10px wide right and left border</p> <p id="treval"> three different values: 0.3em top, 9px bottom, and zero width right and left</p...
border - CSS: Cascading Style Sheets
time with the physical (e.g., border-top ) and logical (e.g., border-block-start) border properties. borders vs. outlines borders and outlines are very similar. however, outlines differ from borders in the following ways: outlines never take up space, as they are drawn outside of an element's content. according to the spec, outlines don't have to be rectangular, although they usually are. ...
...) | rgb( <number>{3} [...
bottom - CSS: Cascading Style Sheets
elements, the distance of the element from its normal position is based on the top property; or if top is also auto, the element is not moved vertically at all. inherit specifies that the value is the same as the computed value from its parent element (which might not be its containing block). this computed value is then handled as if it were a <length>, <percentage>, or the auto keyword. ...
...ue is then handled as if it were a <length>, <percentage>, or the auto keyword.
formal definition initial valueautoapplies topositioned elementsinheritednopercentagesrefer to the height of the containing blockcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length, percentage or calc();
formal syntax <length> | <percentage> | auto examples absolute and fixed positioning this example demonstrates the difference in behavior of the bottom property, when position is absolute versus fixed. html <p>this<br>is<br>some<br>tall,<br>tall,<br>tall,<br>tall,<br>tall<br>content.</p> <div class="fixed"><p>fixed</p></div> <div class="absolute"><p>absolute</p></div> css p { font-size: 30px...
box-decoration-break - CSS: Cascading Style Sheets
r details. clone each box fragment is rendered independently with the specified border, padding, and margin wrapping each fragment. the border-radius, border-image, and box-shadow are applied to each fragment independently. the background is also drawn independently for each fragment, which means that a background image with background-repeat: no-repeat may nevertheless repeat multiple times. ...
...ach fragment. the border-radius, border-image, and box-shadow are applied to each fragment independently. the background is also drawn independently for each fragment, which means that a background image with background-repeat: no-repeat may nevertheless repeat multiple times. ...
box-lines - CSS: Cascading Style Sheets
the box-lines css property determines whether the box may have a single or multiple lines (rows for horizontally oriented boxes, columns for vertically oriented boxes). /* keyword values */ box-lines: single; box-lines: multiple; /* global values */ box-lines: inherit; box-lines: initial; box-lines: unset; by default a horizontal box will lay out its children in a single row, and a vertical box will lay out its children in a single column. ...
...e are considered when evaluating box-flex and box-flex-groups. the packing of elements in a line, as specified by the box-pack property, is also computed independently for each line. syntax the box-lines property is specified as one of the keyword values listed below. values single box elements lay out in a single row or column. multiple box elements layout in multiple rows or columns.
formal definition initial valuesingleapplies tobox elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax single | multiple examples simple usage example in the original version of the spec, box-lines allowed you to specify that you wanted your flex container's children to wrap onto multiple lines. this was only supported in webkit-based browsers, with a prefix. div {...
box-shadow - CSS: Cascading Style Sheets
re not inset, then the interpolated shadow must match the input shadows in that regard. if any pair of input shadows has one inset and the other not inset, the entire shadow list is uninterpolable. if the lists of shadows have different lengths, then the shorter list is padded at the end with shadows whose color is transparent, all lengths are 0, and whose inset (or not) matches the longer list. ...
... different lengths, then the shorter list is padded at the end with shadows whose color is transparent, all lengths are 0, and whose inset (or not) matches the longer list.
formal definition initial valuenoneapplies toall elements. ...
break-inside - CSS: Cascading Style Sheets
within the principal box. page break aliases for compatibility reasons, the legacy page-break-inside property should be treated by browsers as an alias of break-inside. this ensures that sites using page-break-inside continue to work as designed. ...
...ted by browsers as an alias of break-inside. this ensures that sites using page-break-inside continue to work as designed. a subset of values should be aliased as follows: page-break-inside break-inside auto auto avoid avoid
formal definition initial valueautoapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax auto | avoid | avoid-page | avoid-column | avoid-region examples avoiding breaking inside a figure in the following example we have a container that contains an <h1> spanning all columns (achieved using column-span: all) and a series of paragraphs laid out in multiple columns using column-width: 200px. we also have a <figure> containing an image and a caption. by default, it is poss...
caption-side - CSS: Cascading Style Sheets
this value in a future specification. bottom-outside the caption box should be positioned below the table, while the width and horizontal alignment behavior are not bound to the table's horizontal layout. the css 2.1 specification notes that the css 2 specification described a different behavior for the bottom value, which will be reintroduced by this value in a future specification. ...
...and horizontal alignment behavior are not bound to the table's horizontal layout. the css 2.1 specification notes that the css 2 specification described a different behavior for the bottom value, which will be reintroduced by this value in a future specification. ...
caret-color - CSS: Cascading Style Sheets
t the user agent may choose a different color to ensure good visibility and contrast with the surrounding content, taking into account the value of currentcolor, the background, shadows, and other factors. note: while user agents may use currentcolor (which is usually animatable) for the auto value, auto is not interpolated in transitions and animations. <color> the color of the caret. ...
...s. note: while user agents may use currentcolor (which is usually animatable) for the auto value, auto is not interpolated in transitions and animations. <color> the color of the caret. ...
clamp() - CSS: Cascading Style Sheets
the minimum value will be used. the preferred value is the expression whose value will be used as long as the result is between the minimum and maximum values. the maximum value is the largest (most positive) expression value to which the value of the property will be assigned if the preferred value is greater than this upper bound. the expressions can be math functions (see calc() for more in
formation), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>), or nested min() and max() functions. as math expressions, so you can use addition, subtraction, multiplication and division without using the calc() function itself. you may also use parentheses to establish computation order when needed. you can use different units for each value...
... / ) operators, using standard operator precedence rules. make sure to put a space on each side of the + and - operands. the operands in the expression may be any <length> syntax value. you can use different units for each value in your expression. you may also use parentheses to establish computation order when needed. oftentimes you will want to use min() and max() within a clamp() function. ...
clear - CSS: Cascading Style Sheets
margins between two floated elements on the other hand will not collapse. when applied to floating elements, the margin edge of the bottom element is moved below the margin edge of all relevant floats. this affects the position of later floats, since later floats cannot be positioned higher than earlier ones. the floats that are relevant to be cleared are the earlier floats within the same block
formatting context. if an element contains only floated elements, its height collapses to nothing. if you want it to always be able to resize, so that it contains floating elements inside it, you need to self-clear its children. this is called clearfix, and one way to do it is to add clear to a replaced ::after pseudo-element on it. #container::after { content: ""; display: block; clear: both...
... inline-start is a keyword indicating that the element is moved down to clear floats on start side of its containing block, that is the left floats on ltr scripts and the right floats on rtl scripts. inline-end is a keyword indicating that the element is moved down to clear floats on end side of its containing block, that is the right floats on ltr scripts and the left floats on rtl scripts.
formal definition initial valuenoneapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax none | left | right | both | inline-start | inline-end examples clear: left html <div class="wrapper"> <p class="black">lorem ipsum dolor sit amet, consectetuer adipiscing elit. phasellus sit amet diam. duis mattis varius dui. suspendisse eget dolor.</p> ...
clip-path - CSS: Cascading Style Sheets
is positioned at the origin of the coordinate system established by the viewbox attribute and the dimension of the size of the reference box is set to the width and height values of the viewbox attribute. none no clipping path is created. note: a computed value other than none results in the creation of a new stacking context the same way that css opacity does for values other than 1. ...
...acity does for values other than 1. ...
color-adjust - CSS: Cascading Style Sheets
white paper. this is the default. exact the element's content has been specifically and carefully crafted to use colors, images, and styles in a thoughtful and/or important way, such that being altered by the browser might actually make things worse rather than better. the appearance of the content should not be changed except by the user's request. for example, a page might include a list of in
formation with rows whose background colors alternate between white and a light grey. removing the background color would decrease the legibility of the content. usage notes there are a number of reasons a browser might wish to deviate from the specified appearance, such as: the content uses text and background colors that will be too similar on the output device for legibility purposes. if the...
...on a white background. any options the user agent offers the user to allow them to control the use of color and images will take priority over the value of color-adjust. in other words, there isn't any guarantee that color-adjust will do anything. not only can the user override the behavior, but each user agent is allowed to decide for itself how to handle color-adjust in any given situation.
formal definition initial valueeconomyapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax economy | exact examples preserving low contrast in this example, a box is shown which uses a background-image and a translucent linear-gradient() function atop a black background color to have a dark blue gradient behind medium red text. for whatever reason, thi...
column-gap (grid-column-gap) - CSS: Cascading Style Sheets
the browser's default spacing is used between columns. for multi-column layout this is specified as 1em. for all other layout types it is 0. <length> the size of the gap between columns, defined as a <length>. the <length> property's value must be non-negative. <percentage> the size of the gap between columns, defined as a <percentage>. the <percentage> property's value must be non-negative. ...
... the <percentage> property's value must be non-negative. ...
column-rule-color - CSS: Cascading Style Sheets
* <color> values */ column-rule-color: red; column-rule-color: rgb(192, 56, 78); column-rule-color: transparent; column-rule-color: hsla(0, 100%, 50%, 0.6); /* global values */ column-rule-color: inherit; column-rule-color: initial; column-rule-color: unset; the column-rule-color property is specified as a single <color> value. values <color> the color of the rule that separates columns. ...
...sla(0, 100%, 50%, 0.6); /* global values */ column-rule-color: inherit; column-rule-color: initial; column-rule-color: unset; the column-rule-color property is specified as a single <color> value. values <color> the color of the rule that separates columns. ...
column-rule - CSS: Cascading Style Sheets
; column-rule: initial; column-rule: unset; the column-rule property is specified as one, two, or three of the values listed below, in any order. values <'column-rule-width'> is a <length> or one of the three keywords, thin, medium, or thick. see border-width for details. <'column-rule-style'> see border-style for possible values and details. <'column-rule-color'> is a <color> value. ...
...olor: currentcolorapplies tomulticol elementsinheritednocomputed valueas each of the properties of the shorthand:column-rule-color: computed colorcolumn-rule-style: as specifiedcolumn-rule-width: the absolute length; 0 if the column-rule-style is none or hiddenanimation typeas each of the properties of the shorthand:column-rule-color: a colorcolumn-rule-style: discretecolumn-rule-width: a length
formal syntax <'column-rule-width'> | <'column-rule-style'> | <'column-rule-color'> examples example 1 /* same as "medium dotted currentcolor" */ p.foo { column-rule: dotted; } /* same as "medium solid blue" */ p.bar { column-rule: solid blue; } /* same as "8px solid currentcolor" */ p.baz { column-rule: solid 8px; } p.abc { column-rule: thick inset blue; } example 2 html <p class="content-...
column-width - CSS: Cascading Style Sheets
ndicates the optimal column width. the actual column width may differ from the specified value: it may be wider when necessary to fill available space, and narrower when the available space is too small. the value must be strictly positive or the declaration is invalid. percentage values are also invalid. auto the width of the column is determined by other css properties, such as column-count. ...
... available space is too small. the value must be strictly positive or the declaration is invalid. percentage values are also invalid. auto the width of the column is determined by other css properties, such as column-count.
formal definition initial valueautoapplies toblock containers except table wrapper boxesinheritednocomputed valuethe absolute length, zero or largeranimation typea length
formal syntax <length> | auto examples setting column width in pixels html <p class="content-box"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. </p> css .content-box { ...
columns - CSS: Cascading Style Sheets
a <length> or the keyword auto. the actual width may be wider or narrower to fit the available space. see column-width. <'column-count'> the ideal number of columns into which the element's content should be flowed, defined as an <integer> or the keyword auto. if neither this value nor the column's width are auto, it merely indicates the maximum allowable number of columns. see column-count. ...
...the text is equally distributed over the columns. </p> css .content-box { columns: 3 auto; } result specifications specification status comment css multi-co...
conic-gradient() - CSS: Cascading Style Sheets
er right black quadrants, then repeating the gradient 16 times (four times across and four times down) you can make a checkerboard. conic-gradient(#fff 90deg, #000 0.25turn 0.5turn, #fff 1rad 1.5rad, #000 300grad); background-size: 25% 25%; and, yes, you can mix and match different angle units, but don't. the above is hard to read. accessibility concerns browsers do not provide any special in
formation on background images to assistive technology. this is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. while it is possible to create pie charts, checkerboards, and other effects with conic gradients, css images provide no native way to assign alternative text, and therefore the image represented by the conic...
...or screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. while it is possible to create pie charts, checkerboards, and other effects with conic gradients, css images provide no native way to assign alternative text, and therefore the image represented by the conic gradient will not be accessible to screen reader users. if the image contains in
formation critical to understanding the page's overall purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 examples gradient at 40-degrees div { width: 100px; height: 100px; } <div></div> div { background-image: conic-gradient(from 40deg, #fff, #0...
counter-increment - CSS: Cascading Style Sheets
ecify as many counters to increment as you want, with each name or name-number pair separated by a space. the keyword value none. values <custom-ident> the name of the counter to increment. <integer> the value to add to the counter. defaults to 1 if not specified. none no counter must be incremented. this is used as the default value, or to cancel an increment in more specific rules. ...
...value none. values <custom-ident> the name of the counter to increment. <integer> the value to add to the counter. defaults to 1 if not specified. none no counter must be incremented. this is used as the default value, or to cancel an increment in more specific rules. ...
counters() - CSS: Cascading Style Sheets
it is generally used with pseudo-elements, but can be used, theoretically, anywhere a <string> value is supported. the generated text is the value of all counters with the given name, from outermost to innermost, separated by the specified string. the counters are rendered in the style indicated, defaulting to decimal if no style is specified. ...
...ame is a numeric, alphabetic, or symbolic simple predefined counter style, a complex longhand east asian or ethiopic predefined counter style, or other predefined counter style. if omitted, the counter-style defaults to decimal <string> any number of text characters. non-latin characters must be encoded using their unicode escape sequences: for example, \000a9 represents the copyright symbol. ...
cross-fade() - CSS: Cascading Style Sheets
pacity of the first declared image. the included percentage is subtracted from 100%, with the difference being the opacity of the second image. the green/red example (with the percentages totalling 150%) and the yellow/red/blue example (with three images) from the specification syntax section, are not possible in this implementation. accessibility concerns browsers do not provide any special in
formation on background images to assistive technology. this is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. if the image contains in
formation critical to understanding the page's overall purpose, it is better to describe it semantically in the document. when using background images, make sure the contrast in color...
...ormation critical to understanding the page's overall purpose, it is better to describe it semantically in the document. when using background images, make sure the contrast in color is great enough that any text is legible over the image as well as if the images is missing. ...
empty-cells - CSS: Cascading Style Sheets
en the border-collapse property is separate. syntax /* keyword values */ empty-cells: show; empty-cells: hide; /* global values */ empty-cells: inherit; empty-cells: initial; empty-cells: unset; the empty-cells property is specified as one of the keyword values listed below. values show borders and backgrounds are drawn like in normal cells. hide no borders or backgrounds are drawn. ...
...ues */ empty-cells: inherit; empty-cells: initial; empty-cells: unset; the empty-cells property is specified as one of the keyword values listed below. values show borders and backgrounds are drawn like in normal cells. hide no borders or backgrounds are drawn. ...
flex-basis - CSS: Cascading Style Sheets
uto was changed to mean automatic sizing, and "main-size" was introduced as the "look at my width or height property" keyword. it was implemented in bug 1032922. then, that change was reverted in bug 1093316, so auto once again means "look at my width or height property"; and a new content keyword is being introduced to trigger automatic sizing. (bug 1105111 covers adding that keyword). ...
...nt keyword is being introduced to trigger automatic sizing. (bug 1105111 covers adding that keyword). ...
flex-direction - CSS: Cascading Style Sheets
ing with the aid of assistive technology such as a screen reader. if the visual (css) order is important, then screen reader users will not have access to the correct reading order. ...
...der users will not have access to the correct reading order. ...
flex-flow - CSS: Cascading Style Sheets
olumn-reverse; /* flex-flow: <'flex-wrap'> */ flex-flow: nowrap; flex-flow: wrap; flex-flow: wrap-reverse; /* flex-flow: <'flex-direction'> and <'flex-wrap'> */ flex-flow: row nowrap; flex-flow: column wrap; flex-flow: column-reverse wrap-reverse; /* global values */ flex-flow: inherit; flex-flow: initial; flex-flow: unset; values see flex-direction and flex-wrap for details on the values. ...
...w: inherit; flex-flow: initial; flex-flow: unset; values see flex-direction and flex-wrap for details on the values.
formal definition initial valueas each of the properties of the shorthand:flex-direction: rowflex-wrap: nowrapapplies toflex containersinheritednocomputed valueas each of the properties of the shorthand:flex-direction: as specifiedflex-wrap: as specifiedanimation typediscrete
formal syntax <'flex-direction'> | <'flex-wrap'> examples setting column-reverse and wrap element { /* main-axis is the block direction with reversed main-start and main-end. flex items are laid out in multiple lines */ flex-flow: column-reverse wrap; } specifications specification status comment css flexible box layout modulethe definition of 'flex-flow' in that...
flex - CSS: Cascading Style Sheets
width: 110px; min-width: 0; background-color: #1b5385; color: white; font-family: monospace; font-size: 13px; } .initial { flex: initial; } .auto { flex: auto; } .none { flex: none; } .four { flex: 4; } .two { flex: 2; } .one { flex: 1; } by default flex items don't shrink below their minimum content size. to change this, set the item's min-width or min-height. ...
...| <'flex-basis'> ] examples setting flex: auto html <div id="flex-container"> <div class="flex-item" id="flex">flex box (click to toggle raw box)</div> <div class="raw-item" id="raw">raw box</div> </div> css #flex-container { display: flex; flex-direction: row; } #flex-container > .flex-item { flex: auto; } #flex-container > .ra...
float - CSS: Cascading Style Sheets
t float on the right side of its containing block. none the element must not float. inline-start the element must float on the start side of its containing block. that is the left side with ltr scripts, and the right side with rtl scripts. inline-end the element must float on the end side of its containing block. that is the right side with ltr scripts, and the left side with rtl scripts. ...
... is the left side with ltr scripts, and the right side with rtl scripts. inline-end the element must float on the end side of its containing block. that is the right side with ltr scripts, and the left side with rtl scripts.
formal definition initial valuenoneapplies toall elements, but has no effect if the value of display is none.inheritednocomputed valueas specifiedanimation typediscrete
formal syntax left | right | none | inline-start | inline-end examples how floated elements are positioned as mentioned above, when an element is floated, it is taken out of the normal flow of the document (though still remaining part of it). it is shifted to the left, or right, until it touches the edge of its containing box, or another floated element. in this example, there are three colored sq...
font-smooth - CSS: Cascading Style Sheets
ements a similar property, but with different values: -moz-osx-font-smoothing. it only works on mac os x/macos. auto - allow the browser to select an optimization for font smoothing, typically grayscale. grayscale - render text with grayscale antialiasing, as opposed to the subpixel. switching from subpixel rendering to antialiasing for light text on dark backgrounds makes it look lighter. ...
...- allow the browser to select an optimization for font smoothing, typically grayscale. grayscale - render text with grayscale antialiasing, as opposed to the subpixel. switching from subpixel rendering to antialiasing for light text on dark backgrounds makes it look lighter.
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax auto | never | always | <absolute-size> | <length>where <absolute-size> = xx-small | x-small | small | medium | large | x-large | xx-large | xxx-large examples basic usage example the following example shows the safari/chromium and firefox equivalents that turn on font-smoothing on macos. in both cases the smoothed font should look slightly lighter in weight. for those of you not on...
font-stretch - CSS: Cascading Style Sheets
helvetica neue, which is installed by default on macos, has a single condensed face in addition to the normal face. all values of font-stretch less than 100% select the condensed face, while all other values select the normal face. league mono variable is a variable font that offers something like a continuous range of widths for different percentage values of font-stretch. ...
...ect the condensed face, while all other values select the normal face. league mono variable is a variable font that offers something like a continuous range of widths for different percentage values of font-stretch.
formal definition initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typea font stretch
formal syntax <font-stretch-absolute>where <font-stretch-absolute> = normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> examples setting font stretch percentages note that this example will only work in browsers that support <percentage> values. html <div class="container"> <p class="condensed">a...
font-style - CSS: Cascading Style Sheets
slantlabel.textcontent = `font-style: ${slant};`; sampletext.style.fontstyle = slant; } slantinput.addeventlistener('input', update); update(); accessibility concerns large sections of text set with a font-style value of italic may be difficult for people with cognitive concerns such as dyslexia to read. ...
... large sections of text set with a font-style value of italic may be difficult for people with cognitive concerns such as dyslexia to read. mdn understanding wcag, guideline 1.4 explanations w3c understanding wcag 2.1
formal definition initial valuenormalapplies toall elements. ...
font-variation-settings - CSS: Cascading Style Sheets
tps://github.com/mdn/interactive-examples and send us a pull request. syntax /* use the default settings */ font-variation-settings: normal; /* set values for variable font axis names */ font-variation-settings: "xhgt" 0.7; /* global values */ font-variation-settings: inherit; font-variation-settings: initial; font-variation-settings: unset; values this property's value can take one of two
forms: normal text is laid out using default settings. <string> <number> when rendering text, the list of variable font axis names is passed to the text layout engine to enable or disable font features. each setting is always one or more pairs consisting of a <string> of 4 ascii characters followed by a <number> indicating the axis value to set. if the <string> has more or fewer characters or co...
...ere is that axis tags are case-sensitive. in order to use variable fonts on your operating system, you need to make sure that it is up to date. for example linux oses need the latest linux freetype version, and macos prior to 10.13 does not support variable fonts. if your operating system is not up to date, you will not be able to use variable fonts in web pages or the firefox developer tools.
formal definition initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typea trans
form 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. weight (wght) the following live example's css c...
gap (grid-gap) - CSS: Cascading Style Sheets
> followed optionally by a value for <'column-gap'>. if <'column-gap'> is omitted, it’s set to the same value as <'row-gap'>. <'row-gap'> and <'column-gap'> are each specified as a <length> or a <percentage>. values <length> is the width of the gutter separating the grid lines. <percentage> is the width of the gutter separating the grid lines, relative to the dimension of the element. ...
... examples flex layout html <div id="flexbox"> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> </div> css #flexbox { display: flex; flex-wrap: wrap; width: 300px; gap: 20px 5px; } #flexbox > div { border: 1px solid green; background-color: lime; flex: 1 1 auto; width: 100px; height: 50px; } result...
grid-auto-rows - CSS: Cascading Style Sheets
grid container is sized under a minimal content constraint). auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. ...
...ght) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. ...
grid-template - CSS: Cascading Style Sheets
ed). note: the repeat() function isn’t allowed in these track listings, as the tracks are intended to visually line up one-to-one with the rows/columns in the “ascii art”. note: the grid shorthand accepts the same syntax, but also resets the implicit grid properties to their initial values. use grid (as opposed to grid-template) to prevent these values from cascading in seperately. ...
...<string> <track-size>? <line-names>? ]+ [ / <explicit-track-list> ]?where <line-names> = '[' <custom-ident>* ']'<track-size> = <track-breadth> | minmax( <inflexible-breadth> , <track-breadth> ) | fit-content( [ <length> | <percentage> ] )<explicit-track-list> = [ <line-names>? <track-size> ]+ <line-names>?wh...
grid - CSS: Cascading Style Sheets
up an auto-flow by setting the column tracks explicitly via the grid-template-columns property (and the grid-template-rows property to none) and specifying how to auto-repeat the row tracks via grid-auto-rows (and setting grid-auto-columns to auto). grid-auto-flow is also set to row accordingly, with dense if it’s specified. all other grid sub-properties are reset to their initial values. ...
...] <'grid-auto-columns'>? | [ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'> examples creating a grid layout html <div id="container"> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> </div> css #container { display: grid; grid...
height - CSS: Cascading Style Sheets
: initial; height: unset; values <length> defines the height as an absolute value. <percentage> defines the height as a percentage of the containing block's height. auto the browser will calculate and select a height for the specified element. max-content the intrinsic preferred height. min-content the intrinsic minimum height. fit-content(<length-percentage>) uses the fit-content
formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, )). accessibility concerns ensure that elements set with a height are not truncated and/or do not obscure other content when the page is zoomed to increase text size. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 fo...
...enerated box's containing block. if the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the value computes to auto. a percentage height on the root element is relative to the initial containing block.computed valuea percentage or auto or the absolute lengthanimation typea length, percentage or calc();
formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting height using pixels and percentages html <div id="taller">i'm 50 pixels tall.</div> <div id="shorter">i'm 25 pixels tall.</div> <div id="parent"> <div id="child"> i'm half the height of my parent. </div> </div> cs...
hyphens - CSS: Cascading Style Sheets
please clone https://github.com/mdn/interactive-examples and send us a pull request. hyphenation rules are language-specific. in html, the language is determined by the lang attribute, and browsers will hyphenate only if this attribute is present and the appropriate hyphenation dictionary is available. in xml, the xml:lang attribute must be used. note: the rules defining how hyphenation is per
formed are not explicitly defined by the specification, so the exact hyphenation may vary from browser to browser. syntax /* keyword values */ hyphens: none; hyphens: manual; hyphens: auto; /* global values */ hyphens: inherit; hyphens: initial; hyphens: unset; the hyphens property is specified as a single keyword value chosen from the list below. values none words are not broken at line br...
...ak opportunity. even if the line is not actually broken at that point, the hyphen is still rendered. u+00ad (shy) an invisible, "soft" hyphen. this character is not rendered visibly; instead, it marks a place where the browser should break the word if hyphenation is necessary. in html, use ­ to insert a soft hyphen. when the html <wbr> element leads to a line break, no hyphen is added.
formal definition initial valuemanualapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax none | manual | auto examples specifying text hyphenation this example uses three classes, one for each possible configuration of the hyphens property. html <dl> <dt><code>none</code>: no hyphen; overflow if needed</dt> <dd lang="en" class="none">an extreme&...
image() - CSS: Cascading Style Sheets
ly semi-transparent) colors over other images. the size of the color swatch can be set with the background-size property. this is different from the background-color, which sets a color to cover the entire element. both image(color) and background-color placements are impacted by the background-clip and background-origin properties. accessibility concerns browsers do not provide any special in
formation on background images to assistive technology. this is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. if the image contains in
formation critical to understanding the page's overall purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations unders...
...t items — those with dir="ltr" set on the element itself or inheriting the directionality from an ancestor or default value for the page — the image will be used as-is. list items with dir="rtl" set on the <li> or inheriting the right-to-left directionality from an ancestor, such as documents set to arabic or hebrew, will have the bullet display on the right, horizontally flippled, as if trans
form: scalex(-1) had been set. the text will also be displayed left-to-right. displaying a section of the background image <div class="box">hover over me. what cursor do you see?</div> .box:hover { cursor: image("https://mdn.mozillademos.org/files/16411/sprite.png#xywh=32,64,16,16"); } when the user hovers over the box, the cursor will change to display the 16x16 px section of the sprite imag...
initial-letter-align - CSS: Cascading Style Sheets
hanging. alphabetic as described above, the cap height of the initial letter aligns with the cap height of the first line of text. the baseline of the initial letter aligns with the baseline of the nth text baseline. hanging the hanging baseline of the initial letter aligns with the hanging baseline of the first line of text. ideographic the initial letter is centered in the n-line area. ...
...seline of the nth text baseline. hanging the hanging baseline of the initial letter aligns with the hanging baseline of the first line of text. ideographic the initial letter is centered in the n-line area. ...
initial-letter - CSS: Cascading Style Sheets
ial initial-letter effect. text behaves as normal. <number> defines the size of the initial letter, in terms of how many lines it occupies. negative values are not allowed. <integer> defines the number of lines the initial letter should sink when the size of it is given. values must be greater than zero. if omitted, it duplicates the size value, floored to the nearest positive whole number. ...
...fines the number of lines the initial letter should sink when the size of it is given. values must be greater than zero. if omitted, it duplicates the size value, floored to the nearest positive whole number. ...
inline-size - CSS: Cascading Style Sheets
nline-size: inherit; inline-size: initial; inline-size: unset; if the writing mode is vertically oriented, the value of inline-size relates to the height of the element; otherwise, it relates to the width of the element. a related property is block-size, which defines the other dimension of the element. values the inline-size property takes the same values as the width and height properties. ...
...f the element. a related property is block-size, which defines the other dimension of the element. values the inline-size property takes the same values as the width and height properties.
formal definition initial valueautoapplies tosame as width and heightinheritednopercentagesinline-size of containing blockcomputed valuesame as width and heightanimation typea length, percentage or calc();
formal syntax <'width'> examples setting inline size in pixels html <p class="exampletext">example text</p> css .exampletext { writing-mode: vertical-rl; background-color: yellow; inline-size: 110px; } result specifications specification status comment css logical properties and values level 1the definition of 'inline-size' in that specification. edito...
inset-block-end - CSS: Cascading Style Sheets
ation. /* <length> values */ inset-block-end: 3px; inset-block-end: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-block-end: 10%; /* keyword value */ inset-block-end: auto; /* global values */ inset-block-end: inherit; inset-block-end: initial; inset-block-end: unset; syntax values the inset-block-end property takes the same values as the left property. ...
... initial; inset-block-end: unset; syntax values the inset-block-end property takes the same values as the left property. ...
inset-block-start - CSS: Cascading Style Sheets
th> values */ inset-block-start: 3px; inset-block-start: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-block-start: 10%; /* keyword value */ inset-block-start: auto; /* global values */ inset-block-start: inherit; inset-block-start: initial; inset-block-start: unset; syntax values the inset-block-start property takes the same values as the left property. ...
...tial; inset-block-start: unset; syntax values the inset-block-start property takes the same values as the left property. ...
inset-block - CSS: Cascading Style Sheets
h or height of the containing block */ inset-block: 10% 5%; /* keyword value */ inset-block: auto; /* global values */ inset-block: inherit; inset-block: initial; inset-block: unset; constituent properties this property is a shorthand for the following css properties: inset-block-end inset-block-start syntax values the inset-block property takes the same values as the left property. ...
... inset-block-end inset-block-start syntax values the inset-block property takes the same values as the left property. ...
inset-inline-end - CSS: Cascading Style Sheets
ercentage>s of the width or height of the containing block */ inset-inline-end: 10%; /* keyword value */ inset-inline-end: auto; /* global values */ inset-inline-end: inherit; inset-inline-end: initial; inset-inline-end: unset; the shorthand for inset-inline-start and inset-inline-end is inset-inline. syntax values the inset-inline-end property takes the same values as the left property. ...
... inset-inline-end is inset-inline. syntax values the inset-inline-end property takes the same values as the left property. ...
inset-inline-start - CSS: Cascading Style Sheets
of the width or height of the containing block */ inset-inline-start: 10%; /* keyword value */ inset-inline-start: auto; /* global values */ inset-inline-start: inherit; inset-inline-start: initial; inset-inline-start: unset; the shorthand for inset-inline-start and inset-inline-end is inset-inline. syntax values the inset-inline-start property takes the same values as the left property. ...
...nset-inline-end is inset-inline. syntax values the inset-inline-start property takes the same values as the left property. ...
inset-inline - CSS: Cascading Style Sheets
ght of the containing block */ inset-inline: 10% 5%; /* keyword value */ inset-inline: auto; /* global values */ inset-inline: inherit; inset-inline: initial; inset-inline: unset; constituent properties this property is a shorthand for the following css properties: inset-inline-end inset-inline-start syntax values the inset-inline property takes the same values as the left property. ...
... inset-inline-end inset-inline-start syntax values the inset-inline property takes the same values as the left property. ...
inset - CSS: Cascading Style Sheets
et: 5px 15px 10px; /* top left/right bottom */ inset: 2.4em 3em 3em 3em; /* top right bottom left */ /* <percentage>s of the width (left/right) or height (top/bottom) of the containing block */ inset: 10% 5% 5% 5%; /* keyword value */ inset: auto; /* global values */ inset: inherit; inset: initial; inset: unset; syntax values the inset property takes the same values as the left property. ...
...set: inherit; inset: initial; inset: unset; syntax values the inset property takes the same values as the left property. ...
isolation - CSS: Cascading Style Sheets
de. syntax /* keyword values */ isolation: auto; isolation: isolate; /* global values */ isolation: inherit; isolation: initial; isolation: unset; the isolation property is specified as one of the keyword values listed below. values auto a new stacking context is created only if one of the properties applied to the element requires it. isolate a new stacking context must be created. ...
... listed below. values auto a new stacking context is created only if one of the properties applied to the element requires it. isolate a new stacking context must be created.
formal definition initial valueautoapplies toall elements. ...
justify-content - CSS: Cascading Style Sheets
nt keyword. if the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes of the item and alignment container, and regardless of whether overflow which causes data loss might happen, the given alignment value is honored. ...
...ad aligned as if the alignment mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes of the item and alignment container, and regardless of whether overflow which causes data loss might happen, the given alignment value is honored. ...
left - CSS: Cascading Style Sheets
property has no effect. when both left and right are defined, and width constraints don't prevent it, the element will stretch to satisfy both. if the element cannot stretch to satisfy both, the position of the element is overspecified. when this is the case, the left value has precedence when the container is left-to-right; the right value has precedence when the container is right-to-left. ...
...ft-to-right; the right value has precedence when the container is right-to-left. ...
letter-spacing - CSS: Cascading Style Sheets
he point where the word(s) may be unrecognizable. legible letter-spacing must be determined on a case-by-case basis, as different font families have different character widths. there is no one value that can ensure all font families automatically maintain their legibility. ...
...ically maintain their legibility. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.8 | w3c understanding wcag 2.0
formal definition initial valuenormalapplies toall elements. ...
line-height - CSS: Cascading Style Sheets
ight of the current block. accessibility concerns use a minimum value of 1.5 for line-height for main paragraph content. this will help people experiencing low vision conditions, as well as people with cognitive concerns such as dyslexia. if the page is zoomed to increase the text size, using a unitless value ensures that the line height will scale proportionately. ...
...lue ensures that the line height will scale proportionately. w3c understanding wcag 2.1
formal definition initial valuenormalapplies toall elements. ...
list-style-image - CSS: Cascading Style Sheets
keyword values */ list-style-image: none; /* <url> values */ list-style-image: url('starsolid.gif'); /* global values */ list-style-image: inherit; list-style-image: initial; list-style-image: unset; values <url> location of image to use as the marker. none specifies that no image is used as the marker. if this value is set, the marker defined in list-style-type will be used instead. ...
... list-style-image: initial; list-style-image: unset; values <url> location of image to use as the marker. none specifies that no image is used as the marker. 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 e...
list-style - CSS: Cascading Style Sheets
to ensure the list is recognized properly. this ensures the design is unaffected by the bug fix and that list items are not improperly described. ...
...nding wcag 2.0
formal definition initial valueas each of the properties of the shorthand:list-style-type: disclist-style-position: outsidelist-style-image: noneapplies tolist itemsinheritedyescomputed valueas each of the properties of the shorthand:list-style-image: none or the image with its uri made absolutelist-style-position: as specifiedlist-style-type: as specifiedanimation typediscrete
formal syntax <'list-style-type'> | <'list-style-position'> | <'list-style-image'> examples setting list style type and position html list 1 <ul class="one"> <li>list item1</li> <li>list item2</li> <li>list item3</li> </ul> list 2 <ul class="two"> <li>list item a</li> <li>list item b</li> <li>list item c</li> </ul> css .one { list-style: circle; } .two { list-style: square ins...
margin-block-end - CSS: Cascading Style Sheets
nd: unset; it corresponds to the margin-top, margin-right, margin-bottom, or margin-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to margin-block-start, margin-inline-start, and margin-inline-end, which define the other margins of the element. values the margin-block-end property takes the same values as the margin-left property. ...
... define the other margins of the element. values the margin-block-end property takes the same values as the margin-left property. ...
margin-block-start - CSS: Cascading Style Sheets
rt: unset; it corresponds to the margin-top, margin-right, margin-bottom, or margin-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to margin-block-end, margin-inline-start, and margin-inline-end, which define the other margins of the element. values the margin-block-start property takes the same values as the margin-left property. ...
...efine the other margins of the element. values the margin-block-start property takes the same values as the margin-left property. ...
margin-block - CSS: Cascading Style Sheets
s corresponds to the margin-top and margin-bottom, or margin-right, and margin-left property depending on the values defined for writing-mode, direction, and text-orientation. constituent properties this property is a shorthand for the following css properties: margin-block-end margin-block-start syntax values the margin-block property takes the same values as the margin-left property. ...
...margin-block-end margin-block-start syntax values the margin-block property takes the same values as the margin-left property. ...
margin-bottom - CSS: Cascading Style Sheets
ial; margin-bottom: unset; the margin-bottom property is specified as the keyword auto, or a <length>, or a <percentage>. its value can be positive, zero, or negative. values <length> the size of the margin as a fixed value. <percentage> the size of the margin as a percentage, relative to the width of the containing block. auto the browser selects a suitable value to use. see margin. ...
...r selects a suitable value to use. see margin.
formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table. ...
margin-inline-end - CSS: Cascading Style Sheets
est block container's width */ /* keyword values */ margin-inline-end: auto; /* global values */ margin-inline-end: inherit; margin-inline-end: initial; margin-inline-end: unset; it relates to margin-block-start, margin-block-end, and margin-inline-start, which define the other margins of the element. values the margin-inline-end property takes the same values as the margin-left property. ...
...efine the other margins of the element. values the margin-inline-end property takes the same values as the margin-left property. ...
margin-inline-start - CSS: Cascading Style Sheets
margin-inline-start: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-inline-start: auto; /* global values */ margin-inline-start: inherit; it relates to margin-block-start, margin-block-end, and margin-inline-end, which define the other margins of the element. values the margin-inline-start property takes the same values as the margin-left property. ...
...efine the other margins of the element. values the margin-inline-start property takes the same values as the margin-left property. ...
margin-inline - CSS: Cascading Style Sheets
esponds to the margin-top and margin-bottom, or margin-right, and margin-left properties, depending on the values defined for writing-mode, direction, and text-orientation. constituent properties this property is a shorthand for the following css properties: margin-inline-end margin-inline-start syntax values the margin-inline property takes the same values as the margin-left property. ...
...gin-inline-end margin-inline-start syntax values the margin-inline property takes the same values as the margin-left property. ...
margin-left - CSS: Cascading Style Sheets
argin-left and margin-right are set to auto. in this case, it is set to the value centering the border area inside the available width, if fixed. absolutely positioned layout mode flex, inline-flex any any 0, except if there is any positive horizontal free space. in this case, it is evenly distributed to all horizontal auto margins. ...
...to margins. 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. working draft no significant change from css 2.1...
margin-right - CSS: Cascading Style Sheets
argin-left and margin-right are set to auto. in this case, it is set to the value centering the border area inside the available width, if fixed. absolutely positioned layout mode flex, inline-flex any any 0, except if there is any positive horizontal free space. in this case, it is evenly distributed to all horizontal auto margins. ...
...to margins. 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. working draft no significant change ...
margin-top - CSS: Cascading Style Sheets
: initial; margin-top: unset; the margin-top property is specified as the keyword auto, or a <length>, or a <percentage>. its value can be positive, zero, or negative. values <length> the size of the margin as a fixed value. <percentage> the size of the margin as a percentage, relative to the width of the containing block. auto the browser selects a suitable value to use. see margin. ...
...r selects a suitable value to use. see margin.
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. working draft no significa...
margin-trim - CSS: Cascading Style Sheets
here they adjoin the container’s edges. syntax none margins are not trimmed by the container. in-flow for in-flow boxes contained by this box, block-axis margins adjacent to the box's edges are truncated to zero. it also truncates any margins collapsed with such a margin. all trims the margins of in-flow boxes and floats whose margins coincide with the container's content edge. ...
... truncated to zero. it also truncates any margins collapsed with such a margin. all trims the margins of in-flow boxes and floats whose margins coincide with the container's content edge.
formal definition initial valuenoneapplies toblock containers and multi-column containers. ...
margin - CSS: Cascading Style Sheets
r values are specified, the margins apply to the top, right, bottom, and left in that order (clockwise). values <length> the size of the margin as a fixed value. <percentage> the size of the margin as a percentage, relative to the width of the containing block. auto the browser selects a suitable margin to use. for example, in certain cases this value can be used to center an element. ...
...y: flex; justify-content: center; . however, in older browsers like ie8-9 that do not support flexible box layout, these are not available. in order to center an element inside its parent, use margin: 0 auto;. margin collapsing elements' top and bottom margins are sometimes collapsed into a single margin that is equal to the larger of the two margins. see mastering margin collapsing for more in
formation. specifications specification status comment css basic box modelthe definition of 'margin' in that specification. working draft no significant change. css level 2 (revision 1)the definition of 'margin' in that specification. recommendation removes the effect of top and bottom margins on inline elements. css level 1the definition of ...
mask-border-source - CSS: Cascading Style Sheets
o the final mask border. syntax /* keyword value */ mask-border-source: none; /* <image> values */ mask-border-source: url(image.jpg); mask-border-source: linear-gradient(to top, red, yellow); /* global values */ mask-border-source: inherit; mask-border-source: initial; mask-border-source: unset; values none no mask border is used. <image> image reference to use for the mask border. ...
...border-source: initial; mask-border-source: unset; values none no mask border is used. <image> image reference to use for the mask border. ...
mask-border-width - CSS: Cascading Style Sheets
not be negative. <number> the width of the mask border, specified as a multiple of the corresponding border-width. must not be negative. auto the width of the mask border is made equal to the intrinsic width or height (whichever is applicable) of the corresponding mask-border-slice. if the image does not have the required intrinsic dimension, the corresponding border-width is used instead. ...
... dimension, the corresponding border-width is used instead.
formal definition initial valueautoapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesrelative to width/height of the mask border image areacomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete
formal syntax [ <length-percentage> | <number> | auto ]{1,4}where <length-percentage> = <length> | <percentage> examples basic usage this property doesn't appear to be supported anywhere yet. when it eventually starts to be supported, it will serve to define the width of the border mask — setting this to a different value to mask-border-slice will cause the slices to be scaled to fit the border ...
mask-border - CSS: Cascading Style Sheets
e element's outside edge. up to four values may be specified. see mask-border-outset. <'mask-border-repeat'> defines how the edge regions of the source image are adjusted to fit the dimensions of the border mask. up to two values may be specified. see mask-border-repeat. <'mask-border-mode'> defines whether the source image is treated as a luminance mask or alpha mask. see mask-border-mode. ...
...the source for the mask is a ".png" file of 90 by 90 pixels, with three diamonds going vertically and horizontall...
mask-clip - CSS: Cascading Style Sheets
attribute and the dimension of the reference box is set to the width and height values of the viewbox attribute. no-clip the painted content is not clipped. border this keyword behaves the same as border-box. padding this keyword behaves the same as padding-box. content this keyword behaves the same as content-box. text this keyword clips the mask image to the text of the element. ...
...ng this keyword behaves the same as padding-box. content this keyword behaves the same as content-box. text this keyword clips the mask image to the text of the element. ...
mask-composite - CSS: Cascading Style Sheets
he current mask layer is referred to as source, while all layers below it are referred to as destination. add the source is placed over the destination. subtract the source is placed, where it falls outside of the destination. intersect the parts of source that overlap the destination, replace the destination. exclude the non-overlapping regions of source and destination are combined. ...
...of the destination. intersect the parts of source that overlap the destination, replace the destination. exclude the non-overlapping regions of source and destination are combined. ...
mask-image - CSS: Cascading Style Sheets
ltiple values */ mask-image: image(url(mask.png), skyblue), linear-gradient(rgba(0, 0, 0, 1.0), transparent); /* global values */ mask-image: inherit; mask-image: initial; mask-image: unset; syntax values none this keyword is interpreted as a transparent black image layer. <mask-source> a <url> reference to a <mask> or to a css image. <image> an image value used as mask image layer. ...
...transparent black image layer. <mask-source> a <url> reference to a <mask> or to a css image. <image> an image value used as mask image layer. ...
mask-mode - CSS: Cascading Style Sheets
ed as the mask values. luminance this keyword indicates that the luminance values of the mask layer image should be used as the mask values. 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. ...
...ance 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. ...
mask-origin - CSS: Cascading Style Sheets
rence box. if a viewbox attribute is specified for the element creating the svg viewport, the reference box is positioned at the origin of the coordinate system established by the viewbox attribute and the dimension of the reference box is set to the width and height values of the viewbox attribute. content same as content-box. padding same as padding-box. border same as border-box. ...
...he reference box is set to the width and height values of the viewbox attribute. content same as content-box. padding same as padding-box. border same as border-box. ...
mask-position - CSS: Cascading Style Sheets
ition: 1rem 1rem, center; /* global values */ mask-position: inherit; mask-position: initial; mask-position: unset; syntax one or more <position> values, separated by commas. values <position> one to four values representing a 2d position regarding the edges of the element's box. relative or absolute offsets can be given. note that the position can be set outside of the element's box. ...
...| [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]where <length-percentage> = <length> | <percentage> examples setting mask position css #wrapper { border: 1px ...
mask-repeat - CSS: Cascading Style Sheets
iginal width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added. they will then compress to 225px. no-repeat the image is not repeated (and hence the mask painting area will not necessarily be entirely covered). the position of the non-repeated mask image is defined by the mask-position css property. ...
...rea will not necessarily be entirely covered). the position of the non-repeated mask image is defined by the mask-position css property. ...
mask-size - CSS: Cascading Style Sheets
e specified dimension and compute the other dimension from the specified dimension and the intrinsic proportion. if the image has no intrinsic proportion, use the specified dimension for that dimension. for the other dimension, use the image's corresponding intrinsic dimension if there is one. if there is no such intrinsic dimension, use the corresponding dimension of the mask positioning area. ...
...imension, use the corresponding dimension of the mask positioning area. ...
mask-type - CSS: Cascading Style Sheets
the mask-type property is specified as one of the keyword values listed below. values luminance is a keyword indicating that the associated mask image is a luminance mask, i.e., that its relative luminance values must be used when applying it. alpha is a keyword indicating that the associated mask image is an alpha mask, i.e., that its alpha channel values must be used when applying it. ...
...hat the associated mask image is a luminance mask, i.e., that its relative luminance values must be used when applying it. alpha is a keyword indicating that the associated mask image is an alpha mask, i.e., that its alpha channel values must be used when applying it. ...
mask - CSS: Cascading Style Sheets
try-box> if only one <geometry-box> value is given, it sets both mask-origin and mask-clip. if two <geometry-box> values are present, then the first sets mask-origin and the second sets mask-clip. <geometry-box> | no-clip sets the area that is affected by the mask image. see mask-clip. <compositing-operator> sets the compositing operation used on the current mask layer. see mask-composite. ...
...| <repeat-style> | <geometry-box> | [ <geometry-box> | no-clip ] | <compositing-operator> | <masking-mode>where <mask-reference> = none | <image> | <mask-source><position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <l...
max-inline-size - CSS: Cascading Style Sheets
25em; /* <percentage> values */ max-inline-size: 75%; /* keyword values */ max-inline-size: auto; max-inline-size: max-content; max-inline-size: min-content; max-inline-size: fit-content(20em); /* global values */ max-inline-size: inherit; max-inline-size: initial; max-inline-size: unset; values the max-inline-size property takes the same values as the max-width and max-height properties. ...
...s */ max-inline-size: inherit; max-inline-size: initial; max-inline-size: unset; values the max-inline-size property takes the same values as the max-width and max-height properties. ...
min-block-size - CSS: Cascading Style Sheets
al; min-block-size: unset; if the writing mode is vertically oriented, the value of min-block-size relates to the minimum width of the element; otherwise, it relates to the minimum height of the element. a related property is min-inline-size, which defines the other dimension of the element. values the min-block-size property takes the same values as the min-width and min-height properties. ...
...ted property is min-inline-size, which defines the other dimension of the element. values the min-block-size property takes the same values as the min-width and min-height properties. ...
min-height - CSS: Cascading Style Sheets
min-height as an absolute value. <percentage> defines the min-height as a percentage of the containing block's height. auto the browser will calculate and select a min-height for the specified element. none no limit on the size of the box. max-content the intrinsic preferred min-height. min-content the intrinsic minimum min-height. fit-content(<length-percentage>) uses the fit-content
formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)).
formal definition initial valueautoapplies toall elements but non-replaced inline elements, table columns, and column groupsinheritednopercentagesthe percentage is calculated with respect to the height of the generated box's containing block. if the height of the containing block ...
...agesthe percentage is calculated with respect to the height of the generated box's containing block. if the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as 0.computed valuethe percentage as specified or the absolute lengthanimation typea length, percentage or calc();
formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting min-height table { min-height: 75%; }
form { min-height: 0; } specifications specification status comment css box sizing module level 4the definition of 'min-height' in that specification. ...
min-inline-size - CSS: Cascading Style Sheets
; min-inline-size: unset; if the writing mode is vertically oriented, the value of min-inline-size relates to the minimum height of the element; otherwise, it relates to the minimum width of the element. a related property is min-block-size, which defines the other dimension of the element. values the min-inline-size property takes the same values as the min-width and min-height properties. ...
...ed property is min-block-size, which defines the other dimension of the element. values the min-inline-size property takes the same values as the min-width and min-height properties. ...
object-fit - CSS: Cascading Style Sheets
placed content is sized to fill the element’s content box. the entire object will completely fill the box. if the object's aspect ratio does not match the aspect ratio of its box, then the object will be stretched to fit. none the replaced content is not resized. scale-down the content is sized as if none or contain were specified, whichever would result in a smaller concrete object size. ...
... aspect ratio does not match the aspect ratio of its box, then the object will be stretched to fit. none the replaced content is not resized. scale-down the content is sized as if none or contain were specified, whichever would result in a smaller concrete object size. ...
object-position - CSS: Cascading Style Sheets
<position> values */ object-position: center top; object-position: 100px 50px; /* global values */ object-position: inherit; object-position: initial; object-position: unset; values <position> from one to four values that define the 2d position of the element. relative or absolute offsets can be used. note: the position can be set so that the replaced element is drawn outside its box. ...
... the 2d position of the element. relative or absolute offsets can be used. note: the position can be set so that the replaced element is drawn outside its box. ...
offset - CSS: Cascading Style Sheets
et: path('m 100 100 l 300 100 l 200 300 z'); offset: url(arc.svg); /* offset path with distance and/or rotation */ offset: url(circle.svg) 100px; offset: url(circle.svg) 40%; offset: url(circle.svg) 30deg; offset: url(circle.svg) 50px 20deg; /* including offset anchor */ offset: ray(45deg closest-side) / 40px 20px; offset: url(arc.svg) 2cm / 0.5cm 3cm; offset: url(arc.svg) 30deg / 50px 100px;
formal definition initial valueas each of the properties of the shorthand:offset-position: autooffset-path: noneoffset-distance: 0offset-anchor: autooffset-rotate: autoapplies totrans
formable elementsinheritednopercentagesas each of the properties of the shorthand:offset-position: refertosizeofcontainingblockoffset-distance: refer to the total path lengthoffset-anchor: relativetowidthandheightcompute...
...[ / <'offset-anchor'> ]? examples animating an element along a path html <div id="offsetelement"></div> css @keyframes move { from { offset-distance: 0%; } to { offset-distance: 100%; } } #offsetelement { width: 50px; height: 50px; background-color: blue; offset: ...
opacity - CSS: Cascading Style Sheets
color values. in order to meet current web content accessibility guidelines (wcag), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. large text is defined as 18.66px and bold or larger, or 24px or larger. ...
... such as headings. large text is defined as 18.66px and bold or larger, or 24px or larger. ...
outline-offset - CSS: Cascading Style Sheets
tween the element and its outline. a negative value places the outline inside the element. a value of 0 places the outline so that there is no space between it and the element. description an outline is a line that is drawn around an element, outside the border edge. the space between an element and its outline is transparent. in other words, it is the same as the parent element's background. ...
.... description an outline is a line that is drawn around an element, outside the border edge. the space between an element and its outline is transparent. in other words, it is the same as the parent element's background. ...
outline-style - CSS: Cascading Style Sheets
two lines and the space between them. groove the outline looks as though it were carved into the page. ridge the opposite of groove: the outline looks as though it were extruded from the page. inset the outline makes the box look as though it were embedded in the page. outset the opposite of inset: the outline makes the box look as though it were coming out of the page. ...
... the opposite of groove: the outline looks as though it were extruded from the page. inset the outline makes the box look as though it were embedded in the page. outset the opposite of inset: the outline makes the box look as though it were coming out of the page.
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax auto | <'border-style'> examples setting outline style to auto the auto value indicates a custom outline style — typically a style [that] is either a user interface default for the plat
form, or perhaps a style that is richer than can be described in detail in css, e.g. a rounded edge outline with semi-translucent outer pixels that appears to glow. html <div> <p class="auto">out...
outline-width - CSS: Cascading Style Sheets
listed below. values <length> the width of the outline specified as a <length>. thin depends on the user agent. typically equivalent to 1px in desktop browsers (including firefox). medium depends on the user agent. typically equivalent to 3px in desktop browsers (including firefox). thick depends on the user agent. typically equivalent to 5px in desktop browsers (including firefox). ...
...). medium depends on the user agent. typically equivalent to 3px in desktop browsers (including firefox). thick depends on the user agent. typically equivalent to 5px in desktop browsers (including firefox). ...
outline - CSS: Cascading Style Sheets
heir initial value. accessibility concerns assigning outline a value of 0 or none will remove the browser's default focus style. if an element can be interacted with it must have a visible focus indicator. provide obvious focus styling if the default focus style is removed. how to design useful and usable focus indicators wcag 2.1: understanding success criterion 2.4.7: focus visible
formal definition initial valueas each of the properties of the shorthand:outline-color: invert, for browsers supporting it, currentcolor for the otheroutline-style: noneoutline-width: mediumapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:outline-color: for the keyword invert, the computed value is invert. for the color value, if the value is translucent, the...
...e computed value will be the rgba() corresponding one. if it isn't, it will be the rgb() corresponding one. ...
overscroll-behavior-x - CSS: Cascading Style Sheets
scroll overflow behavior occurs as normal. contain default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented. ...
... no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented.
formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax contain | none | auto examples preventing an underlying element from scrolling horizontally in our simple overscroll-behavior-x example (see source code also), we have two block-level boxes, one inside the other. the outer box has a large width set on it so the page will scroll horizontally. the inner box has a small width (and height) set on it so it sits comforably inside the viewp...
overscroll-behavior-y - CSS: Cascading Style Sheets
scroll overflow behavior occurs as normal. contain default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented. ...
... no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented.
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. specifications specification status comment css overscroll behavior module level 1the definition of 'overscroll-behavior-...
overscroll-behavior - CSS: Cascading Style Sheets
scroll overflow behavior occurs as normal. contain default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented. ...
... no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented.
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. both of these areas scroll; normally if you scrolled the chat window until you hit a scroll boundary, the underlying contacts window would star...
padding-block-end - CSS: Cascading Style Sheets
lock-end property takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-inline-start, and padding-inline-end, which define the other paddings of the element. ...
..., or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-inline-start, and padding-inline-end, which define the other paddings of the element. ...
padding-block-start - CSS: Cascading Style Sheets
lock-start property takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-end, padding-inline-start, and padding-inline-end, which define the other paddings of the element. ...
...om, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-end, padding-inline-start, and padding-inline-end, which define the other paddings of the element. ...
padding-block - CSS: Cascading Style Sheets
ponds to the padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-orientation. constituent properties this property is a shorthand for the following css properties: padding-block-end padding-block-start syntax values the padding-block property takes the same values as the padding-left property. ...
...orientation. constituent properties this property is a shorthand for the following css properties: padding-block-end padding-block-start syntax values the padding-block property takes the same values as the padding-left property. ...
padding-bottom - CSS: Cascading Style Sheets
bottom: initial; padding-bottom: unset; the padding-bottom property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. <percentage> the size of the padding as a percentage, relative to the width of the containing block. must be nonnegative. ...
... working draft no change. ...
padding-inline-end - CSS: Cascading Style Sheets
nline-end property takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-block-end, and padding-inline-start, which define the other paddings of the element. ...
...m, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-block-end, and padding-inline-start, which define the other paddings of the element. ...
padding-inline-start - CSS: Cascading Style Sheets
nline-start property takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-block-end, and padding-inline-end, which define the other paddings of the element. ...
...tom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-block-end, and padding-inline-end, which define the other paddings of the element. ...
padding-inline - CSS: Cascading Style Sheets
rthand for the following css properties: padding-inline-end padding-inline-start syntax values the padding-inline property takes the same values as the padding-left property. description values for this property correspond to the padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-orientation. ...
... padding-left property. description values for this property correspond to the padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-orientation. ...
padding-left - CSS: Cascading Style Sheets
dding-left: initial; padding-left: unset; the padding-left property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. <percentage> the size of the padding as a percentage, relative to the width of the containing block. must be nonnegative. ...
... working draft no change. ...
padding-right - CSS: Cascading Style Sheets
ng-right: initial; padding-right: unset; the padding-right property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. <percentage> the size of the padding as a percentage, relative to the width of the containing block. must be nonnegative. ...
... working draft no change. ...
padding-top - CSS: Cascading Style Sheets
padding-top: initial; padding-top: unset; the padding-top property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. <percentage> the size of the padding as a percentage, relative to the width of the containing block. must be nonnegative. ...
... working draft no change. ...
padding - CSS: Cascading Style Sheets
ues are specified, the first padding applies to the top, the second to the right and left, the third to the bottom. when four values are specified, the paddings apply to the top, right, bottom, and left in that order (clockwise). values <length> the size of the padding as a fixed value. <percentage> the size of the padding as a percentage, relative to the width of the containing block.
formal definition initial valueas each of the properties of the shorthand:padding-bottom: 0padding-left: 0padding-right: 0padding-top: 0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column. it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valueas...
...eritednopercentagesrefer to the width of the containing blockcomputed valueas each of the properties of the shorthand:padding-bottom: the percentage as specified or the absolute lengthpadding-left: the percentage as specified or the absolute lengthpadding-right: the percentage as specified or the absolute lengthpadding-top: the percentage as specified or the absolute lengthanimation typea length
formal syntax [ <length> | <percentage> ]{1,4} examples setting padding with pixels html <h4>this element has moderate padding.</h4> <h3>the padding is huge in this element!</h3> css h4 { background-color: lime; padding: 20px 50px; } h3 { background-color: cyan; padding: 110px 50px 50px 110px; } result setting padding with pixels and percentages padding: 5%; /* al...
page-break-inside - CSS: Cascading Style Sheets
nside property is now a legacy property, replaced by break-inside. for compatibility reasons, page-break-inside should be treated by browsers as an alias of break-inside. this ensures that sites using page-break-inside continue to work as designed. ...
...designed. a subset of values should be aliased as follows: page-break-inside break-inside auto auto avoid avoid
formal definition initial valueautoapplies toblock-level elements in the normal flow of the root element. ...
paint-order - CSS: Cascading Style Sheets
ropriate when drawing svg shapes involving the use of the marker-* properties (e.g. marker-start) and <marker> element. they do not apply to html text, so in that case, you can only determine the order of stroke and fill. values normal paint the different items in normal paint order. stroke, fill, markers specify some or all of these values in the order you want them to be painted in. ...
...y do not apply to html text, so in that case, you can only determine the order of stroke and fill. values normal paint the different items in normal paint order. stroke, fill, markers specify some or all of these values in the order you want them to be painted in. ...
place-content - CSS: Cascading Style Sheets
e main-end edge and the last item, are all exactly the same. ...
...lignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container
formal definition initial valuenormalapplies tomulti-line flex containersinheritednocomputed valueas specifiedanimation typediscrete
formal syntax <'align-content'> <'justify-content'>? examples placing content in a flex container html <div id="container"> <div class="small">lorem</div> <div class="small">lorem<br/>ipsum</div> <div class="large">lorem</div> <div class="large">lorem<br/>impsum</div> <div class="large"></div> <div class="large"></div> </div> <code>writing-mode:</code><select id="writingmode"> <o...
place-items - CSS: Cascading Style Sheets
first baseline is start, the one for last baseline is end. stretch if the combined size of the items is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container. ...
...max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container. ...
place-self - CSS: Cascading Style Sheets
if the combined size of the items along the cross axis is less than the size of the alignment container and the item is auto-sized, its size is increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size of all auto-sized items exactly fills the alignment container along the cross axis. ...
...ch of the properties of the shorthand:align-self: auto computes to itself on absolutely-positioned elements, and to the computed value of align-items on the parent (minus any legacy keywords) on all other boxes, or start if the box has no parent. its behavior depends on the layout model, as described for justify-self. otherwise the specified value.justify-self: as specifiedanimation typediscrete
formal syntax <'align-self'> <'justify-self'>? examples simple demonstration in the following example we have a simple 2 x 2 grid layout. initially the grid container has justify-items and align-items values of stretch — the defaults — which causes the grid items to stretch across the entire width of their cells. the second, third, and fourth grid items are then given different values of plac...
repeating-conic-gradient() - CSS: Cascading Style Sheets
o color stops by adding a color hint, indicating where the middle of the color transition should be. if two or more color stops are at the same location, the transition will be a hard line between the first and last colors declared at that location. while you can mix and match different angle units, don't. it makes css hard to read. accessibility concerns browsers do not provide any special in
formation on background images to assistive technology. this is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. while it is possible to create pie charts, checkerboards, and other effects with conic gradients, css images provide no native way to assign alternative text, and therefore the image represented by the conic...
...or screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. while it is possible to create pie charts, checkerboards, and other effects with conic gradients, css images provide no native way to assign alternative text, and therefore the image represented by the conic gradient will not be accessible to screen reader users. if the image contains in
formation critical to understanding the page's overall purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 examples black and white starburst div { width: 200px; height: 200px; } <div></div> div { background-image: repeating-conic-gradient(#fff 0 ...
repeating-radial-gradient() - CSS: Cascading Style Sheets
if unspecified, it defaults to center. <shape> the gradient's shape. the value can be circle (meaning that the gradient's shape is a circle with constant radius) or ellipse (meaning that the shape is an axis-aligned ellipse). if unspecified, it defaults to ellipse. <extent-keyword> a keyword describing how big the ending shape must be. the possible values are: keyword ...
...olor-stop> a color-stop's <color> value, followed by an optional stop position (either a <percentage> or a <length> along the gradient's axis). a percentage of 0%, or a length of 0, represents the center of the gradient; the value 100% represents the intersection of the ending shape with the virtual gradient ray. percentage values in between are linearly positioned on the virtual gradient ray. ...
resize - CSS: Cascading Style Sheets
horizontally or vertically, depending on the writing-mode and direction value). inline the element displays a mechanism for allowing the user to resize it in the inline direction (either horizontally or vertically, depending on the writing-mode and direction value). ...
...ing on the writing-mode and direction value). 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. you may override this behavior with the resize property. html <textarea>type some text here.</textarea> css textarea { resize: none; /* disables resizability */ } result using resize with arbitrary elements you ...
right - CSS: Cascading Style Sheets
defined, if not prevented from doing so by other properties, the element will stretch to satisfy both. if the element cannot stretch to satisfy both -- for example, if a width is declared -- the position of the element is over-constrained. when this is the case, the left value has precedence when the container is left-to-right; the right value has precedence when the container is right-to-left. ...
...eft-to-right; the right value has precedence when the container is right-to-left. ...
row-gap (grid-row-gap) - CSS: Cascading Style Sheets
roperty as in the interactive example above. syntax /* <length> values */ row-gap: 20px; row-gap: 1em; row-gap: 3vmin; row-gap: 0.5cm; /* <percentage> value */ row-gap: 10%; /* global values */ row-gap: inherit; row-gap: initial; row-gap: unset; values <length-percentage> is the width of the gutter separating the rows. <percentage> values are relative to the dimension of the element. ...
...e> values are relative to the dimension of the element. ...
ruby-align - CSS: Cascading Style Sheets
the ruby will be aligned with the start of the base text. center is a keyword indicating that the ruby will be aligned at the middle of the base text. space-between is a keyword indicating that the extra space will be distributed between the elements of the ruby. space-around is a keyword indicating that the extra space will be distributed between the elements of the ruby, and around it. ...
...that the extra space will be distributed between the elements of the ruby. space-around is a keyword indicating that the extra space will be distributed between the elements of the ruby, and around it. ...
ruby-position - CSS: Cascading Style Sheets
ues over is a keyword indicating that the ruby has to be placed over the main text for horizontal scripts and right to it for vertical scripts. under is a keyword indicating that the ruby has to be placed under the main text for horizontal scripts and left to it for vertical scripts. inter-character is a keyword indicating that the ruby has to be placed between the different characters. ...
...cal scripts. under is a keyword indicating that the ruby has to be placed under the main text for horizontal scripts and left to it for vertical scripts. inter-character is a keyword indicating that the ruby has to be placed between the different characters. ...
scroll-margin-block-end - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. ...
...e examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-block-end: 10px; scroll-margin-block-end: 1em; /* global values */ scroll-margin-block-end: inherit; scroll-margin-block-end: initial; scroll-margin-block-end: unset; values <length> an outset from the block end edge of the scroll container.
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type
formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block-end' in that specification. candidate recommendation initial definition ...
scroll-margin-block-start - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. ...
...oject, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-block-start: 10px; scroll-margin-block-start: 1em; /* global values */ scroll-margin-block-start: inherit; scroll-margin-block-start: initial; scroll-margin-block-start: unset; values <length> an outset from the block start edge of the scroll container.
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type
formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block-start' in that specification. candidate recommendation initial definition ...
scroll-margin-block - CSS: Cascading Style Sheets
1em .5em ; /* global values */ scroll-margin-block: inherit; scroll-margin-block: initial; scroll-margin-block: unset; values <length> an outset from the corresponding edge of the scroll container. description the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. ...
...from the corresponding edge of the scroll container. description the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. the scroll snap area is determined by taking the trans
formed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets.
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type
formal syntax <length>{1,2} specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block' in that specification. candidate recommendation initial definition ...
scroll-margin-bottom - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-bottom: 10px; scroll-margin-bottom: 1em; /* global values */ scroll-margin-bottom: inherit; scroll-margin-bottom: initial; scroll-margin-bottom: unset; values <length> an outset from the bottom edge of the scroll container.
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type
formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-bottom' in that specification. candidate recommendation initial definition ...
scroll-margin-inline-end - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. ...
...les project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-inline-end: 10px; scroll-margin-inline-end: 1em; /* global values */ scroll-margin-inline-end: inherit; scroll-margin-inline-end: initial; scroll-margin-inline-end: unset; values <length> an outset from the inline end edge of the scroll container.
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 aim here is to create four horizontally-scrolling blocks, the second an...
scroll-margin-inline-start - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. ...
... please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-inline-start: 10px; scroll-margin-inline-start: 1em; /* global values */ scroll-margin-inline-start: inherit; scroll-margin-inline-start: initial; scroll-margin-inline-start: unset; values <length> an outset from the inline start edge of the scroll container.
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 aim here is to create four horizontally-scrolling blocks, the second an...
scroll-margin-inline - CSS: Cascading Style Sheets
m .5em ; /* global values */ scroll-margin-inline: inherit; scroll-margin-inline: initial; scroll-margin-inline: unset; values <length> an outset from the corresponding edge of the scroll container. description the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. ...
...from the corresponding edge of the scroll container. description the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. the scroll snap area is determined by taking the trans
formed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets.
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 aim here is to create four horizontally-scrolling blocks, the seco...
scroll-margin-left - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-left: 10px; scroll-margin-left: 1em; /* global values */ scroll-margin-left: inherit; scroll-margin-left: initial; scroll-margin-left: unset; values <length> an outset from the left edge of the scroll container.
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type
formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-left' in that specification. candidate recommendation initial definition ...
scroll-margin-right - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ibute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-right: 10px; scroll-margin-right: 1em; /* global values */ scroll-margin-right: inherit; scroll-margin-right: initial; scroll-margin-right: unset; values <length> an outset from the right edge of the scroll container.
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type
formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-right' in that specification. candidate recommendation initial definition ...
scroll-margin-top - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-top: 10px; scroll-margin-top: 1em; /* global values */ scroll-margin-top: inherit; scroll-margin-top: initial; scroll-margin-top: unset; values <length> an outset from the top edge of the scroll container.
formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type
formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-top' in that specification. candidate recommendation initial definition ...
scroll-margin - CSS: Cascading Style Sheets
scrolling to a point partway between two of the "pages" of the example's content. the value specified for scroll-margin determines how much of the page that's primarily outside the snapport should remain visible. thus, the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. ...
...that's primarily outside the snapport should remain visible. thus, the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. the scroll snap area is determined by taking the trans
formed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets.
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 aim here is to create four horizontally-scrolling blocks, the seco...
scroll-padding-block-end - CSS: Cascading Style Sheets
ding-block-end: inherit; scroll-padding-block-end: initial; scroll-padding-block-end: unset; values <length-percentage> an inwards offset from the block end edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...lid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type
formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-block-end' in that specification. candidate recommendation initial definition ...
scroll-padding-block-start - CSS: Cascading Style Sheets
ck-start: inherit; scroll-padding-block-start: initial; scroll-padding-block-start: unset; values <length-percentage> an inwards offset from the block start edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...lid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type
formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-block-start' in that specification. candidate recommendation initial definition ...
scroll-padding-block - CSS: Cascading Style Sheets
roll-padding-block: inherit; scroll-padding-block: initial; scroll-padding-block: unset; values <length-percentage> an inwards offset from the corresponding edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...lid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type
formal syntax [ auto | <length-percentage> ]{1,2}where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-block' in that specification. candidate recommendation initial definition ...
scroll-padding-bottom - CSS: Cascading Style Sheets
/ scroll-padding-bottom: inherit; scroll-padding-bottom: initial; scroll-padding-bottom: unset; values <length-percentage> an inwards offset from the bottom edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...lid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type
formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-bottom' in that specification. candidate recommendation initial definition ...
scroll-padding-inline-end - CSS: Cascading Style Sheets
g-inline-end: inherit; scroll-padding-inline-end: initial; scroll-padding-inline-end: unset; values <length-percentage> an inwards offset from the inline end edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...alid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type
formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-inline-end' in that specification. candidate recommendation initial definition ...
scroll-padding-inline-start - CSS: Cascading Style Sheets
start: inherit; scroll-padding-inline-start: initial; scroll-padding-inline-start: unset; values <length-percentage> an inwards offset from the inline start edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...lid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type
formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-inline-start' in that specification. candidate recommendation initial definition ...
scroll-padding-inline - CSS: Cascading Style Sheets
l-padding-inline: inherit; scroll-padding-inline: initial; scroll-padding-inline: unset; values <length-percentage> an inwards offset from the corresponding edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...lid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type
formal syntax [ auto | <length-percentage> ]{1,2}where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-inline' in that specification. candidate recommendation initial definition ...
scroll-padding-left - CSS: Cascading Style Sheets
values */ scroll-padding-left: inherit; scroll-padding-left: initial; scroll-padding-left: unset; values <length-percentage> an inwards offset from the left edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...alid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type
formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-left' in that specification. candidate recommendation initial definition ...
scroll-padding-right - CSS: Cascading Style Sheets
lues */ scroll-padding-right: inherit; scroll-padding-right: initial; scroll-padding-right: unset; values <length-percentage> an inwards offset from the top edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...lid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type
formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-right' in that specification. candidate recommendation initial definition ...
scroll-padding-top - CSS: Cascading Style Sheets
bal values */ scroll-padding-top: inherit; scroll-padding-top: initial; scroll-padding-top: unset; values <length-percentage> an inwards offset from the top edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...lid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type
formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-top' in that specification. candidate recommendation initial definition ...
scroll-padding - CSS: Cascading Style Sheets
values */ scroll-padding: inherit; scroll-padding: initial; scroll-padding: unset; values <length-percentage> an inwards offset from the corresponding edge of the scrollport, as a valid <length> or a <percentage>. auto the offset is determind by the user agent. this will generally be 0px, but the user agent is free to detect and do something else if a non-zero value is more appropriate. ...
...ength> or a <percentage>. auto the offset is determind by the user agent. this will generally be 0px, but the user agent is free to detect and do something else if a non-zero value is more appropriate.
formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type
formal syntax [ auto | <length-percentage> ]{1,4}where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding' in that specification. candidate recommendation initial definition ...
scroll-snap-destination - CSS: Cascading Style Sheets
roll-snap-destination: 400px 600px; /* global values */ scroll-snap-destination: inherit; scroll-snap-destination: initial; scroll-snap-destination: unset; syntax values <position> specifies the offset of the snap destination from the start edge of the scroll container’s visual viewport. the first value gives the x coordinate of the snap destination, the second value its y coordinate. ...
...roll container’s visual viewport. the first value gives the x coordinate of the snap destination, the second value its y coordinate. ...
scroll-snap-points-x - CSS: Cascading Style Sheets
syntax values none the scroll container does not define any snap points. elements within the scroll container may still define snap points on behalf of the scroll container. repeat(<length-percentage>) defines an interval at which snap points are defined, starting from the container's relevant start edge. only positive lengths are allowed. percentages refer to the width of the container. ...
...ned, starting from the container's relevant start edge. only positive lengths are allowed. percentages refer to the width of the container. ...
scroll-snap-points-y - CSS: Cascading Style Sheets
syntax values none the scroll container does not define any snap points. elements within the scroll container may still define snap points on behalf of the scroll container. repeat(<length-percentage>) defines an interval at which snap points are defined, starting from the container's relevant start edge. only positive lengths are allowed. percentages refer to the width of the container. ...
...ned, starting from the container's relevant start edge. only positive lengths are allowed. percentages refer to the width of the container. ...
shape-margin - CSS: Cascading Style Sheets
loat element) and the surrounding content. syntax /* <length> values */ shape-margin: 10px; shape-margin: 20mm; /* <percentage> value */ shape-margin: 60%; /* global values */ shape-margin: inherit; shape-margin: initial; shape-margin: unset; values <length-percentage> sets the margin of the shape to a <length> value or to a <percentage> of the width of the element's containing block. ...
...; values <length-percentage> sets the margin of the shape to a <length> value or to a <percentage> of the width of the element's containing block. ...
shape-outside - CSS: Cascading Style Sheets
t-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. if both shapes are of type polygon(), both polygons have the same number of vertices, and use the same <fill-rule>, interpolate between each value in the shape functions. in all other cases no interpolation occurs. ...
...he same <fill-rule>, interpolate between each value in the shape functions. in all other cases no interpolation occurs. ...
<shape> - CSS: Cascading Style Sheets
rect() rect(top, right, bottom, left) values top is a <length> representing the offset for the top of the rectangle relative to the top border of the element's box. ...
... rect() rect(top, right, bottom, left) values top is a <length> representing the offset for the top of the rectangle relative to the top border of the element's box. right is a <length> representing the offset for the right of the rectangle relative to the left border of the element's box. ...
tab-size - CSS: Cascading Style Sheets
racters (u+0009). syntax /* <integer> values */ tab-size: 4; tab-size: 0; /* <length> values */ tab-size: 10px; tab-size: 2em; /* global values */ tab-size: inherit; tab-size: initial; tab-size: unset; values <integer> a multiple of the advance width of the space character (u+0020) to be used as the width of tabs. must be nonnegative. <length> the width of tabs. must be nonnegative. ...
...ab-size: inherit; tab-size: initial; tab-size: unset; values <integer> a multiple of the advance width of the space character (u+0020) to be used as the width of tabs. must be nonnegative. <length> the width of tabs. must be nonnegative.
formal definition initial value8applies toblock containersinheritedyescomputed valuethe specified integer or an absolute lengthanimation typea length
formal syntax <integer> | <length> examples expanding by character count pre { tab-size: 4; /* set tab size to 4 characters wide */ } collapse tabs pre { tab-size: 0; /* remove indentation */ } comparing to the default size this example compares a default tab size with a custom tab size. note that white-space is set to pre to prevent the tabs from collapsing. html <p>no tab</p> <p>�...
text-align - CSS: Cascading Style Sheets
ing> when applied to a table cell, specifies the alignment character around which the cell's contents will align. accessibility concerns the inconsistent spacing between words created by justified text can be problematic for people with cognitive concerns such as dyslexia. ...
... suspendisse in libero risus, in interdum massa. vestibulum ac leo vitae metus faucibus gravida ac in neque. nullam est eros, suscipit sed dictum quis, accumsan a ligula. </p> css .example { text-align: left; bor...
text-decoration-color - CSS: Cascading Style Sheets
ratio is determined by comparing the luminosity of the text and background color values. color alone should not be used to convey meaning. for example, change of text and text-decoration-color alone is not enough to indicate a link has focus. ...
...ration-color alone is not enough to indicate a link has focus. webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0
formal definition initial valuecurrentcolorapplies toall elements. ...
text-decoration-skip-ink - CSS: Cascading Style Sheets
lines and overlines so that they do not touch or closely approach a glyph. that is, they are interrupted where they would otherwise cross over a glyph. all the browser must interrupt underlines and overlines so that they do not touch or closely approach a glyph. this can be helpful with certain chinese, japanese, or korean (cjk) fonts, where the auto behavior might not create interruptions. ...
...d otherwise cross over a glyph. all the browser must interrupt underlines and overlines so that they do not touch or closely approach a glyph. this can be helpful with certain chinese, japanese, or korean (cjk) fonts, where the auto behavior might not create interruptions. ...
text-decoration-style - CSS: Cascading Style Sheets
ext-decoration-style: dashed; text-decoration-style: wavy; /* global values */ text-decoration-style: inherit; text-decoration-style: initial; text-decoration-style: unset; values solid draws a single line. double draws a double line. dotted draws a dotted line. dashed draws a dashed line. wavy draws a wavy line. -moz-none draws no line. use text-decoration-line: none instead. ...
... values solid draws a single line. double draws a double line. dotted draws a dotted line. dashed draws a dashed line. wavy draws a wavy line. -moz-none draws no line. use text-decoration-line: none instead.
formal definition initial valuesolidapplies toall elements. ...
text-emphasis-color - CSS: Cascading Style Sheets
r: currentcolor; /* <color> */ text-emphasis-color: #555; text-emphasis-color: blue; text-emphasis-color: rgba(90, 200, 160, 0.8); text-emphasis-color: transparent; /* global values */ text-emphasis-color: inherit; text-emphasis-color: initial; text-emphasis-color: unset; syntax values <color> defines the color of the emphasis marks. if no color is present, it defaults to currentcolor. ...
...8); text-emphasis-color: transparent; /* global values */ text-emphasis-color: inherit; text-emphasis-color: initial; text-emphasis-color: unset; syntax values <color> defines the color of the emphasis marks. if no color is present, it defaults to currentcolor. ...
text-emphasis-position - CSS: Cascading Style Sheets
der the text in horizontal writing mode. right draws marks to the right of the text in vertical writing mode. left draw marks to the left of the text in vertical writing mode. description the preferred position of emphasis marks depends on the language. in japanese for example, the preferred position is over right. in chinese, on the other hand, the preferred position is under right. ...
...apanese: preferred emphasis mark and ruby position language preferred position illustration horizontal vertical japanese over right korean mongolian chinese under right note: the text-emphasis-position cannot be set, and therefore are not reset either, using the text-emphasis shorthand property.
formal definition initial valueover rightapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax [ over | under ] && [ right | left ] examples preferring ruby over emphasis marks some editors prefer to hide emphasis marks when they conflict with ruby. in html, this can be done with the following style rule: ruby { text-emphasis: none; } preferring em...
text-emphasis-style - CSS: Cascading Style Sheets
es as marks. the filled triangle is '▲' (u+25b2), and the open triangle is '△' (u+25b3). sesame display sesames as marks. the filled sesame is '﹅' (u+fe45), and the open sesame is '﹆' (u+fe46). <string> display the given string as marks. authors should not specify more than one character in <string>. the ua may truncate or ignore strings consisting of more than one grapheme cluster. ...
...s marks. the filled sesame is '﹅' (u+fe45), and the open sesame is '﹆' (u+fe46). <string> display the given string as marks. authors should not specify more than one character in <string>. the ua may truncate or ignore strings consisting of more than one grapheme cluster.
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax none | [ [ filled | open ] | [ dot | circle | double-circle | triangle | sesame ] ] | <string> examples h2 { text-emphasis-style: sesame; } specifications specification status comment css text decoration module level 3the definition of 'text-emphasis' in that specification. candidate recommendation initial definition ...
text-emphasis - CSS: Cascading Style Sheets
n sesame is '﹆' (u+fe46). this is the default shape in vertical writing modes when no other shape is given. <string> display the given string as marks. authors should not specify more than one character in <string>. the ua may truncate or ignore strings consisting of more than one grapheme cluster. <color> defines the color of the mark. if no color is present, it defaults to currentcolor. ...
... css h2 { text-emphasis: triangle #d55; } html <h2>this is important!</h2> result specifications specification status comment css text decoration module level 3the defini...
text-indent - CSS: Cascading Style Sheets
are allowed. see <length> values for possible units. <percentage> indentation is a <percentage> of the containing block's width. each-line indentation affects the first line of the block container as well as each line after a forced line break, but does not affect lines after a soft wrap break. hanging inverts which lines are indented. all lines except the first line will be indented. ...
...ect lines after a soft wrap break. hanging inverts which lines are indented. all lines except the first line will be indented. ...
text-justify - CSS: Cascading Style Sheets
justify property is specified as a single keyword chosen from the list of values below. values none the text justification is turned off. this has the same effect as not setting text-align at all, although it is useful if you need to turn justification on and off for some reason. auto the browser chooses the best type of justification for the current situation based on a balance between per
formance and quality, but also on what is most appropriate for the language of the text (e.g., english, cjk languages, etc.). this is the default justification used if text-justify is not set at all. inter-word the text is justified by adding space between words (effectively varying word-spacing), which is most appropriate for languages that separate words using spaces, like english or korean. inte...
...rying word-spacing), which is most appropriate for languages that separate words using spaces, like english or korean. inter-character the text is justified by adding space between characters (effectively varying letter-spacing), which is most appropriate for languages like japanese. distribute exhibits the same behaviour as inter-character; this value is kept for backwards compatibility.
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. nunc ornare maximus vehicula. duis nisi velit, dictum id mauris vitae, loborti...
text-orientation - CSS: Cascading Style Sheets
ion is forced to be ltr. sideways causes characters to be laid out as they would be horizontally, but with the whole line rotated 90° clockwise. sideways-right an alias to sideways that is kept for compatibility purposes. use-glyph-orientation on svg elements, this keyword leads to use the value of the deprecated svg properties glyph-orientation-vertical and glyph-orientation-horizontal. ...
...eways that is kept for compatibility purposes. use-glyph-orientation on svg elements, this keyword leads to use the value of the deprecated svg properties glyph-orientation-vertical and glyph-orientation-horizontal.
formal definition initial valuemixedapplies toall elements, except table row groups, rows, column groups, and columnsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax mixed | upright | sideways examples html <p>lorem ipsum dolet semper quisquam.</p> css p { writing-mode: vertical-rl; text-orientation: upright; } result specifications specification status comment css writing modes module level 3the definition of 'text-orientation' in that specification. proposed recommendation initial definition. ...
text-overflow - CSS: Cascading Style Sheets
the overflowing inline content and applies a fade-out effect near the edge of the line box with complete transparency at the edge. the argument determines the distance over which the fade effect is applied. the <percentage> is resolved against the width of the line box. values lower than 0 are clipped to 0. values greater than the width of the line box are clipped to the width of the line box. ...
... the argument determines the distance over which the fade effect is applied. the <percentage> is resolved against the width of the line box. values lower than 0 are clipped to 0. values greater than the width of the line box are clipped to the width of the line box. ...
text-shadow - CSS: Cascading Style Sheets
et-y> specifies the vertical distance; a negative value places the shadow above the text. if both values are 0, the shadow is placed directly behind the text, although it may be partly visible due to the effect of <blur-radius>. <blur-radius> optional. this is a <length> value. the higher the value, the bigger the blur; the shadow becomes wider and lighter. if not specified, it defaults to 0. ...
...he effect of <blur-radius>. <blur-radius> optional. this is a <length> value. the higher the value, the bigger the blur; the shadow becomes wider and lighter. if not specified, it defaults to 0.
formal definition initial valuenoneapplies toall elements. ...
text-size-adjust - CSS: Cascading Style Sheets
eed it. syntax the text-size-adjust property is specified as none, auto, or a <percentage>. values none disables the browser's inflation algorithm. auto enables the browser's inflation algorithm. this value is used to cancel a none value previously set with css. <percentage> enables the browser's inflation algorithm, specifying a percentage value with which to increase the font size. ...
...centage> enables the browser's inflation algorithm, specifying a percentage value with which to increase the font size. ...
text-underline-offset - CSS: Cascading Style Sheets
ze. <percentage> specifies the offset of underlines as a <percentage> of 1 em in the element's font. a percentage inherits as a relative value, and so therefore scales with changes in the font. for a given application of this property, the offset is constant across the whole box that the underline is applied to, even if there are child elements with different font sizes or vertical alignment. ...
...offset is constant across the whole box that the underline is applied to, even if there are child elements with different font sizes or vertical alignment.
formal definition initial valueautoapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyespercentagesrefer to the font size of the element itselfcomputed valueas specifiedanimation typeby computed value type
formal syntax auto | <length> | <percentage> examples <p class="oneline">here's some text with an offset wavy red underline!</p> <br> <p class="twolines">this text has lines both above and below it. only the bottom one is offset.</p> p { text-decoration: underline wavy red; text-underline-offset: 1em; } .twolines { text-decoration-color: purple; text-decoration-line: underline overline; }...
top - CSS: Cascading Style Sheets
ts, the distance of the element from its normal position is based on the bottom property; or if bottom is also auto, the element is not moved vertically at all. inherit specifies that the value is the same as the computed value from its parent element (which might not be its containing block). this computed value is then handled as if it were a <length>, <percentage>, or the auto keyword. ...
...ue is then handled as if it were a <length>, <percentage>, or the auto keyword. ...
touch-action - CSS: Cascading Style Sheets
is may be combined with any of the pan- values. accessibility concerns a declaration of touch-action: none; may inhibit operating a browser's zooming capabilities. this will prevent people experiencing low vision conditions from being able to read and understand page content. ...
...n conditions from being able to read and understand page content. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | understanding wcag 2.0
formal definition initial valueautoapplies toall elements except: non-replaced inline elements, table rows, row groups, table columns, and column groupsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax auto | none | [ [ pan-x | pan-left | pan-right ] | [ pan-y | pan-up | pan-down ] | pinch-zoom ] | manipulation examples disabling all gestures the most common usage is to disable all gestures on an element (and its non-scrollable descendants) that provides its own dragging and zooming behavior – such as a map or game surface. html <div id="map"></div> css #map { height: 400p...
transition-delay - CSS: Cascading Style Sheets
ted to match the number of properties. in both cases, the css declaration remains valid. syntax /* <time> values */ transition-delay: 3s; transition-delay: 2s, 4ms; /* global values */ transition-delay: inherit; transition-delay: initial; transition-delay: unset; values <time> denotes the amount of time to wait between a property's value changing and the start of the transition effect. ...
...y: 2s, 4ms; /* global values */ transition-delay: inherit; transition-delay: initial; transition-delay: unset; values <time> denotes the amount of time to wait between a property's value changing and the start of the transition effect. ...
user-select - CSS: Cascading Style Sheets
ndants. if a double-click or context-click occurred in sub-elements, the highest ancestor with this value will be selected. contain enables selection to start within the element; however, the selection will be contained by the bounds of that element. element (ie-specific alias) same as contain. supported only in internet explorer. note: css ui 4 renames user-select: element to contain. ...
...cted. contain enables selection to start within the element; however, the selection will be contained by the bounds of that element. element (ie-specific alias) same as contain. supported only in internet explorer. note: css ui 4 renames user-select: element to contain. ...
vertical-align - CSS: Cascading Style Sheets
t-top, text-bottom, <length>, and <percentage>) aligns the baseline of the cell with the baseline of all other cells in the row that are baseline-aligned. top aligns the top padding edge of the cell with the top of the row. middle centers the padding box of the cell within the row. bottom aligns the bottom padding edge of the cell with the bottom of the row. negative values are allowed. ...
... cell with the bottom of the row. negative values are allowed.
formal definition initial valuebaselineapplies toinline-level and table-cell elements. ...
word-spacing - CSS: Cascading Style Sheets
he beginning and end of each word is unrecognizable. legible word-spacing must be determined on a case-by-case basis, as different font families have different character widths. there is no one value that can ensure all font families automatically maintain their legibility. ...
...rstanding success criterion 1.4.8 | w3c understanding wcag 2.0
formal definition initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyespercentagesrefer to the width of the affected glyphcomputed valuean optimum, minimum, and maximum value, each consisting of either an absolute length, a percentage, or the keyword normalanimation typea length
formal syntax normal | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css text module level 3the definition of 'word-spacing' in that specification. working draft replaces the previous values with a <spacing-limit> value that defines the same thing, plus the <percentage> value. allows up to three v...
writing-mode - CSS: Cascading Style Sheets
deprecated except for svg1 documents. for css, use horizontal-tb instead. rl deprecated except for svg1 documents. for css, use horizontal-tb instead. tb deprecated except for svg1 documents. for css, use vertical-lr instead. tb-lr deprecated except for svg1 documents. for css, use vertical-lr instead. tb-rl deprecated except for svg1 documents. for css, use vertical-rl instead. ...
...ss, use vertical-lr instead. tb-lr deprecated except for svg1 documents. for css, use vertical-lr instead. tb-rl deprecated except for svg1 documents. for css, use vertical-rl instead.
formal definition initial valuehorizontal-tbapplies toall elements except table row groups, table column groups, table rows, and table columnsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr examples using multiple writing modes this example demonstrates all of the writing modes, showing each with text in various languages. html the html is a <table> with each writing mode in a row with a column showing text in various scripts using that writing mode. <table> <tr> <th>value</th> <th>vertic...
z-index - CSS: Cascading Style Sheets
. the stack level of the generated box in the current stacking context is the same as its parent's box. <integer> this <integer> is the stack level of the generated box in the current stacking context. the box also establishes a local stacking context in which its stack level is 0. this means that the z-indexes of descendants are not compared to the z-indexes of elements outside this element. ...
...e generated box in the current stacking context. the box also establishes a local stacking context in which its stack level is 0. this means that the z-indexes of descendants are not compared to the z-indexes of elements outside this element. ...
regexp:replace() - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes regexp:replace() replaces the portions of a string that match a given regular expression with the contents of another string. syntax regexp:replace(originalstring, regexpstring, flagsstring, replacestring) parameters originalstring the string per
form a search-and-replace operation upon. regexpstring the javascript style regular expression to evaluate. flagsstring the string containing character flags. replacestring the string with which the matched substrings are to be replaced. the character flags are: g - global replace if this flag is specified, all occurrences of the regular expression within the originalstring are replaced. otherwise only the first occurrence is replaced. ...
...the string containing character flags. replacestring the string with which the matched substrings are to be replaced. the character flags are: g - global replace if this flag is specified, all occurrences of the regular expression within the originalstring are replaced. otherwise only the first occurrence is replaced. i - case insensitive match if this flag is specified, the match is per
formed in a case insensitive fashion. returns the revised version of the string. specifications exslt - regexp:replace ...
Ajax - Developer guides
x model, web applications are able to make quick, incremental updates to the user interface without reloading the entire browser page. this makes the application faster and more responsive to user actions. although x in ajax stands for xml, json is used more than xml nowadays because of its many advantages such as being lighter and a part of javascript. both json and xml are used for packaging in
formation in the ajax model. documentation getting started this article guides you through the ajax basics and gives you two simple hands-on examples to get you started. using the xmlhttprequest api the xmlhttprequest api is the core of ajax. this article will explain how to use some ajax techniques, like: analyzing and manipulating the response of the server monitoring the progress of...
... documentation getting started this article guides you through the ajax basics and gives you two simple hands-on examples to get you started. using the xmlhttprequest api the xmlhttprequest api is the core of ajax. this article will explain how to use some ajax techniques, like: analyzing and manipulating the response of the server monitoring the progress of a request submitting
forms and upload binary files – in pure ajax, or using
formdata objects using ajax within web workers fetch api the fetch api provides an interface for fetching resources. it will seem familiar to anyone who has used xmlhttprequest, but this api provides a more powerful and flexible feature set. server-sent events traditionally, a web page has to send a request to the server to receive new...
DOM onevent handlers - Developer guides
events are actions like: being clicked detecting pressed keys getting focus the onevent handler is usually named with the event it reacts to, like onclick, onkeypress, onfocus, etc. ...
...events are actions like: being clicked detecting pressed keys getting focus the onevent handler is usually named with the event it reacts to, like onclick, onkeypress, onfocus, etc. ...
HTML5 Parser - Developer guides
ywhere in the document (also in html content). to deal with legacy pages where authors have pasted partial svg fragments into html (who knows why) or used a <math> tag for non-mathml purposes, attempts to nest various common html elements as children of svg elements (without foreignobject) will immediately break out of svg or mathml context. this may make some typos have surprising effects. per
formance improvement with speculative parsing unrelated to the requirements of html5 specification, the gecko 2 parser uses speculative parsing, in which it continues parsing a document while scripts are being downloaded and executed. this results in improved per
formance compared to older parsers, because most of the time, gecko can complete these tasks in parallel. to best take advantage of specula...
...oes here.</p>"); document.write("</div>"); </script> <!-- non-script html goes here. --> in contrast, the following code contains two scripts with unbalanced sub-trees, which causes speculative parsing to fail and therefore the time to parse the document is longer. <script>document.write("<div>");</script> <p>some content goes here.</p> <script>document.write("</div>");</script> for more in
formation, see optimizing your pages for speculative parsing. ...
Introduction to HTML5 - Developer guides
an was previously possible. some html5 features remain unsupported by some browsers. however, gecko, and by extension, firefox, has very good support for html5, and work continues toward supporting more of its features. gecko began supporting some html5 features in version 1.8.1. you can find a list of all of the html5 features that gecko currently supports on the main html5 page. for detailed in
formation about multiple browsers' support of html5 features, refer to the caniuse website. declaring that the document contains html5 mark-up with the html5 doctype the doctype for html5 is very simple. to indicate that your html content uses html5, simply use: <!doctype html> doing so will cause even browsers that don't presently support html5 to enter into standards mode, which means that they...
... doctype for html5 is very simple. to indicate that your html content uses html5, simply use: <!doctype html> doing so will cause even browsers that don't presently support html5 to enter into standards mode, which means that they'll interpret the long-established parts of html in an html5-compliant way while ignoring the new features of html5 they don't support. this is much simpler than the
former doctypes, and shorter, making it easier to remember and reducing the amount of bytes that must be downloaded. declaring the character set with the <meta charset> the first thing done on a page is usually indicating the character set that is used. in previous versions of html, it was done using a very complex <meta> element. now, it is very simple: <meta charset="utf-8"> place this right aft...
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. ...
...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 con
form 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. the problems are described in more details in the following articles: beware of xhtml by david hammond sending xhtml as text/html considered harmful by ian hickson xhtml's ...
Localizations and character encodings - Developer guides
ll use that encoding for turning the bytes into the internal representation. unfortunately, using utf-8 and declaring that utf-8 was used was not always the prevalent way of offering web content. in the 1990s, it was common to leave the encoding undeclared and to use a region-specific encoding that wasn't able to represent all of unicode. firefox needs a fallback encoding that it uses for non-con
forming legacy content that doesn't declare its encoding. for most locales, the fallback encoding is windows-1252 (often called iso-8859-1), which was the encoding emitted by most windows applications in the 1990s and a superset of the encoding emitted by most unix applications in the 1990s as a deployed in the america has and in western europe. however, there are locales where web publishing was comm...
...ection is obsolete, since the preference intl.charset.default no longer exists. the mapping from locales onto fallback encodings is now built into gecko itself. the fallback encoding is specified by the preference intl.charset.default in intl.properties. it should be set to the canonical name of the legacy encoding that users of the localizations are most likely to encounter when browsing non-con
forming legacy web content that doesn't declare its encoding. note that the fallback encoding as defined by the previous sentence does not necessarily need to be able to represent the characters needed for the language of the localization! the fallback encoding should be left to windows-1252 for western european locales, north, central and south american locales, african locales, central asian locale...
Writing forward-compatible websites - Developer guides
always possible to follow all of these, but following as many of them as possible will help future-proof your website. javascript prefix all global variable access in onfoo attributes with “window.” when an event handler content attribute (onclick, onmouseover, and so forth) is used on html element, all name lookup in the attribute first happens on the element itself, then on the element's
form if the element is a
form control, then on the document, and then on the window (where the global variables you have defined are). for example, if you have this markup: <div onclick="alert(ownerdocument)">click me</div> then clicking on the text alerts the ownerdocument of the div. this happens even if there is a var ownerdocument declared in global scope. what this means is that any time you a...
... validate entirely you should make sure all your > characters are present. missing those can lead to unexpected situations due to a following tag name being treated as an attribute on a previous tag. this can work for a bit, then break if a specification attaches a meaning to that attribute. here's an example that works in browsers without html5 support but breaks in a browser supporting html5: <
form action="http://www.example.com"> <input type="submit" value="submit the
form" </
form> due to the missing > on the input tag. don't leave experiments that didn't work in your code if you try using a css property to do something you want, but it has no effect, remove it. it might start doing something you don't expect in the future ...
HTML attribute: max - HTML: Hypertext Markup Language
he value of the element is greater than this, the element fails constraint validation. this value must be greater than or equal to the value of the min attribute. if the max attribute is present by is not specified or is invalid, no max value is applied. if the max attribute is valid and a non-empty value is greater than the maximum allowed by the max attribute, constraint validation will prevent
form submission. 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. if the value exceeds the max value allowed, the validitystate.rangeoverflow will be true, and the the control will be...
... for the<progress> element, the max attribute describes how much work the task indicated by the progress element requires. if present, must have a value greater than zero and be a valid floating point number. for the <meter> element, the max attribute defines the upper numeric bound of the measured range. this must be greater than the minimum value (min attribute), if specified. in both ca...
HTML attribute: min - HTML: Hypertext Markup Language
s constraint validation. this value must be less than or equal to the value of the max attribute. if a value is specified for min that isn't a valid number, the input has no minimum value. 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. if omitted, <input type="num...
... for the <meter> element, the min attribute defines the lower numeric bound of the measured range. this must be less than the minimum value (max attribute), if specified. in both cases, if omitted, the value defaults to 1. syntax for min values for other elements input type syntax example <meter> <number> <meter id="fuel" min="0" max="100" low="33" high=...
<a>: The Anchor element - HTML: Hypertext Markup Language
context that’s an ancestor of the current one). if no ancestors, behaves as _self. note: when using target, add rel="noreferrer noopener" to avoid exploitation of the window.opener api; note: in newer browser versions (e.g. firefox 79+) setting target="_blank" on <a> elements implicitly provides the same rel behavior as setting rel="noopener". type hints at the linked url’s
format with a mime type. no built-in functionality. obsolete attributes charsetobsolete since html5 hinted at the character encoding of the linked url. note: this attribute is obsolete and should not be used by authors. use the http content-type header on the linked url. coordsobsolete since html5 used with the shape attribute. a comma-separated list of coordinates. nameobsolete since ...
...sety) ); canvas.addeventlistener('mousedown', () => isdrawing = true); canvas.addeventlistener('mouseup', () => isdrawing = false); document.queryselector('a').addeventlistener('click', event => event.target.href = canvas.todataurl() ); result security and privacy <a> elements can have consequences for users’ security and privacy. see referer header: privacy and security concerns for in
formation. using target="_blank" without rel="noreferrer" and rel="noopener" makes the website vulnerable to window.opener api exploitation attacks (vulnerability description), although note that, in newer browser versions (e.g. firefox 79+) setting target="_blank" implicitly provides the same protection as setting rel="noopener". accessibility strong link text the content inside a link should ind...
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
/abbr>, you can style your abbreviations!</p> css abbr { font-variant: all-small-caps; } result providing an expansion adding a title attribute lets you provide an expansion or definition for the abbreviation or acronym. html <p>ashok's joke made me <abbr title="laugh out loud">lol</abbr> big time.</p> result defining an abbreviation you can use <abbr> in tandem with <dfn> to more
formally define an abbreviation, as shown here. html <p><dfn id="html"><abbr title="hypertext markup language">html</abbr> </dfn> is a markup language used to create the semantics and structure of a web page.</p> <p>a <dfn id="spec">specification</dfn> (<abbr title="specification">spec</abbr>) is a document that outlines in detail how a technology or api is intended to function and how it is access...
...il how a technology or api is intended to function and how it is accessed.</p> result accessibility concerns spelling out the acronym or abbreviation in full the first time it is used on a page is beneficial for helping people understand it, especially if the content is technical or industry jargon. example <p>javascript object notation (<abbr>json</abbr>) is a lightweight data-interchange
format.</p> this is especially helpful for people who are unfamiliar with the terminology or concepts discussed in the content, people who are new to the language, and people with cognitive concerns. specifications specification status comment html living standardthe definition of '<abbr>' in that specification. living standard html5the definition of '<a...
<basefont> - HTML: Hypertext Markup Language
ent. you should not use this element; instead, you should use css properties such as font, font-family, font-size, and color to change the font configuration for an element and its contents. attributes like all other html elements, this element supports the global attributes. color this attribute sets the text color using either a named color or a color specified in the hexadecimal #rrggbb
format. face this attribute contains a list of one or more font names. the document text in the default style is rendered in the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. size this attribute specifies the font size as either a numeric or relative val...
...ly) normalized in html 3.2, it wasn't supported in all major browsers. further, browsers, and even successive versions of browsers, never implemented it in the same way: practically, using it has always brought indeterminate results. the <basefont> element was deprecated in the standard at the same time as all elements related to styling only. starting with html 4, html does not convey styling in
formation anymore (outside the <style> element or the style attribute of each element). in html5, this element has been removed completely. for any new web development, styling should be written using css only. the
former behavior of the <font> element can be achieved, and even better controlled using the css fonts properties. dom interface this element implements the htmlbasefontelement interface.
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
no corresponding role permitted aria roles any dom interface htmlcanvaselement attributes this element's attributes include the global attributes. height the height of the coordinate space in css pixels. defaults to 150. moz-opaque lets the canvas know whether or not translucency will be a factor. if the canvas knows there's no translucency, painting per
formance can be optimized. this is only supported by mozilla-based browsers; use the standardized canvas.getcontext('2d', { alpha: false }) instead. width the width of the coordinate space in css pixels. defaults to 300. usage notes alternative content you may (and should) provide alternate content inside the <canvas> block. that content will be rendered both on older browsers that don't support...
...canvas content is not exposed to accessibility tools as semantic html is. in general, you should avoid using canvas in an accessible website or app. the following guides can help to make it more accessible. mdn hit regions and accessability canvas accessibility use cases canvas element accessibility issues html5 canvas accessibility in firefox 13 – by steve f...
<cite>: The Citation element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. ...
...that a person’s name must never be included, under any circumstances. to include a reference to the source of quoted material which is contained within a <blockquote> or <q> element, use the cite attribute on the element. typically, browsers style the contents of a <cite> element in italics by default. to avoid this, apply the css font-style property to the <cite> element. example <p>more in
formation can be found in <cite>[iso-0000]</cite>.</p> the html above outputs: specifications specification status comment html living standardthe definition of '<cite>' in that specification. living standard html5the definition of '<cite>' in that specification. recommendation html 4.01 specificationthe definition of '<cite>' in that sp...
<del>: The Deleted Text element - HTML: Hypertext Markup Language
the <ins> element can be used for the opposite purpose: to indicate text that has been added to the document. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this element is often (but need not be) rendered by applying a strike-through style to the text. ...
...s this element's attributes include the global attributes. cite a uri for a resource that explains the change (for example, meeting minutes). datetime this attribute indicates the time and date of the change and must be a valid date string with an optional time. if the value cannot be parsed as a date with an optional time string, the element does not have an associated time stamp. for the
format of the string without a time, see date strings. the
format of the string if it includes both date and time is covered in local date and time strings. examples <p><del>this text has been deleted</del>, here is the rest of the paragraph.</p> <del><p>this paragraph has been deleted.</p></del> result accessibility concerns the presence of the del element is not announced by most screen read...
<dfn>: The Definition element - HTML: Hypertext Markup Language
vious aspects to using the <dfn> element. we examine those here. specifying the term being defined the term being defined is identified following these rules: if the <dfn> element has a title attribute, the value of the title attribute is considered to be the term being defined. the element must still have text within it, but that text may be an abbreviation (perhaps using <abbr>) or another
form of the term. if the <dfn> contains a single child element and does not have any text content of its own, and the child element is an <abbr> element with a title attribute itself, then the exact value of the <abbr> element's title is the term being defined. otherwise, the text content of the <dfn> element is the term being defined. this is shown in the first example below. if the <dfn> elemen...
...dfn> is among the most productive scientific instruments ever constructed. it has been in orbit for over 20 years, scanning the sky and returning data and photographs of unprecedented quality and detail.</p> <p>indeed, the <abbr title="hubble space telescope">hst</abbr> has arguably done more to advance science than any device ever built.</p> note the <abbr> element nested inside the <dfn>. the
former establishes that the term is an abbreviation ("hst") and specifies the full term ("hubble space telescope") in its title attribute. the latter indicates that the abbreviated term represents a term being defined. result the output of the above code looks like this: specifications specification status comment html living standardthe definition of '<dfn>' in that ...
<dl>: The Description List element - HTML: Hypertext Markup Language
permitted parents any element that accepts flow content. implicit aria role no corresponding role permitted aria roles group, list, none, presentation dom interface htmldlistelement attributes this element only includes the global attributes. ...
...ngle term and description <dl> <dt>firefox</dt> <dd> a free, open source, cross-plat
form, graphical web browser developed by the mozilla corporation and hundreds of volunteers. </dd> <!-- other terms and descriptions --> </dl> multiple terms, single description <dl> <dt>firefox</dt> <dt>mozilla firefox</dt> <dt>fx</dt> <dd> a free, open source, cross-plat
form, graphical web browser developed by the mozilla corporation and hundreds of volunteers. </dd> <!-- other terms and descriptions --> </dl> single term, multiple descriptions <dl> <dt>firefox</dt> <dd> a free, open source, cross-plat
form, graphical web browser developed by the mozilla corporation and hundreds of volunteers. </dd> <dd> the red panda ...
<font> - HTML: Hypertext Markup Language
summary the html font element (<font>) defines the font size, color and face for its content. usage note: do not use this element! though once normalized in html 3.2, it was deprecated in html 4.01, at the same time as all elements related to styling only, then made obsolete in html5. starting with html 4, html does not convey styling in
formation anymore (outside the <style> element or the style attribute of each element). for any new web development, styling should be written using css only. the
former behavior of the <font> element can be achieved, and even better controlled using the css fonts css properties. attributes like all other html elements, this element supports the global attributes. color this attribute sets the text color using either a named color or a color sp...
... face this attribute contains a comma-separated list of one or more font names. the document text in the default style is rendered in the first font face that the client's browser supports. ...
<footer> - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, palpable content. permitted content flow content, but with no <footer> or <header> descendants. ...
... implicit aria role contentinfo, or no corresponding role if a descendant of an article, aside, main, nav or section element, or an element with role=article, complementary, main, navigation or region permitted aria roles group, presentation or none dom interface htmlelement attributes this element only includes the global attributes. usage notes enclose in
formation about the author in an <address> element that can be included into the <footer> element. the <footer> element is not sectioning content and therefore doesn't introduce a new section in the outline. examples <footer> some copyright info or perhaps some author info for an <article>? </footer> accessibility concerns the voiceover screen reader has an issue where the footer land...
<menu> - HTML: Hypertext Markup Language
this includes both list menus, which might appear across the top of a screen, as well as context menus, such as those that might appear underneath a button after it has been clicked. content categories flow content. if the element's children include at least one <li> element: palpable content. permitted content if the element is in the list menu state: flow content, or alternatively, zero or more occurrences of <li>, <script>, and <template>. ...
...t. this might be as a button menu referenced by a menu attribute of a <button> element, or as context menu for an element with a contextmenu attribute. this value is the default if the attribute is missing and the parent element is also a <menu> element. toolbar: indicates the toolbar state, which represents a toolbar consisting of a series of commands for user interaction. this might be in the
form of an unordered list of <li> elements, or, if the element has no <li> element children, flow content describing available commands. this value is the default if the attribute is missing. usage notes the <menu> and <ul> elements both represent an unordered list of items. the key difference is that <ul> primarily contains items for display, whilst <menu> is intended for interactive items, to...
<object> - HTML: Hypertext Markup Language
ource for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content; phrasing content; embedded content, palpable content; if the element has a usemap attribute, interactive content; listed, submittable
form-associated element. permitted content zero or more <param> elements, then transparent. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts embedded content. implicit aria role no corresponding role permitted aria roles application, document, image dom interface htmlobj...
... data specified by classid. data the address of the resource as a valid url. at least one of data and type must be defined. declarehtml 4 onlyobsolete since html5 the presence of this boolean attribute makes this element a declaration only. the object must be instantiated by a subsequent <object> element. in html5, repeat the <object> element completely each that that the resource is reused.
formhtml5 the
form element, if any, that the object element is associated with (its
form owner). the value of the attribute must be an id of a <
form> element in the same document. height the height of the displayed resource, in css pixels. -- (absolute values only. no percentages) name the name of valid browsing context (html5), or the name of the control (html 4). standbyhtml 4 onlyobsolete sin...
<p>: The Paragraph element - HTML: Hypertext Markup Language
paragraphs are block-level elements, and notably will automatically close if another block-level element is parsed before the closing </p> tag. see “tag omission” below. ...
... clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, palpable content. permitted content phrasing content. tag omission the start tag is required. the end tag may be omitted if the <p> element is immediately followed by an <address>, <article>, <aside>, <blockquote>, <div>, <dl>, <fieldset>, <footer>, <
form>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <header>, <hr>, <menu>, <nav>, <ol>, <pre>, <section>, <table>, <ul> or another <p> element, or if there is no more content in the parent element and the parent element is not an <a> element. permitted parents any element that accepts flow content. implicit aria role no corresponding role permitted aria roles any d...
<sub>: The Subscript element - HTML: Hypertext Markup Language
d be used (likely the vertical-align property, such as vertical-align: sub or, to more precisely control the baseline shift, vertical-align: -25%. appropriate use cases for <sub> include (but aren't necessarily limited to): marking up footnote numbers. see footnote numbers for an example. marking up the subscript in mathematical variable numbers (although you may also consider using a mathml
formula for this). see variable subscripts. denoting the number of atoms of a given element within a chemical
formula (such as every developer's best friend, c8h10n4o2, otherwise known as "caffeine"). see chemical
formulas. examples footnote numbers traditional footnotes are denoted using numbers which are rendered in subscript. this is a common use case for <sub>: <p>according to the computatio...
... like this: variable subscripts in mathematics, families of variables related to the same concept (such as distances along the same axis) are represented using the same variable name with a subscript following. for example: <p>the horizontal coordinates' positions along the x-axis are represented as <var>x<sub>1</sub></var> ... <var>x<sub>n</sub></var>.</p> the resulting output: chemical
formulas when writing a chemical
formula, such as h20, the number of atoms of a given element within the described molecule is represented using a subscripted number; in the case of water, the subscripted "2" indicates that there are two atoms of hydrogen in the molecule. another example: <p>almost every developer's favorite molecule is c<sub>8</sub>h<sub>10</sub>n<sub>4</sub>o<sub>2</sub>, which i...
<table>: The Table element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... caption & summary • tables • w3c wai web accessibility tutorials scoping rows and columns the scope attribute on header elements is redundant in simple contexts, because scope is inferred. however, some assistive technologies may fail to draw correct inferences, so specifying header scope may improve user experiences. in complex tables, scope can be specified so as to provide necessary in
formation about the cells related to a header. example <table> <caption>color names and values</caption> <tbody> <tr> <th scope="col">name</th> <th scope="col">hex</th> <th scope="col">hsla</th> <th scope="col">rgba</th> </tr> <tr> <th scope="row">teal</th> <td><code>#51f6f6</code></td> <td><code>hsla(180, 90%, 64%, 1)</code></td> <td><...
<title>: The Document Title element - HTML: Hypertext Markup Language
permitted aria roles no role permitted. dom interface htmltitleelement attributes this element only includes the global attributes. usage notes the <title> element is always used within a page's <head> block. page titles and seo the contents of a page title can have significant implications for search engine optimization (seo). in general, a longer, descriptive title per
forms better than short or generic titles. the content of the title is one of the components used by search engine algorithms to decide the order in which to list pages in search results. also, the title is the initial "hook" by which you grab the attention of readers glancing at the search results page. a few guidelines and tips for composing good titles: avoid one- or two-word titles. use a desc...
... assistive technology is to read the page title and infer the content the page contains. this is because navigating into a page to determine its content can be a time consuming and potentially confusing process. example <title>menu - blue house chinese food - foodyum: online takeout today!</title> to help the user, update the page title value to reflect significant page state changes (such as
form validation problems). example <title>2 errors - your order - blue house chinese food - foodyum: online takeout today!</title> mdn understanding wcag, guideline 2.4 explanations understanding success criterion 2.4.2 | w3c understanding wcag 2.0 specifications specification status comment html living standardthe definition of '<title>' in that specification. ...
accesskey - HTML: Hypertext Markup Language
les and send us a pull request. note: in the whatwg spec, it says you can specify multiple space-separated characters, and the browser will use the first one it supports. however, this does not work in most browsers. ie/edge uses the first one it supports without problems, provided there are no conflicts with other commands. ...
...h other combinations. certain accesskey values may not be present on certain keyboards, especially when internationalization is a concern. so adapting to specific languages could cause further problems. accesskey values that rely on numbers may be confusing to individuals experiencing cognitive concerns, where the number doesn't have a logical association with the functionality it triggers. in
forming the user that accesskeys are present, so that they are aware of the functionality. if the system lacks a method of notifying the user about this feature, the user might accidentally activate accesskeys. because of these issues, it is generally advised not to use accesskeys for most general-purpose websites and web apps. webaim: keyboard accessibility - accesskey specifications ...
hidden - HTML: Hypertext Markup Language
s a pull request. the hidden attribute must not be used to hide content just from one presentation. if something is marked hidden, it is hidden from all presentations, including, for instance, screen readers. hidden elements shouldn't be linked from non-hidden elements, and elements that are descendants of a hidden element are still active, which means that script elements can still execute and
form elements can still submit. elements and scripts may, however, refer to elements that are hidden in other contexts. for example, it would be incorrect to use the href attribute to link to a section marked with the hidden attribute. if the content is not applicable or relevant, then there is no reason to link to it. it would be fine, however, to use the aria aria-describedby attribute to refer to...
...e to refer to descriptions that are themselves hidden. while hiding the descriptions implies that they are not useful on their own, they could be written in such a way that they are useful in the specific context of being referenced from the element that they describe. similarly, a canvas element with the hidden attribute could be used by a scripted graphics engine as an off-screen buffer, and a
form control could refer to a hidden
form element using its
form attribute. note: changing the value of the css display property on an element with the hidden attribute overrides the behavior. for instance, elements styled display: flex will be displayed despite the hidden attribute's presence. specifications specification status comment html living standardthe definition ...
Preloading content with rel="preload" - HTML: Hypertext Markup Language
the preload value of the <link> element's rel attribute lets you declare fetch requests in the html's <head>, specifying resources that your page will need very soon, which you want to start loading early in the page lifecycle, before browsers' main rendering machinery kicks in. this ensures they are available earlier and are less likely to block the page's render, improving per
formance. this article provides a basic guide to how <link rel="preload"> works. the basics you most commonly use <link> to load a css file to style your page with: <link rel="stylesheet" href="styles/main.css"> here however, we will use a rel value of preload, which turns <link> into a preloader for any resource we want. you will also need to specify: the path to the resource in the href attribute. the...
... a while ago, and was intended to tackle the same issue as preload, but it had a problem: there was no way to work out a priority for the items (as didn't exist back then), so they all got fetched with fairly low priority. there are a number of script-based resource loaders out there, but they don't have any power over the browser's fetch prioritization queue, and are subject to much the same per
formance problems. specifications specification status comment preloadthe definition of 'preload' in that specification. candidate recommendation further details of preload. html living standardthe definition of 'rel=preload' in that specification. living standard definition of rel=preload. ...
Basics of HTTP - HTTP
on top of these basic concepts, numerous extensions have been developed over the years that add updated functionality and semantics with new http methods or headers. articles overview of http describes what http is and its role in web architecture, including its position in the protocol stack. evolution of http http was created in the early 1990s and has been extended several times. this article goes through its history and describes http/0.9, http/1.0, http/1.1, and the modern http/2, as well as novelties introduced over the years. ...
... and the way it's encoded. connection management in http/1.x http/1.1 was the first version of http to support persistent connection and pipelining. this article explains both concepts. connection management in http/2 http/2 completely revisited how connections are created and maintained. this article explains how http frames allow multiplexing and solve the 'head-of-line' blocking problem of
former http versions. content negotiation http introduces a set of headers, starting with accept as a way for a browser to announce the
format, language, or encoding it prefers. this article explains how this advertisement happens, how the server is expected to react, and how it chooses the most adequate response. ...
Accept-Encoding - HTTP
the accept-encoding request http header advertises which content encoding, usually a compression algorithm, the client is able to understand. using content negotiation, the server selects one of the proposals, uses it and in
forms the client of its choice with the content-encoding response header. even if both the client and the server supports the same compression algorithms, the server may choose not to compress the body of a response, if the identity value is also acceptable. two common cases lead to this: the data to be sent is already compressed and a second compression won't lead to smaller data to be transmitted. this may be the case with some image
formats; the server is overloaded and cannot afford the computational overhead induced by the compression requirement. typically, micr...
... licensing problems. header type request header forbidden header name yes syntax accept-encoding: gzip accept-encoding: compress accept-encoding: deflate accept-encoding: br accept-encoding: identity accept-encoding: * // multiple algorithms, weighted with the quality value syntax: accept-encoding: deflate, gzip;q=1.0, *;q=0.5 directives gzip a compression
format using the lempel-ziv coding (lz77), with a 32-bit crc. compress a compression
format using the lempel-ziv-welch (lzw) algorithm. deflate a compression
format using the zlib structure, with the deflate compression algorithm. br a compression
format using the brotli algorithm. identity indicates the identity function (i.e. no compression, nor modification). this value is always considered...
Accept-Language - HTTP
the accept-language request http header advertises which languages the client is able to understand, and which locale variant is preferred. (by languages, we mean natural languages, such as english, and not programming languages.) using content negotiation, the server then selects one of the proposals, uses it and in
forms the client of its choice with the content-language response header. browsers set adequate values for this header according to their user interface language and even if a user can change it, this happens rarely (and is frowned upon as it leads to fingerprinting). this header is a hint to be used when the server has no way of determining the language via another way, like a specific url, that is controlled by an explicit user decision. it is recommended that the server never ...
...ept-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"). this consists of a 2-3 letter base language tag representing the language, optionally followed by additional subtags separated by '-'. the most common extra in
formation 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. * any language; '*' is used as a wildcard. ;q= (q-factor weighting) any value placed in an order of preference expressed using a relative quality value called weight. ...
Content-Security-Policy-Report-Only - HTTP
header type response header forbidden header name no this header is not supported inside a <meta> element. ...
...position": "report" } } as you can see, the report includes the full path to the violating resource in blocked-uri. this is not always the case. for example, when the signup.html would attempt to load css from http://anothercdn.example.com/stylesheet.css, the browser would not include the full path but only the origin (http://anothercdn.example.com). this is done to prevent leaking sensitive in
formation about cross-origin resources. specifications specification status comment content security policy level 3 working draft no changes. content security policy level 2 recommendation initial definition. ...
Expect - HTTP
for example, the server may reject a request if its content-length is too large. ...
...e. for example, the server may reject a request if its content-length is too large. no common browsers send the expect header, but some other clients such as curl do so by default. header type request header forbidden header name yes syntax no other expectations except "100-continue" are specified currently. expect: 100-continue directives 100-continue in
forms recipients that the client is about to send a (presumably large) message body in this request and wishes to receive a 100 (continue) interim response. examples large message body a client sends a request with a expect header and waits for the server to respond before sending the message body. put /somewhere/fun http/1.1 host: origin.example.com content-type: video/h264 content-length: 12345...
Forwarded - HTTP
the forwarded header contains in
formation from the reverse proxy servers that is altered or lost when a proxy is involved in the path of the request. the alternative and de-facto standard versions of this header are the x-forwarded-for, x-forwarded-host and x-forwarded-proto headers. this header is used for debugging, statistics, and generating location-dependent content and by design it exposes privacy sensitive in
formation, such as the ip address of the client. therefore the user's privacy must be kept in mind when deploying this header. ...
...and by design it exposes privacy sensitive in
formation, such as the ip address of the client. therefore the user's privacy must be kept in mind when deploying this header. header type request header forbidden header name no syntax forwarded: by=<identifier>;for=<identifier>;host=<host>;proto=<http|https> directives <identifier> an identifier disclosing the in
formation that is altered or lost when using a proxy. this can be either: an ip address (v4 or v6, optionally with a port, and ipv6 quoted and enclosed in square brackets), an obfuscated identifier (such as "_hidden" or "_secret"), or "unknown" when the preceding entity is not known (and you still want to indicate that forwarding of the request was made). by=<identifier> the interface wh...
Public-Key-Pins-Report-Only - HTTP
p public-key-pins-report-only response header was used to send reports of pinning violation to the report-uri specified in the header but, unlike public-key-pins still allows browsers to connect to the server if the pinning is violated. the header is silently ignored in modern browsers as support for hpkp has been removed. use certificate transparency and the expect-ct header instead. for more in
formation, see the public-key-pins header reference page and the http public key pinning article. header type response header forbidden header name no syntax public-key-pins-report-only: pin-sha256="<pin-value>"; max-age=<expire-time>; includesubdomains; report-uri="<uri>" directive...
.... header type response header forbidden header name no syntax public-key-pins-report-only: pin-sha256="<pin-value>"; max-age=<expire-time>; includesubdomains; report-uri="<uri>" directives pin-sha256="<pin-value>" the quoted string is the base64 encoded subject public key in
formation (spki) fingerprint. it is possible to specify multiple pins for different public keys. some browsers might allow other hashing algorithms than sha-256 in the future. max-age=<expire-time> this directive is meaningless for the public-key-pins-report-only header, it will be ignored by user agents and the header will not be cached. includesubdomains optional if this optional parameter is sp...
Public-Key-Pins - HTTP
ecated in favor of certificate transparency and expect-ct header. the http public-key-pins response header used to associate a specific cryptographic public key with a certain web server to decrease the risk of mitm attacks with forged certificates, however, it has been removed from modern browsers and is no longer supported. use certificate transparency and expect-ct header instead. for more in
formation, see the http public key pinning article. header type response header forbidden header name no syntax public-key-pins: pin-sha256="<pin-value>"; max-age=<expire-time>; includesubdomains; report-uri="<uri>" directives pin-sha256="<pin-value>" the quoted string is the base64 encoded subject public key info...
...4hhybnf6lhkmjahkhpgpwe="; max-age=5184000; includesubdomains; report-uri="https://www.example.org/hpkp-report" in this example, pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" pins the server's public key used in production. the second pin declaration pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe=" also pins the backup key. max-age=5184000 tells the client to store this in
formation for two months, which is a reasonable time limit according to the ietf rfc. this key pinning is also valid for all subdomains, which is told by the includesubdomains declaration. finally, report-uri="https://www.example.org/hpkp-report" explains where to report pin validation failures. specifications specification title rfc 7469, section 2.1: public-key-pins public ...
Server-Timing - HTTP
the server-timing header communicates one or more metrics and descriptions for a given request-response cycle. it is used to surface any backend server timing metrics (e.g. database read/write, cpu time, file system access, etc.) in the developer tools in the user's browser or in the per
formanceservertiming interface. header type response header forbidden header name no syntax the syntax of the server-timing header allows you to communicate metrics in different ways: server metric name only, metric with value, metric with value and description, and metric with description. the specification advices that names and descriptions should be kept as short as possible (use abbreviations and omit optional values where possible) to minimize the http overhead. // sing...
...-timing: cpu;dur=2.4 // single metric with description and value server-timing: cache;desc="cache read";dur=23.2 // two metrics with value server-timing: db;dur=53, app;dur=47.2 // server-timing as trailer trailer: server-timing --- response body --- server-timing: total;dur=123.4 privacy and security the server-timing header may expose potentially sensitive application and infrastructure in
formation. consider to control which metrics are returned when and to whom on the server side. for example, you could only show metrics to authenticated users and nothing to the public. per
formanceservertiming interface in addition to having server-timing header metrics appear in the developer tools of the browser, the per
formanceservertiming interface enables tools to automatically collect and proc...
TE - HTTP
in http/2 - the te header field is only accepted if the trailers value is set. see also the transfer-encoding response header for more details on transfer encodings. note that chunked is always acceptable for http/1.1 recipients and you don't have to specify "chunked" using the te header. however, it is useful for setting if the client is accepting trailer fields in a chunked transfer coding using the "trailers" value. ...
...ader. however, it is useful for setting if the client is accepting trailer fields in a chunked transfer coding using the "trailers" value. header type request header forbidden header name yes syntax te: compress te: deflate te: gzip te: trailers // multiple directives, weighted with the quality value syntax: te: trailers, deflate;q=0.5 directives compress a
format using the lempel-ziv-welch (lzw) algorithm is accepted as a transfer coding name. deflate using the zlib structure is accepted as a transfer coding name. gzip a
format using the lempel-ziv coding (lz77), with a 32-bit crc is accepted as a transfer coding name. trailers indicates that the client is willing to accept trailer fields in a chunked transfer coding. q when multiple transfer ...
Upgrade - HTTP
ies the protocol(s) being switched to. for example: http/1.1 101 switching protocols upgrade: foo/2 connection: upgrade send a response to the original request using the new protocol (the server may only switch to a protocol with which it can complete the original request). a server may also send the header as part of a 426 upgrade required response, to indicate that the server won't per
form the request using the current protocol, but might do so if the protocol is changed. the client can then request a protocol change using the process above. more detail and examples are provided in the topic protocol upgrade mechanism. syntax connection: upgrade upgrade: protocol_name[/protocol_version] notes: the connection header with type upgrade must always be sent with the upgrade he...
... examples connection: upgrade upgrade: http/2.0, shttp/1.3, irc/6.9, rta/x11 connection: upgrade upgrade: websocket specifications specification hypertext transfer protocol (http/1.1): message syntax and routing (http/1.1)# header.upgrade hypertext transfer protocol (http/1.1): semantics and content (http/1.1)# status.426 hypertext transfer protocol version 2 (http/2) (http/2)# in
formational-responses ...
Warning - HTTP
more than one warning header may appear in a response. ...
...ue to an inability to reach the server. 112 disconnected operation the cache is disconnected from the rest of the network. 113 heuristic expiration sent if a cache heuristically chose a freshness lifetime greater than 24 hours and the response's age is greater than 24 hours. 199 miscellaneous warning arbitrary, non-specific warning 214 trans
formation applied added by a proxy if it applies any trans
formation to the representation, such as changing the content-coding, media-type or the like. 299 miscellaneous persistent warning same as 199, but indicating a persistent warning examples warning: 110 anderson/1.3.37 "response is stale" date: wed, 21 oct 2015 07:28:00 gmt warning: 112 - "cache down" "wed, 21 oct 2015...
X-Forwarded-For - HTTP
rough an http proxy or a load balancer. when traffic is intercepted between clients and servers, server access logs contain the ip address of the proxy or load balancer only. to see the original ip address of the client, the x-forwarded-for request header is used. this header is used for debugging, statistics, and generating location-dependent content and by design it exposes privacy sensitive in
formation, such as the ip address of the client. therefore the user's privacy must be kept in mind when deploying this header. a standardized version of this header is the http forwarded header. x-forwarded-for is also an email-header indicating that an email-message was forwarded from another account. header type request header forbidden header name no syntax x-forw...
...le proxies, the ip addresses of each successive proxy is listed. this means, the right-most ip address is the ip address of the most recent proxy and the left-most ip address is the ip address of the originating client. examples x-forwarded-for: 2001:db8:85a3:8d3:1319:8a2e:370:7348 x-forwarded-for: 203.0.113.195 x-forwarded-for: 203.0.113.195, 70.41.3.18, 150.172.238.178 other non-standard
forms: # used for some google services x-proxyuser-ip: 203.0.113.19 specifications not part of any current specification. the standardized version of this header is forwarded. ...
PATCH - HTTP
necessarily so for patch. patch (like put) may have side-effects on other resources. to find out whether a server supports patch, a server can advertise its support by adding it to the list in the allow or access-control-allow-methods (for cors) response headers. ...
...r access-control-allow-methods (for cors) response headers. another (implicit) indication that patch is allowed, is the presence of the accept-patch header, which specifies the patch document
formats accepted by the server. request has body yes successful response has body yes safe no idempotent no cacheable no allowed in html
forms no syntax patch /file.txt http/1.1 example request patch /file.txt http/1.1 host: www.example.com content-type: application/example if-match: "e0023aa4e" content-length: 100 [description of changes] response a successful response is indicated by any 2xx status code. in the example below a 204 response code is used, because the response does not carry a payload body. a 200 resp...
TRACE - HTTP
the http trace method per
forms a message loop-back test along the path to the target resource, providing a useful debugging mechanism. the final recipient of the request should reflect the message received, excluding some fields described below, back to the client as the message body of a 200 (ok) response with a content-type of message/http. the final recipient is either the origin server or the first server to receive a max-forwards value of 0 in the request. ...
...elow, back to the client as the message body of a 200 (ok) response with a content-type of message/http. ...
HTTP request methods - HTTP
although they can also be nouns, these request methods are sometimes referred to as http verbs. each of them implements a different semantic, but some common features are shared by a group of them: e.g. a request method can be safe, idempotent, or cacheable. get the get method requests a representation of the specified resource. requests using get should only retrieve data. head the head method asks for a response identical to that of a get request, but without the response body. ...
...t the put method replaces all current representations of the target resource with the request payload. delete the delete method deletes the specified resource. connect the connect method establishes a tunnel to the server identified by the target resource. options the options method is used to describe the communication options for the target resource. trace the trace method per
forms a message loop-back test along the path to the target resource. patch the patch method is used to apply partial modifications to a resource. specifications specification title comment rfc 7231, section 4: request methods hypertext transfer protocol (http/1.1): semantics and content specifies get, head, post, put, delete, connect, options, trace. rfc ...
Protocol upgrade mechanism - HTTP
er decides to upgrade the connection, it sends back a 101 switching protocols response status with an upgrade header that specifies the protocol(s) being switched to. if it does not (or cannot) upgrade the connection, it ignores the upgrade header and sends back a regular response (for example, a 200 ok). right after sending the 101 status code, the server can begin speaking the new protocol, per
forming any additional protocol-specific handshakes as necessary. effectively, the connection becomes a two-way pipe as soon as the upgraded response is complete, and the request that initiated the upgrade can be completed over the new protocol. common uses for this mechanism here we look at the most common use cases for the upgrade header. upgrading to a websocket connection by far, the most comm...
...sions in one such header. sec-websocket-extensions: extensions extensions a comma-separated list of extensions to request (or agree to support). these should be selected from the iana websocket extension name registry. extensions which take parameters do so by using semicolon delineation. for example: sec-websocket-extensions: superspeed, colormode; depth=16 sec-websocket-key provides in
formation to the server which is needed in order to confirm that the client is entitled to request an upgrade to websocket. this header can be used when insecure (http) clients wish to upgrade, in order to offer some degree of protection against abuse. the value of the key is computed using an algorithm defined in the websocket specification, so this does not provide security. instead, it helps to pre...
HTTP
d uses. http cache caching is very important for fast web sites. this article describes different methods of caching and how to use http headers to control them. http cookies how cookies work is defined by rfc 6265. when serving an http request, a server can send a set-cookie http header with the response. the client then returns the cookie's value with every request to the same server in the
form of a cookie request header. the cookie can also be set to expire on a certain date, or restricted to a specific domain and path. cross-origin resource sharing (cors) cross-site http requests are http requests for resources from a different domain than the domain of the resource making the request. for instance, an html page from domain a (http://domaina.example/) makes a request for an image on...
...ined in rfc 4229. iana also maintains a registry of proposed new http message headers. http request methods the different operations that can be done with http: get, post, and also less common requests like options, delete, or trace. http status response codes http response codes indicate whether a specific http request has been successfully completed. responses are grouped in five classes: in
formational responses, successful responses, redirections, client errors, and servers errors. csp directives the content-security-policy response header fields allows web site administrators to control resources the user agent is allowed to load for a given page. with a few exceptions, policies mostly involve specifying server origins and script endpoints. tools & resources helpful tools and r...
CSS Houdini
ed to be passed as function arguments. li { background-image: paint(mycomponent, stroke, 10px); --highlights: blue; --lowlights: green; } note: with great power comes great responsibility! with houdini you could invent your own masonry, grid, or regions implementation, but doing so is not necessarily the best idea. the css working group does a lot of work to ensure every feature is per
formant, handles all edge cases, and considers security, privacy, and accessibility. as you extend css with houdini, make sure to keep these considerations in mind, and start small before moving on to more ambitious projects. the houdini apis below you can find links to the main reference pages covering the apis that fall under the houdini umbrella, along with links to guides to help you if you nee...
...fines an api for registering new css properties. properties registered using this api are provided with a parse syntax that defines a type, inheritance behaviour, and an initial value. css properties and values api reference css properties and values api guide css typed om converting cssom value strings into meaningfully typed javascript representations and back can incur a significant per
formance overhead. the css typed om exposes css values as typed javascript objects to allow their per
formant manipulation. css typed om reference css typed om guide css layout api designed to improve the extensibility of css, this api enables developers to write their own layout algorithms, like masonry or line snapping. it is not yet natively available. no guide or reference has current...
JavaScript Guide - JavaScript
the javascript guide shows you how to use javascript and gives an overview of the language. if you need exhaustive in
formation about a language feature, have a look at the javascript reference. chapters this guide is divided into several chapters: introduction about this guide about javascript javascript and java ecmascript tools hello world grammar and types basic syntax & comments declarations variable scope variable hoisting data structures and types literals control flow and error handling if...else switch try/catch/throw error objects loops and iteration for while do...while break/continue for..in for..of functions defining functions calling functions function scope closures arguments & para...
...ontinue for..in for..of functions defining functions calling functions function scope closures arguments & parameters arrow functions expressions and operators assignment & comparisons arithmetic operators bitwise & logical operators conditional (ternary) operator numbers and dates number literals number object math object date object text
formatting string literals string object template literals internationalization regular expressions indexed collections arrays typed arrays keyed collections map weakmap set weakset working with objects objects and properties creating objects defining methods getter and setter details of the object model prototype-based oop creating object ...
ReferenceError: deprecated caller or arguments usage - JavaScript
and 'caller' cannot be accessed in strict mode. (safari) error type a strict-mode-only warning that a referenceerror occurred. javascript execution won't be halted. what went wrong? in strict mode, the function.caller or function.arguments properties are used and shouldn't be. they are deprecated, because they leak the function caller, are non-standard, hard to optimize and potentially a per
formance-harmful feature. examples deprecated function.caller or arguments.callee.caller function.caller and arguments.callee.caller are deprecated (see the reference articles for more in
formation). 'use strict'; function myfunc() { if (myfunc.caller == null) { return 'the function was called from the top!'; } else { return 'this function\'s caller was ' + myfunc.caller; } } myfunc...
...tion). 'use strict'; function myfunc() { if (myfunc.caller == null) { return 'the function was called from the top!'; } else { return 'this function\'s caller was ' + myfunc.caller; } } myfunc(); // warning: referenceerror: deprecated caller usage // "the function was called from the top!" function.arguments function.arguments is deprecated (see the reference article for more in
formation). 'use strict'; function f(n) { g(n - 1); } function g(n) { console.log('before: ' + g.arguments[0]); if (n > 0) { f(n); } console.log('after: ' + g.arguments[0]); } f(2); console.log('returned: ' + g.arguments); // warning: referenceerror: deprecated arguments usage ...
RangeError: invalid date - JavaScript
(). message rangeerror: invalid date (edge) rangeerror: invalid date (firefox) rangeerror: invalid time value (chrome) rangeerror: provided date is not in valid range (chrome) error type rangeerror what went wrong? a string leading to an invalid date has been provided to date or date.parse(). ...
...or: invalid time value (chrome) rangeerror: provided date is not in valid range (chrome) error type rangeerror what went wrong? a string leading to an invalid date has been provided to date or date.parse(). examples invalid cases unrecognizable strings or dates containing illegal element values in iso
formatted strings usually return nan. however, depending on the implementation, non–con
forming iso
format strings, may also throw rangeerror: invalid date, like the following cases in firefox: new date('foo-bar 2014'); new date('2014-25-23').toisostring(); new date('foo-bar 2014').tostring(); this, however, returns nan in firefox: date.parse('foo-bar 2014'); // nan for more details, see the date.parse() documentation. valid cases new date('05 october 2011 14:48 utc'); new date(13...
Array.prototype.copyWithin() - JavaScript
pywithin will copy from index 0. end optional zero-based index at which to end copying elements from. copywithin copies up to but not including end. if negative, end will be counted from the end. if end is omitted, copywithin will copy until the last index (default to arr.length). return value the modified array. description the copywithin works like c and c++'s memmove, and is a high-per
formance method to shift the data of an array. this especially applies to the typedarray method of the same name. the sequence is copied and pasted as one operation; pasted sequence will have the copied values even when the copy and paste region overlap. the copywithin function is intentionally generic, it does not require that its this value be an array object. the copywithin method is a mutable me...
... ...
Array.prototype.sort() - JavaScript
eric sort, 9 comes before 80, but because numbers are converted to strings, "80" comes before "9" in the unicode order. all undefined elements are sorted to the end of the array. note : in utf-16, unicode characters above \uffff are encoded as two surrogate code units, of the range \ud800-\udfff. the value of each code unit is taken separately into account for the comparison. thus the character
formed by the surrogate pair \ud655\ude55 will be sorted before the character \uff3a. if comparefunction is supplied, all non-undefined array elements are sorted according to the return value of the compare function (all undefined elements are sorted to the end of the array, with no call to comparefunction). if a and b are two elements being compared, then: if comparefunction(a, b) returns less t...
...versions dating back to at least 2003) respect this. if comparefunction(a, b) returns greater than 0, sort b to an index lower than a (i.e. b comes first). comparefunction(a, b) must always return the same value when given a specific pair of elements a and b as its two arguments. if inconsistent results are returned, then the sort order is undefined. so, the compare function has the following
form: function compare(a, b) { if (a is less than b by some ordering criterion) { return -1; } if (a is greater than b by the ordering criterion) { return 1; } // a must be equal to b return 0; } to compare numbers instead of strings, the compare function can simply subtract b from a. the following function will sort the array in ascending order (if it doesn't contain infinity a...
Array.prototype.toLocaleString() - JavaScript
ring() method returns a string representing the elements of the array. the elements are converted to strings using their tolocalestring methods and these strings are separated by a locale-specific string (such as a comma “,”). syntax arr.tolocalestring([locales[, options]]); parameters locales optional a string with a bcp 47 language tag, or an array of such strings. for the general
form and interpretation of the locales argument, see the intl page. options optional an object with configuration properties, for numbers see number.prototype.tolocalestring(), and for dates see date.prototype.tolocalestring(). return value a string representing the elements of the array. polyfill // https://tc39.github.io/ecma402/#sup-array.prototype.tolocalestring if (!array.prototype.toloca...
...ds. object: object.prototype.tolocalestring() number: number.prototype.tolocalestring() date: date.prototype.tolocalestring() always display the currency for the strings and numbers in the prices array: var prices = ['¥7', 500, 8123, 12]; prices.tolocalestring('ja-jp', { style: 'currency', currency: 'jpy' }); // "¥7,¥500,¥8,123,¥12" for more examples, see also the intl, number
format, and datetime
format pages. specifications specification ecmascript (ecma-262)the definition of 'array.prototype.tolocalestring' in that specification. ecmascript internationalization api (ecma-402)the definition of 'array.prototype.tolocalestring' in that specification. ...
Array - JavaScript
neither the length of a javascript array nor the types of its elements are fixed. since an array's length can change at any time, and data can be stored at non-contiguous locations in the array, javascript arrays are not guaranteed to be dense; this depends on how the programmer chooses to use them. ...
...ing the length property does, however, delete elements. fruits.length = 2 console.log(object.keys(fruits)) // ['0', '1'] console.log(fruits.length) // 2 this is explained further on the array.length page. creating an array using the result of a match the result of a match between a regexp and a string can create a javascript array. this array has properties and elements which provide in
formation about the match. such an array is returned by regexp.exec(), string.match(), and string.replace(). to help explain these properties and elements, see this example and then refer to the table below: // match one d followed by one or more b's followed by one d // remember matched b's and the following d // ignore case const myre = /d(b+)(d)/i const myarray = myre.exec('cdbbdbsbz') the pro...
Date.prototype.getDay() - JavaScript
uesday, and so on. examples using getday() the second statement below assigns the value 1 to weekday, based on the value of the date object xmas95. december 25, 1995, is a monday. ...
...r 25, 1995, is a monday. var xmas95 = new date('december 25, 1995 23:15:30'); var weekday = xmas95.getday(); console.log(weekday); // 1 note: if needed, the full name of a day ("monday" for example) can be obtained by using intl.datetime
format with an options parameter. using this method, the internationalization is made easier: var options = { weekday: 'long'}; console.log(new intl.datetime
format('en-us', options).
format(xmas95)); // monday console.log(new intl.datetime
format('de-de', options).
format(xmas95)); // montag specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getday' in that specification. ...
Date.prototype.getMonth() - JavaScript
january, 1 to february, and so on. examples using getmonth() the second statement below assigns the value 11 to the variable month, based on the value of the date object xmas95. ...
...of the date object xmas95. var xmas95 = new date('december 25, 1995 23:15:30'); var month = xmas95.getmonth(); console.log(month); // 11 note: if needed, the full name of a month ("january" for example) can be obtained by using intl.datetime
format() with an options parameter. using this method, internationalization is made easier: var options = { month: 'long'}; console.log(new intl.datetime
format('en-us', options).
format(xmas95)); // december console.log(new intl.datetime
format('de-de', options).
format(xmas95)); // dezember specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getmonth' in that specification. ...
Date.prototype.toGMTString() - JavaScript
the togmtstring() method converts a date to a string, using internet greenwich mean time (gmt) conventions. the exact
format of the value returned by togmtstring() varies according to the plat
form and browser, in general it should represent a human readable date string. note: togmtstring() is deprecated and should no longer be used. it remains implemented only for backward compatibility; please use toutcstring() instead. syntax dateobj.togmtstring() return value a string representing the given date following the internet greenwich mean time (gmt) convention. ...
...compatibility; please use toutcstring() instead. syntax dateobj.togmtstring() return value a string representing the given date following the internet greenwich mean time (gmt) convention. examples simple example in this example, the togmtstring() method converts the date to gmt (utc) using the operating system's time-zone offset and returns a string value that is similar to the following
form. the exact
format depends on the plat
form. var today = new date(); var str = today.togmtstring(); // deprecated! use toutcstring() console.log(str); // mon, 18 dec 1995 17:28:35 gmt specifications specification ecmascript (ecma-262)the definition of 'date.prototype.togmtstring' in that specification. ...
Date.prototype.toISOString() - JavaScript
polyfill this method was standardized in ecma-262 5th edition. ...
...y). the timezone is always zero utc offset, as denoted by the suffix "z". the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.toisostring() return value a string representing the given date in the iso 8601
format according to universal time. polyfill this method was standardized in ecma-262 5th edition. engines which have not been updated to support this method can work around the absence of this method using the following shim: if (!date.prototype.toisostring) { (function() { function pad(number) { if (number < 10) { return '0' + number; } return number; } ...
Date.prototype.toTimeString() - JavaScript
the totimestring() method returns the time portion of a date object in human readable
form in american english. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.totimestring() return value a string representing the time portion of the given date in human readable
form in american english. description date instances refer to a specific point in time. calling tostring() will return the date
formatted in a human readable
form in american english. in spidermonkey, this consists of the date portion (day, month, and year) followed by the time portion (hours, minutes, seconds, and time zone). sometimes i...
...ion (day, month, and year) followed by the time portion (hours, minutes, seconds, and time zone). sometimes it is desirable to obtain a string of the time portion; such a thing can be accomplished with the totimestring() method. the totimestring() method is especially useful because compliant engines implementing ecma-262 may differ in the string obtained from tostring() for date objects, as the
format is implementation-dependent; simple string slicing approaches may not produce consistent results across multiple engines. examples a basic usage of totimestring() var d = new date(1993, 6, 28, 14, 39, 7); console.log(d.tostring()); // wed jul 28 1993 14:39:07 gmt-0600 (pdt) console.log(d.totimestring()); // 14:39:07 gmt-0600 (pdt) specifications specification ecmasc...
Date.prototype.toUTCString() - JavaScript
he source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.toutcstring() return value a string representing the given date using the utc time zone. description the value returned by toutcstring() is a string in the
form www, dd mmm yyyy hh:mm:ss gmt, where:
format sring description www day of week, as three letters (e.g. sun, mon, ...) dd day of month, as two digits with leading zero if required mmm month, as three letters (e.g. jan, feb, ...) yyyy year, as four or more digits with leading zeroes if required hh hour, as two digits with ...
...eading zero if required mmm month, as three letters (e.g. jan, feb, ...) yyyy year, as four or more digits with leading zeroes if required hh hour, as two digits with leading zero if required mm minute, as two digits with leading zero if required ss seconds, as two digits with leading zero if required prior to ecmascript 2018, the
format of the return value varied according to the plat
form. the most common return value was an rfc-1123
formatted date stamp, which is a slightly updated version of rfc-822 date stamps. examples using toutcstring() let today = new date('wed, 14 jun 2017 00:00:00 pdt'); let utcstring = today.toutcstring(); // wed, 14 jun 2017 07:00:00 gmt specifications specification ecmas...
Function() constructor - JavaScript
the function constructor creates a new function object. calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) per
formance issues to eval. however, unlike eval, the function constructor creates functions which execute in the global scope only. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new function([arg1 [, arg2 [, ...argn]] ,] functionbody) parameters arg1, arg2, ... argn names to be used by the function as
formal argument names. each must be a string that corresponds to a valid javascript identifier, or a list of such st...
...les specifying arguments with the function constructor the following code creates a function object that takes two arguments. // example can be run directly in your javascript console // create a function that takes two arguments, and returns the sum of those arguments const adder = new function('a', 'b', 'return a + b'); // call the function adder(2, 6); // 8 the arguments "a" and "b" are
formal argument names that are used in the function body, "return a + b". specifications specification ecmascript (ecma-262)the definition of 'function constructor' in that specification. ...
Function.prototype.bind() - JavaScript
ed by the function call. a bound function may also be constructed using the new operator. doing so acts as though the target function had instead been constructed. the provided this value is ignored, while prepended arguments are provided to the emulated function. polyfill because older browsers are generally also slower browsers, it is far more critical than most people recognize to create per
formance polyfills to make the browsing experience in outdated browsers slightly less horrible. thus, presented below are two options for function.prototype.bind() polyfills: the first one is much smaller and more per
formant, but does not work when using the new operator. the second one is bigger and less per
formant, but it permits some usage of the new operator on bound functions. generally, i...
...you must not rely on those cases where behavior deviates from ecma-262, 5th edition! thankfully, these deviations from the specification rarely (if ever) come up in most coding situations. if you do not understand any of the deviations from the specification above, then it is safe in this particular case to not worry about these noncompliant deviation details. if it's absolutely necessary and per
formance is not a concern, a far slower (but more specification-compliant solution) can be found at https://github.com/raynos/function-bind. examples creating a bound function the simplest use of bind() is to make a function that, no matter how it is called, is called with a particular this value. a common mistake for new javascript programmers is to extract a method from an object, then to later ...
Intl.Collator() constructor - JavaScript
ison. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new intl.collator([locales[, options]]) parameters locales optional. a string with a bcp 47 language tag, or an array of such strings. for the general
form and interpretation of the locales argument, see the intl page. the following unicode extension keys are allowed: co variant collations for certain locales. possible values include: "big5han", "dict", "direct", "ducet", "gb2312", "phonebk", "phonetic", "pinyin", "re
formed", "searchjl", "stroke", "trad", "unihan". the "standard" and "search" values are ignored; they are replaced by the optio...
...lse" (use the locale's default). this option can be set through an options property or through a unicode extension key; if both are provided, the options property takes precedence. options optional. an object with some or all of the following properties: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for in
formation about this option, see the intl page. usage whether the comparison is for sorting or for searching for matching strings. possible values are "sort" and "search"; the default is "sort". sensitivity which differences in the strings should lead to non-zero result values. possible values are: "base": only strings that differ in base letters compare as unequal. examples: a ≠ b...
Intl.DisplayNames.prototype.resolvedOptions() - JavaScript
description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. ...
... description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. ...
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. ...
... description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. ...
Intl.PluralRules - JavaScript
the intl.pluralrules object enables plural-sensitive
formatting and plural-related language rules. constructor intl.pluralrules.pluralrules() creates a new intl.pluralrules object. static methods intl.pluralrules.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.pluralrules.prototype.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object. intl.pluralrules.prototype.select() returns a string indicating which plural rule to use for locale-aware
formatting. examples using locales this example shows some of the variations in localized plural rules. in order ...
...alrules.prototype.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object. intl.pluralrules.prototype.select() returns a string indicating which plural rule to use for locale-aware
formatting. examples using locales this example shows some of the variations in localized plural rules. ...
JSON.stringify() - JavaScript
t under key '${key}'`; else return this; } }; json.stringify(obj); // '{"data":"data"}' json.stringify({ obj }); // shorthand property names (es2015). // '{"obj":"now i am a nested object under key 'obj'"}' json.stringify([ obj ]); // '["now i am a nested object under key '0'"]' issue with json.stringify() when serializing circular references note that since the json
format doesn't support object references (although an ietf draft exists), a typeerror will be thrown if one attempts to encode an object with circular references. const circularreference = {}; circularreference.myself = circularreference; // serializing circular references throws "typeerror: cyclic object value" json.stringify(circularreference); to serialize circular references you can use a libr...
...push({ 'name': 'screend', 'width': 250, 'height': 60 }); session.screens.push({ 'name': 'screene', 'width': 390, 'height': 120 }); session.screens.push({ 'name': 'screenf', 'width': 1240, 'height': 650 }); // converting the json string with json.stringify() // then saving with localstorage in the name of session localstorage.setitem('session', json.stringify(session)); // example of how to trans
form the string generated through // json.stringify() and saved in localstorage in json object again var restoredsession = json.parse(localstorage.getitem('session')); // now restoredsession variable contains the object that was saved // in localstorage console.log(restoredsession); well-
formed json.stringify() engines implementing the well-
formed json.stringify specification will stringify lone s...
JSON - JavaScript
) parses the string as json and eval executes the string as javascript: let code = '"\u2028\u2029"' json.parse(code) // evaluates to "\u2028\u2029" in all engines eval(code) // throws a syntaxerror in old engines other differences include allowing only double-quoted strings and having no provisions for undefined or comments. for those who wish to use a more human-friendly configuration
format based on json, there is json5, used by the babel compiler, and the more commonly used yaml. full json syntax the full json syntax is as follows: json = null or true or false or jsonnumber or jsonstring or jsonobject or jsonarray jsonnumber = - positivenumber or positivenumber positivenumber = decimalnumber or decimalnumber . digits o...
...jsonnumber (numbers must contain no whitespace) or jsonstring (where it is interpreted as the corresponding character in the string, or would cause an error). the tab character (u+0009), carriage return (u+000d), line feed (u+000a), and space (u+0020) characters are the only valid whitespace characters. static methods json.parse(text[, reviver]) parse the string text as json, optionally trans
form the produced value and its properties, and return the value. any violations of the json syntax, including those pertaining to the differences between javascript and json, cause a syntaxerror to be thrown. the reviver option allows for interpreting what the replacer has used to stand in for other datatypes. json.stringify(value[, replacer[, space]]) return a json string corresponding to the spec...
Map - JavaScript
ng keys will yield the keys in order of insertion. size the number of items in a map is easily retrieved from its size property. the number of items in an object must be determined manually. iteration a map is an iterable, so it can be directly iterated. iterating over an object requires obtaining its keys in some fashion and iterating over them. per
formance per
forms better in scenarios involving frequent additions and removals of key-value pairs. not optimized for frequent additions and removals of key-value pairs. setting object properties setting object properties works for map objects as well, and can cause considerable confusion. therefore, this appears to work in a way: let wrongmap = new map() wrongmap['bl...
... value] of mymap.entries()) { console.log(key + ' = ' + value) } // 0 = zero // 1 = one iterating map with foreach() maps can be iterated using the foreach() method: mymap.foreach(function(value, key) { console.log(key + ' = ' + value) }) // 0 = zero // 1 = one relation with array objects let kvarray = [['key1', 'value1'], ['key2', 'value2']] // use the regular map constructor to trans
form a 2d key-value array into a map let mymap = new map(kvarray) mymap.get('key1') // returns "value1" // use array.from() to trans
form a map into a 2d key-value array console.log(array.from(mymap)) // will show you exactly the same array as kvarray // a succinct way to do the same, using the spread syntax console.log([...mymap]) // or use the keys() or values() iterators, and convert them to an ...
Math.random() - JavaScript
the implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. math.random() does not provide cryptographically secure random numbers. do not use them for anything related to security. use the web crypto api instead, and more precisely the window.crypto.getrandomvalues() method. ...
...an min if min isn't an integer), and is less than (but not equal to) max. function getrandomint(min, max) { min = math.ceil(min); max = math.floor(max); return math.floor(math.random() * (max - min) + min); //the maximum is exclusive and the minimum is inclusive } it might be tempting to use math.round() to accomplish that, but doing so would cause your random numbers to follow a non-uni
form distribution, which may not be acceptable for your needs. getting a random integer between two values, inclusive while the getrandomint() function above is inclusive at the minimum, it's exclusive at the maximum. what if you need the results to be inclusive at both the minimum and the maximum? the getrandomintinclusive() function below accomplishes that. function getrandomintinclusive(min, ma...
Math.random() - JavaScript
the implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. math.random() does not provide cryptographically secure random numbers. do not use them for anything related to security. use the web crypto api instead, and more precisely the window.crypto.getrandomvalues() method. ...
...an min if min isn't an integer), and is less than (but not equal to) max. function getrandomint(min, max) { min = math.ceil(min); max = math.floor(max); return math.floor(math.random() * (max - min) + min); //the maximum is exclusive and the minimum is inclusive } it might be tempting to use math.round() to accomplish that, but doing so would cause your random numbers to follow a non-uni
form distribution, which may not be acceptable for your needs. getting a random integer between two values, inclusive while the getrandomint() function above is inclusive at the minimum, it's exclusive at the maximum. what if you need the results to be inclusive at both the minimum and the maximum? the getrandomintinclusive() function below accomplishes that. function getrandomintinclusive(min, ma...
Math - JavaScript
angent of x. math.tanh(x) returns the hyperbolic tangent of x. math.trunc(x) returns the integer portion of x, removing any fractional digits. examples converting between degrees and radians the trigonometric functions sin(), cos(), tan(), asin(), acos(), atan(), and atan2() expect (and return) angles in radians. ...
... in javascript, we can do this with the following: 50 * math.tan(degtorad(60)). we use our degtorad() function to convert 60 degrees to radians, as math.tan() expects an input value in radians. ...
Number - JavaScript
this means it can represent fractional values, but there are some limits to what it can store. ...
...08. numbers beyond that are replaced with the special number constant infinity. a number literal like 37 in javascript code is a floating-point value, not an integer. there is no separate integer type in common everyday use. (javascript now has a bigint type, but it was not designed to replace number for everyday uses. 37 is still a number, not a bigint.) number may also be expressed in literal
forms like 0b101, 0o13, 0x0a. learn more on numeric lexical grammar here. description when used as a function, number(value) converts a string or other value to the number type. if the value can't be converted, it returns nan. literal syntax 123 // one-hundred twenty-three 123.0 // same 123 === 123.0 // true function syntax number('123') // returns the number 123 number('123') === 123 ...
Object.prototype.__proto__ - JavaScript
warning: changing the [[prototype]] of an object is, by the nature of how modern javascript engines optimize property accesses, a very slow operation, in every browser and javascript engine. the effects on the per
formance of altering inheritance are subtle and far-flung, and are not limited to simply the time spent in obj.__proto__ = ... statements, but may extend to any code that has access to any object whose [[prototype]] has been altered. if you care about per
formance you should avoid setting the [[prototype]] of an object. instead, create a new object with the desired [[prototype]] using object.create(). warning: while object.prototype.__proto__ is supported today in most browsers, its existence and exact behavior has only been standardized in the ecmascript 2015 specificati...
...way. only recently was the __proto__ property standardized by the ecmascript 2015 specification for compatibility with web browsers, so it will be supported into the future. it is deprecated in favor of object.getprototypeof/reflect.getprototypeof and object.setprototypeof/reflect.setprototypeof (though still, setting the [[prototype]] of an object is a slow operation that should be avoided if per
formance is a concern). the __proto__ property can also be used in an object literal definition to set the object [[prototype]] on creation, as an alternative to object.create(). see: object initializer / literal syntax. description the __proto__ getter function exposes the value of the internal [[prototype]] of an object. for objects created using an object literal, this value is object.prototype.
Object.prototype.toString() - JavaScript
r binary numbers, 8 for octal numbers, 10 for decimal numbers, 16 for hexadecimal numbers. examples overriding the default tostring method you can create a function to be called in place of the default tostring() method. the tostring() method takes no arguments and should return a string. the tostring() method you create can be any value you want, but it will be most useful if it carries in
formation about the object. 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...
...w 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 code creates and assigns dogtostring() to override the default tostring() method. this function generates a string containing the name, breed, color, and sex of the object, in the
form "property = value;". dog.prototype.tostring = function dogtostring() { const ret = 'dog ' + this.name + ' is a ' + this.sex + ' ' + this.color + ' ' + this.breed; return ret; } or, using es6 template strings: dog.prototype.tostring = function dogtostring() { return `dog ${this.name} is a ${this.sex} ${this.color} ${this.breed}`; } with the preceding code in place, any time thedog is u...
Set - JavaScript
console.log([...myset]) // will show you exactly the same array as myarray remove duplicate elements from the array // use to remove duplicate elements from the array const numbers = [2,3,4,4,2,3,3,4,4,5,5,6,6,7,5,32,3,4,5] console.log([...ne...
...section(seta, setc) // => set [3, 4] symmetricdifference(seta, setc) // => set [1, 2, 5, 6] difference(seta, setc) // => set [1, 2] relation with array objects let myarray = ['value1', 'value2', 'value3'] // use the regular set constructor to trans
form an array into a set let myset = new set(myarray) myset.has('value1') // returns true // use the spread operator to trans
form a set into an array. console.log([...myset]) // will show you exactly the same array as myarray remove duplicate elements from the array // use to remove duplicate elements from the array const numbers = [2,3,4,4,2,3,3,4,4,5,5,6,6,7,5,32,3,4,5] console.log([...new set(numbers)]) // [2, 3, 4, 5, 6, 7, 32] relation with strings let text = 'india' let myset = new set(text) // set ['i', 'n'...
String.fromCharCode() - JavaScript
tory. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax string.fromcharcode(num1[, ...[, numn]]) parameters num1, ..., numn a sequence of numbers that are utf-16 code units. the range is between 0 and 65535 (0xffff). numbers greater than 0xffff are truncated. no validity checks are per
formed. return value a string of length n consisting of the n specified utf-16 code units. description this method returns a string and not a string object. because fromcharcode() is a static method of string, you always use it as string.fromcharcode(), rather than as a method of a string object you created. returning supplementary characters in utf-16, the most common characters can be repre...
...de point u+1f303 "night with stars". examples using fromcharcode() bmp characters, in utf-16, use a single code unit: string.fromcharcode(65, 66, 67); // returns "abc" string.fromcharcode(0x2014); // returns "—" string.fromcharcode(0x12014); // also returns "—"; the digit 1 is truncated and ignored string.fromcharcode(8212); // also returns "—"; 8212 is the decimal
form of 0x2014 complete utf 16 table. supplementary characters, in utf-16, require two code units (i.e. a surrogate pair): string.fromcharcode(0xd83c, 0xdf03); // code point u+1f303 "night with string.fromcharcode(55356, 57091); // stars" == "\ud83c\udf03" string.fromcharcode(0xd834, 0xdf06, 0x61, 0xd834, 0xdf07); // "\ud834\udf06a\ud834\udf07" specifications specification ...
String length - JavaScript
ecmascript 2016 (ed. ...
...ished a maximum length of 2^53 - 1 elements. previously, no maximum length was specified. in firefox, strings have a maximum length of 2**30 - 2 (~1gb). in versions prior to firefox 65, the maximum length was 2**28 - 1 (~256mb). for an empty string, length is 0. the static property string.length is unrelated to the length of strings, it's the arity of the string function (loosely, the number of
formal parameters it has), which is 1. unicode since `length` counts code units instead of characters, if you want to get the number of characters you need something like this: function getcharacterlength (str) { // the string iterator that is used here iterates over characters, // not mere code units return [...str].length; } console.log(getcharacterlength('a\ud87e\udc04z')); // 3 // whil...
String.prototype.localeCompare() - JavaScript
ch ignore the locales and options arguments, the locale and sort order used are entirely implementation-dependent. syntax referencestr.localecompare(comparestring[, locales[, options]]) parameters comparestring the string against which the referencestr is compared. locales and options these arguments customize the behavior of the function and let applications specify the language whose
formatting conventions should be used. in implementations which ignore the locales and options arguments, the locale used and the
form of the string returned are entirely implementation-dependent. see the intl.collator() constructor for details on these parameters and how to use them. return value a negative number if referencestr occurs before comparestring; positive if the referencestr occurs...
...itive when the referencestr occurs after comparestring returns 0 if they are equivalent do not rely on exact return values of -1 or 1! negative and positive integer results vary between browsers (as well as between browser versions) because the w3c specification only mandates negative and positive values. some browsers may return -2 or 2, or even some other negative or positive value. per
formance when comparing large numbers of strings, such as in sorting large arrays, it is better to create an intl.collator object and use the function provided by its compare property. examples using localecompare() // the letter "a" is before "c" yielding a negative value 'a'.localecompare('c'); // -2 or -1 (or some other negative value) // alphabetically the word "check" comes after "against" ...
String.prototype.match() - JavaScript
returned. in this case, the returned item will have additional properties as described below. additional properties as explained above, some results contain additional properties as described below. groups an object of named capturing groups whose keys are the names and values are the capturing groups or undefined if no named capturing groups were defined. see groups and ranges for more in
formation. index the index of the search at which the result was found. input a copy of the search string. description if the regular expression does not include the g flag, str.match() will return the same result as regexp.exec(). other methods if you need to know if a string matches a regular expression regexp, use regexp.test(). if you only want the first match found, you might want to ...
...lag is set, you need to use regexp.exec() or string.prototype.matchall() instead. examples using match() in the following example, match() is used to find 'chapter' followed by 1 or more numeric characters followed by a decimal point and numeric character 0 or more times. the regular expression includes the i flag so that upper/lower case differences will be ignored. const str = 'for more in
formation, see chapter 3.4.5.1'; const re = /see (chapter \d+(\.\d)*)/i; const found = str.match(re); console.log(found); // logs [ 'see chapter 3.4.5.1', // 'chapter 3.4.5.1', // '.1', // index: 22, // input: 'for more in
formation, see chapter 3.4.5.1' ] // 'see chapter 3.4.5.1' is the whole match. // 'chapter 3.4.5.1' was captured by '(chapter \d+(\.\d)*)'. // '.1' was...
String.raw() - JavaScript
the static string.raw() method is a tag function of template literals. this is similar to the r prefix in python, or the @ prefix in c# for string literals. (but it is not identical; see explanations in this issue.) it's used to get the raw string
form of template strings, that is, substitutions (e.g. ${foo}) are processed, but escapes (e.g. \n) are not. syntax string.raw(callsite, ...substitutions) string.raw`templatestring` parameters callsite well-
formed template call site object, like { raw: ['foo', 'bar', 'baz'] }. ...substitutions contains substitution values. templatestring a template string, optionally with substitutions (${...}). return value the raw string
form of a given template string. exceptions typeerror a typeerror is thrown if the first argument is not ...
...ring.raw`templatestring` parameters callsite well-
formed template call site object, like { raw: ['foo', 'bar', 'baz'] }. ...substitutions contains substitution values. templatestring a template string, optionally with substitutions (${...}). return value the raw string
form of a given template string. exceptions typeerror a typeerror is thrown if the first argument is not a well-
formed object. description in most cases, string.raw() is used with template strings. the first syntax mentioned above is only rarely used, because the javascript engine will call this with proper arguments for you, (just like with other tag functions). string.raw() is the only built-in tag function of template strings. it works just like the default template function and per
forms concatenation. ...
Symbol.iterator - JavaScript
rator is used to obtain the values to be iterated. some built-in types have a default iteration behavior, while other types (such as object) do not. the built-in types with a @@iterator method are: array.prototype[@@iterator]() typedarray.prototype[@@iterator]() string.prototype[@@iterator]() map.prototype[@@iterator]() set.prototype[@@iterator]() see also iteration protocols for more in
formation. property attributes of symbol.iterator writable no enumerable no configurable no examples user-defined iterables we can make our own iterables like this: var myiterable = {} myiterable[symbol.iterator] = function* () { yield 1; yield 2; yield 3; }; [...myiterable] // [1, 2, 3] ...
...) { yield 1; yield 2; yield 3; }; [...myiterable] // [1, 2, 3] or iterables can be defined directly inside a class or object using a computed property: class foo { *[symbol.iterator] () { yield 1; yield 2; yield 3; } } const someobj = { *[symbol.iterator] () { yield 'a'; yield 'b'; } } [...new foo] // [ 1, 2, 3 ] [...someobj] // [ 'a', 'b' ] non-well-
formed iterables if an iterable's @@iterator method does not return an iterator object, then it is a non-well-
formed iterable. using it as such is likely to result in runtime exceptions or buggy behavior: var nonwell
formediterable = {} nonwell
formediterable[symbol.iterator] = () => 1 [...nonwell
formediterable] // typeerror: [] is not a function specifications specification e...
Uint16Array() constructor - JavaScript
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. ...
...new typed array view is created that views the specified arraybuffer. the byteoffset and length parameters specify the memory range that will be exposed by the typed array view. if both are omitted, all of buffer is viewed; if only length is omitted, the remainder of buffer is viewed. description the uint16array() typed array constructor creates an array of 16-bit unsigned integers in the plat
form byte order. if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). starting with ecmascript 2015, uint16array constructors require to be constructed with a new operator. calling a uint16array construc...
WebAssembly.Module.customSections() - JavaScript
tom sections matching sectionname. exceptions if module is not a webassembly.module object instance, a typeerror is thrown. description a wasm module is comprised of a sequence of sections. most of these sections are fully specified and validated by the wasm spec, but modules can also contain custom sections that are ignored and skipped over during validation. (read high level structure for in
formation on section structures, and how normal sections ("known sections") and custom sections are distinguished.) this provides developers with a way to include custom data inside wasm modules for other purposes, for example the name custom section, which allows developers to provide names for all the functions and locals in the module (like "symbols" in a native build). note that the webassembly ...
... on section structures, and how normal sections ("known sections") and custom sections are distinguished.) this provides developers with a way to include custom data inside wasm modules for other purposes, for example the name custom section, which allows developers to provide names for all the functions and locals in the module (like "symbols" in a native build). note that the webassembly text
format currently doesn't have a syntax specified for adding new custom sections; you can however add a name section to your wasm during conversion from text
format over to .wasm. the wast2wasm command available as part of the wabt tool has a --debug-names option — specify this during conversion to get a .wasm with a names custom section, for example: wast2wasm simple-name-section.was -o simple-name...
decodeURI() - JavaScript
the decodeuri() function decodes a uni
form resource identifier (uri) previously created by encodeuri() or by a similar routine. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax decodeuri(encodeduri) parameters encodeduri a complete, encoded uni
form resource identifier. return value a new string representing the unencoded version of the given encoded uni
form resource identifier (uri). exceptions throws an urierror ("mal
formed uri sequence") exception when encodeduri contains invalid character sequences. description replaces each escape sequence in the encoded uri with the character that it represen...
...have been introduced by encodeuri. the character “#” is not decoded from escape sequences. examples decoding a cyrillic url decodeuri('https://developer.mozilla.org/ru/docs/javascript_%d1%88%d0%b5%d0%bb%d0%bb%d1%8b'); // "https://developer.mozilla.org/ru/docs/javascript_шеллы" catching errors try { var a = decodeuri('%e0%a4%a'); } catch(e) { console.error(e); } // urierror: mal
formed uri sequence specifications specification ecmascript (ecma-262)the definition of 'decodeuri' in that specification. ...
decodeURIComponent() - JavaScript
the decodeuricomponent() function decodes a uni
form resource identifier (uri) component previously created by encodeuricomponent or by a similar routine. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax decodeuricomponent(encodeduri) parameters encodeduri an encoded component of a uni
form resource identifier. return value a new string representing the decoded version of the given encoded uni
form resource identifier (uri) component. exceptions throws an urierror ("mal
formed uri sequence") exception when used wrongly. description replaces each escape sequence in the encoded uri component with the ch...
...) exception when used wrongly. description replaces each escape sequence in the encoded uri component with the character that it represents. examples decoding a cyrillic url component decodeuricomponent('javascript_%d1%88%d0%b5%d0%bb%d0%bb%d1%8b'); // "javascript_шеллы" catching errors try { var a = decodeuricomponent('%e0%a4%a'); } catch(e) { console.error(e); } // urierror: mal
formed uri sequence decoding query parameters from a url decodeuricomponent cannot be used directly to parse query parameters from a url. it needs a bit of preparation. function decodequeryparam(p) { return decodeuricomponent(p.replace(/\+/g, ' ')); } decodequeryparam('search+query%20%28correct%29'); // 'search query (correct)' specifications specification ecmascript (ecma-2...
eval() - JavaScript
date(5) }" )) the code above may seem inefficiently slow because of the triple nested function, but let's analyze the benefits of the above efficient method: it allows the code in the string passed to runcodewithdatefunction() to be minified. function call overhead is minimal, making the far smaller code size well worth the benefit function() more easily allows your code to utilize the per
formance buttering "use strict"; the code does not use eval(), making it orders of magnitude faster than otherwise. lastly, let's examine minification. with using function() as shown above, you can minify the code string passed to runcodewithdatefunction() far more efficiently because the function arguments names can be minified too as seen in the minified code below. console.log(function('"use st...
...z = '42'; eval('x + y + 1'); // returns 42 eval(z); // returns 42 using eval to evaluate a string of javascript statements the following example uses eval() to evaluate the string str. this string consists of javascript statements that assigns z a value of 42 if x is five, and assigns 0 to z otherwise. when the second statement is executed, eval() will cause these statements to be per
formed, and it will also evaluate the set of statements and return the value that is assigned to z. var x = 5; var str = "if (x == 5) {console.log('z is 42'); z = 42;} else z = 0;"; console.log('z is ', eval(str)); if you define multiple values then the last value is returned. var x = 5; var str = "if (x == 5) {console.log('z is 42'); z = 42; x = 420; } else z = 0;"; console.log('x is ', eval(str...
async function - JavaScript
c function will always complete asynchronously. for example: async function foo() { await 1 } ...is equivalent to: function foo() { return promise.resolve(1).then(() => undefined) } code after each await expression can be thought of as existing in a .then callback. in this way a promise chain is progressively constructed with each reentrant step through the function. the return value
forms the final link in the chain. in the following example, we successively await two promises. progress moves through function foo in three stages. the first line of the body of function foo is executed synchronously, with the await expression configured with the pending promise. progress through foo is then suspended and control is yielded back to the function that called foo. some time later,...
...conds. in concurrentstart, both timers are created and then awaited. the timers run concurrently, which means the code finishes in 2 rather than 3 seconds, i.e. the slowest timer. however, the await calls still run in series, which means the second await will wait for the first one to finish. in this case, the result of the fastest timer is processed after the slowest. if you wish to safely per
form two or more jobs in parallel, you must await a call to promise.all, or promise.allsettled. error handling note that functions concurrentstart and concurrentpromise are not functionally equivalent. in concurrentstart, if promise fast rejects before promise slow is fulfilled, then an unhandled promise rejection error will be raised, regardless of whether the caller has configured a catch clause...
for await...of - JavaScript
async function* asyncgenerator() { let i = 0; while (i < 3) { yield i++; } } (async function() { for await (let num of asyncgenerator()) { console.log(num); } })(); // 0 // 1 // 2 for a more concrete example of iterating over an async generator using for await...of, consider iterating over data from an a...
... (async function() { try { for (let numorpromise of generatorwithrejectedpromises()) { console.log(await numorpromise); } } catch (e) { console.log('catched', e) } })() // 0 // 1 // 2 // catched 3 // called finally specifications ...
function* - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. you can also define generator functions using the generatorfunction constructor, or the function expression syntax. syntax function* name([param[, param[, ... param]]]) { statements } name the function name. param optional the name of a
formal parameter for the function. statements the statements comprising the body of the function. description generators are functions that can be exited and later re-entered. their context (variable bindings) will be saved across re-entrances. generators in javascript -- especially when combined with promises -- are a very powerful tool for asynchronous programming as they mitigate -- if not en...
...rue). if a value is returned, it will be set as the value property of the object returned by the generator. much like a return statement, an error is thrown inside the generator will make the generator finished -- unless caught within the generator's body. when a generator is finished, subsequent next() calls will not execute any of that generator's code, they will just return an object of this
form: {value: undefined, done: true}. examples simple example function* idmaker() { var index = 0; while (true) yield index++; } var gen = idmaker(); console.log(gen.next().value); // 0 console.log(gen.next().value); // 1 console.log(gen.next().value); // 2 console.log(gen.next().value); // 3 // ... example with yield* function* anothergenerator(i) { yield i + 1; yield i + 2; yiel...
import.meta - JavaScript
the import.meta object exposes context-specific metadata to a javascript module. it contains in
formation about the module, like the module's url. syntax import.meta description the syntax consists of the keyword import, a dot, and the identifier meta. normally the left-hand side of the dot is the object on which property access is per
formed, but here import is not really an object. the import.meta object is created by the ecmascript implementation, with a null prototype. the object is extensible, and its properties are writable, configurable, and enumerable. examples using import.meta given a module my-module.js <script type="module" src="my-module.js"></script> you can access meta in
formation about the module using the import.meta object. console.log(import.meta); // { url: "file...
... such file-specific argument passing may be complementary to that used in the application-wide location.href (with query strings or hash added after the html file path) (or on node.js, through process.argv). specifications specification import.meta proposal ...
Transitioning to strict mode - JavaScript
created and initialized with the same values than the named arguments, but changes to either the arguments object or the named arguments aren't reflected in one another. change to eval in strict mode code, eval doesn't create a new variable in the scope from which it was called. also, of course, in strict mode, the string is evaluated with strict mode rules. thorough testing will need to be per
formed to make sure nothing breaks. not using eval if you don't really need it may be another pragmatic solution. strictness-neutral code a potential "downside" of moving strict code to strict mode is that the semantics may be different in legacy browsers which do not implement strict mode. in some rare occasions (like bad concatenation or minification), your code also may not run in the mode you wr...
...ode also may not run in the mode you wrote and tested it in. here are the rules to make your code strictness-neutral: write your code as strict and make sure no strict-only errors (from the above "new runtime errors" section) are thrown. 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 per
form a copy of the arguments object using: var args = array.prototype.slice.call(arguments) as the first line of your function this: only use this when it refers to an object you created. ...
MathML attribute reference - MathML
<mtext> the text direction. possible values are either ltr (left to right) or rtl (right to left). display <math> specifies the rendering mode. the values block and inline are allowed. displaystyle <mstyle>, <mtable> a boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display
formulas. unimplemented edge <malignmark> unimplemented equalcolumns <mtable> a boolean value indicating whether to force all columns to have the same total height. unimplemented equalrows <mtable> a boolean value indicating whether to force all rows to have the same total height. fence <mo> a boolean value specifying whether the operator is...
... a boolean value indicating whether to force all columns to have the same total height. unimplemented equalrows <mtable> a boolean value indicating whether to force all rows to have the same total height. fence <mo> a boolean value specifying whether the operator is a fence (such as parentheses). there is no visual effect for this attribute. unimplemented
form <mo> specifies the role of the operator in an enclosed expression. frame <mtable> specifies borders of an entire <mtable>. possible values are: none (default), solid and dashed. framespacing <mtable> specifies additional space added between the table and frame. unimplemented groupalign <maligngroup>, <mtable>, <mtd>, <mtr> height <mg...
<math> - MathML
ry valid mathml instance must be wrapped in <math> tags. in addition you must not nest a second <math> element in another, but you can have an arbitrary number of other child elements in it. attributes in addition to the following attributes, the <math> element accepts any attributes of the <mstyle> element. class, id, style provided for use with stylesheets. dir overall directionality of
formulas. possible values are either ltr (left to right) or rtl (right to left). href used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. display this enumerated attribute specifies how the enclosed mathml markup should be rendered. it can have ...
...mn>2</mn> </msup> </mrow> </math> </body> </html> notes: xhtml documents with mathml must be served as application/xhtml+xml. you can achieve that easily by adding the .xhtml extension to your local files. for apache servers you can configure your .htaccess file to map extensions to the correct mime type. since you notate your mathml in an xml document, also be sure you write a well-
formed xml document. specifications specification status comment mathml 3.0the definition of 'the top-level math element' in that specification. recommendation current specification mathml 2.0the definition of 'the top-level math element' in that specification. recommendation initial specification ...
<mo> - MathML
hether the operator should be treated as an accent. allowed values are true or false. class, id, style provided for use with stylesheets. dir the text direction. possible values are either ltr (left to right) or rtl (right to left). fence there is no visual effect for this attribute, but it specifies whether the operator is a fence (such as parentheses). allowed values are true or false.
form specifies the role of the operator in an enclosed expression, which affects spacing and other default properties. for ordinary operators (+, -, etc. ) you usually do not need to specify this attribute explicitly. possible values are: prefix, for opening fences. (it is the default value if the operator is the first argument in a <mrow> element with more than one argument.) infix, for separ...
...rue or false. symmetric if stretchy is true, this attribute specifies whether the operator should be vertically symmetric around the imaginary math axis (centered fraction line). the default value is true if stretchy is set to true and otherwise false. allowed values are true or false. examples <math> <mrow> <mn>5</mn> <mo>+</mo> <mn>5</mn> </mrow> <mrow> <mo> [ </mo> <!-- default
form value: prefix --> <mrow> <mn> 0 </mn> <mo> ; </mo> <!-- default
form value: infix --> <mn> 1 </mn> </mrow> <mo> ) </mo> <!-- default
form value: postfix --> </mrow> </math> specifications specification status comment mathml 3.0the definition of 'mo' in that specification. recommendation current specification mathml 2.0the definition...
Examples - MathML
mathml torture test large set of test markup. ...
... mathml torture test large set of test markup. ...
Autoplay guide for media and Web Audio APIs - Web media technologies
automatically starting the playback of audio (or videos with audio tracks) immediately upon page load can be an unwelcome surprise to users. while autoplay of media serves a useful purpose, it should be used carefully and only when needed. in order to give users control over this, browsers often provide various
forms of autoplay blocking. in this guide, we'll cover autoplay functionality in the various media and web audio apis, including a brief overview of how to use autoplay and how to work with browsers to handle autoplay blocking gracefully. autoplay blocking is not applied to <video> elements when the source media does not have an audio track, or if the audio track is muted. media with an active audio track are considered to be audible, and autoplay blocking applies to them. inau...
... example: the autoplay attribute an <audio> element using the autoplay attribute might look like this: <audio id="musicplayer" autoplay> <source src="/music/chapter1.mp4"> </audio> example 2: detecting autoplay failure if you rely on autoplay for anything important, or if autoplay failure will impact your app in any way, you will probably want to be able to tell when it ...
Guide to streaming audio and video - Web media technologies
in this guide, we'll examine the techniques used to stream audio and/or video media on the web, and how you can optimize your code, your media, your server, and the options you use while per
forming the streaming to bring out the best quality and per
formance possible. <<<...xxxxxx...>>> protocols in addition to the configuration of the server and the streaming code, there are sometimes special protocols which can be used to optimize per
formance. https live streaming https live streaming (hls) is a protocol developed by apple and supported by safari on all of their plat
forms. hls may also be supported in other environments, although in some cases this support is conditional. for example, because many web sites' mobile-specific content assume that mobile browsers support hls, firefox for a...
...ause many web sites' mobile-specific content assume that mobile browsers support hls, firefox for android does as well, in order to avoid strange compatibility errors from occurring due to this assumption being incorrect. the desktop version of android, however, does not support hls. hls uses playlists to allow the user to not only select the media to stream, but also to choose among versions or
forms of the same media. for example, hls lets the server stream a video with multiple audio streams which the user can choose from, in order to hear their own language. additionally,
forms of the stream can be provided which are optimized for different network conditions. in this way, live streams can be made flexible and highly per
formant. as of mid-2017, hls has been standardized as rfc 8217. ...
Mapping the width and height attributes of media container elements to their aspect-ratio - Web media technologies
n browsers first loaded the page, they could put a correctly-sized placeholder box in the layout for each image to appear in when it finally loads. without the width and height attributes, no placeholder space would be created, and when the image finally loaded you would get a noticeable jank in the page layout. this wasn't an attractive thing for your users to see, and could also result in per
formance issues due to the repainting required after each image loads, hence adding the attributes being a good idea. let’s move forward a few years to the era of responsive design. to keep images from breaking out of their containers when the container becomes narrower than the image, developers started using css like the following: img { max-width: 100%; height: auto; } this is really usefu...
...years to the era of responsive design. to keep images from breaking out of their containers when the container becomes narrower than the image, developers started using css like the following: img { max-width: 100%; height: auto; } this is really useful for responsive layouts, but unfortunately it causes the jank problem to return — the above css overrides the width and height attribute in
formation, meaning that if the image has not loaded for some reason, its height will be set to 0. when the image finally loads, the same jank will occur as the page layout is shifted to make space for it. a new way of sizing images before loading completes recognizing the problem, a wicg community group
formed to propose an intrinsicsize attribute. folks from mozilla then expanded on this thinking, ...
Using images in HTML - Web media technologies
'll find links to resources that deal with adding images to websites. references these articles cover some of the html elements and css properties that are used to control how images are displayed on the web. html <img> the html <img> element is used to embed an image in a webpage. it supports a wide range of attributes that control how the image behaves and allows you to add important in
formation like alt text for people who don't see the image. <picture> the html <picture> element contains zero or more <source> elements and one <img> element which provides versions of an image for different display/device scenarios. the browser considers each child <source> element and chooses the best match among them. css object-fit the object-fit css property sets how the content of a rep...
...alignment of content in a selected replaced element within the element's box. areas of the box which aren't covered by the replaced element's object will show the element's background. background-image the background-image css property sets one or more background images for an element. 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. mapping the width and height attributes of media container elements to their aspect-ratio this changes how browse...
Installing and uninstalling web apps - Progressive web apps (PWAs)
ly “install” a web application on their device so they can access it in the same way they would any other installed app. depending on the device and features of the operating system and browser, this can result in what is essentially a fully featured application (for example, using webapk on android) or as a shortcut added to their device’s screen. this guide explains how installation is per
formed, what it means, and what you need to do as a developer to let your users take advantage of it. why installation? the option to install a web application is part of the progressive web app philosophy—giving web apps the same user experience advantages as native apps so they can be competitive. installed applications are more conveniently invoked as they have a presence in a device’s home s...
...source code) that doesn't do much, but was developed with the necessary code to allow it to be installed, as well as a service worker to enable it to be used offline. the example displays a series of fox pictures.if you have a web application compatible device available, use it to navigate to our demo at https://mdn.github.io/pwa-examples/a2hs/. you'll see fox pictures, but more importantly, some
form of user interface will be available to let you install the site as a web app. the ui for this varies from browser to browser, but the general idea is the same. unfortunately, there isn't a standard for icons and symbols used for operations such as this. firefox for android on an android device using firefox, you'll see a "home" icon with a plus (+) icon inside it—this is the "add to home s...
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
ntroduces a different approach from traditional web programming — the api is non-blocking, and can send and receive communication between different contexts. you are able to give a service worker something to work on, and receive the result whenever it is ready using a promise-based approach. they can do a lot more than "just" offering offline capabilities, including handling notifications, per
forming heavy calculations on a separate thread, etc. service workers are quite powerful as they can take control over network requests, modify them, serve custom responses retrieved from the cache, or synthesize responses completely. security because they are so powerful, service workers can only be executed in secure contexts (meaning https). if you want to experiment first before pushing your cod...
... cache, so we don't leave any garbage behind; the available cache space in the browser is limited, so it is a good idea to clean up after ourselves. other use cases serving files from cache is not the only feature service worker offers. if you have heavy calculations to do, you can offload them from the main thread and do them in the worker, and receive results as soon as they are available. per
formance-wise, you can prefetch resources that are not needed right now, but might be in the near future, so the app will be faster when you actually need those resources. summary in this article we took a simple look at how you can make your pwa work offline with service workers. be sure to check out our further documentation if you want to learn more about the concepts behind the service worker ap...
Web API reference - Web technology reference
these can be accessed using javascript code, and let you do anything from making minor adjustments to any window or element, to generating intricate graphical and audio effects using apis such as webgl and web audio. each individual interface across all apis is listed in the index. there's also a listing of all available events in the event reference. document object model the dom is an api that allows access to and modification of the current document. it allows manipulation of document node and element. html, xml and svg have extended it to manipulate their specific elements. ...
...ir specific elements. device apis this set of apis allows access to various hardware features available to web pages and applications. e.g. ambient light sensor api, geolocation api, pointer lock api, proximity api, device orientation api, screen orientation api, vibration api. communication apis these apis let web pages and applications communicate with other pages or devices. e.g. network in
formation api, web notifications. data management apis user data can be stored and managed using this set of apis. e.g. filehandle api, indexeddb. related topics these topics may also be of interest: index of all web api interfaces ...
SVG Core Attributes - SVG: Scalable Vector Graphics
le document. its purpose is to identify the element when linking (using a fragment identifier), scripting, or styling (with css). value: any valid id string; animatable: no lang participates in defining the language of the element, the language that non-editable elements are written in or the language that editable elements should be written in. the tag contains one single entry value in the
format defined in the tags for identifying languages (bcp47) ietf document. svg 2 introduce the new lang attributes. if both lang and xml:lang attribute are used, xml:lang has priority over lang. value: any valid language id; animatable: no tabindex the tabindex svg attribute allows you to control whether an element is focusable and to define the relative order of the element for the purpo...
...f the element for the purposes of sequential focus navigation. 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. it's almost identical in usage to html's lang, but in con
forming xml 1.0 documents, it does not allow the use of a null attribute value (xml:lang="") to indicate an unknown language. instead, use xml:lang="und". svg 2 introduce the new lang attributes. if both lang and xml:lang attribute are used, xml:lang has priority over lang. value: any valid language id; animatable: no xml:space deprecated since svg 2 svg supports the standard xml attribu...
class - SVG: Scalable Vector Graphics
for general use by the browser. ...
...of a separated sequence of values. unless explicitly described differently, lists within svg's xml attributes can be either comma-separated (with optional white space before or after the comma), or white space-separated. white space in lists is defined as one or more of the following consecutive characters: "space" (u+0020), "tab" (u+0009), "line feed" (u+000a), "carriage return" (u+000d), and "
form-feed" (u+000c). 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. for example, a <list-of-lengths> is represented in the svg dom using an svglengthlist or svganimatedlengthlist object. exam...
font-variant - SVG: Scalable Vector Graphics
the font-variant attribute indicates whether the text is to be rendered using variations of the fontʼs glyphs. note: as a presentation attribute, font-variant can be used as a css property. see the css font-variant property for more in
formation. as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-variant="normal">normal text</text> <text x="100" y="20" font-variant="small-caps">small-caps text</text> </svg> usage notes value normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <context...
...ox="0 0 250 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-variant="normal">normal text</text> <text x="100" y="20" font-variant="small-caps">small-caps text</text> </svg> usage notes value normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || stylistic( <feature-value-name> ) || historical-
forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <...
glyph-orientation-vertical - SVG: Scalable Vector Graphics
the following five elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value auto | <angle> default value auto animatable no auto fullwidth ideographic and fullwidth latin text will be set with a glyph orientation of 0 degrees. ideographic punctuation and other ideographic characters having alternate horizontal and vertical
forms will use the vertical
form of the glyph. text which is not fullwidth will be set with a glyph orientation of 90 degrees. this reorientation rule applies only to the first-level non-ideographic text. all further embedding of writing modes or bidirectional processing will be based on the first-level rotation. note: text set in this "rotated" manner may contain ligatures or other glyph combin...
...ll be set with a glyph orientation of 90 degrees. this reorientation rule applies only to the first-level non-ideographic text. all further embedding of writing modes or bidirectional processing will be based on the first-level rotation. note: text set in this "rotated" manner may contain ligatures or other glyph combining and reordering common to the language and script. (this presentation
form does not disable auto-ligature
formation or similar context-driven variations.) the determination of which characters should be auto-rotated may vary across user agents. the determination is based on a complex interaction between country, language, script, character properties, font, and character context. <angle> the value of the angle is restricted to 0, 90, 180, and 270 degrees. if a...
k1 - SVG: Scalable Vector Graphics
the k1 attribute defines one of the values to be used within the the arithmetic operation of the <fecomposite> filter primitive. ...
... working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'k1' i...
k2 - SVG: Scalable Vector Graphics
the k2 attribute defines one of the values to be used within the the arithmetic operation of the <fecomposite> filter primitive. ...
... working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'k2' i...
k3 - SVG: Scalable Vector Graphics
the k3 attribute defines one of the values to be used within the the arithmetic operation of the <fecomposite> filter primitive. ...
... working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'k3' i...
k4 - SVG: Scalable Vector Graphics
the k4 attribute defines one of the values to be used within the the arithmetic operation of the <fecomposite> filter primitive. ...
... working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'k4' i...
kernelUnitLength - SVG: Scalable Vector Graphics
first number is the x value. the second number is the y value. if the x value is not specified, it defaults to the same value as x. fediffuselighting for the <fediffuselighting>, kernelunitlength indicates the intended distance in current filter units (i.e., units as determined by the value of attribute primitiveunits) for the x and y coordinate, respectively, in the surface normal calculation
formulas. the first number is the x value. the second number is the y value. if the y value is not specified, it defaults to the same value as x. by specifying value(s) for kernelunitlength, the kernel becomes defined in a scalable, abstract coordinate system. if the attribute is not specified, the x and y values represent very small deltas relative to a given position, which might be implemented in ...
... the first number is the x value. the second number is the y value. if the y value is not specified, it defaults to the same value as x. by specifying value(s) for kernelunitlength, the kernel becomes defined in a scalable, abstract coordinate system. if the attribute is not specified, the x and y values represent very small deltas relative to a given position, which might be implemented in ...
lang - SVG: Scalable Vector Graphics
nguage used in contents and attributes containing text content of particular elements. there is also an xml:lang attribute (with namespace). if both of them are defined, the one with namespace is used and the one without is ignored. in svg 1.1 there was a lang attribute defined with a different meaning and only applying to <glyph> elements. that attribute specified a list of languages in bcp 47
format. the glyph was meant to be used if the xml:lang attribute exactly matched one of the languages given in the value of this parameter, or if the xml:lang attribute exactly equaled a prefix of one of the languages given in the value of this parameter such that the first tag character following the prefix was "-". all elements are using this attribute. <svg viewbox="0 0 200 100" xmlns="http://ww...
..."0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <text lang="en-us">this is some english text</text> </svg> usage notes value <language-tag> default value none animatable no <language-tag> this value specifies the language used for the element. the syntax of this value is defined in the bcp 47 specification. the most common syntax is a value
formed by a lowercase two-character part for the language and an uppercase two-character part for the region or country, separated by a minus sign, e.g. en-us for us english or de-at for austrian german. specifications specification status comment scalable vector graphics (svg) 2the definition of 'lang' in that specification. candidate recommendation made the lan...
numOctaves - SVG: Scalable Vector Graphics
taves for the noise function of the <feturbulence> primitive. an octave is a noise function defined by its frequency and amplitude. a turbulence is built by accumulating several octaves with increasing frequencies and decreasing amplitudes. the higher the number of octaves, the more natural the noise looks. though more octaves also require more calculations, resulting in a negative impact on per
formance. only one element is using this attribute: <feturbulence> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="noise1" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" numoctaves="1" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025...
...negative values are forbidden. example <svg width="200" height="200" viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence basefrequency="0.05" ...
opacity - SVG: Scalable Vector Graphics
the opacity attribute specifies the transparency of an object or of a group of objects, that is, the degree to which the background behind the element is overlaid. note: as a presentation attribute, opacity can be used as a css property. see the css opacity property for more in
formation. as a presentation attribute, it can be applied to any element but it has effect only on the following elements: <a>, <audio>, <canvas>, <circle>, <ellipse>, <foreignobject>, <g>, <iframe>, <image>, <line>, <marker>, <path>, <polygon>, <polyline>, <rect>, <svg>, <switch>, <symbol>, <text>, <textpath>, <tspan>, <use>, <unknown>, and <video> html, body, svg { height: 100%; } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" x1="0%" y1="0%" x2="0" y...
...any values outside the range 0.0 (fully transparent) to 1.0 (fully opaque) will be clamped to this range. specifications specification status comment css color module level 4the definition of 'opacity' in that specification. working draft defines in more detail what this attribute applies to...
operator - SVG: Scalable Vector Graphics
the operator attribute as two meanings based on the context itʼs used in. either it defines the compositing or morphing operation to be per
formed. two elements are using this attribute: <fecomposite> and <femorphology> html, body, svg { height: 100%; font: 20px arial, helvetica, sans-serif; } <svg viewbox="0 0 120 70" xmlns="http://www.w3.org/2000/svg"> <filter id="erode"> <femorphology operator="erode" radius="0.4"/> </filter> <filter id="dilate"> <femorphology operator="dilate" radius="0.8"/> </filter> <text x="0" y="15">normal text</text> <text x="0" y="40" filter="url(#erode)">thin text</text> <text x="0" y="65" filter="url(#dilate)">fat text</text> </svg> fecomposite for <fecomposite>, operator defines the compositing operation that is to be perfor...
...ation graphic defined in the in2 attribute are combined. lighter this value indicates that the sum of the source graphic defined in the in attribute and the destination graphic defined in the in2 attribute is displayed. arithmetic this value indicates that the source graphic defined in the in attribute and the destination graphic defined in the in2 attribute are combined using the following
formula: result = k1*i1*i2 + k2*i1 + k3*i2 + k4 where: i1 and i2 indicate the corresponding pixel channel values of the input image, which map to in and in2 respectively, and k1,k2,k3,and k4 indicate the values of the attributes with the same name. femorphology for <femorphology>, operator defines whether to erode (i.e., thin) or dilate (fatten) the source graphic. value erode ...
order - SVG: Scalable Vector Graphics
the values provided must be <integer>s greater than zero. values that are not integers will be truncated, i.e. rounded to the closest ...
...ger value towards zero. the first number, indicates the number of columns in the matrix. the second number, indicates the number of rows in the matrix. if no second number is not provided, it defaults to the first number. it is recommended that only small values (e.g., 3) be used; higher values may result in very high cpu overhead and usually do not produce results that justify the impact on per
formance. specifications specification status comment filter effects module level 1the definition of 'order' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'order' in that specification. recommendation initial definition ...
overflow - SVG: Scalable Vector Graphics
it has the same parameter values and meaning as the css overflow property, however, the following additional points apply: if it has a value of visible, the attribute has no effect (i.e., a clipping rectangle is not created). if the overflow property has the value hidden or scroll, a clip of the exact size of the svg viewport is applied. when scroll is specified on an <svg> element, a scrollbar or panner is normally shown for the svg viewport whether or not any of its content is clipped. ...
... or by rendering with no clip. although the initial value for overflow is auto, it is overwritten in the user agent style sheet for the <svg> element when it is not the root element of a stand-alone document, the <pattern> element, and the <marker> element to be hidden by default. note: as a presentation attribute, overflow can be used as a css property. see the css opacity property for more in
formation. as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <foreignobject>, <iframe>, <image>, <marker>, <pattern>, <symbol>, <svg>, and <text> html, body, svg { height: 100%; } <svg viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg" overflow="auto"> <text y="20">this text is wider than the svg, so there should be a s...
rotate - SVG: Scalable Vector Graphics
1 110 10 a120,120 -45 0,1 10,110" stroke="lightgrey" stroke-width="2" fill="none" id="themotionpath"/> <!-- red arrow which will not rotate --> <path fill="red" d="m-5,-5 l10,0 -5,5 0,0 z"> <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indefinite" rotate="0"> <mpath href="#themotionpath"/> </animatemotion> </path> <g trans
form="translate(100, 0)"> <use href="#themotionpath"/> <!-- green arrow which will rotate along the motion path --> <path fill="green" d="m-5,-5 l10,0 -5,5 0,0 z"> <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indefinite" rotate="auto"> <mpath href="#themotionpath"/> </animatemotion> </path> </g> <g trans
form="translate(200, 0)"> ...
...<g trans
form="translate(200, 0)"> <use href="#themotionpath"/> <!-- blue arrow which will rotate backwards along the motion path --> <path fill="blue" d="m-5,-5 l10,0 -5,5 0,0 z"> <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indefinite" rotate="auto-reverse"> <mpath href="#themotionpath"/> </animatemotion> </path> </g> <g trans
form="translate(300, 0)"> <use href="#themotionpath"/> <!-- purple arrow which will have a static rotation of 210 degrees --> <path fill="purple" d="m-5,-5 l10,0 -5,5 0,0 z"> <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indefinite" rotate="210"> <mpath href="#themotionpath"/> </animatemotion> </path> </g> </svg> result specifications...
stitchTiles - SVG: Scalable Vector Graphics
dth="100%" height="100%"> <feturbulence basefrequency="0.025" stitchtiles="nostitch" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" stitchtiles="stitch" /> </filter> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise1);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise1); trans
form: translate(100px, 0);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise1); trans
form: translate(0, 100px);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise1); trans
form: translate(100px, 100px);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise2); trans
form: translate(220px, 0);" /> <rect x="0" y="0" width="100" height...
...y="0" width="100" height="100" style="filter: url(#noise1); trans
form: translate(0, 100px);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise1); trans
form: translate(100px, 100px);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise2); trans
form: translate(220px, 0);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise2); trans
form: translate(320px, 0);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise2); trans
form: translate(220px, 100px);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise2); trans
form: translate(320px, 100px);" /> </svg> usage notes value nostitch | stitch default value nostitch animatable yes nostitch this...
xlink:title - SVG: Scalable Vector Graphics
the xlink:title attribute is used to describe the meaning of a link or resource in a human-readable fashion. the use of this in
formation is highly dependent on the type of processing being done. it may be used, for example, to make titles available to applications used by visually impaired users, or to create a table of links, or to present help text that appears when a user lets a mouse pointer hover over a starting resource. note: new content should use a <title> child element rather than a xlink:title attribute. ...
...vailable to applications used by visually impaired users, or to create a table of links, or to present help text that appears when a user lets a mouse pointer hover over a starting resource. note: new content should use a <title> child element rather than a xlink:title attribute. these elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetrans
form>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, and <use> usage context value <anything> default value none animatable no <anything> this value specifies the title used to describe the meaning of the link or resource. ...
<altGlyph> - SVG: Scalable Vector Graphics
ates a shift along the x-axis on the position of the element. value type: <list-of-coordinates> ; default value: relative y-coordinate of ancestor <text> or <tspan>; animatable: yes rotate this attribute defines the supplemental rotation that will be applied to the element. value type: <list-of-numbers> ; default value: none; animatable: yes (non-additive) glyphref the glyph identifier, the
format of which is dependent on the
format defined by the
format attribute of the given font. value type: <string> ; default value: none; animatable: no
format the
format of the given font. value type: <string> ; default value: none; animatable: no xlink:href an <iri> reference either to a <glyph> element in an svg document or to an <altglyphdef> element. if the reference is to a <glyph> elem...
... specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of '<altglyph>' in that specification. recomm...
<cursor> - SVG: Scalable Vector Graphics
note: the css cursor property should be used instead of this element. the <cursor> svg element can be used to define a plat
form-independent custom cursor. a recommended approach for defining a plat
form-independent custom cursor is to create a png image and define a cursor element that references the png image and identifies the exact position within the image which is the pointer position (i.e., the hot spot). the png
format is recommended because it supports the ability to define a transparency mask via an alpha channel. if a different image
format is used, this
format should support the definition of a transparency mask (two options: provide an explicit alpha channel or use a particular pixel color to indicate transparency). if the transparency mask can be determined, the mask...
...note that cursors usually contain at least two colors so that the cursor can be visible over most backgrounds. ...
<defs> - SVG: Scalable Vector Graphics
motes understandability of the svg content and is beneficial to the overall accessibility of the document. ...
...ent element 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, trans
form, vector-effect, visibility usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>,...
<ellipse> - SVG: Scalable Vector Graphics
the <ellipse> element is an svg basic shape, used to create ellipses based on a center coordinate, and both their x and y radius. note: ellipses are unable to specify the exact orientation of the ellipse (if, for example, you wanted to draw an ellipse tilted at a 45 degree angle), but it can be rotated by using the trans
form attribute. html,body,svg { height:100% } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <ellipse cx="100" cy="50" rx="100" ry="50" /> </svg> attributes cx the x position of the ellipse. 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>|<perc...
...tes 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, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
<feComponentTransfer> - SVG: Scalable Vector Graphics
the colors are modified by changing each channel (r, g, b, and a) to the result of what the children <fefuncr>, <fefuncb>, <fefuncg>, and <fefunca> return. ...
...the colors are modified by changing each channel (r, g, b, and a) to the result of what the children <fefuncr>, <fefuncb>, <fefuncg>, and <fefunca> return. ...
<feConvolveMatrix> - SVG: Scalable Vector Graphics
sharpening, embossing and beveling. a matrix convolution is based on an n-by-m matrix (the convolution kernel) which describes how a given pixel value in the input image is combined with its neighboring pixel values to produce a resulting pixel value. each result pixel is determined by applying the kernel matrix to the corresponding source pixel and its neighboring pixels. ...
...present the x and y values for the ‘order’ attribute, "targetx" represents the value of the ‘targetx’ attribute, "targety" represents the value of the ‘targety’ attribute, "kernelmatrix" represents the value of the ‘kernelmatrix’ attribute, "divisor" represents the value of the ‘divisor’ attribute, and "bias" represents the value of the ‘bias’ attribute. note in the above
formulas that the values in the kernel matrix are applied such that the kernel matrix is rotated 180 degrees relative to the source and destination images in order to match convolution theory as described in many computer graphics textbooks. to illustrate, suppose you have a input image which is 5 pixels by 5 pixels, whose color values for one of the color channels are as follows: 0 20 40 235 23...
<feDisplacementMap> - SVG: Scalable Vector Graphics
xc(x,y) and yc(x,y) are the component values of the channel designated by xchannelselector and ychannelselector. ...
...xc(x,y) and yc(x,y) are the component values of the channel designated by xchannelselector and ychannelselector. ...
<image> - SVG: Scalable Vector Graphics
animated gif behavior is undefined. svg files displayed with <image> are treated as an image: external resources aren't loaded, :visited styles aren't applied, and they cannot be interactive. to include dynamic svg elements, try <use> with an external url. to include svg files and run scripts inside them, try <object> inside of <foreignobject>. note: the html spec defines <image> as a synonym for <img> while parsing html. ...
...s or inline svg. usage context categoriesgraphics element, graphics referencing elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes xlink attributes class style externalresourcesrequired trans
form specific attributes x: positions the image horizontally from the origin. y: positions the image vertically from the origin. width: the width the image renders at. unlike html's <img>, this attribute is required. height: the height the image renders at. unlike html's <img>, this attribute is required. href and xlink:href: points at a url for the image file. preserveaspectratio: controls ...
<marker> - SVG: Scalable Vector Graphics
table: 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. value type: auto|auto-start-reverse|<angle> ; default value: 0; animatable: yes preserveaspectratio this attribute defines how the svg fragment must be de
formed 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)? ; default value: xmidymid meet; animatable: yes refx this attribute defines the x coordinate for the reference point of the marker. value type: left|center|right|<coordinate> ; default value: 0; animatable:...
...ibutes most notably: requiredextensions, systemlanguage 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, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
<radialGradient> - SVG: Scalable Vector Graphics
fault value: same as cx; animatable: yes fy this attribute defines the y coordinate of the start circle of the radial gradient. value type: <length> ; default value: same as cy; animatable: yes gradientunits this attribute defines the coordinate system for attributes x1, x2, y1, y2 value type: userspaceonuse|objectboundingbox ; default value: objectboundingbox; animatable: yes gradienttrans
form this attribute provides additional trans
formation to the gradient coordinate system. value type: <trans
form-list> ; default value: identity trans
form; 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 r this attribute defines the radius of the end circle of th...
...obal event attributes, document element 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, trans
form, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetrans
form>, <set>, <stop> specifications specification status comment scalable vector graphics (svg) 2the definition of '<radialgradient>' in that spec...
<svg> - SVG: Scalable Vector Graphics
e: no contentstyletype deprecated since svg 2 the default style sheet language used by the svg fragment. value type: <string> ; default value: text/css; animatable: no height the displayed height of the rectangular viewport. (not the height of its coordinate system.) value type: <length>|<percentage> ; default value: auto; animatable: yes preserveaspectratio how the svg fragment must be de
formed if it is displayed with a different aspect ratio. value type: (none| xminymin| xmidymin| xmaxymin| xminymid| xmidymid| xmaxymid| xminymax| xmidymax| xmaxymax) (meet|slice)? ; default value: xmidymid meet; animatable: yes version deprecated since svg 2 which version of svg is used for the inner content of the element. value type: <number> ; default value: none; animatable: no viewbox the s...
...ment event attributes, document element 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, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
<symbol> - SVG: Scalable Vector Graphics
t" x="35" y="5" style="opacity:0.6" /> <use xlink:href="#mydot" x="50" y="5" style="opacity:0.4" /> <use xlink:href="#mydot" x="65" y="5" style="opacity:0.2" /> </svg> attributes height this attribute determines the height of the symbol. value type: <length>|<percentage> ; default value: auto; animatable: yes preserveaspectratio this attribute defines how the svg fragment must be de
formed 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)? ; default value: xmidymid meet; animatable: yes refx this attribute determines the x coordinate of the reference point of the symbol. value type: <length>|<percentage>|left|center|right ; default value: 0; ...
...ent element 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, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
<use> - SVG: Scalable Vector Graphics
cloned dom unless you explicitly request them using css inheritance. for security reasons, browsers may apply the same-origin policy on use elements and may refuse to load a cross-origin url in the href attribute. there is currently no defined way to set a cross-origin policy for use elements. since svg 2, the xlink:href attribute is deprecated in favor of href. see xlink:href page for more in
formation. however, xlink:href can still be required in practice for cross-browser compatibility (see the compatibility table below). attributes href the url to an element/fragment that needs to be duplicated. 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; ani...
...tes 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, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
Example - SVG: Scalable Vector Graphics
1.5 and above. </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. </div> <
form action="" onsubmit="return false;"> <p> <label>number of motes:</label> <input id='num_motes' value='5'/> <br/> <label>max. 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/> ...
..." onsubmit="return false;"> <p> <label>number of motes:</label> <input id='num_motes' value='5'/> <br/> <label>max. 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. function display() { return document.getelementbyid('display'); } // determine dimensions of the display element. // return this as a 2-tuple (x,y) in an array function dimensions() { // our rendering element var display = display(); var width = parseint( displ...
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
mented. view module view implemented in gecko 15.0 (bug 512525). . scripting module script implemented. animation module animate implemented set implemented animatemotion implemented animatetrans
form implemented animatecolor not implemented (bug 436296). mpath implemented font module font not implemented (bug 119490). font-face not implemented. glyph not implemented. missing-glyph ...
... not implemented. glyph not implemented. missing-glyph not implemented. hkern not implemented. vkern not implemented. font-face-src not implemented. font-face-uri not implemented. font-face-
format not implemented. font-face-name not implemented. definition-src not implemented. extensibility module foreignobject implemented. ...
Basic shapes - SVG: Scalable Vector Graphics
tangle ry the y radius of the corners of the rectangle circle the <circle> element draws a circle on the screen. it takes 3 basic parameters to determine the shape and size of the element. <circle cx="25" cy="75" r="20"/> r the radius of the circle. cx the x position of the center of the circle. cy the y position of the center of the circle. ellipse an <ellipse> is a more general
form of the <circle> element, where you can scale the x and y radius (commonly refferred to as the semimajor and semiminor axes in maths) of the circle separately. <ellipse cx="75" cy="75" rx="20" ry="5"/> rx the x radius of the ellipse. ry the y radius of the ellipse. cx the x position of the center of the ellipse. cy the y position of the center of the ellipse. line the <line> element ...
...ses, polylines, and polygons. basically any of the other types of shapes, bezier curves, quadratic curves, and many more. for this reason, the next section in this tutorial will be focused on paths. but for now, note that there is a single parameter used to control its shape. <path d="m20,230 q40,205 50,230 t90,230" fill="none" stroke="blue" stroke-width="5"/> d a list of points and other in
formation about how to draw the path. see the paths section for more in
formation. « previousnext » ...
Gradients in SVG - SVG: Scalable Vector Graphics
svg> screenshotlive sample if the focal point is moved outside the circle described earlier, it's impossible for the gradient to be rendered correctly, so the spot will be assumed to be within the edge of the circle. if the focal point isn't given at all, it's assumed to be at the same place as the center point. both linear and radial gradients also take a few other attributes to describe trans
formations they may undergo. the only other one i want to mention here is the spreadmethod attribute. this attribute controls what happens when the gradient reaches its end, but the object isn't filled yet. it can take on one of three values, "pad", "reflect", or "repeat". "pad" is what you have seen so far. when the gradient reaches its end, the final offset color is used to fill the rest of the obje...
...to one, and they're scaled to the size of your object automatically for you. userspaceonuse essentially takes in absolute units. so you have to know where your object is, and place the gradient at the same place. the radialgradient above would be rewritten: <radialgradient id="gradient" cx="60" cy="60" r="50" fx="35" fy="35" gradientunits="userspaceonuse"> you can also then apply another trans
formation to the gradient by using the gradienttrans
form attribute, but since we haven't introduced trans
forms yet, i'll leave that for later. there are some other caveats for dealing with gradientunits="objectboundingbox" when the object bounding box isn't square, but they're fairly complex and will have to wait for someone more in-the-know to explain them. « previousnext » ...
Introduction - SVG: Scalable Vector Graphics
« previousnext » svg is an xml language, similar to xhtml, which can be used to draw vector graphics, such as the ones shown to the right. it can be used to create an image either by specifying all the lines and shapes necessary, by modifying already existing raster images, or by a combination of both. the image and its components can also be trans
formed, composited together, or filtered to change their appearance completely. svg came about in 1999 after several competing
formats had been submitted to the w3c and failed to be fully ratified. svg is supported by all major browsers. a downside is loading svg can be slow. svg does offer benefits, some of which include having a dom interface available for it, and not requiring third-party extensions. whether or not to use it oft...
...image can become arbitrarily complex. svg supports gradients, rotations, filter effects, animations, interactivity with javascript, and so on. but all these extra features of the language rely on this relatively small set of elements to define the graphics area. before you start there are a number of drawing applications available such as inkscape which are free and use svg as their native file
format. however, this tutorial will rely on the trusty xml or text editor (your choice). the idea is to teach the internals of svg to those who want to understand it, and that is best done by dirtying your hands with a bit of markup. you should note your final goal though. not all svg viewers are equal and so there is a good chance that something written for one app will not display exactly the same i...
SVG: Scalable Vector Graphics
th other web standards including css, dom, javascript, and smil. svg is, essentially, to graphics what html is to text. svg images and their related behaviors are defined in xml text files, which means they can be searched, indexed, scripted, and compressed. additionally, this means they can be created and edited with any text editor or with drawing software. compared to classic bitmapped image
formats such as jpeg or png, svg-
format vector images can be rendered at any size without loss of quality and can be easily localized by updating the text within them, without the need of a graphical editor to do so. with proper libraries, svg files can even be localized on-the-fly. svg has been developed by the world wide web consortium (w3c) since 1999. documentation svg element reference de...
... an image svg animation with smil svg art gallery animation and interactions like html, svg has a document model (dom) and events, and is accessible from javascript. this allows developers to create rich animations and interactive images. some real eye-candy svg at svg-wow.org firefox extension (grafox) to add a subset of smil animation support interactive photos manipulation html trans
formations using svg's foreignobject mapping, charting, games & 3d experiments while a little svg can go a long way to enhanced web content, here are some examples of heavy svg usage. connect 4 jvectormap (interactive maps for data visualization) jointjs (javascript diagramming library) d3 ( javascript library for visualizing data with html, svg, and css ) ...
Insecure passwords - Web security
this was famously demonstrated by firesheep. to fix this issue, install and configure an ssl/tls certificate onto your server. ...
...rs could steal a user's password by sniffing the network, or by modifying the served page in transit. the https protocol is designed to protect user data from eavesdropping (confidentiality) and from modification (integrity) on the network. websites that handle user data should use https to protect their users from attackers. if a website uses http instead of https, it is trivial to steal user in
formation (such as their login credentials). this was famously demonstrated by firesheep. to fix this issue, install and configure an ssl/tls certificate onto your server. there are various vendors offering free and paid certificates. if you are using a cloud plat
form, it may have its own ways of enabling https. note on password reuse sometimes websites require username and passwords but don't actu...
Mixed content - Web security
hing, sensitive data disclosure, redirection to malicious sites, etc. mixed passive/display content mixed passive/display content is content served over http that is included in an https webpage, but that cannot alter other portions of the webpage. for example, an attacker could replace an image served over http with an inappropriate image or message to the user. the attacker could also infer in
formation about the user's activities by watching which images are served to the user; often images are only served on a specific page within a website. if the attacker observes http requests to certain images, they could determine which webpage the user is visiting. passive content list this section lists all types of http requests which are considered passive content: <img> (src attribute) <au...
...mages are only served on a specific page within a website. if the attacker observes http requests to certain images, they could determine which webpage the user is visiting. 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> per
forms 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. hence, in addition to the risks described for mixed display content above, mixed active content is vulnerable to a few other at...
Subdomain takeovers - Web security
me) in the domain name system (dns), but no host is providing content for it. this can happen because either a virtual host hasn’t been published yet or a virtual host has been removed. an attacker can take over that subdomain by providing their own virtual host and then hosting their own content for it. if an attacker can do this, they can potentially read cookies set from the main domain, per
form cross-site scripting, or circumvent content security policies, thereby enabling them to capture protected in
formation (including logins) or send malicious content to unsuspecting users. a subdomain is like an electrical outlet. if you have your own appliance (host) plugged into it, everything is fine. however, if you remove your appliance from the outlet (or haven’t plugged one in yet), someon...
...l host is not handled properly, there can be an opportunity for an attacker to take over a subdomain. during provisioning an attacker sets up a virtual host for a subdomain name you bought on the hosting provider, before you get to do it. suppose you control the domain example.com. you want to add a blog at blog.example.com, and you decide to use a hosting provider who maintains a blogging plat
form. (for "blog", you can substitute "e-commerce plat
form", "customer service plat
form", or any other "cloud-based" virtual hosting scenario.) the process you go through might look like this: you register the name "blog.example.com" with a domain registrar. you set up dns records to direct browsers that want to access blog.example.com so that they go to the virtual host. you create a virtual hos...
Subresource Integrity - Web security
than the document in which it’s embedded, browsers additionally check the resource using cross-origin resource sharing (cors), to ensure the origin serving the resource allows it to be shared with the requesting origin. how subresource integrity helps using content delivery networks (cdns) to host files such as scripts and stylesheets that are shared among multiple sites can improve site per
formance and conserve bandwidth. however, using cdns also comes with a risk, in that if an attacker gains control of a cdn, the attacker can inject arbitrary malicious content into files on the cdn (or replace the files completely) and thus can also potentially attack all sites that fetch files from that cdn. subresource integrity enables you to mitigate some risks of attacks such as this, by ensurin...
... it matches one of those hashes. example integrity string with base64-encoded sha384 hash: sha384-oqvuafxrkap7fdgccy5uykm6+r9gqq8k/uxy9rx7hnqlgyl1kpzqho1wx4jwy8wc so oqvuafxrkap7fdgccy5uykm6+r9gqq8k/uxy9rx7hnqlgyl1kpzqho1wx4jwy8wc is the "hash" part, and the prefix sha384 indicates that it's a sha384 hash. note: an integrity value's "hash" part is, strictly speaking, a cryptographic digest
formed by applying a particular hash function to some input (for example, a script or stylesheet file). but it’s common to use the shorthand "hash" to mean cryptographic digest, so that's what's used in this article. tools for generating sri hashes you can generate sri hashes from the command-line with openssl using a command invocation such as this: cat filename.js | openssl dgst -sha384 -binar...
HTML Imports - Web Components
until there is a consensus on the standard or alternative mechanisms are worked out, you can use a polyfill such as google's webcomponents.js. html imports is intended to be the packaging mechanism for web components, but you can also use html imports by itself. ...
...until there is a consensus on the standard or alternative mechanisms are worked out, you can use a polyfill such as google's webcomponents.js. html imports is intended to be the packaging mechanism for web components, but you can also use html imports by itself. ...
Using shadow DOM - Web Components
: let para = document.createelement('p'); shadow.appendchild(para); // etc. working through a simple example now let's walk through a simple example to demonstrate the shadow dom in action inside a custom element — <popup-info> (see a live example also). this takes an image icon and a text string, and embeds the icon into the page. when the icon is focused, it displays the text in a pop up in
formation box to provide further in-context in
formation. to begin with, in our javascript file we define a class called popupinfo, which extends htmlelement: class popupinfo extends htmlelement { constructor() { // always call super first in constructor super(); // write element functionality in here ... } } inside the class definition we define the element's constructor, which...
... ...
Functions - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the following is an annotated list of core xpath functions and xslt-specific additions to xpath, including a description, syntax, a list of arguments, result-type, source in the appropriate w3c recommendation, and degree of present gecko support. for further in
formation on using xpath/xslt functions, please see the for further reading page. ...
...cluding a description, syntax, a list of arguments, result-type, source in the appropriate w3c recommendation, and degree of present gecko support. for further in
formation on using xpath/xslt functions, please see the for further reading page. ...
XPath
, you may consider js-xpath or wicked-good-xpath. documentation introduction to using xpath in javascript describes a non-xslt use of xpath. xpath:axes list and definition of the axes defined in the xpath specification. axes are used to describe the relationships between nodes. xpath:functions list and description of the core xpath functions and xslt-specific additions to xpath. trans
forming xml with xslt xslt uses xpath to address code segments in an xml document that it wishes to trans
form. xpath snippets these are javascript utility functions, that can be used in your own code, based on dom level 3 xpath apis. what is xslt? this extensive introduction to xslt and xpath assumes no prior knowledge of the technologies, and guides the reader through background, context, struc...
...n which the whole content of an xml document must be read from the javascript interpreter (like for web-apps languages or settings xml documents, for example). in these cases jxon could represent the most practical way and valid alternative to xpath. view all... tools chropath xpath panel that integrates tightly into firebug, providing an editor and inspector (firefox add-on). xmlquire (
formerly known as sketchpath) a graphical xpath builder/debugger(.net). xpath tester an online xpath builder/debugger. related topics xslt, xquery, xml, dom, jxon, jsonpath comparison of css selectors and xpath ...
Interacting with page scripts - Archive of obsolete content
roperties or functions being, or doing, what you expect. any of them, even setters and getters, could have been redefined by a page script. don't use it unless you trust the page, and even then be careful. also, unsafewindow isn't a supported api, so it could be removed or changed in a future version of the sdk. ...
Content Processes - Archive of obsolete content
eal object. a potential problem with the content script having access to the window object is that a malicious page could override methods on the window object that it knows are being used by the add-on, in order to trick the add-on into doing something it does not expect. similarly, if the content script defines any values on the window object, a malicious page could potentially steal that in
formation. to avoid problems like this, content scripts should always see the built-in properties of the window object, even when they are overridden by another script. conversely, other scripts should not see any properties added to the window object by the content script. this is where xray wrappers come in. xray wrappers automatically wrap native objects like the window object, and only exposes t...
XUL Migration Guide - Archive of obsolete content
json messages: in fact, the ability to communicate with the add-on scripts is the only extra privilege a content script is granted over a normal remote web page script. a xul-based add-on will need to be reorganized to respect this distinction. the main reason for this design is security: it reduces the risk that a malicious web page will be able to access privileged apis. there's much more in
formation on content scripts in the working with content scripts guide. using the supported apis the sdk provides a set of high level apis providing some basic user interface components and functionality commonly required by add-ons. because we expect to keep these apis compatible as new versions of firefox are released, we call them the "supported" apis. see the tutorials and the high-level api re...
util/uuid - Archive of obsolete content
generate or parse uuids. usage it exports a single function, uuid(). for more details about uuid representations and what they are used for by the plat
form see the mdn documentation for jsid. generate uuid to generate a new uuid, call uuid() with no arguments: let uuid = require('sdk/util/uuid').uuid(); parsing uuid to convert a string representation of a uuid to an nsid, pass the string representation to uuid(): let { uuid } = require('sdk/util/uuid'); let firefoxuuid = uuid('{ec8030f7-c20a-464f-9b0e-13a3a9e97384}'); globals functions uuid(stringid) generate a new uuid, or convert a string representation of a uuid to an nsid. parameters stringid : string string representation of a uuid, such as: "8cbc9bf4-4a16-11e2-aef7-c1a56188709b" optional. if this argument is supplied...
Creating annotations - Archive of obsolete content
click on the highlight and you should see something like this in the console output: info: show info: http://blog.mozilla.com/addons/2011/02/04/overview-amo-review-process/, post-2249,when you submit a new add-on, you will have to choose between 2 review tracks: full review and preliminary review. annotation editor panel so far we have a page-mod that can highlight elements and send in
formation about them to the main add-on code. next we will create the editor panel, which enables the user to enter an annotation associated with the selected element. we will supply the panel's content as an html file, and will also supply a content script to execute in the panel's context. so create a subdirectory under data called editor. this will contain two files: the html content, and the con...
Overview - Archive of obsolete content
t of annotations and searches web pages for the elements they are associated with. it highlights any annotated elements that are found. when the user moves the mouse over an annotated element the matcher tells the main add-on code, which displays the annotation panel. working with data we'll use the simple-storage module to store annotations. because we are recording potentially sensitive in
formation, we want to prevent the user creating annotations when in private browsing mode. the simplest way to do this is to omit the "private-browsing" key from the add-on's "package.json" file. if we do this, then the add-on won't see any private windows, and the annotator's widget will not appear in any private windows. getting started let's get started by creating a directory called "annotator".
Chrome Authority - Archive of obsolete content
"; var xpcom = require(modname); var one = require("one"); var two = require("two"); the intention is that developers use require() statements for two purposes: to declare (to security reviewers) what sorts of powers the module wants to use, and to control how those powers are mapped into the module's local namespace. their statements must therefore be clear and easy to parse. a future manifest
format may move the declaration portion out to a separate file, to allow for more fine-grained expression of authority. commands that build a manifest, like "jpm xpi" or "jpm run", will scan all included modules for use of cc/ci aliases (or the expanded components.classes
forms). it will emit a warning if it sees the expanded
forms, or if it sees a use of e.g. "cc" without a corresponding entry in th...
Troubleshooting - Archive of obsolete content
dd-on sdk up and running, don't panic! this page lists some starting points that might help you track down your problem. check your firefox jpm searches well known locations on your system for firefox. jpm may not have found an installation, or if you have multiple installations, jpm may have found the wrong one. in those cases you need to use jpm's --binary option. see the jpm guide for more in
formation. when you run jpm to test your add-on or run unit tests, it prints out the location of the firefox or xulrunner binary that it found, so you can check its output to be sure. check your text console when errors are generated in the sdk's apis and your code, they are logged to the text console. this should be the same console or shell from which you ran the jpm command. search for known is...
Bootstrapped extensions - Archive of obsolete content
led. (also sent during uninstallation) addon_install 5 the add-on is being installed. addon_uninstall 6 the add-on is being uninstalled. addon_upgrade 7 the add-on is being upgraded. addon_downgrade 8 the add-on is being downgraded. bootstrap data each of the entry points is passed a simple data structure containing some useful in
formation about the add-on being bootstrapped. more in
formation about the add-on can be obtained by calling addonmanager.getaddonbyid(). the data is a simple javascript object with the following properties: property type description id string the id of the add-on being bootstrapped. version string the version of the add-on being bootstrapped. inst...
Autocomplete - Archive of obsolete content
turning autocomplete on for a xul widget this article is about xul widgets and not about html
form inputs. first, declare a panel with the "autocomplete" type, like so: <panel id="popup_autocomplete" type="autocomplete" noautofocus="true" /> now set the autocompletepopup attribute of your <browser> element to the id of the panel you just declared: <browser id="my_browser" ... autocompletepopup="popup_autocomplete" /> finally, make sure that the value of the browser.
formfill.enable pref is set to true. see also textbox (toolkit autocomplete) how to implement custom autocomplete search component ...
Bookmarks - Archive of obsolete content
0); // index in the folder firefox 3 firefox 3 provides a reworked set of api for working with history and bookmarks. the documentation for the new api is available at places. the places bookmarks service, provided by the nsinavbookmarksservice interface, provides methods for creating, deleting, and manipulating bookmarks and bookmark folders. this article offers examples for how to per
form common bookmark management tasks using the bookmarks service. initiating the bookmarks service as is the case with nearly all interfaces, before you can use the bookmarks service, you need to get access to it: var bmsvc = components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(components.interfaces.nsinavbookmarksservice); creating a bookmark fold...
Customizing the download progress bar - Archive of obsolete content
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. this is required since it contains plat
form-specific directives, as we will see. the myextension.css file will look something like this: richlistitem progressmeter { %ifdef xp_win min-height: 17px !important; %else %ifdef xp_macosx -moz-appearance: none !important; background-image: url(chrome://myextension/skin/progress_bg_osx.png) !important; %endif %endif } richlistitem .progress-bar { %ifdef xp_win -moz-appearan...
Dialogs and Prompts - Archive of obsolete content
describing dialog windows dialogs in mozilla whenever you want to create a dialog in your application, use <dialog> (instead of usual <window>) as root element in the xul file. this will: handle a few keyboard events (enter/esc and more), which is good for keyboard accessibility. add ok and cancel buttons in an order that is consistent with os default (but the button set and layout is highly customizable, see below). ...
Downloading Files - Archive of obsolete content
if, and only if, the url is not // related to a window, null should be used instead. var privacy = privatebrowsingutils.privacycontextfromwindow(urlsourcewindow); persist.persistflags = persist.persist_flags_from_cache | persist.persist_flags_replace_existing_files; persist.saveuri(uritosave, null, null, null, "", targetfile, privacy); if you don't need detailed progress in
formation, you might be happier with nsidownloader. downloading binary files with a progress listener to download a binary file with custom progress listener: components.utils.import("resource://gre/modules/privatebrowsingutils.jsm"); const webbrowserpersist = components.constructor("@mozilla.org/embedding/browser/nswebbrowserpersist;1", "nsiwebbrow...
Running applications - Archive of obsolete content
this page describes how to run other programs from your chrome javascript code, using mozilla xpcom interfaces. there are two ways to run programs. using nsiprocess the recommended way is to use the nsiprocess interface because it is crossplat
form. using nsilocalfile.launch() this method is not implemented on all plat
forms, especially not on unix/linux! see nsilocalfile.launch() for details and make sure that all your target plat
forms support this method! this method has the same effect as if you double-clicked the file, so for executable files—it will just run the file without any parameters. for more in
formation on nsifile/nsilocalfile, see file i/o. var file = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile); ...
Windows - Archive of obsolete content
opening new browser windows to open a new browser window, you can simply use window.open(). however, window.open() returns a window object for content, not for the browser window itself, so you should get the chrome window first. the simplest way to do that is to use nsiwindowmediator. ...
Downloading JSON and JavaScript in extensions - Archive of obsolete content
t) from a remote website. once the content has been downloaded, the extension authors proceed to use eval() to decode the string content into javascript objects. this practice is dangerous and will not, in fact, pass an amo review. so the extension will not be allowed to move out of the amo sandbox. the practice is dangerous because the decoded javascript has full chrome privileges and could per
form some nasty actions. how could the javascript an extension downloads per
form nasty actions? fairly easy if the webserver where the javascript is hosted were to be hijacked or compromised. it happens to the best of us. amo takes the threat very seriously. the good news is there are several ways to workaround the problem. downloading json if the extension is downloading json, then the developer s...
Installing Extensions and Themes From Web Pages - Archive of obsolete content
er, with several properties on that object used to affect the install. url the url property specifies the url of the xpi to install. this property is required. iconurl the iconurl property specifies an icon to be displayed in the installation dialog. this property is optional. if you do not specify an icon, the default icon will be used, usually a green puzzle piece. the icon can be any image
format supported by firefox, and should be 32x32 pixels in size. hash the hash property specifies a cryptographic hash of the xpi file contents. this is used to verify the downloaded file, to protect against a corrupted file being served by a mirror download server, for example. you can use any hash function supported by nsicryptohash. the hash is specified as hash function:hash value, for example, ...
Jetpack Processes - Archive of obsolete content
and returns its global scope. this global scope does not contain privileged apis, or any non-standard javascript objects for that matter, though new globals can be endowed by simply attaching them to the global scope as properties. evalinsandbox(asandbox, ascript) evaluates the given script contents in the given sandbox's global scope. at minimum, javascript 1.8.1 is used. individual lines of the
form //@line 1 "foo.js" can be used to specify filename and line number in
formation for debugging purposes. gc() synchronously per
forms garbage collection. handles messages that communicate between the browser and jetpack process may contain only serializable (json) data and handles. a handle can be used to provide context for messages. either the browser or the jetpack implementation may create one.
Migrating raw components to add-ons - Archive of obsolete content
h they are compatible, leading to poor integration and instability as users upgrade their firefox installations. the firefox extension mechanism allows you to do everything that you could do through direct component drops, but also gives you and your users extra flexibility and more sophisticated versioning support. as we roll this new behavior out, this document will be updated with additional in
formation addressing scenarios we see developers encountering. simple migration if your goal is just to get your raw component working properly as an extension, you can do this in three steps: create a new add-on using the instructions here. as you'll see, add-ons give you much more flexibility than simply loading a component, but in order to get started, all you'll need is your directory structure a...
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
ng why it is that all icons are included in a single file instead of having one file for every icon. one reason is that it would be complicated to manage that many files, and it becomes more likely that changes made to some of the files lead to an inconsistent appearance that is not obvious by looking at the individual files. it is easier to be able to edit all icons in one go. there is also a per
formance gain from using a single file. to get the region that corresponds to a specific state of an icon, the -moz-image-region css property is used. here are some examples of how the css for a toolbarbutton would look like on the 3 major plat
forms. this assumes that you've set the class xs-hw-toolbarbutton to all of your buttons. windows: /* the second and third selectors at the bottom are necess...
Adding sidebars - Archive of obsolete content
ted in positions determined by the user, and they can overlap with each other. this can become complicated very easily, though. remember that you can't have flexibility and absolute positioning at the same time. trees the bookmarks and history sidebars in firefox use the « xul reference « element to show their content. trees are another strong option when you need to show a great amount of in
formation in a compact presentation. with a tree you can show a rather small amount of root nodes, giving the user the possibility to expand whichever ones are needed. trees are specially powerful when combined with data templates, a topic that will be covered later on. you can also read much more about trees in the xul tutorial page. the tree element is possibly the most complex element in xul. it i...
Observer Notifications - Archive of obsolete content
you could do that by calling all those functions directly, but xpcom offers you a better and cleaner way to achieve that using observers and the observer service. an observer is an object that is responsible to observe (wait for) notifications and then to carry out subsequent actions. to create an observer, you need to implement the nsiobserver interface. ...
Useful Mozilla Community Sites - Archive of obsolete content
« previous the mozilla community is very rich and active. it's a very powerful tool you have when developing on top of the mozilla plat
form, and you should take advantage of it in order to create a truly successful add-on . amo amo (mozilla add-ons) is the official mozilla repository for add-ons. it allows you to upload, search and download all types of add-ons for mozilla applications. this is the best way to get your extension to users from all around the world. adding your extension to amo is easy. all you need is your xpi, a few screenshots (good ones will make your extension much more appealing), and a few minutes to fill a couple of
forms. but this won't make your extension public right away. amo has a review process that prevents malicious, insecure or low quality extensions t...
Extensions support in SeaMonkey 2 - Archive of obsolete content
ageuris messagedisplay gmessagedisplay api seamonkey 2.0 only supports a reduced set of methods: displayedmessage visible javascript tweaks firefox supports some shorthand in various places. these are so commonly available that developers often forget that they are not built-ins. seamonkey on the other hand defaults to not support them so they either need to be expanded to their proper
forms or matching constants/variables need to be defined in custom code. shorthand expansion cc components.classes ci components.interfaces cr components.results cu components.utils multi-browser compatibility to make an extension compatible with seamonkey as well as firefox/thunderbird, you may need to do different things depending ...
Supporting search suggestions in search plugins - Archive of obsolete content
string. this allows firefox to verify that the suggestions match the current search term. completion list an array of suggested search terms. the array should be enclosed in square brackets. for example: ["term 1", "term 2", "term 3", "term 4"] descriptions this optional element is an array of descriptions for each of the suggestions in thecompletion list . these can be any additional in
formation the search engine might want to return to be displayed by the browser, such as the number of results available for that search. descriptions are not supported in firefox, and are ignored if any are specified. query urls this optional element is an array of alternate urls for each of the suggestions in thecompletion list . for example, if you want to offer a map link instead of just a s...
Using the Stylesheet Service - Archive of obsolete content
applied in is undefined. usage notes stylesheets added using this service get applied to both chrome and content documents. remember to declare the correct namespace if you want to apply stylesheets to xul documents. registered style sheets are not remembered across restarts. loadandregistersheet fails if css contains #id. '#' must be percent-encoded, details see bug 659650. historical in
formation nsistylesheetservice was introduced in firefox 1.5. in firefox 1.5 and 2, adding and removing such style sheets takes effect upon the next load of a page. in firefox 3, the changes take effect immediately, though some declarations (especially those affecting xul) won't work until a reload. backwards compatibility you can check for the availability and the functionality of the stylesheet s...
Bypassing Security Restrictions and Signing Code - Archive of obsolete content
early versions of firefox allowed web sites to segregate principals using signed scripts, and request extra permissions for scopes within signed scripts using a function called enableprivelege. these privilege manager feature was not used much (aside from abuse), and its complexity made per
formance improvements difficult. signed script segregation was removed in bug 726125, the enableprivilege prompt was removed in bug 750859, and enableprivilege itself was nerfed in bug 757046. the privilege manager has been deprecated in firefox 12 and disabled in firefox 17. sites that require additional permissions should now ask firefox users to install an extension, which can interact with non-privileged pages if needed. ...
slideBar - Archive of obsolete content
about status: in development instantiation: jetpack.future.import('slidebar') last update: v0.6 summary: slidebar is a reinvention of the old sidebar feature of browsers. they allow quick access to a wide range of both temporary and permanent in
formation at the side of your browser window. when a slidebar feature is selected, its contents will be revealed from behind the current web page. creating a slidebar and adding options to implement a new slidebar within your jetpack code, use the method jetpack.slidebar.append(options) ...
slideBar - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development. read the experiment report for what we learned from it and the blog post announcing the first sdk release for what we're up to next! slidebar is a reinvention of the old sidebar features of browsers. they allow quick access to a wide range of both temporary and permanent in
formation at the side of your browser window. when a slidebar feature is selected its contents will be revealed from behind the current webpage. it currently under development and lives in the future. jetpack.future.import("slidebar"); methods append(iconurihtmlhtml/xmlurluriwidthintpersistboolautoreloadboolonclickfunctiononselectfunctiononreadyfunction)this is a list of options to specify modifications to your slidebar ins...
Enabling Experimental Jetpack Features - Archive of obsolete content
stringmountpathstring that enumerates where, starting from the jetpack base, the feature will be mounted. to get a list of mount paths that are available, see the method below. string here is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been
formally accepted into the core without additionally changing the script (barring any other changes made during integration). list() arrayreturns an array of the set of potential stringmountpath as used in jetpack.future.import(). this is an example of how to get this array. a quick way of displaying the list is to write it to the console.log. var list = jetpack.future.list(); console.log(list); open...
Clipboard - Archive of obsolete content
content to be copied to the clipboard. if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type. this is an optional parameter. the only flavors currently implemented are 'plain' (text/unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard. jetpack.import.future("clipboard"); // in text
format jetpack.clipboard.set("hello world"); // in other clipboard get(flavor string)returns data to jetpack from the clipboard. if flavor is provided, the data is returned in that
format. flavorreturns data to jetpack from the clipboard. if flavor is provided, the data is returned in that
format. string here's an example of how to use the method to get the data on the clipboard. remember to import...
Selection - Archive of obsolete content
election api provides a method for detecting the selections made by the user. features can get, set, and listen for selection events in html or plain text. the namespace for this api is jetpack.selection. this api currently lives in the future and must be imported for use: jetpack.future.import("selection"); getting and setting the selection the current version of jetpack.selection includes these
formats: .text and .html getting the selection the following is an example of getting the selection from the user. jetpack.import.future("selection"); var textofsel = jetpack.selection.text; var htmlofsel = jetpack.selection.html; setting the selection the following is an example of getting the selection from the user. jetpack.import.future("selection"); jetpack.selection.text = 'hello'; jetpack.se...
Mac OS X Build Prerequisites/fink - Archive of obsolete content
seem to be as well maintained (in terms of available packages) as macports, so it is strongly suggested that you use macports instead of fink. you may download the most recent version of fink that is compatible with your operating system release. fink installs in /sw by default. the installer should configure the fink environment for you, making it available in any new terminal window. if you per
form a major operating system upgrade on your computer, such as an upgrade from tiger to leopard, you should remove the /sw directory and re-install fink and the packages below. libidl, glib using fink. libidl is included in the orbit installation. $ sudo apt-get update $ sudo apt-get install orbit orbit-dev glib autoconf-2.13 using fink. autoconf is installed at /sw/bin/autoconf. do not install th...
Plug-n-Hack Phase2 - Archive of obsolete content
the next phase of plug-n-hack (pnh) is still being planned but is intended to allow browsers to advertise their capabilities to security tools. this will allow the tools to obtain in
formation directly from the browser, and even use the browser as an extension of the tool. if you are interested in working on this aspect then please get in touch. related links plug-n-hack overview ...
BundleLibrary - Archive of obsolete content
bapp internet radio that only plays music you like. reddit: reddit.webapp remember the milk: rtm.webapp (note: should work with google gears with some help) rsizr image editor rsizr.webapp seeqpod: seeqpod.webapp playable music search engine. slimtimer client slimtimer.webapp a very useful time-tracking tool with a "slim" client spagobi spagobi.webapp a web collaborative business intelligence plat
form streamy streamy.webapp ( streamy is a pretty powerful, next-gen online rss feed reader. ) studivz: studivz.webapp wassr: wassr.webapp weightwatchers.com plan manager : weightwatchers.webapp widgetop.com - dashboard widget web desktop: widgetop.webapp yahoo! mail: ymail.webapp (note that this fakes a firefox user agent string while running, which may affect other running web applications.) ...
FAQ - Archive of obsolete content
mozilla product. it is one of the experiments being conducted by mozilla labs to bridge the divide in the user experience between web applications and desktop apps. prism is the codename for the project, and if the functionality provided by prism becomes a product or is integrated into other products (like firefox), then it won't necessarily continue to be called by this codename. is prism a plat
form? no, prism is not a plat
form. prism is built on top of the mozilla plat
form and its gecko rendering engine, just like mozilla firefox, so it provides the same capabilities to web applications that firefox provides, including support for html, javascript, css, and <canvas>. at the same time, we're also working to increase the capabilities of those apps by adding features to the web itself, like su...
Prism - Archive of obsolete content
versions of xulrunner. firefox extension: a firefox extension, code-named "refractor", can be used to spin out new prism apps from inside the web browser. refractor adds a new menu item to call up the shortcut creation dialog for inside firefox. web apps can also point to a complete web app bundle or some elements of a web app (like higher resolution icons). refractor automatically takes this in
formation into account. documentation frequently asked questions bundles a web application bundle is a zip archive that holds a configuration file, icons and an optional webapp js script. bundles can be installed locally, or directly from a website using the prism for firefox...
Proxy UI - Archive of obsolete content
g tab > connection button. seamonkey menu: preferences > advanced group > proxies panel menu: right-click on offline-online button (on browser windows). camino configured in os (networking preferences) (recently added - some support for reading os and account settings.)ui elements preferences panel overview the ui is based on selecting a proxy mode, then filling out any additional needed in
formation in "related" ui. the "ok" button saves the preferences. the preference changes selecting the proxy "mode" all product's proxy preference panels share a basic design: a radio button that selects the proxy mode, then "related proxy mode" ui when needed. 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.typ...
Reading textual data - Archive of obsolete content
readstring(4096, str); if (numchars != 0 /* eof */) var read_string = str.value; to read the entire stream and do something with the data: var str = {}; while (is.readstring(4096, str) != 0) { processdata(str.value); } don't forget to close the stream when you're done with it (is.close()). not doing so can cause problems if you try to rename or delete the file at a later time on some plat
forms. note that you may get less characters than you asked for, especially (but not only) at the end of the file (stream). unsupported byte sequences you can specify what should happen with byte sequences that do not correspond to a valid character. the last (4th) argument to init specifies which character they get replaced with; nsiconverterinputstream.default_replacement_character is u+fffd repl...
Remote debugging - Archive of obsolete content
ctions. the developer trusts that his time is not being wasted: the crash is a real bug in firefox. (that is, there's a legitimate reason it happens only on some computers, but that reason just hasn't been discovered.) the crash victim, in turn, trusts the developer with full access to his computer. a good place to start is a detailed stack (in gdb, use bt followed by bt full). there give more in
formation about the stack than a breakpad crash report: not only the names of the functions on the stack, but also the values they were passed. core dump a core dump includes all of the memory of a crashed program. it allows you to see the crash in a debugger even after the program has long exited. transferring a core dump is tricky, because it is large and can contain private in
formation. core dumps ...
SpiderMonkey coding conventions - Archive of obsolete content
separated or intercaps names, e.g., str_indexof. and library-private and static data use underscores, not intercaps (but library-private data do use a js_ prefix). scalar type names are lowercase and js-prefixed: jsdouble. aggregate type names are js-prefixed and mixed-case: jsobject. macros are generally all_caps and underscored, to call out potential side effects, multiple uses of a
formal argument, etc. 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. dll entry points that are not public apis use js_friend_api() instead. ...
open - Archive of obsolete content
file. certain methods of file, such as read and write should not be used when the file is not open. other methods, such as remove may not be used when the file is open. valid file types are text, binary and unicode. text indicates ascii text without nul characters. binary indicates utf-8 files. unicode indicates ucs-2 files. for all file types, carriage returns and linefeeds are treated in a plat
form-agnostic way. examples example: using open in the following example, myfile is a file object: myfile.open("read", "text"); see also ...
Standalone XPCOM - Archive of obsolete content
fference is that xpt files cannot be read from .zip files in standalone xpcom. todo for v 1.0 optional exclusion of specific features into standalone xpcom like registry, xpconnect. tweeking these options will cause reduction in memory requirements and size. get xpcom/tests directory upto date and documented. update this document for mac. api freeze and documentation original document in
formation author: suresh duddi last updated date: 15 may 2000 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Table Cellmap - Border Collapse - Archive of obsolete content
as one can see from the following illustration this is enough to cover a whole table. only the right most edge and the bottom most edge of a table need to be stored in a different place. border for the top and left border we store the width and the owner of the border. the width is stored in pixel coordinates. ...
Abc Assembler Tests - Archive of obsolete content
ecial 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. compare_numbereq(name:string, expected:*, actual:*, fractiondigits:int=-1):void - compare 2 numbers up to fractiondigits this is to be used for high precision numbers that may vary slightly due to plat
form differences. sample abcasm test /* ***** begin license block ***** * version: mpl 1.1/gpl 2.0/lgpl 2.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. you may obtain a copy of the license at * http://www.mozilla.org/mpl/ * * software distributed under the license is ...
Actionscript Acceptance Tests - Archive of obsolete content
name tuple. # (see http://docs.python.org/library/time.html for details) # e.g.: eastern standard time/eastern daylight time = ('est','edt') # write timezones as tuples, one to each line. ('est', 'edt') ('cst', 'cdt') ('mst', 'mdt') ('pst', 'pdt') testname.err this file is used when the test throws an uncatchable error. the first line must contain the expected error (without the extra debugger in
formation). the exitcode is optional, but must be defined in this file if non-zero. verifyerror: error #1021 exitcode: 1 testname.exitcode file that specifies the expected exitcode. should just be an integer with nothing else. (note that if a .err file is defined, the .exitcode file will be ignored). in this example the .as test runs out of memory and so the expected exitcode is: 128 testname.ou...
Cmdline tests - Archive of obsolete content
the cmdline testsuite is located in test/cmdline. the testsuite allows more flexibility by coding scripts in python allowing any executable to run, sending commands to stdin, and asserting output using regular expressions. see test/cmdline/readme document for more in
formation. two use cases for the cmdline testsuite: use case 1: test the interactive cmdline debugger test contents: start avmshell -d test.abc, set breakpoint on a line, show local variable value, quit from cmdutils import * def run(): r=runtestlib() r.run_test( 'debugger locals', '%s -d testdata/debug.abc'%r.avmrd, input='break 53\ncontinue\nnext\ninfo locals\nnext\ninfo locals\nquit\n', expectedout=['local1 = undefined','local2 = 10','local2 = 15'] ) use case 2: test -memstats retu...
Tamarin Roadmap - Archive of obsolete content
he roadmap is a living document representing current best thinking and is subject to change. comments or questions are welcome and encouraged via the tamarin-devel mailing list. tc jan '09 feature links status integrate the tt string class tamarin:string implementation tamarin:strings bug 465506 complete enhanced c++ profiler enhance memory profiler to work in release builds and be more per
formant in progress enable lir for arm targets bug 460764 complete amd64 nanojit bug 464476 in progress port nanojit to powerpc bug 458077 complete add mac-x64 and linux-x64 buildbots complete fail build on assertion in acceptance tests complete merge tracking bug bug 469836 in progress tc feb '09 spring backlog tbd. ...
Tamarin - Archive of obsolete content
rently implements adobe actionscript™ 3 (a superset of ecmascript edition 3) and is embedded within the adobe® flash® player versions 9 and later. tamarin's jit-compiler, nanojit, is also used in tracemonkey ergo spidermonkey, which is mozilla’s javascript engine in firefox. tamarin is available under the mpl/gpl/lgpl tri-license. releases release tracking in
formation on current, past, and upcoming releases of tamarin. documentation adobe actionscript virtual machine 2 (avm2) overview (pdf, 400k) the instructions, architecture, and file
format supported by the avm2. see also the possible errata. tamarin build documentation how to get, build, and use tamarin. tamarin build system documentation ...
The life of an HTML HTTP request - Archive of obsolete content
layouted (reflowed) the frames it calls nsiframe::paint() method of all frames. these get passed references to the presentation context and a rendering context to do the drawing on. the rendering context implementation is a native class (nsgtkrenderingcontext on unix) that knows how to draw in a window. todo: views, viewmanager, eventstatemanager? diagram created with dia. original document in
formation author(s): alexander larsson last updated date: october 8, 1999 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Tuning Pageload - Archive of obsolete content
de a or mode b. the decision is based on whether there were any user events on the relevant widget in the last content.switch.threshold microseconds. as in, if the user is moving the mouse or typing in that window, we'll be more responsive; if there is no user activity, we will aim for less parser interruption and less responsiveness but lower overall load time. content.notify.* controls the in
formation flow from content sink to rendering model. in particular, the way things work right now is that the parser and content sink construct the dom; then every so often, the content sink lets the rendering model constructor (nscssframeconstructor) know that there are new dom nodes. the reason for this is that nscssframeconstructor is most efficient when doing a bunch of stuff at once instead of c...
[Deprecated] The Mozilla build VM - Archive of obsolete content
icant improvements in our build environment setup process, it's much simpler and easier to get set up and stay up to date by starting with building firefox instead. other links of interest may include: developer guide (documentation about developing on and for mozilla projects). mentored bugs have a mentor who commits to helping you every step of the way. generally, there should be enough in
formation in the bug to get started. whenever you need help, contact the mentor via matrix, in the bug itself, or by email. when you've completed the bug, they will help you get your code into the tree. "good" first bugs may be a little stale, but at some point in their lives we considered that they would be a good first step for newcomers to mozilla. we are in the process of migrating these bugs to ...
Mozilla Web Developer Community - Archive of obsolete content
archived devedge newsletters are at http://devedge-temp.mozilla.org/community/news/ feeds recent changes rss feed warning: this feed is updated very often. mozilla developer news feed actually, there are no other feeds available for developer.mozilla.org. looking for feed ideas? the list of old devedge fee...
Binding Implementations - Archive of obsolete content
property initialization always takes place after content generation but before the firing of a binding attachment event, since the bindingattached handler needs to be able to assume that all properties will be accessible on the binding. properties with getters and setters can define them using onget and onset attributes, or using the more verbose getter and setter elements. if both the attribute
form and the element
form are used to specify a getter or setter, then the element
form is ignored. a getter contains script whose return value is handed back when the property is requested. a setter contains a script that is invoked when a new value is assigned to the property. in script, the word val is used to represent the new value. properties can be designated as constant using the readonly at...
DOM Interfaces - Archive of obsolete content
for. return value nodelist - the return value of getanonymousnodes is a nodelist that represents the children of an element after insertion points from its own binding have been applied. this means that, depending on the details regarding the insertion points of the binding, it's possible that some non-anonymous nodes appear in the list. see "not so anonymous nodes" on mozilla.dev.plat
form for some discussion about this. getanonymouselementbyattribute the getanonymouselementbyattribute methods retrieves an anonymous descendant with a specified attribute value. typically used with an (arbitrary) anonid attribute to retrieve a specific anonymous child in an xbl binding. parameters elt - the element to retrieve anonymous children for. attrname - the attribute name...
Example Sticky Notes - Archive of obsolete content
the bound element. --> <stylesheet src="notes.css"/> </resources> <content> <!-- this svg graphics will be added automatically around each bound element. the position of the original content is indicated by <children/> tag. --> <svg:svg width="60px" height="60px"> <svg:g fill-opacity="0.6" stroke="#ffffff" stroke-width="1px"> <svg:circle cx="25px" cy="12px" r="12" fill="#ff0000" trans
form="translate(0,0)"/> <svg:circle cx="25px" cy="12px" r="12" fill="#00ff00" trans
form="translate(7,12)"/> <svg:circle cx="25px" cy="12px" r="12" fill="#0000ff" trans
form="translate(-7,12)"/> </svg:g> </svg:svg> <children/> </content> <implementation> <!-- here and futher cdata wrappers around javascript code are not mandatory but recommended. this way you protect yourselve from < and...
Unix stub installer - Archive of obsolete content
generate the xpi at package time by adding a makexpifile("<component>"); call at: <http://lxr.mozilla.org/seamonkey/sou.../makeall.pl#75> you can test it by changing your current working directory to mozilla/xpinstall/packager/unix and running "perl deliver.pl" on the shell prompt. the resulting stub and full installers will be delivered to "mozilla/installer/{stub,sea}". original document in
formation author(s): samir gehani other contributors: curt patrick last updated date: march 12, 2003 copyright in
formation: copyright (c) samir gehani, curt patrick ...
Windows stub installer - Archive of obsolete content
mponentlist at: <http://lxr.mozilla.org/seamonkey/sou...makeall.pl#125> you can test it by changing your current working directory to mozilla/xpinstall/wizard/windows/builder and running "perl build.pl" on the shell prompt. the resulting stub installer and packages will be delivered to "mozilla/dist/win32obj_d/installer". run setup.exe there to launch the stub installer. original document in
formation author(s): samir gehani other contributors: curt patrick last updated date: march 12, 2003 copyright in
formation: copyright (c) samir gehani, curt patrick ...
File.windowsShortcut - Archive of obsolete content
"test", vi, 0); f = getfolder("windows"); g = getfolder("temporary"); addfile( "miscshortcut", "2.2.2.2", xpisrc, f, xpisrc, true); target = getfolder(f, xpisrc); shortcutpath = getfolder("program"); err = file.windowsshortcut( target, shortcutpath, "misc shortcut", g, "", target, 0); logcomment("file.windowsshortcut returns: " + err); if (0 == getlasterror()) per
forminstall(); else cancelinstall(); ...
Install.addFile - Archive of obsolete content
install.addfile the install object's addfile method is the standard way to queue files for installation. var xpisrc = "file.txt"; initinstall( "adding a file", "testfile", "1.0.1.7", 1); f = getfolder("program"); setpackagefolder(f); addfile(xpisrc); if (0 == getlasterror()) per
forminstall(); else cancelinstall(); ...
InstallTrigger.startSoftwareUpdate - Archive of obsolete content
installtrigger.startsoftwareupdate this is a very simple example of the installtrigger object's principal method, startsoftwareupdate, which takes a string representing the path to the xpi and installs that xpi on the local machine. function triggerurl(url) { installtrigger.startsoftwareupdtate(url); } // get the url to the .xpi from either a
form // or text field entry. then do: ... onclick="triggerurl(this.
form.url.value); ...
Trigger Scripts and Install Scripts - Archive of obsolete content
trigger scripts and install scripts trigger scripts are simple installations that can be initiated from event handlers and other javascript code on a web page. triggers use the installtrigger object methods to compare software versions, install chrome, and per
form simple software installations. install scripts use the install, file, installversion and plat
form-specific installation object methods to initialize, queue, manage, and per
form the installation of one or more software packages. these install scripts are typically located at the top level of the xpi archives in which the installations are stored. a trigger script may trigger the downloading of a xpi, which in turn will use its own install.js script to manage the complete installation. ...
dirRemove - Archive of obsolete content
dirremove removes a directory. method of file object syntax int dirremove( filespecobject dirtoremove [, boolean recursive] ); parameters the dirremove method has the following parameters: dirtoremove a filespecobject representing the directory to be removed. recursive an optional boolean value indicating whether the remove operation is to be per
formed recursively (1) or not (0). returns an integer error code. for a list of possible values, see return codes. ...
diskSpaceAvailable - Archive of obsolete content
ing your files (see example below). you can use a string representing any file on the disk you want to check, and xpinstall will resolve the reference to the partition itself. example var diskamtneeded = 10000; f = getfolder("program"); diskspace = file.diskspaceavailable(f); g = getfolder(f, "myfile.txt"); if (diskspace > diskamtneeded) { err = addfile(..., ... g, ...); if (err == 0) per
forminstall(); else cancelinstall(); } else { alert("not enough disk space. no install); cancelinstall(); } ...
execute - Archive of obsolete content
executablefile a filespecobject representing the local file already on disk to be executed. note that file names are case sensitive. aparameters an optional parameter string that is passed to the executable. (ignored on mac os) returns an integer error code. for a list of possible values, see return codes. description the specified file is not actually executed until the per
forminstall method is called. see per
forminstall for more in
formation about queued commands during the installation process. example f = getfolder("program", "mytexteditor.exe"); err = file.execute(f, "myfile.txt"); // indicates that 'myfile.txt' will be // opened in the editor ...
windowsGetShortName - Archive of obsolete content
summary returns a path that con
forms to the windows 8.3 file naming convention. method of file object syntax string windowsgetshortname( object localdirspec ) parameters the windowsregisterserver method has the following parameter: localdirspec a filespecobject representing a directory obtained by getcomponentfolder or getfolder. returns a string with the windows shortname. if the path already con
forms to 8.3, the return value is null. example flongfilepath = getfolder(fprogram, "longfilename.file"); sshortfilepath = file.windowsgetshortname(flongfilepath); if(sshortfilepath) { // do something } ...
init - Archive of obsolete content
itializes an init object. method of installversion object syntax init ( int maj, int min, int rev, int bld ); init ( string version ); parameters the init method has the following parameters: maj the major version number. min minor version number. rev revision number. bld build number. version a string representing version in
formation in the
format "4.1.2.1234". when maj, min, rev, and bld are provided as parameters, all four parameters are required, but all of them can be zero. ...
Properties - Archive of obsolete content
major version of netscape 6 is "6" minor second most siginificant element of the installversion object.e.g. minor version of netscape communicator 4.7 is "7" release second least siginificant element of the installversion object. build least siginificant element of the installversion object.e.g. buildid of netscape 6 is represented by a time stamp of teh
format:yyyymmddhh: 2001031808 means in the year 2001, in the month of march, on the 18th day of the month, at 8:00am. the product was built. ...
confirm - Archive of obsolete content
utton0title, string abutton1title, string abutton2title, string acheckmsg, object acheckstate ); parameters the second, extended confirm() method is supported starting with gecko 1.8. it accepts any number of parameters up to 8. previous gecko versions only support the first, one-parameter method and will throw an error on occuring the extended
form. see the notes at the end of this document for a safe way to implement a fallback. atext the string to be displayed in the confirmation dialog. this string is typically in the
form of a prompt for the user (e.g., "are you sure you want to delete the selected file(s)?"). adialogtitle the string to be used as the dialog title. defaults to "confirm" (or the localized e...
gestalt - Archive of obsolete content
gestalt (macintosh only) retrieves in
formation about the operating environment. method of install object syntax int gestalt ( string selector ); parameters the gestalt method takes the following parameters: selector the selector code for the in
formation you want. returns returns the requested in
formation. the
format depends on the select code specified in the selector parameter. description the gestalt method is a wrapper for the gestalt function of the macintosh toolbox. for in
formation on that function, see inside macintosh: operating system utilities. this method returns null on unix and windows plat
forms. ...
getWinProfile - Archive of obsolete content
file a relative pathname to an initialization file in the directory specified by the folder parameter, such as "royal/royal.ini". returns a winprofile object. description the getwinprofile method creates an object for manipulating the contents of a windows .ini file. once you have this object, you can call its methods to retrieve strings from the file or to add strings to the file. for in
formation on the returned object, see winprofile. this method returns null on unix and macintosh plat
forms. example to edit the win.ini file, you would create a winprofile object with this call: var mywinprofileobj = getwinprofile (getfolder("windows"), "win.ini"); ...
getWinRegistry - Archive of obsolete content
nregistry (windows only) constructs an object for working with the windows registry. method of install syntax winreg getwinregistry(); parameters none. returns a winreg object. description use the getwinregistry method to create an object for manipulating the contents of the windows registry. once you have this object, you can call its methods to retrieve or change the registry's content. for in
formation on the returned object, see winreg. this method returns null on unix and macintosh plat
forms. ...
loadResources - Archive of obsolete content
dresources loads a properties file. method of install object syntax object loadresources( string xpipath ); parameters the sole input parameter for loadresources is a string representing the path to the properties file in the xpi in which the key/value pairs are defined. returns a javascript object whose property names are the keys from that file and whose values are the strings. description the
format of the properties file expected by loadresources is the same as that of the chrome locale .properties files. this method is used to internationalize installation scripts by allowing the installer to retrieve localized string values from a separate file. be aware that the parameter specifies the file within the xpi and not on the file system, as the following example demonstrates. example given ...
registerChrome - Archive of obsolete content
ated. returns an integer error code. for a list of possible values, see return codes. in some situations the method may return other errors. in a few cases you may get a registry error. description when the third parameter is omitted (pointing to a specific location within the xpi file), this function is being used in a somewhat deprecated way. in this case, registerchrome is supporting the old
format of installation archives, in which the manifest.rdf file was always located at the highest level of the installation archive. in this case, registerchrome does not require a path inside the archive, as it does now in order to locate the more flexible contents.rdf
format of installation archives. note that you can also look in the installed-chrome.txt file in the chrome directory to see how and ...
resetError - Archive of obsolete content
reseterror resets a saved error code to zero. method of install object syntax void reseterror (); parameters none. returns nothing. description the reseterror method resets any saved error code to zero. see getlasterror for additional in
formation. example to reset the last error code to zero: reseterror(); ...
setPackageFolder - Archive of obsolete content
der method has the following parameter: folder an object representing a directory. you create this object by passing a string representing the directory to the getfolder or getcomponentfolder method. returns none. description the setpackagefolder method to set the default package folder that is saved with the root node. when the package folder is set, it is used as the default for
forms of addfile and other methods that have an optional localdirspec parameter. you should only call this method once, and you should always call it immediately after you call initinstall. if you call setpackagefolder multiple times, the last folder set is the folder that is saved in the client version registry and used as the default for other installations. ...
writeString - Archive of obsolete content
ew value. returns true if successfully scheduled, otherwise, false. description the writestring method is similar to the windows api function writeprivateprofilestring. to delete an existing value, supply null as the value parameter. unlike the writeprivateprofilestring function, this method does not support using a null key to delete an entire section. values are not actually written until per
forminstall is called. example to set the name of the wallpaper file from the desktop section of the win.ini file, use this call: ini = getwinprofile (getfolder("windows"), "win.ini"); ini.writestring ("desktop", "wallpaper", "newpathname"); ...
createKey - Archive of obsolete content
createkey adds a key to the registry. method of winreg object syntax int createkey ( string subkey, string classname); parameters the method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail". classname usually an empty string. for in
formation on this parameter, see the description of regcreatekeyex in your windows api documentation. returns 0 if it succeeded; a nonzero number if it failed to schedule the creation. for a list of possible values, see return codes. description the createkey method adds a key to the registry. you must add a key to the registry before you can add a value for that key. ...
getValue - Archive of obsolete content
following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail". valname the name of the value-name/value pair whose value you want. returns a winregvalue object representing the value of the named value-name/value pair or null if there is no value or if there is an error. see winregvalue for in
formation about these values. description the getvalue method retrieves the value of an arbitraty key. use this method if the value you want is not a string. if the value is a string, the getvaluestring method is more convenient. ...
setRootKey - Archive of obsolete content
hod has the following parameter: key an integer representing a root key in the registry. returns nothing. description the setrootkey changes the root key. when you create a winreg object, it is set to access keys under the hkey_classes_root portion of the registry. if you want to access keys in another portion, you must use this method to change the root key. on 16-bit windows plat
forms, hkey_classes_root is the only valid value and this method does nothing. these root keys are represented as fields of the winreg object. the values you can use are: hkey_classes_root hkey_current_user hkey_local_machine hkey_users example to use the hkey_users section, use these statements: winreg = getwinregistry(); winreg.setrootkey(winreg.hkey_users); ...
setValue - Archive of obsolete content
lue value); parameters the setvalue method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail". valname the name of the value-name/value pair whose value you want to change. value a winregvalue object representing the new non-string value. see winregvalue for in
formation about these values. returns 0 if it succeeded; a nonzero number if it failed to schedule the action. for a list of possible values, see return codes. description the setvalue method sets the value of an arbitrary key. use this method if the value you want to set is not a string. if the value is a string, the setvaluestring method is more convenient. ...
WinRegValue - Archive of obsolete content
ts_list = 10 regdata a java byte array containing the data. returns a new winregvalue object, with the data members type and data set to the values passed to this constructor. description advanced windows developers can use this object to manipulate non-string values for the windows registry. an object of this type has two fields: the type of the data and the value. for in
formation on the possible data types for a registry value, see your windows api documentation. you supply the value for these fields to the constructor for this class. ...
Advanced Rules - Archive of obsolete content
value of the name for each row and the other which displays the value of the prediction. if using the dont-build-content flag on a tree, replace the content element with a treeitem element. adding additional bindings the final element you can add inside a rule is the bindings element. inside it, you place one or more binding elements. a binding in a rule has the same syntax as a triple and per
forms almost the same function. for example, in the weather example above we could add the following binding: <bindings> <binding subject="?city" predicate="http://www.xulplanet.com/rdf/weather#temperature" object="?temp"/> </bindings> this binding will grab the temperature resource of each city and assign it to the 'temp' variable. this is similar to what a triple does. t...
Broadcasters and Observers - Archive of obsolete content
l the elements that issue the back action disable themselves. we can use the attribute forwarding of commands to accomplish this. broadcasters there is a similar element called a broadcaster. broadcasters support attribute forwarding in the same way that commands do. they work the same as commands except that a command is used for actions, while a broadcaster is instead used for holding state in
formation. for example, a command would be used for an action such as back, cut or delete. a broadcaster would be used to hold, for instance, a flag to indicate whether the user was online or not. in the
former case, menu items and toolbar buttons would need to be disabled when there was no page to go back to, or no text to cut or delete. in the latter case, various user interface elements might need ...
Commands - Archive of obsolete content
he command. this is where you would put the code to handle the command. onevent (event) this method handles an event. example: controller implementation let's assume that we want to implement a listbox that handles the delete command. when the user selects delete from the menu, the listbox deletes the selected row. in this case, you just need to attach a controller to a listbox which will per
form the action in its docommand method. try opening the example below (source view) in a browser window and selecting items from the list. you'll notice that the delete command on the browser's edit menu is enabled and that selecting it will delete a row. (see discussion about opening this example). the example below isn't completely polished. really, we should ensure that the selection and focus is...
Content Panels - Archive of obsolete content
it will get the outer xul window. this would be suitable for a child xul panel that is part of your application, but this isn't what you want for a browser that loads a web page. instead, you would want to restrict the web page to only getting access to the web page content. you might note that a mozilla browser window has xul content for the toolbars and statusbar and so forth with a tabbrowser
forming the main area. this inner area displays a web page, but the web page cannot access the xul around it. this is because it uses the second type of browser, specified by setting the type attribute to the value content. this prevents the content from traversing up to the xul window. an example: <browser src="http://www.mozilla.org" type="content" flex="1" /> important: you must set the type at...
Creating a Skin - Archive of obsolete content
ead of below) create a directory somewhere where you want to place the skin files. copy a manifest file (contents.rdf) from the classic or modern skin into this new directory. modify the references in the manifest file to a custom name for your skin. for example, change references of 'classic/1.0' to 'blueswayedshoes/1.0'. add a line to the file 'chrome/installed-chrome.txt of the following
form: skin,install,url,file:///stuff/blueswayedshoes/ where the last part points to the directory you created. make sure to add a slash at the end. copy the original findfile.css into the new directory. we'll use this as a basis for the new skin. we can then refer to it using the url 'chrome://findfile/skin/findfile.css'. adding style rules first, let's decide what kind of changes we want to make.
Creating a Window - Archive of obsolete content
file to open when mozilla starts. if this is not specified, the default window will open. (usually the browser window.) for example, we could open the find files dialog with either of the following: mozilla -chrome chrome://findfile/content/findfile.xul mozilla -chrome resource:/chrome/findfile/content/findfile.xul if you run this command from a command-line (assuming you have one on your plat
form), the find files dialog will open by default instead of the mozilla browser window. of course, because we haven't put any ui elements in the window, you won't see a window appear. we'll add some elements in the next section. to see the effect though, the following will open the bookmarks window: mozilla -chrome chrome://communicator/content/bookmarks/bookmarksmanager.xul if you are using firef...
Creating an Installer - Archive of obsolete content
will describe packaging a xul application into an installer. xpinstall packages mozilla provides a mechanism which can be used to package xul windows, scripts, skins and other files into single file installers. you can place this installer file somewhere for users to download. a simple script can be used to have the package downloaded and installed. this mechanism is called xpinstall (cross plat
form install). xpinstall installers are packaged into jar files. inside the jar file, you can add all the various files that you want to have installed. in addition, installers should contain an install script (a file named install.js) which can be used to script the installation process. this script has access to various install functions which can be used to install files and components. the jar f...
Cross Package Overlays - Archive of obsolete content
ws that you want to apply overlays to by adding additional li nodes. next, we add a node for each overlay to apply to the window. in this case, we only have one, but we could apply others also. add these lines just after the previous lines. <rdf:seq about="chrome://navigator/content/navigator.xul"> <rdf:li>chrome://findfile/content/foverlay.xul</rdf:li> </rdf:seq> mozilla reads this in
formation and builds a list of overlays that are applied to other windows. it stores this in
formation in the chrome/overlayinfo directory. you do not need to manually modify the files in this directory. it is automatically generated and modified when mozilla is first run or when new packages are installed. however, you can force the data to be rebuilt by deleting this directory and the chrome.rdf file...
Focus and Selection - Archive of obsolete content
ly is, to the next place the browser thinks it should be. a user typically does this by hitting the "tab" key. you can do this anywhere you have a xul browser document by simply: document.commanddispatcher.advancefocus(); in fact, the commanddispatcher simply implements the nsidomxulcommanddispatcher interface. this interface also provides a number of other methods which may be useful. plat
form specific behaviors mac os x there is a preference called "full keyboard access" (fka). note that xul adheres to this. this means that when the fka preference is off, only textboxes and lists/trees are focusable with the keyboard, as well as from your code using focus(). handling text changes there are two events that can be used when the user changes the value of a textbox. natura...
More Button Features - Archive of obsolete content
tem 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. note that selecting one of these menu items does not change the label on the button, unlike a menulist. this type of button is intended to be used like a menu, with scripts attached to each item to per
form a task. we'll see more on menus later. you can also set the type attribute to the value menu-button. this also creates a button with a menu, but the appearance will be different. the image to the right shows the difference. the left one is a 'menu' and the second one is a 'menu-button'. it has an arrow indicating the presence of a menu. for the 'menu', the user may click anywhere on the button to...
More Tree Features - Archive of obsolete content
a small plus or minus sign (often called a twisty) has appeared next to the first row, indicating that it contains child rows. by clicking the row, the user can open and close the list. the child rows are indented. notice how the guys row only needs one column as it is a placeholder item for its children. the outer treeitem element contains a single treerow element and a treechildren element. the
former creates the data for the parent row and the latter contains the child items. you can nest rows deeper as well. remember that you must use the container attribute on rows which contain child rows. the simple presence of child rows isn't sufficient to indicate this, as you may have a container that has no children but should still be treated like a container. for example, a directory with no file...
More Wizards - Archive of obsolete content
s necessary to go to the page with the page id color when needed. wizard functions the wizard works much like a tabbed panel, except that the tabs are not displayed and the user navigates between pages by using the buttons along the bottom. because all of the pages are part of the same file, all of the values of the fields on all pages will be remembered. thus, you do not have to load and save in
formation between pages. however, you may want to do some validation of each field on each page. for this, use the handlers described in the previous section. if a field is invalid, you might display an alert. in some cases, it would be more convenient to disable the next button until valid input has been entered. the wizard has a property canadvance, which can be set to true to indicate that the next...
Numeric Controls - Archive of obsolete content
d timepicker elements may be used to allow the user to enter dates and times. when used, they display a set of numeric textboxes to enter each of the components of the date or time. <datepicker value="2004-03-24"/> <timepicker value="15:30:00"/> the value attribute is used to set the default value; if this attribute is omitted, the field will be initially set to the current date or time. the
format of the attribute is exactly as above, that is dates are of the
form yyyy/mm/dd and times are of the
form hh:mm:ss (although the seconds and the accompanying colon may be omitted). these two elements ensure that the user enters a value date or time. this way, you do not have to check for valid dates, ensure that the day isn't greater than the number of days in the month, handle leap years, and s...
Persistent Data - Archive of obsolete content
« previousnext » this section describes how to save the state of a xul window. remembering state when building a large application, you will typically want to be able to save some of the state of a window across sessions. for example, the window should remember which toolbars are collapsed even after the user exits. one possibility would be to write a script to collect in
formation about what you would like to save and then save it to a file. however, that would be a pain to do for every application. conveniently, xul provides such a mechanism to save the state of a window. the in
formation is collected and stored in a rdf file (localstore.rdf) in the same directory as other user preferences. it holds state in
formation about each window. this method has the advantage that it works with...
RDF Datasources - Archive of obsolete content
content-length http://home.netscape.com/nc-rdf#content-length the length of the file. lastmodifieddate http://home.netscape.com/nc-rdf#lastmodifieddate the date that url was last modified. extension http://home.netscape.com/nc-rdf#extension the extension of the file, including the period. this property is only available on plat
forms that use file extensions. possible files roots nc:filesroot top level of the filesystem (usually the list of drives) a file url by using a file url for the ref attribute, you can select a specific directory to be returned. for example, you might use file:///windows or files:///usr/local. the files datasource is an examp...
Simple Menu Bars - Archive of obsolete content
e placed separately. menupopup the popup box that appears when you click on the menu title. this box contains the list of menu commands. menuitem an individual command on a menu. this would be placed in a menupopup. menuseparator a separator bar on a menu. this would be placed in a menupopup. you can customize the menus on the menubar to have whatever you want on them on all plat
forms except the macintosh. this is because the macintosh has its own special menu along the top of the screen controlled by the system. although you can create custom menus, any special style rules or non-menu elements that you place on a menu may not be applied. you should keep this is mind when creating menus. example of a simple menu bar example 1 : source view <toolbox flex="1"> <menubar ...
Styling a Tree - Archive of obsolete content
set. setting properties for the rdf-built trees for rdf-built trees, you can use the same syntax. however, you will often set the properties based on values in the datasource. setting properties for the custom view for trees with a custom view script, you can set properties by supplying the functions getrowproperties(), getcolumnproperties() and getcellproperties() in the view. these return in
formation about an individual row, column and cell. arguments to these functions indicate which row and/or column. prior to gecko 22 the last argument to each of these functions is a properties list which the view is expected to fill with a list of properties. the function getcolumnproperties() also supplies the corresponding treecol element for the column. getrowproperties : function(row,prop){} ge...
The Box Model - Archive of obsolete content
this model allows you to divide a window into a series of boxes. elements inside of a box will orient themselves horizontally or vertically. by combining a series of boxes, spacers and elements with flex and pack attributes, you can control the layout of a window. although a box is the fundamental part of xul element layout, it follows a few very simple rules. a box can lay out its children in one of two orientations, either horizontally or vertically. ...
The Chrome URL - Archive of obsolete content
ropriate file from that right directory. for content, a file with the same name of the package and a xul extension is selected. in the above example, the file browser.xul is selected. for messenger, messenger.xul would be selected. when creating your own applications, you will want to create a file for your main window with the same name as the package, so it can be referred to using this shorter
form. this is convenient since all a user needs to know is the package name to be able to open the application. of course, for extensions that modify the browser interface, the user will not need to know the url, as the extension will present itself in the ui. for a skin, the file <package name>.css is selected; for a locale, the file <package name>.dtd is selected. remember, the chrome url is not rel...
XUL Tutorial - Archive of obsolete content
ple specialized window types features of a window creating dialogs open and save dialogs creating a wizard more wizards overlays cross package overlays installation creating an installer install scripts additional install features this xul tutorial was originally created by neil deakin. he has graciously given us permission to use it as part of the mdn. original document in
formation author: neil deakin copyright in
formation: © 1999-2005 xulplanet.com ...
Using the standard theme - Archive of obsolete content
t depending on the theme currently chosen by the user. that is, depending on the theme currently selected by the user, you can provide different custom style sheets for your extensions. for this to work, you need to create an approriate directory structure, with directory names corresponding to the names of the themes you want to extend, and of course, your adapted custom style sheets. for more in
formation on how to do this, read about theming a custom toolbar button. note that both approaches described above work with this automatic style selection. ...
Window icons - Archive of obsolete content
verride the global icon files, which are located in app_dir/browser/chrome/icons/default. note: the global icons override does not currently work due to bug bug 543490. global icon files currently take precedence and bundles are only searched for icons which are not provided by the application. starting with firefox 3.0, xulrunner 3.0, thunderbird 3.0 and seamonkey 2.0 you can now specify png
format icons instead of xpm
format on linux. you can specify up to 4 different sizes of png icons using the suffixes .png, 16.png, 32.png and 48.png. older versions to support older applications, such as firefox 1.0, you need to copy the icons to app_dir/chrome/icons/default manually on the first start (example code). ...
XUL Accesskey FAQ and Policies - Archive of obsolete content
ge, menu or dialog that indicates to a user a quick, keyboard method of simulating a click on that element. for example, an apply button may have the letter a underlined. on windows and unix, pressing alt+a is a convenient way to push that button. on macintosh, accesskeys are available only in html not in xul, and they are activated using ctrl+letter instead of alt. how is an accesskey added to a
form control? an accesskey can be added to an html or xul
form control or label by using the accesskey attribute. for example, here's how we add an accesskey to a xul button: <button label="apply instantly" accesskey="a" /> apply instantly - or - <button label="apply instantly" accesskey="a" /> apply instantly in mozilla, we use dtd's for one more layer of abstra...
action - Archive of obsolete content
y should have a uri attribute set to the member variable. this element and its descendants may use variables in place of attribute values. variables are a question mark followed by a name. for a matched rule, each variable will be a reference to data within the datasource, determined from the query. if the same variable appears multiple times, it will have the same value in each place. for more in
formation, see actions. 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, ordin...
assign - Archive of obsolete content
any namespace prefixes declared on the element may be used within the expression. var type: string for the xul assign attribute, this is the variable to assign the value to; otherwise it's a reference to a template variable such as "?name". ...
bindings - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used to specify a set of variable bindings for a rule. this element should be contained within a rule element and contain one or more binding elements. this element is optional in firefox 3/mozilla 1.9 and later; instead binding elements may be placed directly inside the rule element. more in
formation is available in the template guide. 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, mouseth...
box - Archive of obsolete content
s | related ] a container element which can contain any number of child elements. if the box has an orient attribute that is set to horizontal, the child elements are laid out from left to right in the order that they appear in the box. if orient is set to vertical, the child elements are laid out from top to bottom. child elements do not overlap. the default orientation is horizontal. more in
formation is available in the xul tutorial. examples <box orient="horizontal"> <label value="zero"/> <box orient="vertical"> <label value="one"/> <label value="two"/> </box> <box orient="horizontal"> <label value="three"/> <label value="four"/> </box> </box> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatea...
broadcaster - Archive of obsolete content
instance, if the broadcaster has a label attribute, the observers will use that label. if the label changes, the labels of the observers will update automatically. an onbroadcast event will be sent to the observers when a change is made. for menuitems or buttons that just want to have their disabled status set when the feature should be disabled, you should use a command element instead. more in
formation is available in the broadcasters and observers xul tutorial. 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, ...
broadcasterset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container element for broadcaster elements. the broadcasterset and its descendants are not displayed. more in
formation is available in the xul tutorial. examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, templ...
column - Archive of obsolete content
attributes | properties | methods | related ] a single column in a columns element. each child of the column element is placed in each successive cell of the grid. the column with the most child elements determines the number of rows in each column. it is common to use columns only to define width and flexibility for the grid column and not place elements directly inside the column. more in
formation is available in the xul tutorial. example see grid for an example. 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,...
columns - Archive of obsolete content
[ examples | attributes | properties | methods | related ] defines the columns of a grid. child column elements define the individual columns to appear in the grid. the columns element may be nested inside another columns element. other elements placed inside a columns element occupy the full height of the grid and are placed in their corresponding positions between the columns. more in
formation about columns is available in the xul tutorial. example see grid for an example. 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, minhei...
commandset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is not displayed and serves as a container for command elements. in addition, this element can hold a command updater which is used to update commands when certain events occur. a common use of the command updater is to update cut, copy, and paste menu items. more in
formation is available in the xul tutorial. 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. typically, this is used to update menu com...
conditions - Archive of obsolete content
aced content, member and triple elements. these may have attributes whose value is a variable name beginning with a question mark (?). when evaluating the rule for a particular rdf resource, the variables are replaced with values from the resource. if all variables can be replaced, the rule matched. this element is used with firefox 2/mozilla 1.8 and earlier instead of the query element. more in
formation is available in the xul tutorial. 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, mouset...
content - Archive of obsolete content
necer a query ("consulta"). la pregunta en una regla debería enlazar a sólo a un elemento del contenido. los contenidos deberían tener al atributo uri . Ésto se utiliza para vincular una variable a un nodo de contenido cuando se emparejan. cuando use un árbol con los atributos flags ("banderas"), establezca dont-build-content, ("no almacenar contenido"), use treeitem en su lugar. para más in
formación, se encuentra disponible el tutorial xul. propiedades tag, uri ejemplos (no son necesarios) atributos 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,...
deck - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element that displays only one of its children at a time. the selectedindex attribute determines which child is displayed. more in
formation is available in the xul tutorial. attributes selectedindex properties selectedindex, selectedpanel examples <deck selectedindex="2"> <description value="this is the first page"/> <button label="this is the second page"/> <box> <description value="this is the third page"/> <button label="this is also the third page"/> </box> </deck> attributes selectedindex type: integer gets and sets the index of the currently selected panel. the first item is at index 0. inherited from xul element align, allowevents, allowneg...
dialogheader - Archive of obsolete content
he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
grippy - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element that may be used inside a splitter which can be used to collapse a sibling element of the splitter. more in
formation is available in the xul tutorial. examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style...
groupbox - Archive of obsolete content
mples | attributes | properties | methods | related ] the groupbox is used to group related elements together. if a caption element is placed inside the groupbox, it will be used as a caption which appears along the top of the groupbox. typically, the groupbox will be drawn with a border around it and the caption either above or over the top border, however the actual appearance will be plat
form specific. on linux, for instance, only the caption appears with no border around the group. more in
formation is available in the xul tutorial. properties accessibletype examples <groupbox> <caption label="settings"/> <radiogroup> <radio label="black and white"/> <radio label="colour"/> </radiogroup> <checkbox label="enabled"/> </groupbox> attributes inherited from ...
hbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container element which can contain any number of child elements. this is equivalent to the box element, except it defaults to horizontal orientation. more in
formation is available in the xul tutorial. example <!-- two button on the right --> <hbox> <spacer flex="1"/> <button label="connect"/> <button label="ping"/> </hbox> 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...
iframe - Archive of obsolete content
cess, use a xul browser element. warning: when used in chrome-privileged documents (either html or xul) such as firefox addons, the contents of the frame may have the same permissions as firefox itself. this can be a serious security vulnerability, for example if you use src="http://...". when used in this case, please see displaying web content in an extension without security issues. more in
formation is available in the xul tutorial. attributes showcaret, src, type, transparent properties accessibletype, contentdocument, contentwindow, docshell, webnavigation examples <iframe src="table.php" flex="2" id="browsertable" name="table_frame"/> selecting an url from a menu <menulist oncommand="donav(this);"> <menupopup> <menuitem label="mozilla" value="http://mozilla.org" /> ...
image - Archive of obsolete content
note: prior to gecko 8.0, images did not shrink down with the same ratio in both directions when specifying maximum sizes using maxheight or maxwidth. ...
listhead - Archive of obsolete content
ies acesssibletype, disabled examples (example needed) attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
listheader - Archive of obsolete content
<listcell label="swashbuckler"/> </listitem> </listbox> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
member - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used within a rule's conditions element to match elements that are containers or are contained within another element. both the container and child attributes may use variables. more in
formation is available in the xul tutorial. properties child, container 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-ed...
menubar - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container that usually contains menu elements. on the macintosh, the menubar is displayed along the top of the screen, and all non-menu related elements inside the menubar will be ignored. to look native (at least on windows), the menubar element needs to be placed inside a toolbox element. more in
formation is available in the xul tutorial. attributes grippyhidden, statusbar properties accessibletype, statusbar examples <menubar id="sample-menubar"> <menu id="action-menu" label="action"> <menupopup id="action-popup"> <menuitem label="new"/> <menuitem label="save" disabled="true"/> <menuitem label="close"/> <menuseparator/> <menuitem label="quit"...
menupopup - Archive of obsolete content
essed. it may be attached to any element using the popup attribute. when the element is clicked with the left mouse button, the menupopup will be displayed. it may be attached to any element using the context attribute. when a context menu is opened, the menupopup will be displayed. a context menu may be opened by right-clicking the element, or by pressing the menu key on the keyboard. more in
formation is available in the xul tutorial and popup guide. attributes ignorekeys, left, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, top properties accessibletype, anchornode, popupboxobject, position, state, triggernode methods hidepopup, moveto, openpopup, openpopupatscreen, setconsumerollupevent, showpopup, sizeto examples the following example shows how a...
notification - Archive of obsolete content
it will normally be used as part of a notificationbox. the box includes a button which the user can use to close the box. attributes image, label, priority, persistence, type, value properties accessibletype, control, image, label, priority, persistence, type, value methods close examples <notification label="this is a warning"/> attributes image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. ...
notificationbox - Archive of obsolete content
perties | methods | related ] the notificationbox element is used to display notifications above an element. typically the element will be a browser, but any element may be used. the notification element is used for each notification, and will be created automatically for each item. each notification will slide in and out as needed. this element is used, for example, to implement the yellow in
formation bar in various firefox windows. the notification box is a vertical box which may have children. the notifications appear at the top of the box. the notifications may be placed at the bottom by setting the dir attribute to reverse. finding the current notification box within a firefox extension, you can retrieve the current notification box for a specific tab by calling the global functi...
observes - Archive of obsolete content
ibutes | properties | methods | related ] the observes element can be used to listen to a broadcaster and receive events and attributes from it. the observes element should be placed inside the element that wants to observe the broadcaster. when an observed attribute is modified on the broadcaster, the attribute's value will be forwarded and set on the parent element of the observer. more in
formation is available in the xul tutorial. attributes attribute, element examples (example needed) attributes attribute type: attribute name the attribute that the observer is observing. when the value of the attribute changes, the broadcast event is called on the observer. use the value * to observe all attribute of the broadcasters. the id, ref, and persist attributes are not observ...
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. ...
popupset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container for menupopup, panel and tooltip elements. this element is optional; the given elements need not appear in a popupset container. more in
formation is available in the xul tutorial. examples <popupset> <menupopup id="clipmenu"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> </popupset> <label value="right click for popup" context="clipmenu"/> 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, maxheig...
prefpane - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single preference panel in a prefwindow. a prefpane is made up of two parts, the preferences descriptions, which specify the set of preferences that will be modified, and the user interface for adjusting those preferences. the
former is specified using a preferences element while the latter may be specified using other xul elements. both may be specified directly as children of the prefpane element, or the src attribute may be used to put a pane in a separate file. in this latter case, the separate file should use an overlay tag as its root tag since it will be loaded as an overlay to the main preferences window. more in
formation is available in the preferences system article. attri...
progressmeter - Archive of obsolete content
amples | attributes | properties | methods | related ] a meter which can be used to display the progress of a lengthy operation. it is drawn as a bar that is filled as the operation completes. in addition, an indeterminate progressmeter may be created by setting the mode attribute to undetermined. this is used when the length of time to complete an operation is not known beforehand. more in
formation is available in the xul tutorial. attributes max, mode, value properties accessibletype, max, mode, value examples <progressmeter mode="determined" value="82"/> <progressmeter mode="undetermined"/> <!-- switching modes while the mouse is over a button --> <progressmeter mode="determined" id="myprogress"/> <button label="example" onmouseover="setloading(true)" ...
queryset - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container for query elements when more than one query is used. for more in
formation, see multiple queries. attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inh...
resizer - Archive of obsolete content
ft. bottomright resized down and to the right. topleft resized up and to the left. topright resized up and to the right. element type: element to resize the id of the element that should be resized by the resizer. 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 plat
forms provide this resizing grip automatically, this type of resizer element will be hidden and ensure that the window does not get an extra resizer. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbe...
richlistitem - Archive of obsolete content
l, selected, tabindex, value examples (example needed) attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of
form elements, it will not be submitted. do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case. the disabled attribute is allowed only for
form controls. using it with an anchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out...
row - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single row in a rows element. each child of the row element is placed in each successive cell of the grid. the row with the most child elements determines the number of columns in each row, which may be smaller or larger than the number of column elements defined in the grid. more in
formation is available in the xul tutorial. example see grid for an example. 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, mousethroug...
rows - Archive of obsolete content
sted rows are counted as normal rows as if they were part of the parent. however, nesting rows elements allows groups of rows to have a separate appearance such as a different border, or separate scrolling may be defined for these rows. non-row related elements placed inside a rows element occupy the full width of the grid and are placed in their corresponding positions between the rows. more in
formation is available in the xul tutorial. example see grid for an example. 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,...
rule - Archive of obsolete content
r action elements. a condition is defined used a where element. for each result that matches all of the conditions, content within the rule's action body is generated. the bindings element is optional and may specify additional variable bindings to be used. when no query element is used in a template, a default query is used and the simple query syntax may be used for rdf datasources. for more in
formation about this, see the simple query syntax. attributes iscontainer, isempty, parent, parsetype examples (example needed) attributes iscontainer type: boolean indicates whether rules match based on containment. if not specified, the rule may match regardless of whether a node is a container or not. true: the rule will only match nodes that are marked as containers. this woul...
script - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] much like the html script element, this is used to declare a script to be used by the xul window. you should usually put scripts in a separate file pointed to by the src attribute, but you may also place the script inline inside the opening and closing script tags. more in
formation is available in the xul tutorial. attributes src, type examples <script src="test.js"/> <script src="http://example.com/js/test.js"/> <script> function foo(){ // code } </script> attributes src type: uri the uri of the script. type type: language content type the language of the script. usually, you would set this to application/javascript. note: if the javascript file is in chrom...
scrollbar - Archive of obsolete content
size of the container, scroll bars may be placed at the side of the container to allow the user to scroll around in the container. the scroll bar may also be used independently when a numeric value or percentage needs to be selected by the user. the user can adjust the position of the scroll bar by clicking arrows on either end of the scroll bar or by dragging the scroll bar thumb around. more in
formation is available in the xul tutorial. 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. the default value is 0. increment type: integer the amount by which the curpos (for scroll...
spacer - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element that takes up space but does not display anything. it is usually used to place spacing within a container. if you don't specify that the spacer has a size or is flexible, the spacer does not occupy any space. if you want a small gap, consider using a separator instead. more in
formation is available in the xul tutorial. examples <box> <button label="left"/> <spacer flex="1"/> <button label="right"/> </box> 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, l...
splitter - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element which should appear before or after an element inside a container. when the splitter is dragged, the sibling elements of the splitter are resized. if a grippy is placed inside the splitter, one sibling element of the splitter is collapsed when the grippy is clicked. more in
formation is available in the xul tutorial. attributes collapse, resizeafter, resizebefore, state, substate style classes tree-splitter examples <!-- this bar has some styling associated with it. 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="examp...
stack - Archive of obsolete content
hese attributes to set width or height, both attributes for the given axis must be explicitly set, eg, if setting width, both "left" and "right" must be set. in some case, setting the width or height this way may even be necessary because using the width/height attributes (eg, "width", "minwidth" and "maxwidth") inside a stack can sometimes produce unpredictable and undesireable results. more in
formation is available in the xul tutorial. examples <stack> <hbox flex="1"> <image src="chrome://xulschoolhello/skin/stack-bg.png" flex="1"left="10"right="10" top="10" bottom="10"/> </hbox> <hbox> <!-- some content here. --> </hbox> </stack> in this example, the resulting width of the top-most hbox will be 400px (600px - 200px - 0) : <stack width="600"> <hbox flex="1"> ...
<statusbarpanel> - Archive of obsolete content
he text will be cropped on its right side. center the text will be cropped in the middle, showing both the start and end of the text normally. none the text will be not be cropped using an ellipsis. however, the text will simply be cut off if it is too large. the side depends on the css text alignment. depending on the plat
form and theme being used, some elements will have set a maximum width so they will always appear cropped. if you wish to use the value none and the displayed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value ...
tabbox - Archive of obsolete content
[ examples | attributes | properties | methods | related ] a container used to display a set of tabbed pages of elements. a row of tabs is displayed at the top of tabbox which may be used to switch between each page. the tabbox should contain two children, the first a tabs element which contains the tabs and the second a tabpanels element which contains the contents of the pages. more in
formation is available in the xul tutorial. attributes eventnode, handlectrlpageupdown, handlectrltab properties accessibletype, eventnode, handlectrlpageupdown, handlectrltab, selectedindex, selectedpanel, selectedtab, tabs, tabpanels examples <tabbox id="mytablist" selectedindex="2"> <tabs> <tab label="a first tab"/> <tab label="second tab"/> <tab label="another tab"/> ...
tabpanel - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a individual panel in a tabpanels element. this element is optional and you may just use any other container in place of it. more in
formation is available in the xul tutorial. examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, sta...
tabpanels - Archive of obsolete content
ases you would use a vbox, but they can be any element, although some people like to use tabpanel elements. by clicking the first tab, the first panel will be displayed. by clicking the second tab, the second panel will be displayed and so on. there should be the same number of panels as there are tabs. panels should never be hidden; hiding the tab suffices to make the panel inaccessible. more in
formation is available in the xul tutorial. attributes selectedindex properties selectedindex, selectedpanel examples (example needed) attributes selectedindex type: integer gets and sets the index of the currently selected panel. the first item is at index 0. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, con...
toolbar - Archive of obsolete content
be used to create a toolbar where its visibility depends on the toolbar flag when opening the window with the window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name. if the name doesn't exist, then a new window is opened and the specified resource is loaded into its browsing context.">window.open() method. more in
formation is available in the xul tutorial. note: starting in gecko 1.9.1, toolbar items are moved from the toolbarpalette and added to the toolbar when a toolbar is first displayed. in earlier versions, a copy of each item was created and placed on the toolbar. this means that the palette now only contains items not already in the toolbar. this introduces a potential compatibility problem for exten...
toolbargrippy - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] not in firefox the notch on the side of a toolbar which can be used to collapse and expand it. this element is used internally by the toolbar and should only be used directly when modifying its theme. more in
formation is available in the xul tutorial. properties accessible 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, posit...
toolbox - Archive of obsolete content
note: gecko 2.0 adds support for external toolbars. these are toolbars that are not children of a toolbox. you can associate an external toolbar with a toolbox for the purpose of managing your toolbars by setting the toolboxid property on the toolbar. the external toolbars associated with a toolbox are listed in the array of elements provided by the toolbox's externaltoolbars property. more in
formation is available in the xul tutorial. if you'd like to detect when toolbars in a toolbox are changed, see toolbar customization events. 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=...
treechildren - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is the body of the tree. for content trees, the content will be placed inside this element. this element is also used to define container rows in the tree. more in
formation is available in the xul tutorial. attributes alternatingbackground attributes alternatingbackground obsolete since gecko 2.0 type: boolean if true, the background of the tree's rows will alternate between two colors. you can use the :-moz-tree-row css style to do this instead. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags,...
treecols - Archive of obsolete content
attributes pickertooltiptext properties accessibletype examples (example needed) attributes pickertooltiptext type: string the text for the tooltip on the column picker. ...
treeitem - Archive of obsolete content
elements. the treeitem can be clicked by the user to select the row of the tree. the treeitem contains a single row and all of what appear to the user as that row's descendants. in a template condition, you should use a treeitem instead of a content element when the dont-build-content flag is specified. set the uri attribute to the variable name to bind to a content node during matching. more in
formation is available in the xul tutorial. attributes container, empty, label, open, uri examples (example needed) attributes container type: boolean set to true if the element is to act as a container which can have child elements. this would be used for folders. this will be set by the template builder as needed. empty type: boolean set to true if the element is a containe...
treerow - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single row in a tree. it should be placed inside a treeitem element. children of the treerow should be treecell elements. if child rows are necessary, they should be placed in a treechildren element inside the parent treeitem. more in
formation is available in the xul tutorial. attributes properties examples (example needed) attributes properties type: space-separated list of property names sets the properties of the element, which can be used to style the element. for more in
formation, see styling a tree. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasour...
treeseparator - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used to place a separator row in a tree. attributes properties examples (example needed) attributes properties type: space-separated list of property names sets the properties of the element, which can be used to style the element. for more in
formation, see styling a tree. 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, quer...
triple - Archive of obsolete content
ch. if the assertion does not exist, the rule will not match. both the subject and object attributes may be variables. the subject of a triple is an rdf resource. in an rdf file this would usually be an rdf description element. the predicate would be a child element or property. for example, for a bookmark resource, the name and url would be predicates. they should be specified in their full uri
form. the object is the value of the rdf property. more in
formation is available in the xul tutorial. attributes object, predicate, subject examples (example needed) attributes object type: string the object of the element. it can be a variable reference, an rdf resource uri, or an rdf literal value. predicate type: uri the predicate or property to match. this must be a uri o...
vbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container element which can contain any number of child elements. this is equivalent to the box element, except it defaults to vertical orientation. more in
formation is available in the xul tutorial. example <!-- two labels at bottom --> <vbox> <spacer flex="1"/> <label value="one"/> <label value="two"/> </vbox> 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, pe...
wizard - Archive of obsolete content
is element provides the header and buttons along the bottom, and also handles navigation between the pages. each page should be constructed using a wizardpage. the pages are displayed in the order that they are placed in the wizard, unless you use the next and pageid attributes on the pages to change the sequence. the wizard will rendered in a manner suitable for the user's selected theme and plat
form. in newer versions of mozilla, a statusbar may be placed directly inside the wizard element which will be shared among all pages. more in
formation is available in the xul tutorial. attributes firstpage, lastpage, pagestep, title, windowtype properties canadvance, canrewind, currentpage, onfirstpage, onlastpage, pagecount, pageindex, pagestep, title, wizardpages methods advance, can...
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. if this is left out, no text appears. ...
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
at code yet! this is a developer preview release: additional features for installing and deploying xulrunner and applications based on xulrunner will be available in future releases. i'm writing a xul application, how can i deploy that application to my users? right now mozilla recommends that xulrunner should be deployed privately with each application. see deploying xulrunner 1.8 for more in
formation. where is the source code? here. i think i've found a bug, how do i report it? bugzilla.mozilla.org is used to track bugs in all mozilla products. please search to make sure that your bug has not already been reported. how can i help? if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the irc...
XULRunner 1.8.0.4 Release Notes - Archive of obsolete content
t code yet! this is a developer preview release: additional features for installing and deploying xulrunner and applications based on xulrunner will be available in future releases. i'm writing a xul application, how can i deploy that application to my users? right now mozilla recommends that xulrunner should be deployed privately with each application. see deploying xulrunner 1.8 for more in
formation. where is the source code? here. i think i've found a bug, how do i report it? bugzilla.mozilla.org is used to track bugs in all mozilla products. please search to make sure that your bug has not already been reported. how can i help? if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the ...
XULRunner 1.9.1 Release Notes - Archive of obsolete content
because nobody has written that code yet! additional features for installing and deploying xulrunner and applications based on xulrunner will be available in future releases. i'm writing a xul application, how can i deploy that application to my users? right now mozilla recommends that xulrunner should be deployed privately with each application. see deploying xulrunner for more in
formation. where is the source code? here. where is the sdk? here. i think i've found a bug, how do i report it? bugzilla.mozilla.org is used to track bugs in all mozilla products. please search to make sure that your bug has not already been reported. how can i help? if you want to help with xulrunner but don't know where to start, visit the xul...
XULRunner 1.9.2 Release Notes - Archive of obsolete content
nice installer? because nobody has written that code yet! additional features for installing and deploying xulrunner and applications based on xulrunner will be available in future releases. i'm writing a xul application, how can i deploy that application to my users? right now mozilla recommends that xulrunner should be deployed privately with each application. see deploying xulrunner for more in
formation. where is the source code? here. where is the sdk? here. i think i've found a bug, how do i report it? bugzilla.mozilla.org is used to track bugs in all mozilla products. please search to make sure that your bug has not already been reported. how can i help? if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroup...
XULRunner 1.9 Release Notes - Archive of obsolete content
e installer? because nobody has written that code yet! additional features for installing and deploying xulrunner and applications based on xulrunner will be available in future releases. i'm writing a xul application, how can i deploy that application to my users? right now mozilla recommends that xulrunner should be deployed privately with each application. see deploying xulrunner for more in
formation. where is the source code? here. where is the sdk? here. i think i've found a bug, how do i report it? bugzilla.mozilla.org is used to track bugs in all mozilla products. please search to make sure that your bug has not already been reported. how can i help? if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the n...
XULRunner 2.0 Release Notes - Archive of obsolete content
nice installer? because nobody has written that code yet! additional features for installing and deploying xulrunner and applications based on xulrunner will be available in future releases. i'm writing a xul application, how can i deploy that application to my users? right now mozilla recommends that xulrunner should be deployed privately with each application. see deploying xulrunner for more in
formation. where is the source code? here. where is the sdk? here. see gecko sdk for in
formation about the sdk. i think i've found a bug, how do i report it? bugzilla.mozilla.org is used to track bugs in all mozilla products. please search to make sure that your bug has not already been reported. how can i help? if you want to help with xulrunner but don't know where to start, visit the xulrunner:comm...
2006-11-03 - Archive of obsolete content
such certs would be presented differently in the ui, to give the cas a reason to go to the extra effort, and to give customers a reason to buy them. in ie 7 at least, the use of an ev certificate is tied to the green background in the url bar. a decision has to be made as to the usefulness of extended validation certificates and weather or not they will make a difference to the reliability of in
formation in certificates. if it does make a difference, does it warrant a different ui presentation for these certificates (ie the green bar). he would like to have some comments before november 19th, after which there will possibly be a vote. all questions about the cabf are welcome. more in
formation about ca can be found at http://www.cabforum.org/ meetings none during this week. ...
JS-Engine FAQ - Archive of obsolete content
ompile js and define js_use_only_nspr_locks in the build. spidermonkey library loading mechanism? to write wrappers in pure javascript to interface with any c library on the system there are mechanisms such as xpcshell, wxjs, jsdb, jsni coding spidermonkey in c check out this tutorial how to compile tamarin on linux/x86 there is a patch that allows you to compile it. rhino what is the per
formance between rhino js and native java rhino js is significantly slower in run-time than native java. even when rhino is pre-compiled with high optimization, it still is no match for a compiled java program. how to determine rhino version programatically? you can call getimplementationversion() on a context instance and it gives you a string, e.g. <tt>rhino 1.6 release 2 2005 09 19</tt>. how t...
2006-10-27 - Archive of obsolete content
summary: mozilla.dev.tech.layout - october 21 - october 27, 2006 announcements none this week. discussions removal of the nn4.6 table border color quirk discussion on removing the nn 4.6 table boarder color quirk, which currently causes a specific markup to produce a green boarder instead of a gray one. help for getting html element width info discussion on retrieving width in
formation on html elements when using the gecko engine. it was determined that the offsetwidth property can be used to get this value. multiple presshells discussion on why current interfaces allow for multiple presshells and how the relationships work for the following objects: docshell, presshell, prescontext, document, domwindow, widget, docshell and contentviewer. boris zbarsky explains in detail the ...
2006-10-20 - Archive of obsolete content
summary: mozilla.dev.tech.xul - oct 14-oct 20, 2006 return to mozilla-dev-tech-xul announcements none during this week. discussions october 16, 2006, 5:10pm - david marteau notes that using "persist" on templatized content prevents from restoring values for the persistent attributes. neil notes that the
format of localstore has changed from previous versions and that "persist" is not functioning properly using the new
format. this is an unexpected result and david has said he will post a bug. the bug number has not been posted to the newsgroup and searching in bugzilla was unsuccessful. meetings none during this week. ...
2006-11-17 - Archive of obsolete content
summary: mozilla.dev.apps.calendar - november 10 - november 17, 2006 announcements no meeting for this week. discussions itip and imip new designs for sending invitations available for comment discussion about the new interface designs for itip. view per
formance discussion about tests on view per
formance. webdav server a discussion related to remote calendar modifications. calendar xpcom component discussion about a debug error of additem function from calicalendar. meetings no meetings were scheduled this week. authors mark paruzel yi (eric) shen [back to weekly summaries ] ...
Newsgroup summaries - Archive of obsolete content
formatmozilla.dev.apps.firefox-2006-09-29mozilla.dev.apps.firefox-2006-10-06mozilla.dev.apps.calendarmozilla.dev.tech.js-enginemozilla-dev-accessibilitymozilla-dev-apps-calendarmozilla-dev-apps-firefoxmozilla-dev-apps-thunderbirdmozilla-dev-buildsmozilla-dev-embeddingmozilla-dev-extensionsmozilla-dev-i18nmozilla-dev-l10nmozilla-dev-planningmozilla-dev-plat
formmozilla-dev-qualitymozilla-dev-securitymozilla-dev-tech-js-enginemozilla-dev-tech-layoutmozilla-dev-tech-xpcommozilla-dev-tech-xul ...
Logging Multi-Process Plugins - Archive of obsolete content
this is done using nspr logging. run firefox in a custom environment to enable this special logging mode. make sure you have write permissions to wherever you wish to save the log. your safest bet is your home directory (c:\users\username on windows vista and above, c:\documents and settings\username on windows xp, and ~ (home directory) on mac os x and linux). windows make sure firefox is not running. ...
Browser-side plug-in API - Archive of obsolete content
the names of all of these methods begin with npn_ to indicate that they are implemented by the browser and called by the plug-in. for an overview of how these two sides of the plug-in api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results. ...
NPAnyCallbackStruct - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary note: this structure is only used on unix plat
forms. contains in
formation required during embedded mode printing. syntax typedef struct { int32 type; } npanycallbackstruct; fields the data structure has the following field: type always contains np_print. description callback structures are used to pass plat
form-specific in
formation. the npanycallbackstruct structure contains in
formation required by the plat
formprint field of the npembedprint structure during embedded mode printing. during printing in embedded mode, the plat
formprint field of the npembedprint structure points to an npanycallbackstruct. this structure contains the file pointer to which the plug-in should write its postscript data. at the t...
NPN_GetURL - Archive of obsolete content
r to retrieve data from anywhere on the network. this is especially useful for enabling an existing application to operate on the web. for http urls, the browser resolves this method as the http server method get, which requests url objects. use npn_geturlnotify() instead of npn_geturl() in these cases: to request a stream and receive notification of the result. if the buffer contains header in
formation (even a blank line). make sure that the target matches the url type sent to it. for example, a null target does not make sense for some url types (such as mailto). the following recommendations about target choice apply to other methods that handle urls as well. if the target parameter refers to the window or frame containing the current plug-in instance, the instance is destroyed and the p...
NPN_MemAlloc - Archive of obsolete content
take advantage of any customized memory allocation scheme the application may have, and allows the application to manage its memory more flexibly and efficiently. mac os npn_memalloc is particularly important on mac os, since the mac os version of the browser frequently fills its memory partition with cached data that is only purged as necessary. since npn_memalloc automatically frees cached in
formation if necessary to fulfill the request, calls to npn_memalloc may succeed where direct calls to newptr fail. existing calls to npn_memflush have no effect. you only need to use npn_memflush in situations where you cannot use npn_memalloc, for example, when calling system methods that allocate memory indirectly. see also npn_memflush, npn_memfree ...
NPN NewStream - Archive of obsolete content
returned in the stream parameter. the plug-in can use this object in subsequent calls to npn_write to write data into the stream. when the plug-in has written all of its data into the stream, npn_destroystream terminates the stream and deallocates the npstream object. the target parameter is the name of the target window or frame, or one of several special target names. for parameter values and in
formation about how to use them, see npn_geturl. if the new stream has the target of _self, this function should return an invalid_param np error. see also npp_newstream, npp_write, npp_destroystream, npstream, npp ...
NPN_PostURL - Archive of obsolete content
e path string. the file-type url prefix "file://" is optional. ms windows and os x if a file is posted with any protocol other than ftp, the file must be text with unix-style line breaks ('\n' separators only). to post data from a memory buffer, set the flag file to false, the buffer buf to the data to post, and len to the length of buffer. possible url types include http (similar to an html
form submission), mail (sending mail), news (posting a news article), and ftp (upload a file). plug-ins can use this function to post
form data to cgi scripts using http or upload files to a remote server using ftp. you cannot use npn_posturl to specify headers (even a blank line) in a memory buffer. to do this, use npn_posturlnotify. for protocols in which the headers must be distinguished from the b...
NPN_ReloadPlugins - Archive of obsolete content
lug-in api summary reloads all of the installed plugins. syntax #include <npapi.h> void npn_reloadplugins(npbool reloadpages);code parameters the function has the following parameter: reloadpages whether to reload pages. if true, all pages are reloaded once the plugins are reloaded; otherwise, they aren't. description npn_reloadplugins() reads the plugins directory for the current plat
form and reinstalls all of the plug-ins it finds there. normally, if you add or remove any plug-ins, the browser does not see them until you restart gecko. npn_reloadplugins() lets you install a new plug-in and load it, or to remove a plug-in, without having to restart the browser. you could use this function as part of the plug-in's installation process. see also npn_version() ...
NPN_RequestRead - Archive of obsolete content
nitiates a read operation; the actual data is received through subsequent calls to npp_writeready() and npp_write(). syntax #include <npapi.h> nperror npn_requestread(npstream* stream, npbyterange* rangelist); parameters the function has the following parameters: stream stream of type np_seek from which to read bytes. rangelist range of bytes in the
form of a linked list of npbyterange objects, each of which specifies a request for a range of bytes. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes. description for a seekable stream, the browser sends data only in response to requests by the plug-in. the plug-in calls npn_requestread() to requ...
NPN_Status - Archive of obsolete content
a message on the browser's status line. syntax #include <npapi.h> void npn_status(npp instance, const char* message); parameters the function has the following parameters: instance pointer to the current plug-in instance. message pointer the buffer that contains the status message string to display. description you can use this function to make your plug-in display status in
formation in the browser window, in the same place the browser does. if your plug-in has a button or other object that acts as a link when clicked, you can call npn_status() to display a description or url when the user moves the cursor over it. the browser always displays the last status line message it receives, regardless of the message source. your message is always displayed, but you have no cont...
NPN_UserAgent - Archive of obsolete content
your plug-in. syntax #include <npapi.h> const char* npn_useragent(npp instance); parameters the function has the following parameter: instance pointer to the current plug-in instance. returns a pointer to a buffer that contains the user agent field of the browser. description the user agent is the part of the http header that identifies the browser during transfers. you can use this in
formation to verify that the expected browser is in use, or you can use it in combination with npn_version() to supply different code for different versions of the same browser. see also npn_status() npn_version() gecko user agent string reference ...
NPP - Archive of obsolete content
the instance; this value should not be modified by the plug-in. description gecko creates an npp structure for each plug-in instance and passes a pointer to it to npp_new(). this pointer--which is an opaque instance handle of a plug-in--identifies the instance on which api calls should operate. npp contains private instance data for both the plug-in and the browser. the npp_destroy() function in
forms the plug-in when the npp instance is about to be deleted; after this call returns, the npp pointer is no longer valid. see also npp_new() npp_destroy() ...
NPP_GetValue - Archive of obsolete content
syntax #include <npapi.h> nperror npp_getvalue(void *instance, nppvariable variable, void *value); parameters the function has the following parameters: instance pointer to the plugin instance from which the value should come. variable variable for which the browser (caller) would like a value. the full list is in the npapi headers. value value for the requested variable. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. ...
NPP_SetValue - Archive of obsolete content
syntax #include <npapi.h> nperror npp_setvalue(void *instance, npnvariable variable, void *value); parameters the function has the following parameters: instance pointer to plugin instance on which to set the variable. variable the variable being set. value value for the variable being set. returns if successful, the function should return nperr_no_error. ...
NPP_URLNotify - Archive of obsolete content
npres_network_err: stream failed due to problems with network, disk i/o, lack of memory, or other problems. notifydata plug-in-private value for associating a previous npn_geturlnotify() or npn_posturlnotify() request with a subsequent npp_urlnotify() call. description the browser calls npp_urlnotify() after the completion of a npn_geturlnotify() or npn_posturlnotify() request to in
form the plug-in that the request was completed and supply a reason code for the completion. the most common reason code is npres_done, indicating simply that the request completed normally. other possible reason codes are npres_user_break, indicating that the request was halted due to a user action (for example, clicking the stop button), and npres_network_err, indicating that the request could not ...
NPP_Write - Archive of obsolete content
he data in the stream is delivered to the plug-in instance in a series of calls to npp_writeready and npp_write. if the plug-in requested a seekable stream, the npn_requestread function requests reads of a specified byte range that results in a series of calls to npp_writeready and npp_write. the plug-in can use the offset parameter to track the bytes that are written. this gives you different in
formation depending in the type of stream. in a normal-mode stream., the parameter value increases as the each buffer is written. the buf parameter is not persistent, so the plug-in must process data immediately or allocate memory and save a copy of it. in a seekable stream with byte range requests, you can use this parameter to track npn_requestread requests.see also npp_destroystream, npp_newstream,...
NPPrint - Archive of obsolete content
syntax typedef struct _npprint { uint16 mode; /* np_full or np_embed */ union { npfullprint fullprint; /* if mode is np_full */ npembedprint embedprint; /* if mode is np_embed */ } print; } npprint; fields the data structure has the following fields: mode determines whether plug-in prints in full-page or embedded mode. values: np_full: pointer to npfullprint structure. plug-in can optionally print in full-page mode. the fullprint field of the union is valid. see npfullprint and npp_print. ...
NPRegion - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary represents a plat
form-defined region of a page. 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 in
formation about the region type definition used by your plat
form, see your plat
form documentation. see also npn_forceredraw() npn_invalidaterect() npn_invalidateregion() npwindow nprect ...
NPStream - Archive of obsolete content
npn_newstream. the browser cannot delete the object until after it calls npp_destroystream or the plug-in calls npn_destroystream. streams produced by the browser: the browser creates the npstream object and passes it to the plug-in initially as a parameter to npp_newstream. all api calls that operate on the stream (such as npp_writeready and npp_write) use a pointer to this stream. the browser in
forms the plug-in when the stream is about to be deleted through npp_destroystream, after which the npstream object is no longer valid. streams produced by the plug-in: the browser creates the npstream object and returns it as an output parameter when the plug-in calls npp_newstream. the plug-in must pass a pointer to the npstream to all api calls that operate on the stream, such as npn_write and npn_...
NP_GetMIMEDescription - Archive of obsolete content
h> #include <libgnomevfs/gnome-vfs-utils.h> // const char* gnome_vfs_mime_get_description (const char *mime_type); const char* desc = gnome_vfs_mime_get_description ("audio/ogg"); if you use gnome gio (gio-2.0), you can get the mime type description too. #include <gio/gio.h> const char* desc = g_content_type_get_description("audio/ogg"); javascript inside a web page, you can retrieve these in
formations with this code: var mimetype = navigator.mimetypes['application/basic-example-plugin']; if (mimetype) { alert(mimetype.type + ':' + mimetype.suffixes + ':' + mimetype.description); } ...
NP_GetValue - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary allows the browser to query the plug-in for in
formation. syntax #include <npapi.h> nperror np_getvalue(void *instance, nppvariable variable, void *value); parameters the function has the following parameters: instance pointer to the current plug-in instance. instance parameter is null because no instance has been created. variable plug-in in
formation the call gets. values: nppvpluginnamestring: gets the name of the plug-in nppvplugindescriptionstring: gets the description string of the plug-in value plug-in name, returned by the function. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error ...
NP_Port - Archive of obsolete content
syntax typedef struct np_port { cgrafptr port; /* grafport */ int32 portx; /* position inside the topmost window */ int32 porty; } np_port; fields the data structure has the following fields: port standard mac os port into which the plug-in should draw. portx, porty top-left corner of the plug-in rectangle in port coordinates (taking the scroll position into account). description on mac os, the window field of an npwindow structure points to an np_port object, which is allocated by the browser. ...
Why RSS Content Module is Popular - Including HTML Contents - Archive of obsolete content
rss has long had the <description> element that can be used to include the contents of an <item>. for example, you could use it to include the entire contents of a blog post; or just a summary of it. however, the rss <description> element is only suppose to be used to includeplain text data. this obviously limits you. and since many peoplewrite in html in
formation and
formatting is lost with the rss <description> element. however, it has become common practice to putxml escaped html data in it. (even through you are not suppose to.) for example, if your blog post was: this is <b>bold</b>. then the <description> would be: <description>this is <b>bold</b>.</description> note that the "<" has been turned into "<". and the ">" has been turned into ">". this greatly...
Atomic RSS - Archive of obsolete content
a guided tutorial that will help you get started with atomic rss. atomic rss uses atom as an rss module. it brings in atom elements into rss, adding the advantages of atom to rss while maintaining backwards compatibility. documentation selected articles atomic rss tim bray talks about using atom 1.0 as a micro
format and extension module for rss 2.0; keeping rss 2.0 as your sydication
format but bringing in and using selected atom 1.0 elements. references atomic rss element list examples none available at this time community none available at this time tools ...
Version - Archive of obsolete content
the list below is of all known rss versions. they are listed in chronological order of when they were released. note: in the list below, although rss 1.0 seems to be out of place, it is actually in the correct place chronologically. note: there are 3 different versions of rss 0.91. netscape's rss 0.91 (revision 1), netscape's rss 0.91 revision 3 and userland's rss 0.91. ...
title - Archive of obsolete content
lement <title>...</title> - the rss title element has 4 uses. it is used to specify thetitle of a <channel>, an <image>, an <item>, or a <textinput>. the rsstitle element contain onlyplain text data. note: in userland's rss 0.91 there is a 100 character maximum limit. ...
.htaccess ( hypertext access ) - Archive of obsolete content
hp" # adds footer.html at bottom of requested document customized error responses : user can be directed to different pages depending on the error they caused or by the webserver. errordocument 404 /notfound.html # redirects traffic to notfound.html in case of a 404 error errordocument 500 /serverr.html # redirects traffic to serverr.html in case of a 500 internal server error for further in
formation see this external article: redirect your traffic for error handling. cache control : .htaccess allows a server to control caching by web browsers, helps load pages faster, and reduces the data transfer. mime types : see correct mime types for further in
formation. ...
SSL and TLS - Archive of obsolete content
shorter key lengths for stronger keys. the drawback to using ecc is that it is not as widely supported as rsa. bits of security rsa key length ecc key length table 1: comparison of rsa and ecc cipher strength 80 1024 160-223 112 2048 224-255 128 3072 256-383 192 7860 384-511 256 15360 512+ the in
formation in this table is from the national institute of standards and technology (nist). for more in
formation, see http://csrc.nist.gov/publications/nistpubs/800-57/sp800-57-part1.pdf. for more in
formation on ecc, see rfc 4492, section 5.6.1, table 2. original document in
formation author(s): ella deon lackey last updated date: 2012 copyright in
formation: © 2012 red hat, inc. link: red hat ...
The Basics of Web Services - Archive of obsolete content
summary: a current hot topic on the web right now are web services. this short guide will allow you to learn more about web services. the basics web services are not really anything that new, and actually, if you've ever used an rss or atom feed to pull news from a website, you have an idea of how a web service might work. web services exchange data from a server to a client, using an xml
format to send requests, so both the server and the client can understand each other. (xml introduction). a better way to understand a web service is to compare it to a html
form communication with a server side script (such as php or asp) to post and send data. both web services and
forms send and receive requests. the only major difference is that a web service uses xml. examples of web services i...
contents.rdf - Archive of obsolete content
state that we work only with major version 1 of this package. --> <rdf:description chrome:skinversion="1.5" about="urn:mozilla:skin:my_theme:browser"/> <rdf:description chrome:skinversion="1.5" about="urn:mozilla:skin:my_theme:communicator"/> <rdf:description chrome:skinversion="1.5" about="urn:mozilla:skin:my_theme:global"/> <rdf:description chrome:skinversion="1.5" about="urn:mozi...
Creating a Skin for Firefox - Archive of obsolete content
defines how the interface looks. you can't change what happens when the user right clicks on an image, but you can change the look of the right click menu (make it blue with pink polka dots, for example). if you want to change the functionality of firefox, you'll have to look into modifying the chrome, which is beyond the scope of this document. contents getting started original document in
formation author(s): neil marshall and tucker lee other contributors: brent marshall, cdn (http://themes.mozdev.org), jp martin, boris zbarsky, asa dotzler, wesayso, david james, dan mauch, anders conbere, tim regula (http://www.igraphics.nn.cx) copyright in
formation: copyright 2002-2003 neil marshall, permission given to mdc to migrate into the wiki april 2005 via email. original location: http://ww...
Scratchpad - Archive of obsolete content
to interact with the page. editing the scratchpad window looks something like this (on macos the menu bar is at the top of the screen): the file menu offers options to save and load javascript code snippets, so you can reuse code later if you like. code completion scratchpad integrates the tern code analysis engine, and uses that to provide autocomplete suggestions and popups containing in
formation on the current symbol. to list autocomplete suggestions, press ctrl + space. for example, try typing d, then pressing ctrl + space. you'll see the autocomplete box, as shown below: the icon next to each suggestion indicates the type, and the currently highlighted suggestion gets a popup with more in
formation. ↑ and ↓ cycle through the suggestions and enter or tab select the highlighted...
Using SSH to connect to CVS - Archive of obsolete content
h is not necessary if ssh is already in your path. replace pserver with ext in your cvsroot environment variable. if you wish to keep your previous pserver trees, you'll need to update the root files in each cvs subdirectory in your tree. this can be done using a unix-style find and perl: find . -name root -exec perl -p -i -e "s/pserver/ext/" {} \; dealing with firewalls do not attempt to per
form the steps in this section unless you have first verified that you can access cvs.mozilla.org from outside of the firewall. only proceed with these steps once you are certain you can access cvs.mozilla.org from the open internet. if you are behind a firewall with an http tunneling proxy, you can use a program called corkscrew, in combination with the proxycommand ssh config directive to continue ...
Summary of Changes - Archive of obsolete content
l 4.01 object non-standard marquee html 4.01 div plus scripting non-standard bgsound html 4.01 object proprietary or deprecated feature w3c feature or recommended replacement ie5+ id_attribute_value document.all.id_attribute_value document.all[id_attribute_value] dom level 2: document.getelementbyid(id_attribute_value) ie5+
formname.inputname.value dom level 1: document.
forms["
formname"].inputname.value ie5+ inputname.value dom level 1: document.
forms["
formname"].inputname.value ie5+
formctrlname dom level 1: document.
forms["
formname"].
formctrlname ie5+ document.
forms(0) dom level 1: document.
forms[0] ie elemref.innertext dom level 1 (core...
-moz-binding - Archive of obsolete content
d by mozilla-based applications to attach an xbl binding to a dom element. syntax /* <url> value */ -moz-binding: url(http://www.example.org/xbl/htmlbindings.xml#checkbox); /* global values */ -moz-binding: inherited; -moz-binding: initial; -moz-binding: unset; values <url> the url for the xbl binding (including the fragment identifier). none no xbl binding is applied to the element.
formal definition initial valuenoneapplies toall elements except generated content or pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax <url> | none examples .exampleone { -moz-binding: url(http://www.example.org/xbl/htmlbindings.xml#radiobutton); } specifications not part of any standard. ...
-moz-border-bottom-colors - Archive of obsolete content
typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. syntax values accepts a white-space separated list of color values. <color> specifies the color of a line of pixels of the bottom border. transparent is valid. see <color> values for possible units. none default, no colors are drawn or border-color is used, if specified. ...
-moz-border-left-colors - Archive of obsolete content
on typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. syntax values accepts a white-space separated list of color values. <color> specifies the color of a line of pixels of the left border. transparent is valid. see <color> values for possible units. none default, no colors are drawn or border-color is used, if specified. ...
::-ms-check - Archive of obsolete content
or border-top-left-radius border-top-right-radius border-top-style border-top-width box-shadow box-sizing 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 trans
form trans
form-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 butt...
::-ms-clear - Archive of obsolete content
or border-top-left-radius border-top-right-radius border-top-style border-top-width box-shadow box-sizing 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 trans
form trans
form-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=te...
::-ms-fill - Archive of obsolete content
n-name background-clip, background-color, background-image, background-origin, background-repeat, and background-size border border-radius box-shadow box-sizing color cursor display (values block, inline-block, none) font height margin -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color, outline-style, and outline-width padding trans
form and trans
form-origin visibility syntax ::-ms-fill example html <progress value="10" max="50"></progress> css progress::-ms-fill { background-color: orange; } result a progress bar using this style might look something like this: ...
::-ms-ticks-after - Archive of obsolete content
op-width box-shadow box-sizing 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 -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top trans
form trans
form-origin visibility width syntax ::-ms-ticks-after ...
::-ms-ticks-before - Archive of obsolete content
op-width box-shadow box-sizing 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 -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top trans
form trans
form-origin visibility width syntax ::-ms-ticks-before ...
::-ms-track - Archive of obsolete content
op-width box-shadow box-sizing 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 -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top trans
form trans
form-origin visibility width syntax ::-ms-track see also ::-ms-thumb ::-ms-fill-upper ::-ms-fill-lower ::-webkit-slider-runnable-track ::-moz-range-track css-tricks: styling cross-browser compatible range inputs with css quirksmode: styling and scripting sliders ...
display-inside - Archive of obsolete content
cts as normal for its given <display-outside> value. otherwise, this value computes to block. block the element lays out its contents using block layout. table the element lays out its contents using table layout. flex the element lays out its contents using flex layout. grid the element lays out its contents using grid layout. ruby the element lays out its contents using ruby layout.
formal syntax syntax not found in db! specifications specification status comment css display module level 3the definition of 'display-inside' in that specification. candidate recommendation initial specification browser compatibility not supported in any browser. ...
Processing XML with E4X - Archive of obsolete content
s part of javascript's e4x support: for each (var lang in languages.lang) { alert(lang); } for each...in can also be used with regular javascript objects to iterate over the values (as opposed to the keys) contained in the object. as with for...in, using it with arrays is strongly discouraged. it is possible to create an xmllist using xml literal syntax without needing to create a well-
formed xml document, using the following syntax: var xmllist = <> <lang>javascript</lang> <lang>python</lang> </>; the += operator can be used to append new elements to an xmllist within a document: languages.lang += <lang>ruby</lang>; note that unlike node lists returned by regular dom methods, xmllists are static and are not automatically updated to reflect changes in the dom. if you ...
Introduction - Archive of obsolete content
ith the {} notation is that the variables' tostring method is called, and the returned value is placed in the element. for instance var a = {foo: 1}; var b = <bar>{a}</bar>; actually produces a document that reads <bar>[object object]</bar>. use of inline functions in content although the brackets are restricted to single statements for evaluation, one might provide an anonymous function to per
form some extra processing inline: var a = 'foo'; var b = <bar>{function () {var c = a.touppercase(); var d = 5 * 5; return c + d;}()}</bar>; where the above produces: <bar>foo25</bar>. see e4x for templating for more discussion on this usage. serializing one of the most powerful tools of e4x is its ability to serialize an entire xml document (or portion thereof) into a string with one simple call to...
Namespaces - Archive of obsolete content
uri of the namespace that the element is in. var info = a.name(); info.localname; // returns 'p'. info.uri; // returns "http://www.w3.org/1999/xhtml" elements in no namespace return the empty string as their uri. the namespace global constructor is very similar to qname. namespace differs in its tostring method, and in that it has a prefix property instead of a localname property. for further in
formation on namespaces in e4x, see processing xml with e4x. next is the global xml object. « previousnext » ...
Iterator - Archive of obsolete content
rray for each iteration if keyonly is falsy, otherwise, if keyonly is truthy, it returns property_name for each iteration. if object is the iterator instance or generator instance, it returns object itself. properties iterator.prototype[@@iterator] returns a function that returns iterator object. methods iterator.prototype.next returns next item in the [property_name, property_value]
format or property_name only. it throws stopiteration if there are no more items. examples iterating over properties of an object var a = { x: 10, y: 20, }; var iter = iterator(a); console.log(iter.next()); // ["x", 10] console.log(iter.next()); // ["y", 20] console.log(iter.next()); // throws stopiteration iterating over properties of an object with legacy destructuring for-in statement va...
Array comprehensions - Archive of obsolete content
does not itself need to be an array; iterators and generators can also be used. even strings may be used as input; to achieve the filter and map actions (under array-like objects) above: var str = 'abcdef'; var consonantsonlystr = [for (c of str) if (!(/[aeiouaeiou]/).test(c)) c].join(''); // 'bcdf' var interpolatedzeros = [for (c of str) c + '0' ].join(''); // 'a0b0c0d0e0f0' again, the input
form is not preserved, so we have to use join() to revert back to a string. examples simple array comprehensions [for (i of [1, 2, 3]) i * i ]; // [1, 4, 9] var abc = ['a', 'b', 'c']; [for (letters of abc) letters.tolowercase()]; // ["a", "b", "c"] array comprehensions with if statement var years = [1954, 1974, 1990, 2006, 2010, 2014]; [for (year of years) if (year > 2000) year]; // [2006, 2010,...
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
implemented proposals not in es.next this section needs to be updated to reflect current changes. (may 2019) the following features are already implemented, but only available in the firefox nightly channel and not yet included in a draft edition of an ecmascript specification. additions to the array...
Date.getVarDate() - Archive of obsolete content
in internet explorer only. the getvardate method returns a vt_date value from a date object. syntax dateobj.getvardate() parameters the required dateobj reference is a date object. return value returns a vt_date value. remarks the getvardate() method is used when javascript code interacts with com objects, activex objects, or other objects that accept and return date values in vt_date
format. these include objects in visual basic and visual basic scripting edition (vbscript). the actual
format of the returned value depends on regional settings. 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. not supported i...
Debug.msTraceAsyncCallbackStarting - Archive of obsolete content
ack stack with a previously specified asynchronous operation. syntax debug.mstraceasynccallbackstarting(asyncoperationid) parameters asyncoperationid the id associated with the asynchronous operation. remarks call this function in the callback function for the asynchronous operation after the call to debug.mstraceasyncoperationcompleted. note: some debugging tools do not display the in
formation sent to the debugger. asyncoperationid must correspond to the operation name previously returned from debug.mstraceasyncoperationstarting. example the following code provides an example of tracing an asynchronous call for a windows 8.x store app. function asyncwrapperfunction() { var opid = debug.mstraceasyncoperationstarting('async trace'); dosomethingasync().then(function (res...
Debug.msTraceAsyncCallbackCompleted - Archive of obsolete content
remarks call this function when the asynchronous operation completes. asyncoperationid must correspond to the operation id previously returned from debug.mstraceasyncoperationstarting. the possible values for status include: debug.ms_async_op_status_success debug.ms_async_op_status_canceled debug.ms_async_op_status_error note: some debugging tools do not display the in
formation sent to the debugger. example the following code provides an example of tracing an asynchronous call for a windows 8.x store app. function asyncwrapperfunction() { var opid = debug.mstraceasyncoperationstarting('async trace'); dosomethingasync().then(function (result) { debug.mstraceasyncoperationcompleted(opid, debug.ms_async_op_status_success); debug.mstraceasyn...
Debug.msUpdateAsyncCallbackRelation - Archive of obsolete content
ay be called when an asynchronous operation is aborted, when a join operation is used, or in other scenarios. the possible values for relationtype include: debug.ms_async_callback_status_assign_delegate debug.ms_async_callback_status_join debug.ms_async_callback_status_chooseany debug.ms_async_callback_status_cancel debug.ms_async_callback_status_error for more in
formation, see debug constants. note: some debugging tools do not display the in
formation sent to the debugger by this function. requirements supported in the internet explorer 11 standards document mode. also supported in store apps (windows 8.1 and windows phone 8.1). not supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, interne...
Debug.setNonUserCodeExceptions - Archive of obsolete content
r unhandled. syntax debug.setnonusercodeexceptions [= bool]; remarks if this property is set to true within a given scope, the debugger can then choose whether to take some specified action on exceptions thrown inside that scope: for instance, if the developer wishes to break on user-unhandled exceptions. setting this property to false is the same as never having set the property. for more in
formation on debugging, see the active script debugging overview. example the following code shows how to set this property. (function () { debug.setnonusercodeexceptions = true; try{ var x = null; x.y(); } catch (e) { // catch the exception. } })(); requirements supported in the following document modes: internet explorer 10 standards and internet explorer 11 ...
Enumerator - Archive of obsolete content
methods enumerator.atend returns a boolean value indicating if the enumerator is at the end of the collection. enumerator.item returns the current item in the collection. enumerator.movefirst resets the current item in the collection to the first item. enumerator.movenext moves the current item to the next item in the collecti...
GetObject - Archive of obsolete content
the specified type. if the pathnameargument is omitted, getobject returns a currently active object of the specified type. if no object of the specified type exists, an error occurs. some applications allow you to activate part of a file. to do so, add an exclamation point (!) to the end of the file name and follow it with a string that identifies the part of the file you want to activate. for in
formation on how to create this string, see the documentation for the application that created the object. for example, in a drawing application you might have multiple layers to a drawing stored in a file. you could use the following code to activate a layer within a drawing called schema.cad: var layerobject = getobject("c:\\cad\\schema.cad!layer3"); if you do not specify the object's class, aut...
ScriptEngineBuildVersion - Archive of obsolete content
non-standard. do not use! this object is a microsoft extension and is only supported in internet explorer. the scriptenginebuildversion function bets the build version number of the scripting engine in use. syntax scriptenginebuildversion() remarks the return value corresponds directly to the version in
formation contained in the dynamic-link library (dll) for the scripting language in use. example the following example illustrates the use of the scriptenginebuildversion function: if(window.scriptenginebuildversion) { console.log(window.scriptenginebuildversion()); } // output: <current build version> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 st...
ScriptEngineMajorVersion - Archive of obsolete content
non-standard. do not use! this object is a microsoft extension and is only supported in internet explorer. the scriptenginemajorversion function gets the major version number of the scripting engine in use. syntax scriptenginemajorversion() remarks the return value corresponds directly to the version in
formation contained in the dynamic-link library (dll) for the scripting language in use. example the following example illustrates the use of the scriptenginemajorversion function: if (window.scriptenginemajorversion) { console.log(window.scriptengine()); } output: <current major version> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, inter...
New in JavaScript 1.1 - Archive of obsolete content
and javascript. changed functionality in javascript 1.1 "object deletion". you can remove an object by setting its object reference to null. constructor and prototype properties on objects added. eval() is now a method of every object (was previously a built-in function); it evaluates a string of javascript code in the context of the specified object. math.random() now works on every plat
form. tostring(): added radix parameter, which specifies the base to use for representing numeric values. isnan() now works on every plat
form (not only unix anymore) parsefloat() and parseint() now return nan on all plat
forms, if the first character of the specified string cannot be converted to a number; in previous releases, it returned nan on solaris and irix and zero on all other plat
forms. ...
New in JavaScript 1.2 - Archive of obsolete content
quality operators (== and !=) new statements labeled statements switch do...while import export other new features regular expressions signed scripts changed functionality in javascript 1.2 you can now nest functions within functions. number now converts a specified object to a number. number now produces nan rather than an error if x is a string that does not contain a well-
formed numeric literal. string now converts a specified object to a string. array.prototype.sort() now works on all plat
forms. it no longer converts undefined elements to null and sorts them to the high end of the array. string.prototype.split() it can take a regular expression argument, as well as a fixed string, by which to split the object string. it can take a limit count so that it wo...
New in JavaScript 1.3 - Archive of obsolete content
ng() date.prototype.setutcfullyear() date.prototype.setutcmonth() date.prototype.setutcdate() date.prototype.setutchours() date.prototype.setutcminutes() date.prototype.setutcseconds() date.prototype.setutcmilliseconds() other new features strict equality operators unicode support a javascript console was introduced. changed functionality in javascript 1.3 changes to date to con
form with ecma-262 new constructor date(year, month, day, [,hours [, minutes [, seconds [, milliseconds ]]]]) additional method parameters: setmonth(month[, date]) sethours(hours[, min[, sec[, ms]]]) setminutes(min[, sec[, ms]]) setseconds(sec[, ms]) the length of an array (property length) is now an unsigned, 32-bit integer. array.prototype.push(): i...
New in JavaScript 1.6 - Archive of obsolete content
n javascript has been added. see for details. array.prototype.indexof() array.prototype.lastindexof() array.prototype.every() array.prototype.filter() array.prototype.foreach() array.prototype.map() array.prototype.some() array generics string generics for each...in changed functionality in javascript 1.6 a bug in which arguments[n] cannot be set if n is greater than the number of
formal or actual parameters has been fixed. ...
New in JavaScript 1.8.1 - Archive of obsolete content
the following is a changelog for javascript 1.8.1. this version was included in firefox 3.5. javascript 1.8.1 is a modest update syntactically to javascript; the main change in this release is the addition of the tracemonkey just-in-time compiler, which improves per
formance. new features in javascript 1.8.1 object.getprototypeof() support for native json string.prototype.trim() string.prototype.trimleft() string.prototype.trimright() changed functionality in javascript 1.8.1 implicit setting of properties in object and array initializers no longer execute setters in javascript. this makes the behavior of setting the values of properties more predictable. ...
ECMAScript 2015 support in Mozilla - Archive of obsolete content
) regexp.prototype[@@replace]() (firefox 49) regexp.prototype[@@search]() (firefox 49) regexp.prototype[@@split]() (firefox 49) get regexp[@@species] (firefox 49) additions to the string object string.fromcodepoint() (firefox 29) string.prototype.codepointat() (firefox 29) string.prototype.startswith(), string.prototype.endswith() (firefox 17) string.prototype.includes() (firefox 40) (
formerly string.prototype.contains() (firefox 17)) string.prototype.repeat() (firefox 24) string.prototype.normalize() (firefox 31) string.raw() (firefox 34) \u{xxxxxx} unicode code point escapes (firefox 40) new symbol object symbol (firefox 36) symbol.iterator (firefox 36) symbol.for() - global symbol registry (firefox 36) symbol.match (firefox 40) symbol.species (firefox 41) symbol.to...
New in JavaScript - Archive of obsolete content
ecmascript versions language resources learn more about the ecmascript standards on which the javascript language is based on. ecmascript 5 support implementation status for the current standard ecma-262 edition 5.1 in mozilla-based engines and products. ecmascript 2015 support implementation status for the draft ecma-262 edition 6 (es2015) in mozilla-based engines and products. ecmascript next support implementation status for upcoming ecma-262 features as per the yearly (es2016/es2017/es2018/...) release schedule in mozilla-based engines and products. javascript versions deprecated ( ). ...
Object.observe() - Archive of obsolete content
r.name + '!'; } updategreeting(); object.observe(user, function(changes) { changes.foreach(function(change) { // any time name or title change, update the greeting if (change.name === 'name' || change.name === 'title') { updategreeting(); } }); }); custom change type // a point on a 2d plane var point = {x: 0, y: 0, distance: 0}; function setposition(pt, x, y) { // per
forming a custom change object.getnotifier(pt).per
formchange('reposition', function() { var olddistance = pt.distance; pt.x = x; pt.y = y; pt.distance = math.sqrt(x * x + y * y); return {olddistance: olddistance}; }); } object.observe(point, function(changes) { console.log('distance change: ' + (point.distance - changes[0].olddistance)); }, ['reposition']); setposition(poin...
Object.prototype.unwatch() - Archive of obsolete content
deprecation warning: do not use unwatch() and watch()! these two methods were implemented only in firefox prior to version 58, they're deprecated and removed in firefox 58+. in addition, using watchpoints has a serious negative impact on per
formance, which is especially true when used on global objects, such as window. you can usually use setters and getters or proxies instead. the unwatch() method removes a watchpoint set with the watch() method. syntax obj.unwatch(prop) parameters prop the name of a property of the object to stop watching. return value undefined. description the javascript debugger has functionality similar to that provided by this method, as well as other debugging options. for in
formation on the debugger, see venkman. by default, this method is inherited b...
JSObject - Archive of obsolete content
cript, the runtime engine unwraps it to its original javascript object type. the jsobject class provides a way to invoke javascript methods and examine javascript properties. any javascript data brought into java is converted to java data types. when the jsobject is passed back to javascript, the object is unwrapped and can be used by javascript code. see the core javascript 1.5 guide for more in
formation about data type conversions. method summary the netscape.javascript.jsobject class has the following methods: call calls a javascript method. equals determines if two jsobject objects refer to the same instance. (what's the problem with == ?) eval evaluates a javascript expression. getmember retrieves the value of a property of a javascript object. getslot retr...
LiveConnect - Archive of obsolete content
constructors and methods. java in firefox extensions community view mozilla.dev.tech.java forums... mailing list newsgroup rss feed related topics javascript, plugins older notes (please update or remove as needed.) while the bloated liveconnect code in the mozilla source was removed in version 1.9.2 of the plat
form (see bug 442399), its
former api has been restored (see also the specification and this thread) (building on npapi?), and as of java 6 update 12, extensions as well as applets can make use of this restored api. the reimplementation also restores the ability to use try-catch exceptions within javascript, and is free of the increasing number of other bugs introduced by the decline of the original l...
JavaArray - Archive of obsolete content
n array in java. for example: var javastring = new java.lang.string("hello world!"); var bytearray = javastring.getbytes(); bytearray[0] // returns 72 bytearray[1] // returns 101 any java data brought into javascript is converted to javascript data types. when the javaarray is passed back to java, the array is unwrapped and can be used by java code. see the core javascript 1.5 guide for more in
formation about data type conversions. in javascript 1.4 and later, the methods of java.lang.object are inherited by javaarray. backward compatibility javascript 1.3 and earlier the methods of java.lang.object are not inherited by javaarray. in addition, the tostring method is inherited from the object object and returns the following value: [object javaarray] you must specify a class object, s...
JavaObject - Archive of obsolete content
is an instance of a java class that is created in or passed to javascript. javaobject is a wrapper for the instance; all references to the class instance are made through the javaobject. any java data brought into javascript is converted to javascript data types. when the javaobject is passed back to java, it is unwrapped and can be used by java code. see the core javascript 1.5 guide for more in
formation about data type conversions. properties inherits public data members from the java class of which it is an instance as properties. it also inherits public data members from any superclass as properties. methods inherits public methods from the java class of which it is an instance. the javaobject also inherits methods from java.lang.object and any other superclass. examples example: in...
Old Proxy API - Archive of obsolete content
ny; } that reifies “proxy(args)”. note: the this-binding of the calltrap function is the this-binding of the call-site. constructtrap is an optional variable-argument function(args) { return any-object; } that reifies “new proxy(args)”. the this-binding of the constructtrap is either undefined (in strict mode) or the global object (in non-strict mode). if no constructtrap is provided, per
forming new proxy(...args) calls the proxy’s calltrap with this bound to a new object delegating to the proxy's prototype. handler is an object that implements the handler api. handler api there are two kinds of traps: fundamental and derived traps. if one of the fundamental traps isn't implemented and the proxy is used in a way that expects the fundamental trap to be defined, then an error is t...
Sharp variables in JavaScript - Archive of obsolete content
a sharp variable is a syntax in object initializers that allows serialization of objects that have cyclic references or multiple references to the same object. warning: sharp variables was a non-standard syntax for creating or serializing cyclic data graphs that used to be supported only by mozilla's spidermonkey js engine. this feature has been removed in bug 566700, firefox 12.
form sharp variables have the
form of a sharp sign (#) immediately followed by one or more digits. the number represented by the digits serves as the variable's unique identifier, but leading 0s are ignored. scope sharp variables are only in scope in the statement in which they are defined. usage to create a sharp variable, simply assign an object to it in a line of code using an equal sign. you cannot a...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
using simple markup and css to create interesting effects, if you weren't already. with just the few elements i had available in this example, there were any number of possibilities for design effects, and i think you'll find the same to be true for your own designs if you just give this sort of approach a try. - fin. - related links the amazing netscape fish cam page original document in
formation author(s): eric meyer, standards evangelist, netscape communications last updated date: published 25 apr 2003 copyright in
formation: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
background-size - Archive of obsolete content
is a compromise for consistency. feel free to put it inside, nothing is set in stone. konqueror's global market share is 0.05%, (< 5% of linux users). given the fact that this reference has serious shortcomings in many places and few contributors, i think spending much time here is not effective. people especially interested in this browser are welcome to contribute. it's hard to get reliable in
formation about its css support without having this browser (read: multiple versions of this browser) installed. are you able and willing to do that for all css properties? if so, feel free to change the en/css_reference/property_template and all css property pages ; ) start with -webkit-background-size and investigate support of contain and cover keywords and "omitted second value" behavior. [i ass...
RFE to the Custom Controls Interfaces - Archive of obsolete content
introduction this page contains requests for enhancement to the custom control interfaces. you can refer to custom controls page to get familiar with custom controls mechanism. in short, we have the following interfaces: nsix
formsaccessors - serves to get/set the value of the instance data node that the x
forms element is bound to as well as getting the various states of that node nsix
formsdelegate - used to obtain the nsix
formsaccessors interface nsix
formsuiwidget - used by the x
forms processor to update the value/state of an x
forms element when its bound node's value/state is changed our current mechanism that allows authors to build custom controls assumes that the controls will be bound to instance nodes of simple content type. this means that the bound node is not allowed to contai...
Correctly Using Titles With External Stylesheets - Archive of obsolete content
eferred. to quote from html 4.01 specification, section 14.3.1: to make a style sheet persistent, set the rel attribute to "stylesheet" and don't set the title attribute. to make a style sheet preferred, set the rel attribute to "stylesheet" and name the style sheet with the title attribute. related links html 4.01 specification, section 14.3: external style sheets original document in
formation author(s): eric a. meyer last updated date: december 30th, 2002 copyright © 2001-2003 netscape. ...
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
e author to have reliable inheritance of font styles into tables when in "quirks" mode. it is also fully valid css2 and so will validate without incident. recommendations in situations where authors must put a document into "quirks" mode but wish to enforce correct font inheritance into tables, use the demonstrated rule. related resources mozilla's doctype sniffing original document in
formation author(s): eric a. meyer, netscape communications last updated date: published 26 nov 2002 copyright in
formation: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
eant to be applied to hyperlinks. furthermore, combining pseudo-classes prevents hover styles from being applied to non-hyperlink anchors. thus, a:hover should always be used instead of just :hover, and a:link:hover (and a:visited:hover) are preferred to the simpler a:hover related links the dynamic pseudo-classes: :hover, :active, and :focus :hover pseudo-class (msdn) original document in
formation author(s): eric a. meyer, netscape communications last updated date: published 07 mar 2003; revised 21 mar 2003 copyright in
formation: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Web Standards - Archive of obsolete content
s from internet explorer to mozilla ever have trouble getting your internet explorer-specific web applications to work with mozilla? this article covers common issues associated with migrating applications to the open source mozilla-based browser. using web standards in your web pages this article provides an overview of the process for upgrading the content of your web pages to con
form to the w3c web standards. choosing standards compliance over proprietary practices in the development world, there is a need for standards because applications are designed across multiple development groups. the business benefits of web standards this article discusses how adhering to web standards, and leaving behind proprietary markup and technologies, can contribute to a c...
XQuery - Archive of obsolete content
x (whether through javascript to developers or to browser users), at least one extension has been developed to give a preliminary support for xquery for browser users (and serving as a simple model for how xquery can be implemented within extensions). xquseme is a working proof-of-concept (so far tested on windows and linux with java installed; mac does not work) extension which allows one to per
form xqueries on external urls, the currently loaded webpage (even if originally from poorly
formed html), and/or xml (including well-
formed xhtml) documents stored locally. the extension now includes and interfaces with the open-source version of saxonica's saxon b (though this extension currently only per
forms the xqueries). other popular native xml databases might also be supported (e.g., exist) i...
Common causes of memory leaks in extensions - Extensions
cular references that might negatively // impact the shutdown process. if (reason == app_shutdown) return; // your add-on needs to unload all modules it ships and imported! components.utils.unload("chrome://myaddon/content/mymodule.jsm"); } note: modules not belonging to your add-on — such as services.jsm — should not be unloaded by your add-on, as this might cause errors and/or per
formance regressions and will actually increase the memory usage. other in
formation also see using xpcom in javascript without leaking (though that page could use some updating). ...
Using the DOM File API in chrome code - Extensions
exception will be thrown. scope availability in the jsm scope file is available without needing to do anything special. in bootstrap scope, this must be imported in like so: cu.importglobalproperties( [ "file" ] ) accessing a file by hard-coded pathname to reference a file by its path, you can simply use a string literal: var file = file.createfromfilename("path/to/some/file"); cross plat
form note: however using hard-coded paths raises cross plat
form issues since it uses a plat
form-dependent path separator (here "/"). in the xul/mozilla plat
form there isn't sadly an equivalent to java file.pathseparator (the system-dependent path-separator character). so the good practice is to avoid trying to determine and to use the path separator at all. instead, use the nsifile::append() method as...
bootstrap.js - Extensions
the bootstrap.js script should contain several specific functions, which are called by the browser to manage the extension. the script gets executed in a privileged sandbox, which is cached until the extension is shut down. for more in
formation, see bootstrapped extensions. the example below contains the required methods in vsdoc
format. function startup(data, reason) { /// bootstrap data structure @see /docs/extensions/bootstrapped_extensions#bootstrap_data /// string id /// string version /// nsifile installpath /// nsiuri resourceuri /// /// reason types: /// app_startup /// addon_enable /// addon_install /// addon_upgrade /// addon_downgrade } function shutdown(data, reason) { /// bootstrap data structure @see...
Publishing games - Game development
html5 games have a huge advantage over native in terms of publishing and distribution — you have the freedom of distribution, promotion and monetization of your game on the web, rather than each version being locked into a single store controlled by one company. you can benefit from the web being truly multiplat
form. this series of articles looks at the options you have when you want to publish and distribute your game, and earn something out of it while you wait for it to become famous. game distribution so you've followed a tutorial or two and created an html5 game — that's great! game distribution provides all you need to know about the ways you can distribute your newly created game into the wild — including hosting it yourself online, submitting it to open marketplaces, an...
Building up a basic demo with A-Frame - Game development
to refer to. html structure the first step is to create an html document — inside your project directory, create a new index.html file, and save the follow html inside it: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: a-frame demo</title> <script src="aframe.min.js"></script> </head> <body> <!-- html goes here --> </body> </html> this contains some basic in
formation like the document charset and <title>. the <script> element includes the a-frame framework in the page; we will write our example code inside the <body> element. initializing the scene a scene is the place where everything happens. when creating new objects in the demo, we will be adding them all to the scene to make them visible on the screen. in a-frame, the scene is reperesented by a sc...
Building up a basic demo with PlayCanvas editor - Game development
anvas homepage — for example mine is https://playcanvas.com/end3r. here's what the page looks like — you can create projects and manage them, change their settings etc. creating a new project start a brand new project by clicking on the new button: the resulting dialog box will show a few different options. there are starter kits available, but we don't want to load models or start a plat
form game. we want to start small, so we will use the empty project — click on the blank project option and enter a name for it (we are using "mdn games demo".) enter a description if you want — it is optional. click create to have it created. next you'll see your project's page — there's not much yet. by clicking the editor button we'll launch the online playcanvas editor where we'll c...
Crisp pixel art look with image-rendering - Game development
nd height properties to be 2x or 4x the value of the html width and height. if the canvas was created with a 128 pixel width, for example, we would set the css width to 512px if we wanted a 4x scale. set the <canvas> element's image-rendering css property to some value that does not make the image blurry. either crisp-edges or pixelated will work. check out the image-rendering article for more in
formation on the differences between these values, and which prefixes to use depending on the browser. an example let's have a look at an example. the original image we want to upscale looks like this: here's some html to create a simple canvas: <canvas id="game" width="128" height="128"></canvas> css to size the canvas and render a crisp image: canvas { width: 512px; height: 512px; ima...
Symmetric-key cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
symmetric-key cryptography is a term used for cryptographic algorithms that use the same key for encryption and for decryption. the key is usually called a "symmetric key" or a "secret key". this is usually contrasted with public-key cryptography, in which keys are generated in pairs and the trans
formation made by one key can only be reversed using the other key. symmetric-key algorithms should be secure when used properly and are highly efficient, so they can be used to encrypt large amounts of data without having a negative effect on per
formance. most symmetric-key algorithms currently in use are block ciphers: this means that they encrypt data one block at a time. the size of each block is fixed and determined by the algorithm: for example aes uses 16-byte blocks. block ciphers a...
Syntax - MDN Web Docs Glossary: Definitions of Web-related terms
anguage to language (e.g., syntax is different in html and javascript). although languages can share few similarities in terms of their syntaxes for example "operand operator operand" rule in javascript and python. this does not mean the two langauges share similarities with syntax. syntax applies both to programming languages (commands to the computer) and markup languages (document structure in
formation) alike. syntax only governs ordering and structure; the instructions must also be meaningful, which is the province of semantics. code must have correct syntax in order to compile correctly, otherwise a syntax error occurs. even small errors, like a missing parenthesis, can stop source code from compiling successfully. frameworks are said to have a "clean" syntax if they produce simple, r...
TCP handshake - MDN Web Docs Glossary: Definitions of Web-related terms
handshake (aka tcp-handshake, three message handshake, and/or syn-syn-ack) to set up a tcp/ip connection over an ip based network. the three messages transmitted by tcp to negotiate and start a tcp session are nicknamed syn, syn-ack, and ack for synchronize, synchronize-acknowledgement, and acknowledge respectively. the three message mechanism is designed so that two computers that want to pass in
formation back and forth to each other can negotiate the parameters of the connection before transmitting data such as http browser requests. the host, generally the browser, sends a tcp synchronize packet to the server. the server receives the syn and sends back a synchronize-acknowledgement. the host receives the server's syn-ack and sends an acknowledge. the server receives ack and the tcp socket ...
TCP slow start - MDN Web Docs Glossary: Definitions of Web-related terms
the network's capabilities. it does this without initially knowing what those capabilities are and without creating congestion. tcp slow start is an algorithm used to detect the available bandwidth for packet transmission, and balances the speed of a network connection. it prevents the appearance of network congestion whose capabilities are initially unknown, and slowly increases the volume of in
formation diffused until the network's maximum capacity is found. to implement tcp slow start, the congestion window (cwnd) sets an upper limit on the amount of data a source can transmit over the network before receiving an acknowledgment (ack). the slow start threshold (ssthresh) determines the (de)activation of slow start. when a new connection is made, cwnd is initialized to one tcp data or ackno...
Transport Layer Security (TLS) - MDN Web Docs Glossary: Definitions of Web-related terms
both ssl and tls are client / server protocols that ensure communication privacy by using cryptographic protocols to provide security over a network. when a server and client communicate using tls, it ensures that no third party can eavesdrop or tamper with any message. all modern browsers support the tls protocol, requiring the server to provide a valid digital certificate confirming its identity in order to establish a secure connection. ...
Texel - MDN Web Docs Glossary: Definitions of Web-related terms
age data. texel components are made up of subjective data, therefore they can be an image as well as a depth map. the process of mapping the appropriate texel’s to their corresponding points on a polygon is called texture mapping, which is a stage of the process of rendering a 3d image for display. texture mapping is typically done prior to lighting the scene; however, in webgl, lighting is per
formed as part of the texture mapping process. textures are characterised by collections of texel’s, as how images are characterised by collections of pixels. when texture mapping occurs the renderer maps texel’s to the appropriate pixels. learn more general knowledge texel (graphics) on wikipedia learn about it using textures in webgl lighting in webgl animating textures in webgl ...
Thread - MDN Web Docs Glossary: Definitions of Web-related terms
to create additional threads, each executing independently while possibly communicating between one another. this is done using technologies such as web workers, which can be used to spin off a sub-program which runs concurrently with the main thread in a thread of its own. this allows slow, complex, or long-running tasks to be executed independently of the main thread, preserving the overall per
formance of the site or app—as well as that of the browser overall. this also allows individuals to take advantage of modern multi-core processors. a special type of worker, called a service worker, can be created which can be left behind by a site—with the user's permission—to run even when the user isn't currently using that site. this is used to create sites capable of notifying the user whe...
Time to interactive - MDN Web Docs Glossary: Definitions of Web-related terms
time to interactive (tti) is a non-standardized web per
formance 'progress' metric defined as the point in time when the last long task finished and was followed by 5 seconds of network and main thread inactivity. tti, proposed by the web incubator community group in 2018, is intended to provide a metric that describes when a page or application contains useful content and the main thread is idle and free to respond to user interactions, including having event handlers registered. caveat: tti is derived by leveraging in
formation from the long tasks api. although available in some per
formance monitoring tools, tti is not a part of any official web specification at the time of writing. ...
UDP (User Datagram Protocol) - MDN Web Docs Glossary: Definitions of Web-related terms
etwork; there is no guarantee of delivery, ordering, or duplicate protection. if error-correction facilities are needed at the network interface level, an application may use the transmission control protocol (tcp) or stream control transmission protocol (sctp) which are designed for this purpose. udp is suitable for purposes where error checking and correction are either not necessary or are per
formed in the application; udp avoids the overhead of such processing in the protocol stack. time-sensitive applications often use udp because dropping packets is preferable to waiting for packets delayed due to retransmission, which may not be an option in a real-time system. general knowledge user datagram protocol on wikipedia technical reference specification ...
UI - MDN Web Docs Glossary: Definitions of Web-related terms
user interface (ui) is anything that facilitates the interaction between a user and a machine. in the world of computers, it can be anything from a keyboard, a joystick, a screen or a program. in case of computer software, it can be a command-line prompt, a webpage, a user input
form, or the front-end of any application. learn more general knowledge user interface on wikipedia front end development on wikipedia ...
URL - MDN Web Docs Glossary: Definitions of Web-related terms
in the context of http, urls are called "web address" or "link". your browser displays urls in its address bar, for example: https://developer.mozilla.org some browsers display only the part of a url after the "//", that is, the domain name. urls can also be used for file transfer (ftp) , emails (smtp), and other applications. learn more general knowledge url on wikipedia learn about it understanding urls and their structure specification the syntax of urls is defined in the url living standard. ...
URN - MDN Web Docs Glossary: Definitions of Web-related terms
urn (uni
form resource name) is a uri in a standard
format, referring to a resource without specifying its location or whether it exists. this example comes from rfc3986: urn:oasis:names:specification:docbook:dtd:xml:4.1.2 learn more general knowledge urn on wikipedia ...
UTF-8 - MDN Web Docs Glossary: Definitions of Web-related terms
each character is represented by one to four bytes. utf-8 is backward-compatible with ascii and can represent any standard unicode character. the first 128 utf-8 characters precisely match the first 128 ascii characters (numbered 0-127), meaning that existing ascii text is already valid utf-8. all other characters use two to four bytes. each byte has some bits reserved for encoding purposes. since non-ascii characters require more than one byte for storage, they run the risk of being corrupted if the bytes are separated and not recombined. ...
Grids - Learn web development
ultrices. phasellus turpis est, posuere sit amet dapibus ut, facilisis sed est.</p> </aside> <footer>contact me@mysite.com</footer> </div> if you use the firefox grid inspector to overlay the grid lines on your design, you can see how our 12 column grid works. test your skills! you've reached the end of this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: grids. summary in this overview we have toured the main features of css grid layout. you should be able to start using it in your designs. to dig further into the specification, read our guides to grid layout, which can be found below. see also css grid guides ...
CSS layout - Learn web development
o the viewport, and one another. we have covered the necessary prerequisites so we can now dive deep into css layout, looking at different display settings, modern layout tools like flexbox, css grid, and positioning, and some of the legacy techniques you might still want to know about. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites before starting this module, you should already: have basic familiarity with html, as discussed in the introduction to html module. be comfortable with css fundamentals, as discussed in introduction to css. understand how to style boxes. note: if you are working on a computer/tablet/other device where you don't have th...
How CSS works - Learn web development
software installed, basic knowledge of working with files, and html basics (study introduction to html.) objective: to understand the basics of how css and html are parsed by the browser, and what happens when a browser encounters css it does not understand. how does css actually work? when a browser displays a document, it must combine the document's content with its style in
formation. it processes the document in a number of stages, which we've listed below. bear in mind that this is a very simplified version of what happens when a browser loads a webpage, and that different browsers will handle the process in different ways. but this is roughly what happens. the browser loads the html (e.g. receives it from the network). it converts the html into a dom (document obj...
Using your new knowledge - Learn web development
this assessment gives you a chance to do that. prerequisites: before attempting this assessment you should have worked through the rest of the css basics module, and also have an understanding of html basics (study introduction to html). objective: to have a play with some css and test your new-found knowledge. ...
Typesetting a community school homepage - Learn web development
ntary styling. you are to write your css additions below the comment at the bottom of the css file, to make sure it is easy to mark the bits you have done. don't worry if some of the selectors are repetitious; we'll let you off in this instance. fonts: first of all, download a couple of free-to-use fonts. because this is a college, the fonts should be chosen to give the page a fairly serious,
formal, trustworthy feel — a serif site-wide font for the general text body, coupled with sans-serif or slab serif for the headings might be nice. use a suitable service to generate bulletproof @font-face code for these two fonts. apply your body font to the whole page, and your heading font to your headings. general text styling: give the page a site-wide font-size of 10px. give your headin...
Styling text - Learn web development
t common things you'll do with css. here we look at text styling fundamentals including setting font, boldness, italics, line and letter spacing, drop shadows, and other text features. we round off the module by looking at applying custom fonts to your page, and styling lists and links. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites before starting this module, you should already have basic familiarity with html, as discussed in the introduction to html module, and be comfortable with css fundamentals, as discussed in introduction to css. note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files...
Learn to style HTML using CSS - Learn web development
l. while html is used to define the structure and semantics of your content, css is used to style it and lay it out. for example, you can use css to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites you should learn the basics of html before attempting any css. we recommend that you work through our introduction to html module first. in that module, you will learn about: css, starting with the introduction to css module more advanced html modules javascript, and how to use it to add dynamic functionality to web pages...
How does the Internet work? - Learn web development
and the rest of the world, so how can you handle this? well, there are already cables linked to your house, for example, electric power and telephone. the telephone infrastructure already connects your house with anyone in the world so it is the perfect wire we need. to connect our network to the telephone infrastructure, we need a special piece of equipment called a modem. this modem turns the in
formation from our network into in
formation manageable by the telephone infrastructure and vice versa. so we are connected to the telephone infrastructure. the next step is to send the messages from our network to the network we want to reach. to do that, we will connect our network to an internet service provider (isp). an isp is a company that manages some special routers that are all linked toge...
How do I use GitHub Pages? - Learn web development
ing repository from the command line section: git push -u origin master now you need to turn github pages on for your repository. to do this, from the homepage of your repository choose settings, then scroll down until you get to the github pages section. underneath source, choose master branch. the page should refresh. go to the github pages section again, and you should see a line of the
form "your site is ready to be published at https://xxxxxx." if you click on this url, you should go to a live version of your example, provided the home page is called index.html — it goes to this entry point by default. if your site's entry point is called something else, for example mypage.html, you'll need to go to https://xxxxxx/mypage.html. further github knowledge if you want to make more...
What is accessibility? - Learn web development
adjust the volume to accommodate their unique needs. visual impairment again, provide a text transcript that a user can consult without needing to play the video, and an audio-description (an off-screen voice that describes what is happening in the video). pausing capacity users may have trouble understanding someone in a video. let them pause the video to read the subtitles or process the in
formation. keyboard capacity let the user tab into/out of a video, play it, and pause it without being trapped in it. the basics of web accessibility a few necessities for basic web accessibility include: whenever your site needs an image to convey meaning, include text as an alternative for visually-challenged users or those with slow connections. make sure all users can operate graphical in...
Common questions - Learn web development
others can access it from their computers. how do i use github pages? this article provides a basic guide to publishing content using github's gh-pages feature. how do you host your website on google app engine? looking for a place to host your website? here's a step-by-step guide to hosting your website on google app engine. what tools are available to debug and improve website per
formance? this set of articles shows you how to use the developer tools in firefox to debug and improve per
formance of your website, using the tools to check memory usage, the javascript call tree, the number of dom nodes being rendered, and more. design and accessibility this section lists questions related to aesthetics, page structure, accessibility techniques, etc. how do i start to des...
Example 1 - Learn web development
this is the first example of code that explains how to build a custom
form widget. basic state html <div class="select"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> css /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy styles */ /* -------...
Test your skills: Basic controls - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. basic controls 1 this task starts you off nice and gently by asking you to create two <input> elements, for a user's id and password, along with a submit button. create appropriate inputs for user id and password. you should also associate them with their text labels semantically. ...
Test your skills: Styling basics - Learn web development
this aim of this skill test is to assess whether you've understood our styling web
forms article. note: you can try out solutions by editing the starting point file locally, however it may be helpful to put your code in an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. styling basics 1 our basic
form styling assessment is fairly free-
form, and you have a lot of flexibility over what you end up doing here. but your css should aim to fulfill the following requirements: add some kind of lightweight "reset" to make fonts, padding, margin, and sizing more consistent to begin with. on top of that, add in some nice, consistent styling for the inputs an...
Dealing with files - Learn web development
your test-site folder. 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. generally, you can turn this off by going to windows explorer, selecting the folder options... option, unchecking the hide extensions for known file types check box, then clicking ok. for more specific in
formation covering your version of windows, you can search on the web. file paths to make files talk to one another, you have to provide a file path between them — basically a route, so one file knows where another one is. to demonstrate this, we will insert a little bit of html into our index.html file, and make it display the image you chose in the article "what will your website look like?" ...
How the Web works - Learn web development
's why domain name servers were invented. these are special servers that match up a web address you type into your browser (like "mozilla.org") to the website's real (ip) address. websites can be reached directly via their ip addresses. you can find the ip address of a website by typing its domain into a tool like ip checker. packets explained earlier we used the term "packets" to describe the
format in which the data is sent from server to client. what do we mean here? basically, when data is sent across the web, it is sent as thousands of small chunks, so that many different web users can download the same website at the same time. if websites were sent as single big chunks, only one user could download one at a time, which obviously would make the web very inefficient and not much fun to...
Publishing your website - Learn web development
code repositories for storage in the git version control system. you can then collaborate on code projects, and the system is open-source by default, meaning that anyone in the world can find your github code, use it, learn from it, and improve on it. github has a very useful feature called github pages, which allows you to expose website code live on the web. google app engine is a powerful plat
form that lets you build and run applications on google’s infrastructure — whether you need to build a multi-tiered web application from scratch or host a static website. see how do you host your website on google app engine? for more in
formation. these options are usually free, but you may outgrow the limited feature-set. using a web-based ide such as codepen there are a number of web apps th...
Use JavaScript within a webpage - Learn web development
ctured) text. rely on html for your content as much as possible. for example, if you've implemented a nice javascript progress bar, make sure to supplement it with matching text percentages inside the html. likewise, your drop-down menus should be structured as unordered lists of links. make all functionality accessible from the keyboard. let users tab through all controls (e.g., links and
form input) in a logical order. if you use pointer events (like mouse events or touch events), duplicate the functionality with keyboard events. test your site using a keyboard only. don't set nor even guess time limits. it takes extra time to navigate with the keyboard or hear content read out. you can hardly ever predict just how long it will take for users or browsers to complete an pro...
Test your skills: Links - Learn web development
rticle. note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. links 1 in this task we want you to help fill in the links on our whales in
formation page: the first link should be linked to a page called whales.html, which is in the same directory as the current page. we'd also like you to give it a tooltip when moused over that tells the user that the page includes in
formation on blue whales and sperm whales. the second link should be turned into a link you can click to open up an email in the user's default mail application, with ...
Test your skills: HTML images - Learn web development
t. the image's intrinsic size is 615 x 419 pixels. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. html images 2 in this task you already have a full-featured image, but we'd like you to add a tooltip that appears when the image is moused over. you should put some appropriate in
formation into the tooltip. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. html images 3 in this final task you are provided with both a full-featured image and some caption text. what you need to do here is add elements that will associate the image with the caption. try updating ...
Test your skills: Multimedia and embedding - Learn web development
nd other features besides. you need to: add an attribute to make browsers display some default controls. add some appropriate fallback text for browsers that don't support <video>. add multiple sources, containing the paths to the video files. the files are called video.mp4 and video.webm, and are in a folder inside the current folder called media. let the browser know in advance what video
formats the sources point to, so it can make an in
formed choice of which one to download ahead of time. give the <video> a width and height equal to its intrinsic size (320 by 240 pixels). make the video muted by default. display the text tracks contained in the media folder, in a file called subtitles_en.vtt, when the video is playing. you must explicitly set the type as subtitles, and the subtitl...
HTML Tables - Learn web development
a very common task in html is structuring tabular data, and it has a number of elements and attributes for just this purpose. coupled with a little css for styling, html makes it easy to display tables of in
formation on the web such as your school lesson plan, the timetable at your local swimming pool, or statistics about your favorite dinosaurs or football team. this module takes you through all you need to know about structuring tabular data using html. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites before starting this module, you should already have covered the basics of html — see introduction to html. note: if you are working on a computer/tabl...
Making asynchronous programming easier with async and await - Learn web development
tting off their associated processes all running simultaneously. next, we await their results — because the promises all started processing at essentially the same time, the promises will all fulfill at the same time; when you run the second example, you'll see the alert box reporting a total run time of just over 3 seconds! you'll have to test your code carefully, and bear this in mind if per
formance starts to suffer. another minor inconvenience is that you have to wrap your awaited promises inside an async function. async/await class methods as a final note before we move on, you can even add async in front of class/object methods to make them return promises, and await promises inside them. take a look at the es class code we saw in our object-oriented javascript article, and then lo...
General asynchronous programming concepts - Learn web development
you with apis that allow you to run such tasks asynchronously. blocking code asynchronous techniques are very useful, particularly in web programming. when a web app runs in a browser and it executes an intensive chunk of code without returning control to the browser, the browser can appear to be frozen. this is called blocking; the browser is blocked from continuing to handle user input and per
form other tasks until the web app returns control of the processor. let's look at a couple of examples that show what we mean by blocking. in our simple-sync.html example (see it running live), we add a click event listener to a button so that when clicked, it runs a time-consuming operation (calculates 10 million dates then logs the final one to the console) and then adds a paragraph to the dom: ...
Build your own function - Learn web development
sage('brian: hi there, how are you today?','chat'); you can see how useful our (now not so) little function is becoming. note: if you have trouble getting the example to work, feel free to check your code against the finished version on github (see it running live also), or ask us for help. test your skills! you've reached the end of this article, but can you remember the most important in
formation? you can find some further tests to verify that you've retained this in
formation before you move on — see test your skills: functions. these tests require skills that are covered in the next article, so you might want to read those first before trying it. conclusion congratulations on reaching the end! this article took you through the entire process of building up a practical custom fun...
Test your skills: variables - Learn web development
note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version). ...
Solve common problems in your JavaScript code - Learn web development
also, see other common errors for a description of common errors. making decisions in code how do you execute different blocks of code, depending on a variable's value or other condition? how do you use if ...else statements? how do you nest one decision block inside another? how do you use and, or, and not operators in...
Object building practice - Learn web development
our loop() function does the following: sets the canvas fill color to semi-transparent black, then draws a rectangle of the color across the whole width and height of the canvas, using fillrect() (the four parameters provide a start coordinate, an...
Test your skills: Object basics - Learn web development
ditor. object basics 2 in our next task, we want you to have a go at creating your own object literal to represent one of your favourite bands. the required members are: name: a string representing the band name. nationality: a string representing the country the band comes from. genre: what type of music the band plays. members: a number representing the number of members the band has.
formed: a number representing the year the band
formed. split: a number representing the year the band split up, or false if they are still together. albums: an array representing the albums released by the band. each array item should be an object containing the following members: name: a string representing the name of the album. released: a number representing the year the album was rele...
JavaScript — Dynamic client-side scripting - Learn web development
javascript is a programming language that allows you to implement complex things on web pages. every time a web page does more than just sit there and display static in
formation for you to look at—displaying timely content updates, interactive maps, animated 2d/3d graphics, scrolling video jukeboxes, or more—you can bet that javascript is probably involved. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites javascript is arguably more difficult to learn than related technologies such as html and css. before attempting to learn javascript, you are strongly advised to get familiar with at least these two technologies first, and perhaps others as well. star...
Server-side website programming first steps - Learn web development
bsite security requires vigilance in all aspects of website design and usage. this introductory article won't make you a website security guru, but it will help you understand the first important steps you can take to protect your web application against the most common threats. note: this topic deals with server-side frameworks, and how to use them to create websites. if you are looking for in
formation on client-side javascript frameworks, consult our understanding client-side javascript frameworks module. assessments this "first steps" module doesn't have any assessment because we haven't yet shown you any code. we do hope that at this point you have a good understanding of what sorts of functionality you can deliver using server-side programming, and that you have made a decision abou...
Ember app structure and componentization - Learn web development
ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo
form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced s...
Rendering a list of Vue components - Learn web development
ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo
form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced s...
Git and GitHub - Learn web development
that a complete copy of the repository containing the codebase is made on your computer (and everyone else's). you make changes to your own copy, and then push those changes back up to the server, where an administrator will decide whether to merge your changes with the master copy. looking to become a front-end web developer? we have put together a course that includes all the essential in
formation you need to work towards your goal. get started prerequisites to use git and github, you need: a desktop computer with git installed on it (see the git downloads page). a tool to use git. depending on how you like to work, you could use a git gui client (we'd recommend github desktop, sourcetree or git kraken) or just stick to using a terminal window. in fact, it is probably useful ...
Chrome Worker Modules
stack traces unfortunately, the module loader doesn’t play nicely with error stack traces. that is, the following will not show human-readable stacks: try { mymodule.foo(); } catch (ex) { log("exception raised at " + ex.filename) log("stack: " + ex.stack); } rather, you should use properties modulename and modulestack, as ...
Browser chrome tests
forexplicitfinish(); settimeout(completetest, 1000); } function completetest() { ok(true, "timeout ran"); finish(); } if your test is randomly timing out and you think that's just due to it taking too long, you can extend the timeout. be aware that this is not a solution; you should investigate why your test is taking so long, since it's most likely due to a bad test design or a per
formance problem. if you can rewrite the test to make is shorter, split it into smaller tests, or find why it's taking so long, you should really do that instead! function test() { // requestlongertimeout accepts an integer factor, that is a multiplier for the the default 30 seconds timeout. // so a factor of 2 means: "wait for at last 60s (2*30s)". requestlongertimeout(2); waitforexplic...
Testopia
q wiki docs bugs (please read the bug reporting guide) official testopia blog irc: #testopia or #bugzilla user help support-webtools@lists.mozilla.org developers dev-apps-webtools@lists.mozilla.org downloads download 2.5 (bugzilla 4.2) download 2.4 (bugzilla 3.6 and 4.0) archived versions developers greg hendricks vance baarda (
former developer) ed fuentetaja (
former developer) ...
Bugzilla
so. view all... other materials an introduction to bugzilla bugzilla for humans bugzilla quicksearch help page. quicksearch is a quick, easy, and very effective way of quickly querying bugzilla. testopia - test case management extension bugzilla.org - the project site wikipedia:bugzilla - general description of bugzilla (not specific to mozilla projects) bmo on wiki.mozilla.org - in
formation about mozilla's customized bugzilla installation, including how to contribute to it tools bugzilla todos lists review and flag requests, patches to check in, unfulfilled requests you made of other people, and assigned bugs. bz kanban is a board to visualize the status of bugs within a milestone. ...
Cookies in Mozilla
suggestions as to needed documentation can be directed to mike connor. creating a cookie log steps to create and attach a cookie log in order to aid in triaging a bug in cookies. cookies preferences in mozilla documentation on what the preferences used by the cookies code actually do. original document in
formation author(s): mike connor last updated date: march 15, 2004 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Creating JavaScript callbacks in components
how to use the callback system: var wordhandler = { onword : function(word) { alert(word); } }; var stringparser = /* get a reference to the parser somehow */ stringparser.addobserver(wordhandler); stringparser.parse("pay no attention to the man behind the curtain"); you can find examples of this pattern all over the mozilla codebase. in fact, there is even a specific interface for this
form of push callbacks, nsiobserverservice. javascript functions as callbacks another common use of the pattern is found in addeventlistener / removeeventlistener. a nice feature of addeventlistener is that you can pass a javascript function in place of the callback listener interface. remember (or discover) that addeventlistener is a method of the nsidomeventtarget interface and is defined as such: v...
Articles for new developers
to help you find the most critical stuff as quickly as possible, we've created this list of the articles you'll find most useful as you get yourself oriented and make your first contributions to the project. ...
OS TARGET
os_target is typically the output of the 'uname -s' command on the target plat
form. the following list is not complete as any plat
form could have its own os_target. winnt linux darwin android sunos freebsd openbsd netbsd os2 beos irix64 aix hp-ux dragonfly skyos riscos nto osf1 ...
Simple SeaMonkey build
build prerequisites hardware requirements: the seamonkey build process is both i/o- and cpu-intensive, and can take a long time to build even on modern hardware. minimum and recommended hardware requirements for mozilla development are: recommended: 8gb of ram (having only 4gb ram and 4gb swap may give memory errors during compile) 35 gb free disk space. this will accomodate visual studio 2013 community edition, the required sdks, the mozillabuild package, the mercurial source repository and enough free disk space to compile. ...
pymake
hon 2.6 or higher (but not python 3). please note that python 2.7 is strongly recommended. usage if you use mach for everything, you don't have to worry about gmake and pymake: mach will run whatever is best for the current machine. note: on windows, you must take special care to be able to switch back and forth between gmake and pymake on the same object dir. see gmake vs. pymake for more in
formation. 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. alternately, if you would like to...
Callgraph
the callgraph project is intended to produce a complete callgraph covering c and c++ code within mozilla. this can be used for per
forming static analysis based on the relationship between functions and methods. for instance, given the c++ code: int foo() { return good(); } int good() { return evil() ? 0 : 1; } the callgraph would be foo() -> good() -> evil(). given the knowledge that evil() does evil things, one could then determine foo() also does evil things. the callgraph project uses gcc and treehydra to generate in
formation about function and method calls at compile time, and aggregates it into a sqlite database. documentation installing callgraph download and installation of callgraph schema reference explanation of the database schema further details implementation ideas ...
HTMLIFrameElement.purgeHistory()
note: to delete cookies for a firefox os app, you could call clearbrowserdata() on the actual app itself. syntax there is a domrequest version and a promise version: var mydomrequest = instanceofhtmliframeelement.purgehistory(); instanceofhtmliframeelement.purgehistory().then(function() { ... ...
HTMLIFrameElement.sendMouseEvent()
nting the x position of the cursor relative to the browser <iframe>'s visible area in css pixels. y a number representing the y position of the cursor relative to the browser <iframe>'s visible area in css pixels. button a number representing which button has been pressed on the mouse: 0 (left button), 1 (middle button), or 2 (right button). clickcount the number of clicks that should be per
formed. modifiers a number representing a key pressed at the same time the mouse button was clicked: 1 : alt 2 : ctrl 4 : shift 8 : meta 16 : alt gr 32 : caps lock 64 : fn 128 : num lock 256 : scroll 512 : symbol lock 1024 : win note: you can specify multiple key modifiers separated by a pipe symbol, for example 1 | 1014. examples var browser = documen...
HTMLIFrameElement.sendTouchEvent()
x an array of numbers representing the x radius of each touch point in css pixels. ry an array of numbers representing the y radius of each touch point in css pixels. rotationangles an array of numbers representing the angle of each touch point in degrees. forces an array of numbers representing the intensity of each touch in the range 0–1. count the number of touches that should be per
formed. modifiers a number representing a key pressed at the same time the mouse button was clicked: 1 : alt 2 : ctrl 4 : shift 8 : meta 16 : alt gr 32 : caps lock 64 : fn 128 : num lock 256 : scroll 512 : symbol lock 1024 : win note: you can specify multiple key modifiers separated by a pipe symbol, for example 1 | 1014. examples var browser = documen...
ChromeWorker
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. summary if you're developing privileged code, and would like to create a worker that can use js-ctypes to per
form calls to native code, you can do so by using chromeworker instead of the standard worker object. it works exactly like a standard worker, except that it has access to js-ctypes via a global ctypes object available in the global scope of the worker. examples of chromeworker's using js-ctypes are availabe on github and are linked to from the see also section below. to use a postmessage with callbac...
Chrome-only API reference
code: see web apis for a list of these. browser apithe html browser api is an extension of the html <iframe> element that allows web apps to implement browsers or browser-like applications. it currently works in (privileged) chrome code on firefox desktop (version 47 and above).chromeworkerif you're developing privileged code, and would like to create a worker that can use js-ctypes to per
form calls to native code, you can do so by using chromeworker instead of the standard worker object. it works exactly like a standard worker, except that it has access to js-ctypes via a global ctypes object available in the global scope of the worker. examples of chromeworker's using js-ctypes are availabe on github and are linked to from the see also section below. to use a postmessage with callbac...
-moz-window-dragging
problems related to firefox windows not being moveable when busy (bug 944836). initial value drag applies to all elements that create native windows, e.g. <window>, <panel> inherited no media visual computed value as specified animation type discrete canonical order the unique non-ambiguous order defined by the
formal grammar syntax the -moz-window-dragging property is specified as one of the keyword values listed below. values drag the window is draggable. no-drag the window is not draggable
formal syntax drag | no-drag example toolbarpaletteitem { -moz-window-dragging: no-drag; } specifications this property is not part of any specification. ...
overflow-clip-box-block
y default, padding-box is used everywhere, but <input type="text"> and similar use the value content-box. note that this property is activated by default only in the ua stylesheet and chrome contexts. value not found in db! syntax values padding-box this keyword makes the clipping be related to the padding box. content-box this keyword makes the clipping be related to the content box. ...
overflow-clip-box-inline
y default, padding-box is used everywhere, but <input type="text"> and similar use the value content-box. note that this property is activated by default only in the ua stylesheet and chrome contexts. value not found in db! syntax values padding-box this keyword makes the clipping be related to the padding box. content-box this keyword makes the clipping be related to the content box. ...
Chrome-only Events reference
this page lists events that are only available in gecko chrome code (and sometimes in other privileged circumstances, eg. ua widgets). mozbeforepaintgecko 2.0 adds a new method for per
forming javascript controlled animations that synchronize not only with one another, but also with css transitions and smil animations being per
formed within the same window.mozscrolledareachangedthe mozscrolledareachanged event is fired when the document view has been scrolled or resized. smartcard-insertthe smartcard-insert event is fired when the insertion of a smart card has been detectedsmartcard-removethe smartcard-remove event is fired when the removal of a smart card has been detected. ...
Gecko Chrome
chrome-only api referencethis page lists apis that only run in gecko chrome code (and sometimes in other privileged circumstances.)chrome-only css referencethis page lists css properties that are only available in gecko chrome code (and sometimes in other privileged circumstances, eg. ua stylesheets.) chrome-only events referencethis page lists events that are only available in gecko chrome code (and sometimes in other privileged circumstances, eg. ua widgets). ...
Gecko
xul-based applications gecko also renders the application's user interface. gecko is used in many applications, including a few browsers such as firefox and seamonkey (for a complete list, please refer to wikipedia's article on gecko). products using the same version of gecko have identical support for web standards. documentation chrome this page contains in
formation specific to browser chrome (not google chrome) code running in gecko. gecko faq frequently asked questions about gecko. gecko dom reference reference to the dom. gecko event reference reference to events used within gecko and mozilla applications; for web-standard dom events, see the dom event reference. introduction to layout in mozilla tech tal...
Gecko's "Almost Standards" Mode
er "almost standards" mode. recommendations for authors who are attempting to migrate to validated markup using either html 4.01 or xhtml 1.0, and who are still using image-in-table design concepts, make sure to use a doctype that will trigger "almost standards" mode. also on mdc images, tables, and mysterious gaps mozilla's doctype sniffing mozilla's quirks mode original document in
formation author(s): eric a. meyer, netscape communications last updated date: published 08 nov 2002 copyright in
formation: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Geckoview-Junit Tests
attach during a sigsegv. assumethat(sessionrule.env.isdebugbuild && sessionrule.env.cpuarch == "x86", equalto(false)) running tests on try to run these tests on try, use something like: mach try fuzzy -q geckoview-junit --artifact or mach try -b do -p android-x86_64 -u geckoview-junit --artifact currently, geckoview-junit is only run on android-x86_64. contact in
formation geckoview-junit tests are maintained by :snorp and :gbrown. bugs should be filed in geckoview :: general. ...
How to add a build-time test
test program from the "check" target in the makefile. (example to run the testcookie program) in the test program: if the test fails, exit with a non-zero status and/or print the string "fail" to stdout if the test passes, exit with a zero status and don't print the string "fail" (bonus points for printing "pass" :) ) write the test so that you expect it to pass on all plat
forms, since if the test fails, the tree will go orange (once we've set this up - see bug 352240 for status). 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. you can of course use unit or test if you're not feeling creative. in <tt>yourmoduledi...
How to investigate Disconnect failures
this article will guide you on how to investigate disconnect failures. an example of such a failure disconnect failures happens when one side is closing the connection and mozmill is unable to send the in
formation over the bridge or when firefox crashes. usually disconnects happens when a modal dialog freezes and we cannot close it sp we close firefox with the modal frozen. we cannot investigate failures via mozmill, because we do not catch the crashes, so the crashes' in
formation is not logged; we have to go to ci machines and investigate directly. check if firefox crashed: windows: [user]/appdata\roaming\mozilla\firefox\crash reports ubuntu: [user/home]/.mozilla/firefox/crash reports and there we can check by timestamp if firefox crashed when we had the disconnect. ch...
Geometry.jsm
it exports two classes: point and rect. to use these routines, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/geometry.jsm"); once you've imported the module, you can then use the point and rect classes. ...
Interfacing with the Add-on Repository
epository, you can use either of the following methods: searchaddons() queries the add-on repository for add-ons matching given search criteria. retrieverecommendedaddons() retrieves a list of recommended add-ons, as determined by the amo site administrators. this example will use the latter, in order to randomly select a recommended add-on and offer to install it. however, the code to per
form a search term based query would be very similar. when the user clicks a toolbar button to initiate the query, the following code gets run to start the request: addonrepository.retrieverecommendedaddons(10, this); this asks the repository to fetch up to 10 add-ons, using the object this as the target for callbacks. the callback object needs to implement the searchcallback interface, providing ...
JavaScript OS
at the time of this writing, some of the features of this module are available only to chrome workers. os.constants os-related constants, including errors, file opening modes, system configuration, etc. os.file access to the native file system. ...
Promise
passing onreject to then(). promise catch( function onreject ); the following calls are therefore identical: p.then(undefined, logerror); p.catch(logerror); debugging by design, the instant state and value of a promise cannot be inspected synchronously from code, without calling the then() method. to help with debugging, only when inspecting a promise object manually, you can see more in
formation as special properties that are inaccessible from code (this, at present, is implemented by randomizing the property name, for the lack of more sophisticated language or debugger support). these code-inaccessible, inspectable properties are: {{private:status}}: 0 for pending, 1 for fulfilled, or 2 for rejected. {{private:value}}: fulfillment value or rejection reason, for fulfilled or re...
Promise.jsm
romise instead. if you need a deferred, because you want to create a promise and manually resolve or reject it, consider using promiseutils.jsm instead. to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/promise.jsm"); note: a preliminary promise module is also available starting from gecko 17, though it didn't con
form to the promises/a+ proposal until gecko 25: components.utils.import("resource://gre/modules/commonjs/promise/core.js"); // gecko 17 to 20 components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js"); // gecko 21 to 24 this implementation also includes helper functions that are specific to the add-on sdk. while you may still import this module from the above paths, the rec...
openLocationLastURL.jsm
(bug 953124) the openlocationlasturl.jsm javascript code module lets you set and retrieve the url most recently opened using the "open location" option in the file menu. to use this, you first need to import the code module into your javascript scope: components.utils.import("resource:///modules/openlocationlasturl.jsm"); once you've imported the module, you can then use the openlocationlasturl object it exports. this object lets you fetch and change the url that is placed in the "open location" dialog box when it opens. if the user is not in private browsing mode, this automatically updates the value of the general.open_location.last_url preference. ...
L10n testing with xcode
e from the toolbar menu. in the edit scheme screen, select run from the left pane and then navigate to the options tab. select your language from the application language menu and click close. tah dah! you're ready to test your localization of firefox on ios. launching & testing your firefox on ios localization the ios simulator is fairly easy to use once you launch your app. to per
form the next steps, you'll need to be familiar with how user gestures and hardware interactions work in the simulator. this guide should help. press the run button in the upper left-hand corner (the button has a playback icon). navigate to the newly opened ios simulator window many strings are accessibility strings and are only revieled when a user hovers their finger over the button. to view th...
Localization notes
localizers usually work on the localizable files without the context of the source files including the localized strings; it is important to add comments to the localizable files themselves, too. these comments are generally referred to as localization notes. there is an established
format for those, which is described in this document. it's important to follow the
format as closely as possible. there are a number of automated tools that parse these comments for easier access and use by localizers. dtd files <!-- localization note (entity name): comment --> properties files # localization note (key): comment file-wide comments should use the same
format, be at the top of the file (after the license header, though) and just drop the (entity name/key) reference. ...
Localizing with Koala
tory, e.g. http://bitbucket.org/mozillal10n/x-testing. if you're starting a new localization, you may not have a remote repository set up yet. it is still recommended to use mercurial locally to version your local files. just type a single dot (".") in the url field to enable mercurial support in koala. branch: default. revision: leave empty. user: type your name and your e-mail address in the
form: "firstname lastname <me@example.com>" (be sure to type the wrapping quotes: "") note that you no longer have to edit the location now, it automatically fills in when you check the "mercurial" checkbox (e.g. "c:\mozilla\l10n\locale\x-testing\3.6" if you enabled mercurial (recommended), koala will ask you if you wish to clone the remote repository. click "ok" (even if you're creating a new local...
Patching a Localization
tion in question using its two or three character iso language code. for our example, i'll use gl (galician). whenever you see gl in blue text, replace it with the locale code for your language. next thing you need to know is which localization version you want to patch. all of our localizations work on the aurora branch. the repository for this version is releases/l10n/mozilla-aurora. for more in
formation about branches see l10n:branches. now let's get a little more detailed. start bash and do the following: create a clean directory for your work. for example, create a directory like localization-workdir (in this example it is located in your home directory): mkdir ~/localization-workdir navigate to the directory you just created. cd ~/localization-workdir clone the locali...
Initial setup
t (i.e., your personal computer). you also need to determine if a localization effort already exists for your locale. here we'll go over the accounts you need as well as the tools and their configurations you need to set up before contributing. new or existing before anything else, you need to know if you will be creating a new localization or joining an existing one. this will determine what in
formation is most applicable to you throughout the rest of this guide. here's what you do: look through the existing localization community directory to see if one already exists for your locale. if a community already exists, reach out to them and ask how you can help. if a community doesn't exist, send an email to the new-locales newsgroup for additional guidance. accounts there are a handf...
Creating localizable web content
sources. images check that images are not going to be a problem for the audience (cultural references, positionning, mirroring for rtl, text in images...) and spot what sizes/margins can be tweaked by css or have to be fixed for all locales but english don't use text in icons images 1&2. bad: image 3. good: image 4. good: this icon is recognized as the international symbol for in
formation. it can stay this way. use localized screenshots if possible screenshots are important in
formative graphics, often times explaining how to achieve something in a desktop or web application. as such, they should be perceived as an essential part of the content and should be localized. image 1. bad. if the screenshot shows the application that the website directly relates to (fi...
Setting up the infrastructure
requirements: php with gettext support, apache and some unix experience. create a new branch for l10n (optional if starting a new project). create a locale directory in your website (usually something like docroot/locale). ...
Web Localizability
how to create localizable web applications. how to set up the infrastructure for localization. ...
What every Mozilla translator should know
committed by the localizers. some branch/release names identified: mozilla source + en-us localization files for [ab-cd] locale corresponding firefox version branches in hg mozilla-central l10n-central firefox.next (trunk) mozilla-1.9.2 l10n-mozilla-1.9.2 firefox 3.6 mozilla-1.9.1 l10n-mozilla-1.9.1 firefox 3.5 and, on the
former revision control system, cvs: cvs trunk (the default branch) -> firefox/thunderbird 3.0.x branch mozilla_1_8_branch -> firefox/thunderbird 2.0 branch mozilla cross-reference mozilla cross-reference is a web site mirroring the content of the hg server. here we can easily have a look into other languages translations. bugzilla, the bug-tracking system you do need an account in bugzilla ...
Writing localizable code
example of a well used composite string is firefox's setting for visited pages: the translator can (implicitly) position the text field as he sees fit. don't use preprocessor macros the use of #if #else #endif or #expand is strongly discouraged. there are few exceptions to this rule, but in general, the localized file should comply with standards and should not require build tools to be trans
formed. if you want to add build processing to localized files, be sure to request feedback from l10n@. in most cases, you can just as well put the processing into the content code and reference different key-value pairs in l10n. use a good source directory structure be sure to put the localizable files in the right place. the addition of new top-level directories is a compromise between module ow...
Mozilla Framework Based on Templates (MFBT)
ument primarily attempts to direct readers to the correct file to read those comments. feel free to file a documentation bug if you think this approach could be improved, and feel free to make improvements to this document if you see them. functionality types and type manipulation standardinteger.h implements the <stdint.h> interface. (the <stdint.h> standard header is not available on all plat
forms and so cannot be used directly. 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. checkedint.h implements checked integers. they behave like integers, but safely check for integer overflow and divide-by-zero. useful for input validation. floatingpoint.
MathML3Testsuite
the mathml testsuite. characters blocks symbols variants entitynames numericrefs utf8 general clipboard genattribs math presentation css dynamicexpressions generallayout scriptsandlimits tablesandmatrices tokenelements topics accents bidi elementarymathexamples embellishedop largeop linebreak nesting stretchychars whitespace torturetests errorhandling original document in
formation author(s): frédéric wang other contributors: last updated date: may 26, 2010 copyright in
formation: portions of this content are © 2010 by individual mozilla.org contributors; content available under a creative commons license | details. ...
MathML Screenshots
can be used in combination with other web features such as background images at a desired opacity. screen captures of mtable, showing typesetting mathematical constructs in 2d. screenshot of roots and physics equations (maxwell's equations and einstein's field equations). this screen capture demonstrates advanced layout with mtable and stretchy operators. you can get the mathml source of a
formula or a selected expression. the choice is yours! mathml in blog posts and emails. ...
MathML In Action
ng. download a mathml-enabled mozilla build to remedy this sad situation. you already have a mathml-enabled build but what you see on the screenshot is not what you get? in that case you are probably missing some crucial mathml fonts. now that you are well-equipped, you should be able to see this inline equation with varying accents: x ^ + xy ^ + xyz ^ . 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. mathml in mozilla aims at complying with the mathml specification so that what you see is what you markup, or to put it another way what you see is what you made, or in short "wysiwym". the difference between these two is in the ...
Mozilla MathML Status
ented. see bug 534967. mscarry not implemented. see bug 534967. msline not implemented. see bug 534967. other elements element [- attribute] notes mglyph not implemented. see bug 297465. maction implemented. maction - tooltip not implemented. see bug 544001. semantics implemented. original document in
formation author(s): frédéric wang other contributors: copyright in
formation: portions of this content are © 2010 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Updates
lete and improve it! may 8, 2007 mozilla ceo speaks out on the future of firefox: the complete 8,000 word interview. interview to the apc magazine where mitchell baker mentions roger sidje's work on mathml. june 5, 2002 mozilla 1.0 released "by virtue of embedding gecko, mozilla 1.0 and products based on mozilla code support more web standards, more deeply, more consistently across more plat
forms than any others. mozilla 1.0 features full support for html 4.0, xml 1.0, resource description framework (rdf), cascading style sheets level 1 (css1), and the w3c document object model level 1 (dom1) [...] as well as support for display of mathematical equations using mathml." december 7, 2001 status report october 2000 the first international mathml conference april 14, 2000 status report...
Mozilla MathML Project
mfrac, mo, mtable, mspace, mmultiscripts, msqrt-mroot. mathml extras - technology demonstration of some interesting upshots from building natively upon the browser environment. various mathml tests - these pages were imported from layout/mathml/tests/. blog with comments that include mathml. create mathml documents authoring mathml editors converters stylesheets original document in
formation author(s): roger b. sidje other contributors: frédéric wang last updated date: april 4, 2010 copyright in
formation: portions of this content are © 1999–2010 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Using the viewport meta tag to control layout on mobile browsers
ppressed in any orientation and the user can zoom in if they want to. <meta name="viewport" content="width=device-width, initial-scale=0.86, maximum-scale=3.0, minimum-scale=0.86"> common viewport sizes for mobile and tablet devices if you want to know what mobile and tablet devices have which viewport widths, there is a comprehensive list of mobile and tablet viewport sizes here. this gives in
formation such as viewport width on portrait and landscape orientation as well as physical screen size, operating system and the pixel density of the device. specifications specification status comment css device adaptationthe definition of '<meta name="viewport">' in that specification. working draft non-normatively describes the viewport meta element there ...
Are We Slim Yet
ears tracked memory usage across builds on the (now defunct) website areweslimyet.com. it used the same infrastructure as about:memory to measure memory usage on a predefined snapshot of alexa top 100 pages known as tp5. since firefox transitioned to using multiple processes by default, we moved awsy into the taskcluster infrastructure. this allowed us to run measurements on all branches and plat
forms. the results are posted to perfherder where we can track regressions automatically. as new processes are added to firefox we want to make sure their memory usage is also tracked by awsy. to this end we request that memory reporting be integrated into any new process before it is enabled on nightly. ...
GC and CC logs
garbage collector logs and cycle collector logs can be analyzed in various ways. in particular, cc logs can be used to understand why the cycle collector is keeping an object alive. these logs can either be manually or automatically generated, and they can be generated in both debug and non-debug builds. this logs the contents of the javascript heap to a file named gc-edges-nnnn.log. ...
Profiling with the Gecko Profiler and Local Symbols on Windows
in the past you had to need to run mach buildsymbols manually, but this is no longer needed. the profiler automatically reads symbols from the pdb files that are generated during the build process. you probably need a 64 bit build of firefox for this to work, though. it looks like we consume too much memory when creating the symbol table for this to work in 32 bit firefox builds. unfortunately, 32 bit is still the default when building firefox locally. ...
Scroll-linked effects
the definition of a scroll-linked effect is an effect implemented on a webpage where something changes based on the scroll position, for example updating a positioning property with the aim of producing a parallax scrolling effect. this article discusses scroll-linked effects, their effect on per
formance, related tools, and possible mitigation techniques. scrolling effects explained often scrolling effects are implemented by listening for the scroll event and then updating elements on the page in some way (usually the css position or trans
form property.) you can find a sampling of such effects at css scroll api: use cases. these effects work well in browsers where the scrolling is done synchronously on the browser's main thread. however, most browsers now support some sort of asynch...
dtrace
keups occur; ustack is short for "user stack", i.e. the stack of the userspace program executing. run that command for a few seconds and then hit ctrl + c to interrupt it. dtrace will then print to the output file a number of stack traces, along with a wakeup count for each one. the ordering of the stack traces can be non-obvious, so look at them carefully. sometimes the stack trace has less in
formation than one would like. it's unclear how to improve upon this. ...
perf
this purpose. sudo perf stat -a -r 1 \ -e "power/energy-pkg/" \ -e "power/energy-cores/" \ -e "power/energy-gpu/" \ -e "power/energy-ram/" \ <command> the -a is necessary; it means "all cores", and without it all the measurements will be zero. the -r 1 means <command> is executed once; higher values can be used to get variations. the output will look like the following. per
formance counter stats for 'system wide': 51.58 joules power/energy-pkg/ [100.00%] 14.80 joules power/energy-cores/ [100.00%] 9.93 joules power/energy-gpu/ [100.00%] 27.38 joules power/energy-ram/ [100.00%] 5.003049064 seconds time elapsed it's not clear from the output, but the following relationship holds. energy-pkg >= energy-cores + energy-gpu the measurement is in ...
accessibility.tabfocus
ab key. note: on mac os x, if this preference is not set, the full keyboard access setting in system preferences > keyboard is honored. type:integer default value: 7 (windows and linux); 2 (mac os x) exists by default: no application support:gecko 1.7 status: active introduction: bugs: bug 140612 values 1 give focus only to text fields (default on mac osx) 2 give focus to all
form elements except text fields. 4 give focus only to links and linked images. other you can add these values to combine their functionality. the value 7 (give focus to all elements) is the default on windows and linux. ...
browser.urlbar.trimURLs
es application support:firefox 7.0 status: active; last updated 2012-04-03 introduction: pushed to nightly on 2011-06-23 bugs: bug 665580 values true (default) if the active url is exactly the domain name, the trailing slash (/) behind the top level domain will be hidden. if the address starts with http:// and neither starts with a ftp. subdomain nor contains @ (usually for ftp login in
formation), the http:// prefix will be hidden. examples: https://www.example.org/ becomes https://www.example.org, http://www.example.org/foobar becomes www.example.org/foobar and http://ftp.example.org/foobar remains unchanged. false all parts of the url are shown. ...
Preferences
the preference system makes it possible to store data for mozilla applications using a key/value pairing system. these articles provide in
formation about how to use the preference system. documentation preferences system an introduction to using the preference system in mozilla. xul school: handling preferences the xul school tutorial chapter on preferences. mozilla preference reference a reference guide to all mozilla preferences; currently a work in progress. a brief guide to mozilla preferences an introductory guide to where preferences are stored and other useful in
formation about the core preference system. using preferences from application code fi...
Profile Manager
ou attempt to launch firefox using profile manager, and it detects that another instance of firefox is already running, it will automatically add the -no-remote argument for you, regardless of whether this launch option was checked. locked profiles some profiles may be shown as locked in the main window. such profiles are currently being used by an instance of firefox. if you attempt to per
form any operation on a locked profile, you'll get a warning; if you choose to continue despite the warning, you may encounter errors or corrupt a profile. it's strongly recommended to avoid operations on locked profiles. if you need to do something with a locked profile, close the instance of firefox which is using the profile first. backing up and restoring profiles profile manager offers tw...
Crash reporting
ction and reporting server where did my crash get submitted? crash data submitted using the mozilla crash reporter is located on crash-stats. if you want to find a specific crash that you submitted, you first need to find the crash id that the server has assigned your crash. type about:crashes into your location bar to get a page listing both submitted and unsubmitted crash reports. for more in
formation, see how to get a stacktrace for a bug report. reports and queries crash-stats has built-in reports of "topcrashes" for each release grouped by signature. there is also a custom query tool which allows users to limit searches on more precise in
formation. finally, a set of mozilla employees have access to directly query the underlying data in either sql summary or using mapreduce on the st...
Debugging out-of-memory problems
spike has gone away, making temporary memory spikes difficult to diagnose. this article explains how to debug such problems. out-of-memory exceptions from js setting memory.dump_reports_on_oom in about:config to true will cause the browser to automatically write about:memory dumps to a temp file printed to the browser console (note: not web console) when an oom crash is encountered. for more in
formation, see bug 969415. out-of-memory crashes in some cases, running out of memory causes the browser to crash. ideally, memory.dump_reports_on_oom would generate an about:memory dump, but it does not currently. firefox android on firefox android, an about:memory dump may be triggered from a connect desktop machine with the command: adb shell am broadcast -a org.mozilla.gecko.memory_dump th...
L20n
a javascript localization framework to unleash your natural language's power with simple code. introducing l20n l20n reinvents software localization. users should be able to benefit from the entire expressive power of the natural language. l20n keeps simple things simple, and at the same time makes complex things possible. through l20n, mozilla is creating a new generation of technology that places more power in localizers' hands. l20n lets localizers reach higher levels of free linguistic expression by sharpening the divide between localization and application logic. ...
Creating a Cookie Log
have reproduced the bug, shut down firefox. close out of the command prompt/shell/terminal, and then launch firefox normally. finally, attach the cookie-log.txt file to the bug where it was requested (by clicking on create new attachment). it should be in c:\temp on windows, your home directory on linux, or the desktop on mac os x. thanks for helping us make firefox better! original document in
formation author(s): mike connor last updated date: december 4, 2004 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
NSPR Poll Method
when the underlying network transport is readable if new_flags contains pr_poll_write, you should try pr_recv or pr_send when the underlying network transport is writable important do not use out_flags in any way other than testing if (new_flags & out_flags) is 0. this is how pr_poll (the primary user and hence the de facto specification of the poll method) uses out_flags. original document in
formation author: wan teh chang last updated date: june 27, 2006 ...
NSPR build instructions
s. if the os vendor provides a compiler (for example, sun and hp), nspr uses that compiler instead of gcc by default. nspr build generates a debug build by default. --disable-debug --enable-optimize specify these two options to generate an optimized (release) build. these two options can actually be used independently, but it's not recommended. --enable-64bit on a dual 32-bit/64-bit plat
form, nspr build generates a 32-bit build by default. to generate a 64-bit build, specify the --enable-64bit configure option. --target=x86_64-pc-mingw32 for 64-bit builds on windows, when using the mozillabuild environment. --enable-win32-target=win95 this option is only used on windows. nspr build generates a "winnt" configuration by default on windows for historical reasons. we recommend most a...
NSPR's Position On Abrupt Thread Termination
benefit. threads are an implementation strategy to provide the illusion of concurrency within a process. they are alternatives to large state machines with mostly non-blocking library functions. when the latter is used to provide concurrency, calling exit() will terminate the entire process. why would anyone expect a thread to behave differently? threads are not processes. original document in
formation author: alan o. freier last updated date: december 1998 ...
Anonymous Shared Memory
filemap type. the anonymous file-mapped shared memory provides an inheritable shared memory, as in: the child process inherits the shared memory. compare the file-mapped anonymous shared memory to to a named shared memory described in prshm.h. the intent is to provide a shared memory that is accessbile only by parent and child processes. ... it's a security thing. depending on the underlying plat
form, the file-mapped shared memory may be backed by a file. ... surprise! ... on some plat
forms, no real file backs the shared memory. on plat
forms where the shared memory is backed by a file, the file's name in the filesystem is visible to other processes for only the duration of the creation of the file, hopefully a very short time. this restricts processes that do not inherit the shared memory fro...
Atomic Operations
this chapter describes the global functions you use to per
form atomic operations. the functions define a portable api that may be reliably used in any environment. since not all operating environments provide access to such functions, their per
formance may vary considerably. atomic operations functions the api defined for the atomic functions is consistent across all supported plat
forms. however, the implementation may vary greatly, and hence the per
formance. on systems that do not provide direct access to atomic operators, nspr emulates the capabilities by using its own locking mechanisms. for such systems, nspr per
forms atomic operations just as efficiently as the client could. therefore, to preserve portability, it is recommended that clients use the nspr api for atomic operations. thes...
Condition Variables
he protection of the monitor. a call to pr_waitcondvar causes a thread to block until a specified condition variable receives notification of a change of state in its associated monitored data. other threads may notify the condition variable when changes occur. for an introduction to nspr thread synchronization, including locks and condition variables, see introduction to nspr. for reference in
formation on nspr locks, see locks. 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. for in
formation about prmonitor, see monitors. condition variable type prcondvar condition variable functions p...
IPC Semaphores
this chapter describes the nspr api for using interprocess communication semaphores. nspr provides an interprocess communication mechanism using a counting semaphore model similar to that which is provided in unix and windows plat
forms. note: see also named shared memory ipc semaphore functions ipc semaphore functions pr_opensemaphore pr_waitsemaphore pr_postsemaphore pr_closesemaphore pr_deletesemaphore ...
Locks
sed in java programming. in addition to prlock, nspr provides another mutex type, prmonitor, which is reentrant and can have only one associated condition variable. prmonitor is intended for use with java and reflects the java approach to thread synchronization. for an introduction to nspr thread synchronization, including locks and condition variables, see introduction to nspr. for reference in
formation on nspr condition variables, see condition variables. lock type prlock lock functions pr_newlock creates a new lock object. pr_destroylock destroys a specified lock object. pr_lock locks a specified lock object. pr_unlock unlocks a specified lock object. ...
Memory Management Operations
nspr provides heap-based memory management functions that map to the familiar malloc(), calloc(), realloc(), and free(). memory allocation functions memory allocation macros memory allocation functions nspr has its own heap, and these functions act on that heap. libraries built on top of nspr, such as the netscape security libraries, use these functions to allocate and free memory. if you are allocating memory for use by such libraries or freeing memory that was allocated by such libraries, you must use these nspr functions rather than the libc equivalents. ...
NSPR LOG MODULES
rolling nspr's log service at execution time. these controls should be set in the nspr_log_modules environment variable at execution time to affect nspr's log service for your application. all the name all enables all log modules. to enable all log module calls to pr_log, set the variable as follows: set nspr_log_modules=all:5 timestamp including timestamp results in a timestamp of the
form "2015-01-15 21:24:26.049906 utc - " prefixing every logged line. append including append results in log entries being appended to the existing contents of the file referenced by nspr_log_file. if not specified, the existing contents of nspr_log_file will be lost as a new file is created with the same filename. sync the name sync enables unbuffered logging. this ensures that all log messages ...
PRCallOnceFN
defines the signature of the function a client must implement. syntax #include <prinit.h> typedef prstatus (pr_callback *prcalloncefn)(void); description the function is called to per
form the initialization desired. the function is expected to return a prstatus indicating the outcome of the process. ...
PRFileInfo
file in
formation structure used with pr_getfileinfo and pr_getopenfileinfo. syntax #include <prio.h> struct prfileinfo { prfiletype type; pruint32 size; prtime creationtime; prtime modifytime; }; typedef struct prfileinfo prfileinfo; fields the structure has the following fields: type type of file. see prfiletype. size size, in bytes, of file's contents. creationtime creation time per definition of prtime. see prtime.h. modifytime last modification time per definition of prtime. see prtime.h. description the prfileinfo structure provides in
formation about a file, a directory, or some other kind of file system object, as specified by the type field. ...
PRFileInfo64
file in
formation structure used with pr_getfileinfo64 and pr_getopenfileinfo64. syntax #include <prio.h> struct prfileinfo64 { prfiletype type; pruint64 size; prtime creationtime; prtime modifytime; }; typedef struct prfileinfo64 prfileinfo64; fields the structure has the following fields: type type of file. see prfiletype. size 64-bit size, in bytes, of file's contents. creationtime creation time per definition of prtime. see prtime.h. modifytime last modification time per definition of prtime. see prtime.h. description the prfileinfo64 structure provides in
formation about a file, a directory, or some other kind of file system object, as specified by the type field. ...
PRFileType
type for enumerators used in the type field of the prfileinfo and prfileinfo64 structures. syntax #include <prio.h> typedef enum prfiletype{ pr_file_file = 1, pr_file_directory = 2, pr_file_other = 3 } prfiletype; enumerators the enumeration has the following enumerators: pr_file_file the in
formation in the structure describes a file. pr_file_directory the in
formation in the structure describes a directory. pr_file_other the in
formation in the structure describes some other kind of file system object. ...
PRHostEnt
of the network address functions. all addresses are passed in host order and returned in network order (suitable for use in system calls). use the network address functions to manipulate the prhostent structure. to make the transition to ip version 6 easier, it's best to treat prhostent as an opaque structure. note winsock.h defines h_addrtype and h_length as a 16-bit field, whereas other plat
forms treat it as a 32-bit field. the #ifdef in the structure allows direct assignment of the prhostent structure. ...
PRInt16
guaranteed to be a signed 16-bit integer on all plat
forms. syntax #include <prtypes.h> typedefdefinition print16; ...
PRInt32
guaranteed to be a signed 32-bit integer on all plat
forms. syntax #include <prtypes.h> typedefdefinition print32; description may be defined as an int or a long, depending on the plat
form. for syntax details for each plat
form, see prtypes.h. ...
PRInt64
guaranteed to be a signed 64-bit integer on all plat
forms. syntax #include <prtypes.h> typedef definition print64; description may be defined in several different ways, depending on the plat
form. for syntax details for each plat
form, see prtypes.h. ...
PRInt8
guaranteed to be a signed 8-bit integer on all plat
forms. syntax #include <prtypes.h> typedef definition print8; ...
PR_Connect
a prfiledesc object representing a socket. addr a pointer to the address of the peer to which the socket is to be connected. timeout a value of type printervaltime specifying the time limit for completion of the connect operation. returns the function returns one of the following values: upon successful completion of connection setup, pr_success. if unsuccessful, pr_failure. further in
formation can be obtained by calling pr_geterror. description pr_connect is usually invoked on a tcp socket, but it may also be invoked on a udp socket. both cases are discussed here. if the socket is a tcp socket, pr_connect establishes a tcp connection to the peer. if the socket is not bound, it will be bound to an arbitrary local address. pr_connect blocks until either the connection is succes...
PR_CreateThread
alid until the thread returns from its root function. if unsuccessful, (for example, if system resources are unavailable), null. description if you want the thread to start up waiting for the creator to do something, enter a lock before creating the thread and then have the thread's root function enter and exit the same lock. when you are ready for the thread to run, exit the lock. for more in
formation on locks and thread synchronization, see introduction to nspr. if you want to detect the completion of the created thread, make it joinable. you can then use pr_jointhread to synchronize the termination of another thread. ...
PR_EXTERN
used to define the prototypes for functions or variables that are to be exported from a shared library. syntax #include <prtypes.h> pr_extern(type)prototype description pr_extern is used to define externally visible routines and globals. for syntax details for each plat
form, see prtypes.h. the macro includes the proper specifications to declare the target extern and set up other required linkages. warning: some plat
forms do not allow the use of the underscore character (_) as the first character of an exported symbol. ...
PR_ExplodeTime
params a time parameter callback function. exploded a pointer to a location where the converted time can be stored. this location must be preallocated by the caller. ...
PR_GMTParameters
note: since this function requires gmt as input, its primary use is as "filler" for cases in which you need a do-nothing callback. syntax #include <prtime.h> prtimeparameters pr_gmtparameters ( const prexplodedtime *gmt); parameter gmt a pointer to the clock/calendar time whose offsets are to be determined. this time should be specified in gmt. returns a time parameters structure that expresses the time zone offsets at the specified time. description this is a frequently-used time parameter callback function. you don't normally call it directly; instead, you pass it as a parameter to pr_explodetime() or pr_normalizetime(). ...
PR_GetError
syntax #include <prerror.h> prerrorcode pr_geterror(void) returns the value returned is a 32-bit number. nspr provides no direct interpretation of the number's value. ...
PR_GetHostByAddr
tdb_buf_size bytes. hostentry this structure is allocated by the caller. on output, this structure is filled in by the runtime if the function returns pr_success. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. you can retrieve the reason for the failure by calling pr_geterror. description pr_gethostbyaddr is used to per
form reverse lookups of network addresses. that is, given a valid network address (of type prnetaddr), pr_gethostbyaddr discovers the address' primary name, any aliases, and any other network addresses for the same host. ...
PR_GetOSError
returns the current thread's last set os-specific error code. syntax #include <prerror.h> print32 pr_getoserror(void) returns the value returned is a 32-bit signed number. its interpretation is left to the caller. description used for plat
form-specific code that requires the underlying os error. for portability, clients should not create dependencies on the values of os-specific error codes. however, this in
formation is preserved, along with a plat
form neutral error code, on a per thread basis. it is most useful during development. ...
PR_GetRandomNoise
upplied buffer to contain the generated random number. buf must be at least as large as specified in size. size the size, in bytes, of the requested random number. returns prsize value equal to the size of the random number actually generated, or zero. the generated size may be less than the size requested. a return value of zero means that pr_getrandomnoise is not implemented on this plat
form, or there is no available noise to be returned at the time of the call. description pr_getrandomnoise provides a random value, depending on plat
form. the length of the random value is dependent on the plat
form and its ability to provide a random value at that moment. pr_getrandomnoise is intended to provide a "seed" value for a another random number generator that may be suitable for cryptogra...
PR_IMPLEMENT
used to define implementations of symbols that are to be exported from a shared library. syntax #include <prtypes.h> pr_implement(type)implementation description pr_implement is used to define implementations of externally visible routines and globals. for syntax details for each plat
form, see prtypes.h. warning: some plat
forms do not allow the use of the underscore character (_) as the first character of an exported symbol. ...
PR_Interrupt
nclude <prthread.h> prstatus pr_interrupt(prthread *thread); parameter pr_interrupt has the following parameter: thread the thread whose interrupt request you want to set. returns the function returns one of the following values: if the specified thread is currently blocked, pr_success. otherwise, pr_failure. description the purpose of pr_interrupt is to request that a thread per
forming some task stop what it is doing and return to some control point. it is assumed that a control point has been mutually arranged between the thread doing the interrupting and the thread being interrupted. when the interrupted thread reaches the prearranged point, it can communicate with its peer to discover the real reason behind the change in plans. the interrupt request remains in the thread...
PR_LOG
a level value. possible values are: pr_log_none = 0 pr_log_always = 1 pr_log_error = 2 pr_log_warning = 3 pr_log_debug = 4 pr_log_notice = pr_log_debug pr_log_warn = pr_log_warning pr_log_min = pr_log_debug pr_log_max = pr_log_debug _args a variable length argument list, as if to printf. returns nothing description this macro
formats the specified arguments and writes the output to the log file, if logging is enabled for the specified module and level. for a description of
formatting and
format strings, see "
formatted printing". for an example of using conditional logging, see use example. this macro compiles to nothing if compile-time options are not specified to enable logging. ...
PR_Listen
g); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing a socket that will be used to listen for new connections. backlog the maximum length of the queue of pending connections. returns the function returns one of the following values: upon successful completion of listen request, pr_success. if unsuccessful, pr_failure. further in
formation can be obtained by calling pr_geterror. description pr_listen turns the specified socket into a rendezvous socket. it creates a queue for pending connections and starts to listen for connection requests on the socket. the maximum size of the queue for pending connections is specified by the backlog parameter. pending connections may be accepted by calling pr_accept. ...
PR_LoadLibrary
returns if successful, returns a reference to an opaque prlibrary object. if the operation fails, returns null. use pr_geterror to find the reason for the failure. description this function loads and returns a reference to the specified library. the returned reference becomes the library's identity. ...
PR_LocalTimeParameters
syntax #include <prtime.h> prtimeparameters pr_localtimeparameters ( const prexplodedtime *gmt); parameter gmt a pointer to the clock/calendar time whose offsets are to be determined. this time should be specified in gmt. returns a time parameters structure that expresses the time zone offsets at the specified time. description this is a frequently-used time parameter callback function. ...
PR_LogPrint
writes an entry to the log. syntax #include <prlog.h> void pr_logprint(const char *fmt, ...); parameters the function has this parameter: fmt the string that is used as the
formatting specification. returns nothing description this function unconditionally writes a message to the log using the specified
format string. for a description of
formatting and
format strings, see "
formatted printing". ...
PR_MicrosecondsToInterval
converts standard clock microseconds to plat
form-dependent intervals. syntax #include <prinrval.h> printervaltime pr_microsecondstointerval(pruint32 milli); parameter the function has the following parameter: micro the number of microseconds to convert to interval
form. returns plat
form-dependent equivalent of the value passed in the micro parameter. ...
PR_MillisecondsToInterval
converts standard clock milliseconds to plat
form-dependent intervals. syntax #include <prinrval.h> printervaltime pr_millisecondstointerval(pruint32 milli); parameter the function has the following parameter: milli the number of milliseconds to convert to interval
form. returns plat
form-dependent equivalent of the value passed in the milli parameter. ...
PR_MkDir
intn mode); parameters the function has the following parameters: name the name of the directory to be created. all the path components up to but not including the leaf component must already exist. mode the access permission bits of the file mode of the new directory if the file is created when pr_create_file is on. caveat: the mode parameter is currently applicable only on unix plat
forms. it may be applicable to other plat
forms in the future. possible values include the following: 00400. read by owner. 00200. write by owner. 00100. search by owner. 00040. read by group. 00020. write by group. 00010. search by group. 00004. read by others. 00002. write by others. 00001. search by others. returns if successful, pr_success. if unsuccessful, pr_failure. the act...
PR_NormalizeTime
adjusts the fields of a clock/calendar time to their proper ranges, using a callback function. syntax #include <prtime.h> void pr_normalizetime ( prexplodedtime *time, prtimeparamfn params); parameters the function has these parameters: time a pointer to a clock/calendar time in the prexplodedtime
format. params a time parameter callback function. returns nothing; the time parameter is altered by the callback function. description this function adjusts the fields of the specified time structure using the specified time parameter callback function, so that they are in the proper range. call this function in these situations: to normalize a time after per
forming arithmetic operations directly on the field values of the calendar time object. for example, if you have a ] ...
PR_Notify
ructure of type prmonitor. the monitor object referenced must be one for which the calling thread currently holds the lock. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. description notification of a monitor signals the change of state of some monitored data. the changing of that data and the notification must all be per
formed while in the monitor. when the notification occurs, the runtime promotes a thread that is waiting on the monitor to a ready state. if more than one thread is waiting, the selection of which thread gets promoted cannot be determined in advance. this implies that all threads waiting on a single monitor must have the same semantics. if no thread is waiting on the monitor, the notify operation is a...
PR_Open
ally updated. pr_excl 0x80 with pr_create_file, if the file does not exist, the file is created. if the file already exists, no action and null is returned. mode when pr_create_file flag is set and the file is created, these flags define the access permission bits of the newly created file. this feature is currently only applicable on unix plat
forms. it is ignored by any other plat
form but it may apply to other plat
forms in the future. possible values of the mode parameter are listed in the table below. name value description pr_irwxu 0700 read, write, execute/search by owner. pr_irusr 0400 read permission, owner. pr_iwusr 0200 write permission, owner. ...
PR_OpenAnonFileMap
emapprotect prot ); parameters the function has the following parameters: dirname a pointer to a directory name that will contain the anonymous file. size the size of the shared memory. prot how the shared memory is mapped. returns pointer to prfilemap or null on error. description if the shared memory already exists, a handle is returned to that shared memory object. on unix plat
forms, pr_openanonfilemap uses dirname as a directory name, without the trailing '/', to contain the anonymous file. a filename is generated for the name. on windows plat
forms, dirname is ignored. ...
PR_Poll
ags; }; typedef struct prpolldesc prpolldesc; the structure has the following fields: fd a pointer to a prfiledesc object representing a socket or a pollable event. this field can be set to null to indicate to pr_poll that this prfiledesc object should be ignored. on unix, the fd field can be set to a pointer to any prfiledesc object, including one representing a file or a pipe. cross-plat
form applications should only set the fd field to a pointer to a prfiledesc object representing a socket or a pollable event because on windows the select function can only be used with sockets. in_flags a bitwise or of the following bit flags: pr_poll_read: fd is readable. pr_poll_write: fd is writable. pr_poll_except: fd has an exception condition. out_flags a bitwise or of the follow...
PR_PushIOLayer
ect for the layer on the stack above which the new layer is to be added. layer a pointer to a prfiledesc object representing the new layer to be added to the stack. returns the function returns one of the following values: if the layer is successfully pushed onto the stack, pr_success. if the layer is not successfully pushed onto the stack, pr_failure. use pr_geterror to get additional in
formation regarding the reason for the failure. description a file descriptor for a layer (possibly allocated using pr_createiolayerstub) may be pushed onto an existing stack of file descriptors at any time. the new layer is inserted into the stack just above the layer with the identity specified by id. even if the id parameter indicates the topmost layer of the stack, the value of the file descri...
PR_ReadDir
irectory. flags specifies which directory entries, if any, to skip. values can include the following: pr_skip_none. do not skip any files. pr_skip_dot. skip the directory entry "." representing the current directory. pr_skip_dot_dot. skip the directory entry ".." representing the parent directory. pr_skip_both. skip both "." and ".." pr_skip_hidden. skip hidden files. on windows plat
forms and the mac os, this value identifies files with the "hidden" attribute set. on unix plat
form, this value identifies files whose names begin with a period ("."). returns a pointer to the next entry in the directory. if the end of the directory is reached or an error occurs, null. the reason can be retrieved via pr_geterror. description pr_readdir returns a pointer to a directory ent...
PR_SecondsToInterval
converts standard clock seconds to plat
form-dependent intervals. syntax #include <prinrval.h> printervaltime pr_secondstointerval(pruint32 seconds); parameter the function has the following parameter: seconds the number of seconds to convert to interval
form. returns plat
form-dependent equivalent of the value passed in the seconds parameter. ...
PR_Shutdown
n the socket. possible values include the following: pr_shutdown_rcv. further receives will be disallowed. pr_shutdown_send. further sends will be disallowed. pr_shutdown_both. further sends and receives will be disallowed. returns the function returns one of the following values: upon successful completion of shutdown request, pr_success. if unsuccessful, pr_failure. further in
formation can be obtained by calling pr_geterror. description the prshutdownhow enumeration is defined as follows: typedef enum prshutdownhow{ pr_shutdown_rcv = 0, pr_shutdown_send = 1, pr_shutdown_both = 2 } prshutdownhow; ...
PR_StringToNetAddr
ul, pr_failure. you can retrieve the reason for the failure by calling pr_geterror. description for ipv4 addresses, the input string represents numbers in the internet standard "." notation. ipv6 addresses are indicated as strings using ":" characters separating octets, with numerous caveats for shortcutting (see rfc #1884). if the nspr library and the host are configured to support ipv6, both
formats are supported. otherwise, use of anything other than ipv4 dotted notation results in an error. ...
PR_TicksPerSecond
returns the number of ticks per second currently used to determine the value of printervaltime. syntax #include <prinrval.h> pruint32 pr_tickspersecond(void); returns an integer between 1000 and 100000 indicating the number of ticks per second counted by printervaltime on the current plat
form. this value is plat
form-dependent and does not change after nspr is initialized. description the value returned by pr_tickspersecond() lies between pr_interval_min and pr_interval_max. the relationship between a printervaltime tick and standard clock units is plat
form-dependent. pr_pr_tickspersecond() allows you to discover exactly what that relationship is. seconds per tick (the inverse of pr_pr_tickspersecond()) is always between 10 microseconds and 1 millisecond. ...
NSS Tools cmsutil
syntax to run cmsutil, type the command cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section. each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options specify an action. option arguments modify an action. ...
NSS Tools dbck-tasks
this file could be mailed to a mail alias to assist in finding the source of database corruption. ...
NSS Tools sslstrength
sslstrength summary a simple command-line client which connects to an ssl-server, and reports back the encryption cipher and strength used. synopsis 1) sslstrength ciphers 2) sslstrength hostname[:port] [ciphers=xyz] [debug] [verbose] [policy=export|domestic] description the first
form simple lists out the possible ciphers. the letter in the first column of the output is used to identify the cipher preferences in the ciphers= command. the second
form attempts to connect to the named ssl host. the hostname argument must be present. however, the port number is an optional argument, and if not given, will default to the https port (443). restricting ciphers by default, sslstrength assumes that all the preferences are on, so it will use any preferences in your policy. the enabled ciphersu...
Necko
this api is used in many mozilla-based client applications (including firefox) and can be used for writing other networking clients. currently the library is built as part of the mozilla distribution. you can get the whole distribution as described in the build documentation. eventually we'd like to move to a binary distribution mechanism for the networking library so that you can build your application that uses this library without having to build mozilla. ...
Renaming With Pork
opies of the source(analysis and test). this isn't strictly required, but will save time. 2. the first copy will be an analysis copy. convince gcc to create annotated .ii files while compiling the analysis copy. typically, make cxxflags="-wp,-k,-w0 -save-temps" will work. note the -k,-w0 options are passed down to the mcpp preprocessor such that it can annotate files with more precise position in
formation. in order for this to work mcpp has to be integrated into your compiler as described in the pork installation instructions 3. in the analysis copy make a list of files to process. use absolute paths. find `pwd` -name \*.ii > /tmp/ls.txt 4. run renamer through pork-barrel. this makes it easier to refer to any diagnostics touch /tmp/err.txt tail -f /tmp/err.txt & ~/work/pork-barrel/pork-b...
Pork Tool Development
hen using mcpp (see installing pork). for the rename_class.cpp test, generate the file with "gcc -e -wp,-w0,-k rename_class.cpp > rename_class.cc" and run the renamer with "../renamer -rename foo bar rename_class.cc". for terminology, suppose "my_foo" --> "foo". then any post-location variables refer to "foo" and pre-location variables refer to "my_foo". cppsourceloc wraps sourceloc, providing in
formation about macro expansion. cppsourceloc will change the previously provided location in
formation (in variable cpp_source_loc._loc) from post-location to pre-location. all values from the ast refer to the post-location. notes the #static channel on irc.mozilla.org is for discussion of pork, dehydra, and other static analysis tools. ...
Pork Tools
outparamdel outparamdel converts functions to return via return value instead of an outparam. it takes a list of functions as input and rewrites the definition and call sites of those functions. <caption>rewrites per
formed</caption> nsresult getter(nsifoo **aresult) { *aresult = ... if (!*aresult) return ns_error_failure; return ns_ok; } nsifoo* getter() { nsifoo *result = null; // aresult below is kept for complicated cases // typically it wont be needed and can be removed nsifoo **aresult = &result; // *aresult patterns are replaced with result result = ... if (result) return nsnull; // error returns are changed to nsnull //instead ns_ok, actual result is returned return result; } caller1 { //case 1 nsresult rv; rv = getter(&var); ns_...
Rhino and BSF
iginally developed by ibm and now published as open source as a project at the apache software foundation. it provides a framework for using a number of scripting languages with java. rhino is one of the supported languages. this framework has been embedded in a number of open source projects, including the xsl processor xalan and the xml/java build tool ant. see xalan-java extensions for more in
formation on adding javascript to xsl and the description of the optional script task in the apache ant manual for using scripting in ant build files. using bsf with rhino now that the apache jakarta bean scripting framework (bsf), version 2.4.0, has been officially released, you can use rhino easily with bsf. see http://commons.apache.org/proper/commons-bsf/index.html. ...
Tutorial: Embedding Rhino
ipt from a shell command line: $ java runscript "math.cos(math.pi)" -1 $ java runscript "function f(x){return x+1} f(7)" 8 note that you'll have to have both the rhino classes and the runscript example class file in the classpath. let's step through the body of main one line at time. entering a context the code context cx = context.enter(); creates and enters a context. a context stores in
formation about the execution environment of a script. initializing standard objects the code scriptable scope = cx.initstandardobjects(); initializes the standard objects (object, function, etc.) this must be done before scripts can be executed. the null parameter tells initstandardobjects to create and return a scope object that we use in later calls. collecting the arguments this code is sta...
Rhino Examples
ractively while the shell is running. primitivewrapfactory primitivewrapfactory.java is an example of a wrapfactory that can be used to control the wrapping behavior of the rhino engine on calls to java methods. multithreaded script execution dynamicscopes.java is a program that creates a single global scope object and then shares it across multiple threads. sharing the global scope allows both in
formation to be shared across threads, and amortizes the cost of context.initstandardobjects by only per
forming that expensive operation once. implementing host objects first check out the tutorial if you haven't already. the foo class - extending scriptableobject foo.java is a simple javascript host object that includes a property with an associated action and a variable argument method. the matrix c...
Rhino history
ed the axe (rumor had it that the executives "forgot" it existed). for a time, a couple of major companies (including sun) licensed rhino for use in their products and paid netscape to do so, allowing work on rhino to continue. now rhino is part of mozilla's open-source repository. originally, rhino compiled all javascript code to java bytecodes in generated classfiles. this produced the best per
formance (often beating the c implementation of javascript when run on a jit), but suffered from two faults. first, compilation time was long since generating java bytecodes and loading the generated classes was a heavyweight process. also, the implementation effectively leaked memory since most jvms don't really collect unused classes or the strings that are interned as a result of loading a class fi...
Rhino serialization
mpiled to a java class, but that class is then made available in the classpath so serialization works. this isn't that interesting an example since compiling a function to a class and then loading it accomplishes the same as serializing an interpreted function, but it becomes more relevant if you wish to serialize javascript objects that have references to compiled functions. original document in
formation author: norris boyd last updated date: november 15, 2006 copyright in
formation: portions of this content are © 1998–2006 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Rhino
rhino is an open-source implementation of javascript written entirely in java. it is typically embedded into java applications to provide scripting to end users. it is embedded in j2se 6 as the default java scripting engine. rhino downloads how to get source and binaries. rhino documentation in
formation on rhino for script writers and embedders. rhino help some resources if you get stuck. ...
SpiderMonkey compartments
sed to create multiple javascript memory heaps, which avoids having one heap for all javascript objects. each compartment is a separate javascript heap. in previous versions of spidermonkey, the garbage collector would walk the entire heap of all javascript objects when garbage collection was needed. with compartments, garbage collection can run per compartment. this can result in significant per
formance improvements in some applications. an object in one compartment cannot touch an object in another compartment, except through a cross-compartment wrapper. compartment example the firefox browser embeds spidermonkey. in firefox 4 and above, compartments are used and all javascript objects that belong to a certain origin (such as "http://mail.google.com/" or "http://www.bank.com/") are place...
JS_SaveExceptionState
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ...
JS_SetContextCallback
js_newcontext successfully created a new jscontext instance. the callback can initialize the instance as required. if the callback returns js_false, the instance will be destroyed and js_newcontext returns null. in this case the callback is not called again. jscontext_destroy one of js_destroycontext, js_destroycontextnogc, or js_destroycontextmaybegc was called. the callback may per
form its own cleanup and must always return true. in a debug build, if the callback returns false, the js engine will halt with an assertion. description js_setcontextcallback specifies a callback function that is automatically called when jscontexts are created or destroyed. only one callback function may be specified per js runtime. this function returns the previous context callback, if any, ...
JS_SetDefaultLocale
ntax bool js_setdefaultlocale(jsruntime *rt, const char *locale); void js_resetdefaultlocale(jsruntime *rt); name type description rt jsruntime * pointer to a js runtime locale const char * string represents locale. description js_setdefaultlocale sets the default locale for the ecmascript internationalization api (intl.collator, intl.number
format, intl.datetime
format). note that the internationalization api encourages clients to specify their own locales. the locale string remains owned by the caller. js_resetdefaultlocale resets the default locale to os defaults. see also mxr id search for js_setdefaultlocale mxr id search for js_resetdefaultlocale bug 769872 ...
JS_SetErrorReporter
sed a jserrorreport structure when an error occurs and has been parsed by js_reporterror. js_seterrorreporter js_geterrorreporter returns the value set by js_seterrorreporter. typically, the error reporting mechanism you define should log the error where appropriate (such as to a log file), and display an error to the user of your application. the error you log and display can make use of the in
formation passed about the error condition in the jserrorreport structure. the error reporter callback must not reenter the jsapi. like all other spidermonkey callbacks, the error reporter callback must not throw a c++ exception. note that js_seterrorreporter has no facility to directly pass a user data pointer to the error reporting function. you can work around this by using the js_setruntimepriva...
JS_SetFunctionCallback
wsers, its use is discouraged since it could be removed at any time. try to avoid using it. sets a callback to be run whenever a javascript function is invoked or exited. this lets you trace the execution of code, and is particularly useful for javascript tracers and profilers since it works across all run modes (interpreter, method jit, trace jit). using this function may have a significant per
formance impact. see function tracing for an example. note: this method is only available if moz_trace_jscalls was defined at compile time using --enable-trace-jscalls. syntax void js_setfunctioncallback(jscontext *cx, jsfunctioncallback fcb); name type description cx jscontext * pointer to a js context from which to derive runtime in
formation. requires request. in ...
JS_SetGCCallback
y happening on another thread). in a js_threadsafe build, a jsgc_begin callback can happen on one thread before or while a jsgc_end callback for the previous gc cycle runs on another thread. in a js_threadsafe build, the jsgc_end callback is called after each stop-the-world rendezvous during which one or more garbage collection cycles finished. the callback executes on the same thread that per
formed gc, after the gc lock has been released. other threads may be running in active requests. see also mxr id search for js_setgccallback js_setfinalizecallback bug 723286 ...
JS_SetGCParametersBasedOnAvailableMemory
syntax void js_setgcparametersbasedonavailablememory(jsruntime *rt, uint32_t availmem); name type description rt jsruntime * the runtime to configure. value uint32_t the value of available memory in megabytes. description js_setgcparametersbasedonavailablememory adjusts the parameters of the garbage collection based on available memory. see bug 950044 for details. ...
JS_SetNativeStackQuota
bytes for untrusted script. if omitted, it uses the value of trustedscriptstacksize. added in spidermonkey 31 description js_setnativestackquota sets the size of the native stack that should not be exceeded. to disable stack size checking, pass 0. spidermonkey allows for a distinction between system code (such as gcs, which may incidentally be triggered by script but are not strictly per
formed on behalf of such script), trusted script (as determined by js_settrustedprincipals), and untrusted script. each kind of code may have a different stack quota, allowing embedders to keep higher-priority machinery running in the face of scripted stack exhaustion by something else. the stack quotas for each kind of code should be monotonically descending, and may be specified with this function.
JS_SetParent
feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. sets the parent for an object. syntax bool js_setparent(jscontext *cx, js::handleobject obj, js::handleobject parent); name type description cx jscontext * pointer to a js context from which to derive runtime in
formation. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject pointer to the object for which to set the parent. this must be an object that has not yet been exposed to script. see the description for details. parent js::handleobject pointer to the parent object to use. description js_setparent sets ...
JS_SetPendingException
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue value to throw as an exception. description js_setpendingexception sets the current exception being thrown within a context. ...
JS_SetVersion
lthough it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. configure a jscontext to use a specific version of the javascript language. syntax jsversion js_setversion(jscontext *cx, jsversion version); name type description cx jscontext * pointer to a js context from which to derive runtime in
formation. version jsversion version of javascript to set context to. description js_setversion attempts to set the version of javascript to version for a specified executable script context, cx. the version comes from the jsversion enumerated type. js_setversion returns the js version in effect for the context before you changed it. see also mxr id search for js_setversion jsv...
JS_StrictlyEqual
are equal in the sense of the === operator. syntax // added in spidermonkey 45 bool js_strictlyequal(jscontext *cx, js::handle<js::value> v1, js::handle<js::value> v2, bool *equal); // obsolete since jsapi 39 bool js_strictlyequal(jscontext *cx, jsval v1, jsval v2, bool *equal); name type description cx jscontext * the context in which to per
form the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v1, v2 js::handle<js::value> / jsval the value to compare. equal bool * out parameter. receives the comparison result. description js_strictlyequal determines if v1 is strictly equal to v2 under the javascript === operator, as specified in ecma...
JS_TypeOfValue
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handle<js::value> the value to examine. description js_typeofvalue examines a specified js value, v, and returns its js data type. ...
JS_ValueToBoolean
feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. replaced by js::toboolean convert any javascript value to a boolean value. syntax jsbool js_valuetoboolean(jscontext *cx, jsval v, jsbool *bp); name type description cx jscontext * the context in which to per
form the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the value to convert. bp jsbool * out parameter. on success, *bp receives the converted boolean value. description js_valuetoboolean converts a specified javascript value, v, to a boolean value. it implements the toboolean operator specified ...
JS_ValueToECMAInt32
oid using it. 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 per
form the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the javascript value to convert. ip int32 * or uint32 * or int16 * out parameter. on success, *ip receives the converted value. description js_valuetoecmaint32, js_valuetoecmauint32, and js_valuetouint16 convert a javascript value to various ...
JS_ValueToInt32
bsolete since jsapi 28this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. convert a javascript value to a 32-bit signed integer. syntax jsbool js_valuetoint32(jscontext *cx, jsval v, int32 *ip); name type description cx jscontext * the context in which to per
form the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the value to convert. ip int32 * out parameter. on success, *ip receives the converted integer value. description js_valuetoint32 converts a specified js value, v, to a 32-bit signed integer (-2147483648 to 2147483647). first it converts v to...
JS_ValueToNumber
ough it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. replaced by js::tonumber. 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 per
form the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the value to convert. dp jsdouble * out parameter. on success, *dp receives the converted floating-point value. description js_valuetonumber converts a javascript value to a number. it implements the tonumber operator described in ecma 262-3 ...
JS_ValueToSource
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handle<js::value> the value to convert. description js_valuetosource converts a specified javascript value, v, to a javascript source. ...
JS_YieldRequest
nt jsapi request, allowing garbage collection to run if another thread has requested it. syntax void js_yieldrequest(jscontext *cx); name type description cx jscontext * the jscontext that is currently in a request on the calling thread. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. description for more in
formation about thread safety and requests, see js_threadsafe. js_yieldrequest momentarily suspends the current request. a program can call this function periodically to ensure that a long-running request does not block garbage collection indefinitely. the effect is the same as a call to js_suspendrequest immediately followed by a call to js_resumerequest. jsapi 1.7 and earlier js_yieldrequest did ...
JS_freeop
17 a wrapper for js_free. syntax void js_freeop(jsfreeop *fop, void *p); name type description fop jsfreeop * a pointer to jsfreeop structure to be used to get the implementation of free. p void * a pointer to the allocated memory to be freed. description js_freeop is a wrapper for js_free(p) that may delay js_free(p) invocation as a per
formance optimization as specified by the given jsfreeop instance. see also mxr id search for js_freeop jsfreeop js_free bug 737365 ...
Property attributes
ack that will need to go away in bug 1105518. added in spidermonkey 38 mxr id search for jsprop_redefine_nonconfigurable jsprop_resolving resolve hooks and enumerate hooks must pass this flag when calling js_define* apis to reify lazily-defined properties. jsprop_resolving is used only with property-defining apis. it tells the engine to skip the resolve hook when per
forming the lookup at the beginning of property definition. this keeps the resolve hook from accidentally triggering itself: unchecked recursion. for enumerate hooks, triggering the resolve hook would be merely silly, not fatal, except in some cases involving non-configurable properties. added in spidermonkey 45 mxr id search for jsprop_resolving jsprop_ignore_enumerate ...
jsdouble
oating-point number type. it is defined to be a 64-bit, ieee 754 compliant type. see ecma 262-3 §8.5. arithmetic on jsdouble values in c should behave exactly like the floating-point arithmetic in javascript, except that c and javascript may treat not-a-number values differently. implementation note: spidermonkey has had several bugs involving details of floating-point arithmetic on various plat
forms. controlling the behavior of floating-point arithmetic is very architecture- and system-specific, and can be hard to get right. help in the
form of test cases, commentary, and patches is always appreciated. ...
jsint
s are still provides in js/public/legacyinttypes.h, // but should not use them. typedef ... int8; typedef ... uint8; typedef ... int16; typedef ... uint16; typedef ... int32; typedef ... uint32; typedef ... int64; typedef ... uint64; description jsint and jsuint are 32-bit integer types. jsword and jsuword are pointer-sized integer types. intn and uintn are integer types the same size as the plat
form's native int type. see also bug 714728 - removes jsword/jsuword bug 730511 - removes intn/uintn bug 732306 - removes jsint bug 733260 - removes jsuint bug 708735 - deprecates {u,}int{8,16,32,64} ...
Profiling SpiderMonkey
duces its own shared library, even in libxul and static builds. make -c my-obj-dir/js/src other ways to profile for linux, there are global jprof functions available. see the documentation on the --enable-jprof mozconfig option. we're working to add support for other profilers, such as oprofile, intel vtune, and callgrind. when we have js scriptable profiling options available for all tier 1 plat
forms, we'll look at adding global start/stop profiling functions. if you'd like to profile something at a higher level of detail than the js shark functions allow, there are corresponding c functions available at the bottom of jsdbgapi.h. costs of thread safety currently, threadsafe spidermonkey costs us 10-15% on some benchmarks vs. a non-threadsafe js shell. if you're looking to investigate that, b...
SpiderMonkey 1.8
rce-compatible with spidermonkey 1.7 though, which means you can probably just recompile and relink your application. a handful of changes are not backwards-compatible: the result of assigning to a property with a setter has changed (bug 312354). in javascript 1.7 and earlier, x = [].length = "7"; would store the number 7 in x. now this statement stores the string "7" in x. the new behavior con
forms to the ecmascript standard, ecma 262-3 §11.13.1. in certain cases, the javascript engine no longer calls jsclass.resolve callbacks repeatedly, as it did in previous versions. specifically, if a property lookup first calls a resolve hook which does not define the property, then finds the property on a prototype, that result can be cached. future lookups for the same property on the same sort of...
Running Parsemark
the intent is to run a dozen or so large-payload js sites globbed up from across the web. yes, it includes gmail. here's how you get your mitts on it. the test files are not checked into the source tree because they're non-mozilla js code. download the suite of parse tests from bug 548621 and decompress them. within js/src/tests, run python parsemark.py -h to see help documentation. generally you'll want to capture json results for your baseline and compare them to the results for the "current" version of your shell. ...
SavedFrame
or the call is not accessible to the caller, this points to the youngest accessible ancestor of the real frame, if any. in all other cases, this is null. parent this stack frame’s caller, or null if this is the oldest frame on the stack. in this case, there might be an asyncparent instead. function properties of the savedframe.prototype object tostring return this frame and its parents
formatted as a human readable stack trace string. source metadata generated from file: js/src/doc/savedframe/savedframe.md watermark: sha256:3475238d6704c659cb3e411b9c601d6ee836762dea14203f1f00ecf2c3b32452 changeset: 251fccc1f62b ...
TPS Password Lists
usernamefield: "uname", passwordfield: "pword", changes: { password: "zippity-do-dah" } }, { hostname: "http://www.example.com", realm: "login", username: "joe", password: "secretlogin" } ]; each object has the following properties: hostname: the hostname for the password. required. submiturl: the submit url for the password. optional. used for passwords in
form fields. realm: the http realm for the password. optional. used for http authentication passwords. username: required. password: required. usernamefield: the username field for a
form password. optional. passwordfield: the password field for a
form password. optional. changes: an object containing any of the above properties, which are applied during a modify action. optional. password lists and ...
Zest implementation
the first version of zest has been released but is intentionally very basic. future versions of zest are planned which will significantly increase the scope of the language. the first version is aimed at creating scripts for reproducing basic security vulnerabilities includes a java reference implementation, which con
forms to jsr 223 has been included in a proof-of-concept owasp zap add-on the next version is underdevelopment - more details soon. related links zest overview ...
Zest
the core language does not define any graphical representation - that is expected to be defined by the tools that integrate zest. ...
Mozinfo
throughout mozmill and other mozilla python code, checking the underlying plat
form is done in many different ways. the various checks needed lead to a lot of copy+pasting, leaving the reader to wonder....is this specific check necessary for (e.g.) an operating system? because in
formation is not consolidated, checks are not done consistently, nor is it defined what we are checking for. mozinfo proposes to solve this problem. mozinfo is a bridge interface, making the underlying (complex) plethora of os and architecture combinations con
form to a subset of values of relevance to mozilla software. the current implementation exposes relevant key, values: os, version, bits, and processor. additionally, the service pack in use is available on the windows plat
form. api usage mozinfo is a pyt...
Using RAII classes in Mozilla
write: autolock(mmutex); which erroneously causes the lock to be released at the end of the statement. we have two techniques for avoiding this problem: static analysis and runtime assertions. static analysis static analysis passes are run on our testing infrastructure using our clang plugin, you can also run them locally marking a raii class for the static analysis is very simple, and per
forming this marking causes the static analysis to produce a build-time error whenever a raii class is allocated as a temporary, on the heap, or in static storage. this involves just one addition to the class, and the inclusion of attributes.h: class moz_raii nsautoscriptblocker {...} this is much simpler and more thorough than the guardobject runtime assertions, but are unfortunately currently on...
Redis Tips
/** * if err is null, it means redis successfully attempted * the operation. */ if(err) throw err; /** * if results === null, it means that a concurrent client * changed the key while we were processing it and thus * the execution of the multi command was not per
formed. * * notice: failing an execution of multi is not considered * an error. so you will have err === null and results === null */ }); }); }); nice. you just have to be careful that you check the result type of an exec() when you're watching variables. it could be either a list or null. note also that it's not ...
Exploitable crashes
king comments or taking actions that expose exploitability publicly. put a security severity rating in the bug's keywords. if you're not sure what rating to give, err on the higher side so the bug will get more attention. explain in a comment why the issue seems exploitable. other tools apple has a tool called "crashwrangler" that are still being maintained as of 2012. there is little public in
formation about it, and it is hard to find even on the apple developer site. to get them go to the mac developer center downloads section -> other downloads -> search for "crashwrangler". microsoft released a debugger extension tool in 2009 called "!exploitable". it hasn't been updated since 2009. ...
Signing Mozilla apps for Mac OS X
ditional requirements for verifying the signature and application metadata. at a minimum you'll need to provide: identifier: this must be the same as the value of the cfbundleidentifier specified in your application's info.plist file. leaf[subject.ou]: this needs to be the subject ou of your developer id. you can find it by running this command in the terminal: openssl x509 -text -noout -in
form der -in devloperid_application.cer | grep subject putting it all together, you'll wind up using a command similar to the one below to sign your app. you'll of course need to change the signing id, keychain, bundle path, and requirements. codesign -s mac-testing -fv \ --keychain /users/user/library/keychains/mykeychain.keychain \ --resource-rules ./application.app/contents/_co...
Task graph
after a change to the gecko source code is pushed to version-control, jobs for that change appear on treeherder. how does this work? a "decision task" is created to decide what to do with the push. the decision task creates a lot of additional tasks. these tasks include build and test tasks, along with lots of other kinds of tasks to build docker images, build toolchains, per
form analyses, check syntax, and so on. these tasks are arranged in a "task graph", with some tasks (e.g., tests) depending on others (builds). once its prerequisite tasks complete, a dependent task begins. the result of each task is sent to treeherder where developers and sheriffs can track the status of the push. the outputs from each task, log files, firefox installers, and so on, appear attached to each ...
AT Development
on windows. then comtypes gives access to msaa and iaccessible2. references at apis implementation references shows how gecko handles atk, iaccessible2, msaa and universal access api accessible web specifications references provides the map of reflecting web specification to at apis. this page includes: aria references - w3c specification reflecting aria mapping into at apis. x
forms references - gecko documentation showing how x
forms controls are mapped to at apis. ...
Accessibility API Implementation Details
ages contain documentation on mozilla specific implementation details of assistive technology apis. at apis supportthis documentation explains how makers of screen readers, voice dictation packages, onscreen keyboards, magnification software and other assitive technologies can support gecko-based software. we provide for them the support of these products on windows, linux/unix and os x plat
forms.at developmentthe accessibility of computer software has seen drastic improvements over the past two decades. this article (from 2007) reviews the progress and technology as it has developed. x
forms accessibilitythis article provides a quick guide to how accessibility is handled in gecko for x
forms.xul accessibilitythis article shows how xul control elements are mapped to accessibility api. ...
Manipulating bookmarks using Places
the places bookmarks service, provided by the nsinavbookmarksservice interface, provides methods for creating, deleting, and manipulating bookmarks and bookmark folders. this article offers examples for how to per
form common bookmark management tasks using the bookmarks service. initiating the bookmarks service as is the case with nearly all interfaces, before you can use the bookmarks service, you need to get access to it: var bmsvc = components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(components.interfaces.nsinavbookmarksservice); creating a bookmark folder creating a new bookmark folder is done using the nsinavbookmarksservice.createfolder() method. for example, to create a new folder in the bookmarks menu: var menufolder =...
Using the Places keywords API
ith multiple urls (doing so will just update the url it's pointing to). each keyword can be associated with post data, in such a case a post action will be executed when the given url is selected from the awesomebar. different keywords can reference the same url, if their post data differ. keywords in firefox are currently created through the add keyword for this search contextual menu option in
form text fields. note this is the same feature previously known as bookmark keywords, the key difference is that keywords are not bound to a specific bookmark, but to a specific url. using the keywords api the keywords api is a promise-based api available through the placesutils module: components.utils.import("resource://gre/modules/xpcomutils.jsm"); xpcomutils.definelazymodulegetter(this, "plac...
Using the Places livemark service
eate a new livemark" for more detail. update behavior five seconds after the browser starts up, the livemark service's update timer is started. the update timer fires immediately, and then every 15 minutes thereafter. when the update timer fires, it iterates over the list of livemarks, and will refresh a livemark *only* if it's expired. the expiration time for a livemark is determined by using in
formation provided by the server when the feed was requested, specifically nsicacheentryinfo.expirationtime. if no in
formation was provided by the server, the default expiration time is 1 hour. users can modify the default expiration time via the <tt>browser.bookmarks.livemark_refresh_seconds</tt> preference, which indicates the expiration time in seconds. see also places ...
FUEL
fuel is deprecated as of firefox 40 and removed as of firefox 47. consider using the add-ons sdk instead fuel is a javascript library designed to help developers build extensions using terminology and interfaces that are familiar to them. fuel is new in firefox 3. fuel is about making it easier for extension developers to be productive, by minimizing some of the xpcom
formality and adding some "modern" javascript ideas. we want to start with areas that will provide the most benefit. fuel has a fueliapplication interface that implements all the functions of extiapplication. the library has also been implemented in thunderbird ("steel") and in seamonkey ("smile"). objects extiapplication objects extiapplication exticonsole extieventitem extieventlistener extievents extie...
SMILE
we want to start with areas that will provide the most benefit. ...
XML Extras
the xml extras module contains several features that allow developers to treat xml as data i.e. not as just another document
format. the module is structured as a drop-in component and exposes its xml-as-data features both to javascript and c++/xpcom users. the xml extras module is built by default on all plat
forms, and is included in the browser installers so it is available in the nightly builds. feature status feature status xmlserializer available xmlhttprequest available domparser (string and stream input source) available web services with soap and wsdl no longer available from gecko 1.9/firefox 3. xml persistence fixptr and xpointer available since 1.4alpha in the core mozilla. moved to xml e...
Accessing the Windows Registry Using XPCOM
to this end, there exist xpcom interfaces to read and write registry data. this article will show you how to use the available interfaces in several mozilla products. the examples in this document are all written in javascript using xpcom. support in firefox 1.5 or newer in firefox 1.5, a new api was added, nsiwindowsregkey, which provides extensive registry functionality. ...
Binary compatibility
if mozilla decides to upgrade to a compiler that does not have the same abi as the current version, any built component may fail. it is a possiblity that is introduced when upgrading to a new compiler without recompiling everything. effectively, it is a different plat
form. what does this mean to you? if you build a component and it works fine in version 1.0 of mozilla. if and when mozilla upgrades the compiler they use, your component will have to be rebuilt against the same compiler. when you see a @status frozen, note that this means it should work as long as the component and xpcom are built with the same compiler abi. for more in
formation on issues of componentization and binary compatibility, see http://mozilla.org/projects/xpcom/gl...ent_reuse.html . comments and questions should...
XPCOM array guide
of nsisimpleenumerator, including one that enumerates nsiarray objects, and another one for nscomarray. it is very common for other interfaces which support nsisimpleenumerator to make their own implementations. nsistringenumerator string enumerators provide an easy way to pass a list of strings around with minimal copying. both unicode strings and utf8-encoded strings are supported. for more in
formation about the different types of strings, see the string guide. string enumerators can be created from nstarray<nsstring> or nstarray<nscstring> objects. the implementation of the string enumerator interfaces for nstarray<nsstring> and nstarray<nscstring> supports conversion between utf8 and unicode, and can be queryinterface'd back and forth between nsistringenumerator and nsiutf8stringenumera...
Avoiding leaks in JavaScript XPCOM components
quite a lot has happened since this article was written. e. g. in firefox 3, a cycle collector was introduced and refined in later versions, and mozilla is currently working on a generational garbage collector for js. this article needs to be updated to reflect the changes and the cases where they help. take every in
formation on this site with a grain of salt, although most concepts and best practices still apply. using xpcom in javascript (also known as xpconnect) is an environment where memory management issues are not obvious. there are no calls to malloc and free and no reference counting. despite this, it's easy to write javascript code that leaks. it's easy to write leaky code in any garbage-collected language. but it's even easier in this environment because some of the objects y...
Making cross-thread calls using runnables
typically, thread activities are triggered and managed using an xpcom event-passing framework that uses the nsirunnable interface. each runnable represents a task which can then be dispatched to another thread for execution. note: javascript code cannot use the techniques described in this article. chrome javascript should instead use workers. in general, threading and message passing should be asynchronous. ...
XPCOM Stream Guide
t with the user. mozilla's use of streams is more complex. on the one hand, we don't interact with the user through streams. on the other hand, we use streams to access files within a zip archive, to store and provide data coming from websites, even to talk to other programs on the same computer through "pipes" (more on that later). we even have streams that take input from other streams and trans
form the data within them to something more useful. primitive streams there are streams for several different types of data storage. each of these implements nsiinputstream. primitive input streams type native class contract id interface how to bind to a data source generic nsstorageinputstream n/a nsiinputstream, nsiseekablestream storagestream.
Interfacing with the XPCOM cycle collector
# is the number of member variables in your class. for instance, if nsfoo contains two member variables, mbar and mbaz, we'd add ns_impl_cycle_collection_2(nsfoo, mbar, mbaz) in nsfoo.cpp. it is possible that your class has more complicated structure than this picture. for example, your class may have multiple nsisupports base classes, which requires the use of some *_ambiguous macros that per
form a disambiguating downcast. or your class may have a complicated ownership structure, such that the simple ns_impl_cycle_collection_n macros are insufficient; in this case you might need to implement the traverse and unlink methods of your helper class manually. it's helpful even in these cases to use the ns_impl_cycle_collection_traverse_{begin,end} and ns_impl_cycle_collection_unlink_{begin,end}...
Components.Constructor
eam.setinputstream takes var bis = new binaryinputstream(); } catch (e) { // someinputstream is an existing nsiinputstream bis = new binaryinputstream(someinputstream); // succeeds var bytes = bis.readbytearray(somenumberofbytes); // succeeds } compare instance creation from base principles with instance creation using components.constructor(); the latter is much easier to read than the
former (particularly if you're creating instances of a component in many different places): var bis = components.classes["@mozilla.org/binaryinputstream;1"] .createinstance(components.interfaces.nsibinaryinputstream); bis.setinputstream(someinputstream); // assumes binaryinputstream was initialized previously var bis = new binaryinputstream(someinputstream); components.constru...
Components.classesByID
ly object whose properties are classes indexed by cid. introduction components.classesbyid is a read-only object whose properties implement the nsijscid interface. each property represents one of the classes of xpcom components that can be constructed or accessed as an xpcom service. components.classesbyid is exactly like components.classes except that the elements are indexed by the canonical
form of their cid, and does not only represent the component classes that have been registered with the component manager using a contractid, but also those registered using a plain cid. usage in order to retrieve the object for a given cid, you can use that cid as an index with components.classesbyid as follows: var clazz = components.classesbyid["{ed132c20-eed1-11d2-baa4-00805f8a5dd7}"]; ...
Components.interfacesByID
resents one of the xpcom interfaces -- that some component or another might or might not implement. it reflects only those interfaces which have been designated in their .idl description as [scriptable], i.e. the interfaces which xpconnect is capable of reflecting into javascript. components.interfacesbyid is exactly like components.interfaces except that the elements are indexed by the canonical
form of their iid. usage you can retrieve an interface object using: var iface = components.interfacesbyid["{aa610f20-a889-11d3-8c81-000064657374}"]; ...
Components.isSuccessCode
is functionally equivalent to the following javascript: function issuccesscode(returncode) { return (returncode & 0x80000000) === 0; } since failure error codes are turned into exceptions when encountered in javascript, this function usually is not necessary. however, if you are using asynchronous apis, it may be essential. for example, if you ask a component or service to asynchronously per
form some task, you must usually pass in an object which will be notified when the task is completed. if the task is sufficiently complex that it can fail, the notification will include a status code indicating the success or failure of the operation (see, for example, nsirequestobserver.onstoprequest()). to determine the success or failure of the complex task, you would call components.issuccesscode(...
Components.utils.evalInSandbox
the evalinsandbox() function enables you to evaluate javascript code inside a sandbox you've previously created using the components.utils.sandbox constructor. note: it's not safe to use evalinsandbox() to evaluate json strings; instead, use the techniques discussed in the article on json. you can also find firefox 3.5 specific in
formation in using json in firefox. use to use evalinsandbox(), you must first create a sandbox object using its constructor, components.utils.sandbox. in the constructor you define the security principal for code running in the sandbox, and can make various properties available to code running in the sandbox. the sandbox will become the global scope object when you pass it to evalinsandbox(text, sandbox). you can import functions or objects into the sand...
Components.utils.forceGC
this mechanism doesn't account for any native (c++) xpcom objects hanging off javascript objects though. in many cases a javascript application will have internal knowledge of javascript objects referencing large (trees of) xpcom objects and know when they are no longer reachable. in this case it can be important to be able to force a garbage collection cycle from javascript. ...
Components.utils.import
as jslint which reports compiler errors for the above, components.utils["import"](url [, scope]); parameters url a string of the url of the script to be loaded. the url must point to a file on the disk, possibly in a jar. scope an optional object to import onto; if omitted, the global object is used. under boot2gecko, the scope is not optional. if your code is meant to work on all plat
forms, you should always provide a scope. in case of doubt, this is generally a good scope. return value the module's global object. use of the return value is discouraged since it grants access to the module's internal properties which are not part of its public api. import throws if it encounters an error (like a syntax error) in the file it reads. example components.utils.import("resourc...
Assign
rs adata [in] a raw character array to copy into this string. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. void assign( char_type achar ); parameters achar [in] the character to copy into this string. remarks if insufficient memory is available to per
form the assignment, then the string's internal buffer will point to a static empty (zero-length) buffer. ...
Insert
equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. void insert( char_type achar, index_type aposition ); parameters achar [in] a character to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. remarks if insufficient memory is available to per
form the assignment, then the string's internal buffer will point to a static empty (zero-length) buffer. ...
Replace
eed not be null terminated. void replace( index_type acutstart, index_type acutlength, char_type achar ); parameters acutstart [in] the starting index of the section to remove, measured in storage units. acutlength [in] the length of the section to remove, measured in storage units. achar [in] a character to append to this string. remarks if insufficient memory is available to per
form the assignment, then the string's internal buffer will point to a static empty (zero-length) buffer. ...
Append
ters adata [in] a raw character array to append to this string. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. void append( char_type achar ); parameters achar [in] a character to append to this string. remarks if insufficient memory is available to per
form the assignment, then the string's internal buffer will point to a static empty (zero-length) buffer. ...
Assign
rs adata [in] a raw character array to copy into this string. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. void assign( char_type achar ); parameters achar [in] the character to copy into this string. remarks if insufficient memory is available to per
form the assignment, then the string's internal buffer will point to a static empty (zero-length) buffer. ...
Insert
equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. void insert( char_type achar, index_type aposition ); parameters achar [in] a character to append to this string. aposition [in] an offset into the string's internal buffer specifying where to place the given characters. remarks if insufficient memory is available to per
form the assignment, then the string's internal buffer will point to a static empty (zero-length) buffer. ...
Replace
need not be null terminated. void replace( index_type acutstart, index_type acutlength, char_type achar ); parameter acutstart [in] the starting index of the section to remove, measured in storage units. acutlength [in] the length of the section to remove, measured in storage units. achar [in] a character to append to this string. remarks if insufficient memory is available to per
form the assignment, then the string's internal buffer will point to a static empty (zero-length) buffer. ...
nsAdoptingCString
nt equalsignorecase prbool equalsignorecase(const char*, print32) const - source equality check between given string and this string. @param astring is the string to check @param aignorecase tells us how to treat case @param acount tells us how many chars to compare @return boolean parameters char* astring print32 acount tofloat float tofloat(print32*) const - source per
form string to float conversion. @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* aerrorcode pruint32 aradix mid pruint32 mid(nscstring&, pruint32, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint3...
nsAdoptingString
@param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* aerrorcode pruint32 aradix mid pruint32 mid(nsstring&, pruint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 ...
nsAutoString
@param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* aerrorcode pruint32 aradix mid pruint32 mid(nsstring&, pruint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 ...
nsCAutoString
gnorecase prbool equalsignorecase(const char*, print32) const - source equality check between given string and this string. @param astring is the string to check @param aignorecase tells us how to treat case @param acount tells us how many chars to compare @return boolean parameters char* astring print32 acount tofloat float tofloat(print32*) const - source per
form string to float conversion. @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* aerrorcode pruint32 aradix mid pruint32 mid(nscstring&, pruint32, pruint32) const - source parameters nscstring& aresult ...
nsCString
nt equalsignorecase prbool equalsignorecase(const char*, print32) const - source equality check between given string and this string. @param astring is the string to check @param aignorecase tells us how to treat case @param acount tells us how many chars to compare @return boolean parameters char* astring print32 acount tofloat float tofloat(print32*) const - source per
form string to float conversion. @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* aerrorcode pruint32 aradix mid pruint32 mid(nscstring&, pruint32, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint3...
nsCStringEncoding
ibes the set of character encodings understood by the ns_cstringtoutf16 and ns_utf16tocstring functions. ns_cstring_encoding_ascii conversion between ascii and utf-16 assumes that all bytes in the source string are 7-bit ascii and can be inflated to utf-16 by inserting null bytes. reverse conversion is done by truncating every other byte. the conversion may result in loss and/or corruption of in
formation if the strings do not strictly contain ascii data. ns_cstring_encoding_utf8 conversion between utf-8 and utf-16 is non-lossy. ns_cstring_encoding_native_filesystem conversion from utf-16 to the native filesystem charset may result in a loss of in
formation. no attempt is made to protect against data loss in this case. the native filesystem charset applies to strings passed to the "native" m...
nsDependentCString
nt equalsignorecase prbool equalsignorecase(const char*, print32) const - source equality check between given string and this string. @param astring is the string to check @param aignorecase tells us how to treat case @param acount tells us how many chars to compare @return boolean parameters char* astring print32 acount tofloat float tofloat(print32*) const - source per
form string to float conversion. @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* aerrorcode pruint32 aradix mid pruint32 mid(nscstring&, pruint32, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint3...
nsDependentString
@param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* aerrorcode pruint32 aradix mid pruint32 mid(nsstring&, pruint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 ...
nsFixedCString
nt equalsignorecase prbool equalsignorecase(const char*, print32) const - source equality check between given string and this string. @param astring is the string to check @param aignorecase tells us how to treat case @param acount tells us how many chars to compare @return boolean parameters char* astring print32 acount tofloat float tofloat(print32*) const - source per
form string to float conversion. @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* aerrorcode pruint32 aradix mid pruint32 mid(nscstring&, pruint32, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint3...
nsFixedString
@param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* aerrorcode pruint32 aradix mid pruint32 mid(nsstring&, pruint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 ...
nsPromiseFlatCString
nt equalsignorecase prbool equalsignorecase(const char*, print32) const - source equality check between given string and this string. @param astring is the string to check @param aignorecase tells us how to treat case @param acount tells us how many chars to compare @return boolean parameters char* astring print32 acount tofloat float tofloat(print32*) const - source per
form string to float conversion. @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* aerrorcode pruint32 aradix mid pruint32 mid(nscstring&, pruint32, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint3...
nsPromiseFlatString
@param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* aerrorcode pruint32 aradix mid pruint32 mid(nsstring&, pruint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 ...
nsString
@param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* aerrorcode pruint32 aradix mid pruint32 mid(nsstring&, pruint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 ...
nsXPIDLCString
nt equalsignorecase prbool equalsignorecase(const char*, print32) const - source equality check between given string and this string. @param astring is the string to check @param aignorecase tells us how to treat case @param acount tells us how many chars to compare @return boolean parameters char* astring print32 acount tofloat float tofloat(print32*) const - source per
form string to float conversion. @param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* aerrorcode pruint32 aradix mid pruint32 mid(nscstring&, pruint32, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint3...
nsXPIDLString
@param aerrorcode will contain error if one occurs @return float rep of string value parameters print32* aerrorcode tointeger print32 tointeger(print32*, pruint32) const - source parameters print32* aerrorcode pruint32 aradix mid pruint32 mid(nsstring&, pruint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 ...
XPCOM glue classes
declarationnsliteralcstring (external)class declarationnsliteralstring (external)class declarationnsmemorythe nsmemory class provides static helper routines to manage memory. these routines allow easy access to xpcom's global nsimemory implementation without having to go through the service manager to get it.nspromiseflatcstringclass declarationnspromiseflatstringclass declarationnsrefptrrefptr (
formerly known as nsrefptr, see bug 1207245) is a general class to implement reference counting pointers for objects. it is similar to nscomptr, but does not require that the type be an xpcom interface. like with nscomptr, it is the responsibility of the object itself to implement reference counting. this is done using the functions addref() and release(), which respectively modify a variable of type...
IAccessibleApplication
other-licenses/ia2/accessibleapplication.idlnot scriptable this interface gives access to the application's name and version in
formation. 1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) this interface provides the at with the in
formation it needs to differentiate this application from other applications, from other versions of this application, or from other versions of this application running on different versions of an accessibility bridge or accessibility toolkit. servers implementing iaccessible2 should provide access to the iaccessibleapplication interface via queryservice from any object so that ats can easily determine specific in
formation about the application such as its name or version. method overview [p...
IAccessibleComponent
other-licenses/ia2/accessiblecomponent.idlnot scriptable this interface is implemented by any object that can be rendered on the screen. 1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) this interface provides the standard mechanism for an assistive technology to retrieve in
formation concerning the graphical representation of an object. coordinates used by the functions of this interface are specified in different coordinate systems. their scale is the same and is equal to that of the screen coordinate system. in other words all coordinates are measured in pixels. they differ in their respective origin: the screen coordinate system has its origin in the upper left corner of the current screen. the origin of the parent ...
IAccessibleEditableText
ndoffset. if endoffset is lower than startoffset, the result is the same as a call with the two arguments exchanged. the whole text can be defined by passing the indices zero and iaccessibletext.ncharacters(). if both indices have the same value, an empty string is defined. refer to the @ref _specialoffsets "special offsets for use in the iaccessibletext and iaccessibleeditabletext methods" for in
formation about a special offset constant that can be used in iaccessibleeditabletext methods. method overview hresult copytext([in] long startoffset, [in] long endoffset ); hresult cuttext([in] long startoffset, [in] long endoffset ); hresult deletetext([in] long startoffset, [in] long endoffset ); hresult inserttext([in] long offset, [in] bstr text ); hresult pastetext([in] long offset );...
IAccessibleHyperlink
return value s_ok. valid() returns whether the target object referenced by this link is still valid. this is a volatile state that may change without sending an appropriate event. [propget] hresult valid( [out] boolean valid ); parameters valid true if the referenced target is still valid and false otherwise. this has also been used to indicate whether or not the uri of the anchortarget is mal
formed. return value s_false if there is nothing to return, [out] value is false. s_ok. see also iaccessibleaction iaccessibletext ...
IAccessibleImage
interface is used for a representation of images like icons on buttons. iaccessibleimage only needs to be implemented in certain situations. some examples are: the accessible name and description() are not enough to fully describe the image, for example when the accessible description() is used to define the behavior of an actionable image and the image itself conveys semantically significant in
formation. the user can edit the content that includes an image and therefore the user needs to be able to review the image's position. method overview [propget] hresult description([out] bstr description ); [propget] hresult imageposition([in] enum ia2coordinatetype coordinatetype, [out] long x, [out] long y ); [propget] hresult imagesize([out] long height, [out] long width ); methods desc...
imgIDecoder
modules/libpr0n/public/imgidecoder.idlscriptable base class for a decoder that reads an image from an input stream and sends it to an imgiloader object. inherits from: nsisupports last changed in gecko 1.7 this interface is the base class for decoders for specific image
formats. method overview void close(); void flush(); void init(in imgiload aload); unsigned long writefrom(in nsiinputstream instr, in unsigned long count); methods close() closes the stream. void close(); parameters none. flush() flushes the stream. void flush(); parameters none. init() initializes an image decoder. void init( in imgiload aload ); parameters aload an imgiload object to receive the decoded image data. this object also implements the imgidec...
imgIDecoderObserver
in imgirequest arequest, in boolean acurrentframe, [const] in nsintrect arect ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object. acurrentframe missing description arect missing description ondiscard() called when the decoded image data is discarded. this means that the frames no longer exist in decoded
form, and any attempt to access or draw the image will initiate a new series of progressive decode notifications. void ondiscard( in imgirequest arequest ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object. onimageisanimated() notification for when an image is known to be animated. this should be fired at the earliest possible t...
nsIAccessibleDocument
when accessibility is turned on in gecko, there is an nsiaccessibledocument for each document whether it is xul, html or whatever. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) you can queryinterface to nsiaccessibledocument from the nsiaccessible or nsiaccessnode for the root node of a document. ...
nsIAccessibleHyperLink
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview nsiaccessible getanchor(in long index); note: renamed from getobject in gecko 1.9 nsiuri geturi(in long index); boolean isselected(); obsolete since gecko 1.9 boolean isvalid(); obsolete since gecko 1.9 attributes attribute type description anchorcount long the number of anchors within this hyperlink. is normally 1 for anchors. this anchor is, for example, the visible output of the html:a tag. ...
nsIAccessibleImage
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getimageposition(in unsigned long coordtype, out long x, out long y); void getimagesize(out long width, out long height); methods getimageposition() returns the coordinates of the image accessible. this method is the same as nsiaccessible.getbounds() excepting coordinate origin parameter. ...
nsIAccessibleText
ype_window 1 methods addselection() void addselection( in long startoffset, in long endoffset ); parameters startoffset endoffset getattributerange() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) get the accessible and start/end offsets around the given offset. this accessible get return the dom node and layout frame with the uni
form attributes for this range of text. nsiaccessible getattributerange( in long offset, out long rangestartoffset, out long rangeendoffset ); parameters offset rangestartoffset rangeendoffset return value getcharacteratoffset() it would be better to return an unsigned long here, to allow unicode chars > 16 bits. wchar getcharacteratoffset( in long offset ); parameters offset return...
nsIAppStartup_MOZILLA_2_0
toolkit/components/startup/public/nsiappstartup.idlscriptable this lets you get in
formation about the times at which key application startup events occurred. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko 4.0 this interface was merged into the nsiappstartup interface. ...
nsIAsyncStreamCopier
n asinkbuffered, in unsigned long achunksize, in boolean aclosesource, in boolean aclosesink); methods asynccopy() starts the copy operation. the specified observer is notified when the copy completes. void asynccopy( in nsirequestobserver aobserver, in nsisupports aobservercontext ); parameters aobserver receives notifications. aobservercontext the object to receive notifications with in
formation about the progress of the copy operation. init() initializes the stream copier. note: at least one of the streams must be buffered. void init( in nsiinputstream asource, in nsioutputstream asink, in nsieventtarget atarget, in boolean asourcebuffered, in boolean asinkbuffered, in unsigned long achunksize, in boolean aclosesource, in boolean aclosesink ); parameters asource ...
nsIAuthPromptWrapper
persisting data from the prompts and using it to pre-fill subsequent prompts would be one such action. embedding/components/windowwatcher/public/nsiauthpromptwrapper.idlscriptable please add a summary to this article. last changed in gecko 1.7 inherits from: nsiauthprompt method overview void setpromptdialogs(in nsiprompt dialogs); methods setpromptdialogs() this method sets a prompt dialog using the given dialog implementation which will be used to display the prompts. ...
nsIBadCertListener2
boolean notifycertproblem(in nsiinterfacerequestor socketinfo, in nsisslstatus status, in autf8string targetsite); methods notifycertproblem() called in case of a broken ssl status. boolean notifycertproblem( in nsiinterfacerequestor socketinfo, in nsisslstatus status, in autf8string targetsite ); parameters socketinfo a network communication context that can be used to obtain more in
formation about the active connection. this object usually supports nsisslsocketcontrol, nsitransportsecurityinfo, nsiidentityinfo, nsisslstatusprovider, nsiclientauthuserdecision and possibly other interfaces. status the ssl status object that describes the problem(s). targetsite the site name that was used to open the current connection. return value the consumer shall return true if it wants to su...
nsIBinaryInputStream
criptable this interface allows consumption of primitive data types from a "binary stream" containing untagged, big-endian binary data, that is as produced by an implementation of nsibinaryoutputstream. this might be used, for example, to implement network protocols or to read from architecture-neutral disk files, that is ones that can be read and written by both big-endian and little-endian plat
forms. inherits from: nsiinputstream last changed in gecko 1.7 method overview pruint8 read8(); pruint16 read16(); pruint32 read32(); pruint64 read64(); unsigned long readarraybuffer(in pruint32 alength, in jsval aarraybuffer); prbool readboolean(); void readbytearray(in pruint32 alength, [array, size_is(alength), retval] out pruint8...
nsIBrowserSearchService
ay; if no confirmation dialog is shown, the new engine will be used right away automatically. void addengine( in astring engineurl, in long datatype, in astring iconurl, in boolean confirm, [optional] in nsisearchinstallcallback callback ); parameters engineurl the url to the search engine's description file. datatype an integer representing the plugin file
format. must be one of the supported search engine data types defined above. iconurl a url string to an icon file to be used as the search engine's icon. this value may be overridden by an icon specified in the engine description file. confirm a boolean value indicating whether the user should be asked for confirmation before this engine is added to the list. if this value ...
nsICache
the cache entry was doomed, then a descriptor will be created for a new cache entry for the key. note: if you think that you might need to modify cached data or meta data, then you must open a cache entry requesting write access. only one cache entry descriptor, per cache entry, will be granted write access. usually, you will request read_write access in order to first test the meta data and in
formational fields to determine if a write, that is going to the net, may actually be necessary. if you determine that it is not, then you would mark the cache entry as valid (using markvalid) and then simply read the data from the cache. a descriptor granted write access has exclusive access to the cache entry up to the point at which it marks it as valid. once the cache entry has been "validated", o...
nsICacheDeviceInfo
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description description string get a human readable description of the cache device. read only. entrycount unsigned long get the number of stored cache entries. read only. maximumsize unsigned long get the upper limit of the size of the data the cache can store. read only. totalsize unsigned long get the total size of the stored cache entries. read only. usagereport string get a usage report, statistics, miscellaneous data about the cache device. ...
nsICacheEntryInfo
inherits from: nsisupports last changed in gecko 1.7 method overview boolean isstreambased(); attributes attribute type description clientid string get the client id associated with this cache entry. read only. datasize unsigned long get the cache entry data size. read only. deviceid string get the id for the device that stores this cache entry. read only. expirationtime pruint32 get the expiration time of the cache entry (in seconds since the epoch). read only. fetchcount long get the number of times the cache entry has been opened. read only. ...
nsICacheSession
granted. if blockingmode is set to false, it will return ns_error_cache_wait_for_validation rather than block when another descriptor has been given write access but hasn't validated the entry yet. note: if at all possible, you should use asyncopencacheentry() instead of calling opencacheentry(), in order to avoid blocking on i/o on the calling thread. this will streamline overall application per
formance. a cache session can only give out one descriptor with write access to a given cache entry at a time. until the client calls markvalid on its descriptor, other attempts to open the same cache entry will block. nsicacheentrydescriptor opencacheentry( in acstring key, in nscacheaccessmode accessrequested, in boolean blockingmode ); parameters key the key for cache entry. accessrequested...
nsICachingChannel
mmary to this article. inherits from: nsicacheinfochannel last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface provides: support for "stream as file" semantics (for jar and plugins). support for "pinning" cached data in the cache (for printing and save-as). support for uniquely identifying cached data in cases when the url is insufficient. for example a http
form submission. a channel may optionally implement this interface to allow clients to affect its behavior with respect to how it uses the cache service. method overview boolean isfromcache(); obsolete since gecko 2.0 attributes attribute type description cacheasfile boolean specifies whether or not the data should be cached to a file. this may fail if the disk cache is not present. the va...
nsICancelable
idlscriptable this interface provides a means to cancel an operation that is in progress. 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 cancel(in nsresult areason); methods cancel() call this method to request that this object abort whatever operation it may be per
forming. void cancel( in nsresult areason ); parameters areason a failure code indicating why the operation is being canceled. it is an error to pass a success code. ...
nsICategoryManager
they are often used to register lists of contractids, corresponding to components that wish to be notified of various events by some subsystem. ...
nsIChannelEventSink
unsigned long flags, in nsiasyncverifyredirectcallback callback ); parameters oldchannel the channel that's being redirected. newchannel the new channel. this channel is not opened yet. flags flags indicating the type of redirect. a bitmask consisting of flags from above. one of redirect_temporary and redirect_permanent will always be set. callback object to in
form about the async result of this method. exceptions thrown this method can throw any exception; if an exception occurs, the load will be canceled, and no network requests will occur for the new channel. the redirect will be canceled. onchannelredirect() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) called when a redirect occurs. this may happen du...
nsIChannelPolicy
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface exists to allow the content policy mechanism to function properly during channel redirects. channels can be created with this interface placed in the property bag and upon redirect, the interface can be transferred from the old channel to the new channel. attributes attribute type description contentsecuritypolicy nsisupports a nsicontentsecuritypolicy object to determine if the load should be allowed. ...
nsIClassInfo
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsisupports gethelperforlanguage(in pruint32 language); void getinterfaces(out pruint32 count, [array, size_is(count), retval] out nsiidptr array); attributes attribute type description classdescription string a human readable string naming the class, or null. read only. classid nscidptr a classid through which an instance of this class can be created, or null. ...
nsIClipboard
the clipboard and notifies the clipboard owner. it empties the "logical" clipboard. it does not clear the native clipboard. void emptyclipboard( in long awhichclipboard ); parameters awhichclipboard specifies the clipboard to which this operation applies. forcedatatoclipboard() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) some plat
forms support deferred notification for putting data on the clipboard this method forces the data onto the clipboard in its various
formats this may be used if the application going away. void forcedatatoclipboard( in long awhichclipboard ); parameters awhichclipboard specifies the clipboard to which this operation applies. getdata() this method retrieves data from the clipboard into a tra...
nsIClipboardDragDropHooks
alternative action to the built-in behavior when something is dropped on the browser or in an editor. boolean onpasteordrop( in nsidomevent event, in nsitransferable trans ); parameters event the dom event (drag drop); null if triggered by paste. trans the transferable holding the list of flavors and the data for each flavor. return value true to indicate the action was handled, do not per
form built-in behavior. otherwise, false to indicate the action was not overridden, do built-in behavior. see also nsiclipboard ...
nsICollection
s you iterate over the items in the collection. nsienumerator enumerate(); parameters none. return value an nsienumerator. getelementat() returns the element at the specified index into the collection. nsisupports getelementat( in pruint32 index ); parameters index the index position of the item to be returned. return value nsisupports item at the index position. queryelementat() per
forms a queryinterface on the item at the specified index into the collection. void queryelementat( in pruint32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result ); parameters index position of the item to be queried. uuid nsiidref of the item. result comparison result of the previous two parameters. removeelement() removes an item from the collectio...
nsICommandLineHandler
t, this attribute is retrieved and displayed to the user (on stdout). the text should have embedded newlines which wrap at 76 columns, and should include a newline at the end. by convention, the right column which contains flag descriptions begins at the 24th character. read only. methods handle() processes a command line. if this handler finds arguments that it understands, it should per
form the appropriate actions (such as opening a window), and remove the arguments from the command-line array. void handle( in nsicommandline acommandline ); parameters acommandline command line to process. see also nsicommandline chrome: command line xulrunner:commandline ...
nsIComponentRegistrar
classname, in string acontractid, in nsifile afile, in string aloaderstr, in string atype); void unregisterfactory(in nscidref aclass, in nsifactory afactory); void unregisterfactorylocation(in nscidref aclass, in nsifile afile); methods autoregister() register a component (.manifest) file or all component files in a directory. registration lasts for this run only, and is not cached. note:
formerly this method would register component files directly. this is no longer supported. component files must have an associated loader and export the required symbols which this loader defines. for example, if the given file is a native library, it must export the symbol nsgetmodule. other loaders may have different semantics. this method may only be called from the main thread. void autoregister( ...
nsIConsoleMessage
xpcom/base/nsiconsolemessage.idlscriptable this interface is a base interface for messages passed to or from the nsiconsoleservice. inherits from: nsisupports last changed in gecko 1.7 implementations may provide an object that can be query interfaced, nsisupports.queryinterface(), to provide more specific message in
formation. see nsiscripterror for an example. attributes attribute type description message wstring the message in a string
format. [binaryname(messagemoz)] read only. see also nsiconsoleservice ...
nsIConsoleService
a common usage is logging a message string to the console: function log(msg) { var consoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice); consoleservice.logstringmessage(msg); } alternative logging methods include components.utils.reporterror and dump(). logging a message with additional in
formation to include other in
formation an nsiconsolemessage object must be used. in this example nsiscripterror, which implements nsiconsolemessage, is used to include in
formation about the source file and line number of the error. function mylogtoconsole(amessage, asourcename, asourceline, alinenumber, acolumnnumber, aflags, acategory) { var consoleservice = components.cla...
nsIContentPrefService2
the context's useprivatebrowsing attribute: if useprivatebrowsing is true, temporary private-browsing storage is used, and otherwise permanent storage is used. a context can be obtained from the window or channel whose content pertains to the preferences being modified or retrieved. callbacks the methods of callback objects are always called asynchronously. see nsicontentprefcallback2 for more in
formation about callbacks. method overview void addobserverforname(in astring name, in nsicontentprefobserver observer); void getbydomainandname(in astring domain, in astring name, in nsiloadcontext context, in nsicontentprefcallback2 callback); void getbysubdomainandname(in astring domain, in astring name, in nsiloadcontext context, in nsicontentprefcall...
nsIContentView
float xscale, in float yscale); attributes attribute type description contentheight float read only. contentwidth float dimensions of scrolled content in chrome-document css pixels. read only. id nscontentviewid id that can be used in conjunction with nsidomwindowutils to change the actual document, instead of just how it is trans
formed; this is a 64-bit unsigned integer. read only. scrollx float horizontal scroll offset in chrome-document css pixels. when this view is active (that is it is being painted because it's in the visible region of the screen), this value is at first lined up with the content's scroll offset. note: when this view becomes inactive, the new content view will have scroll val...
nsICookie2
netwerk/cookie/nsicookie2.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsicookie attributes attribute type description creationtime print64 the creation time of the cookie, in microseconds since midnight (00:00:00), january 1, 1970 utc. read only. expiry print64 the actual expiry time of the cookie, in seconds since midnight (00:00:00), january 1, 1970 utc. (where 0 does not represent a session cookie). read only. ishttponly boolean true if the cookie is an http only cookie. read only. ...
nsIDOMParser
l use a moz-nullprincipal:{<guid>} uri, which will show in the error console in parsing errors, in particular. supposedly, if you want to create objects that some particular set of unprivileged code will be able to access (see discussion in bug 565480). parsing a string once you've created a domparser object, you can use its parsefromstring method to parse xml or html as described in the web plat
form documentation. examples within the context of a window: var parser = new domparser(); var doc = parser.parsefromstring(astr, "application/xml"); outside of a window (e.g., a js xpcom component, a js module, or an xpcshell test): var parser = components.classes["@mozilla.org/xmlextras/domparser;1"] .createinstance(components.interfaces.nsidomparser); var doc = parser.parsefromstring(...
nsIDOMSerializer
a byte stream. if this string is empty and root is a document, the document's character set will be used. serializetostring() the subtree rooted by the specified element is serialized to a string. astring serializetostring( in nsidomnode root ); parameters root the root of the subtree to be serialized. this could be any node, including a document. return value the serialized subtree in the
form of a unicode string. ...
nsIDOMStorageEventObsolete
te gecko 2.0 inherits from: nsidomevent last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) when a dom storage event is received, the recipient can check its domain attribute to determine which domain's data store has changed. if the value of the domain attribute is "#session", then the session storage has changed. note: this interface describes the old, non-standard
form of this event. you should use the nsidomstorageevent interface instead. method overview void initstorageevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in domstring keyarg, in domstring oldvaluearg, in domstring newvaluearg, in domstring urlarg, in nsidomstorage storageareaarg); attributes attribute type description domain ...
nsIDOMWindowInternal
winternal returns a reference to the window that opened this current window. status domstring sets the text in the status bar at the bottom of the browser or returns the previously set text. defaultstatus domstring gets/sets the status bar text for the given window. location nsidomlocation readonly: returns a nsidomlocation object, which contains in
formation about the url of the document. innerwidth long width of the browser window. innerheight long height of the browser window. outerwidth long gets the width of the outside of the browser window. outerheight long gets the height of the outside of the browser window. screenx long the horizontal distance of the left border ...
nsIDOMXULLabeledControlElement
last changed in gecko 1.7 attributes attribute type description accesskey domstring this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label for the element. when the user presses the appropriate modifier and the access key, the element will be focused and/or activated from anywhere in the window. on non-macintosh plat
forms, the character on the element's label matching the access key is underlined. note: the access key is copied to any associated label element. command domstring this property reflects the element's command attribute. crop domstring this property reflects the element's crop attribute. image domstring this property reflects the element's image attribute. label domstring this property reflect...
nsIDebug
line); methods abort() requests the process to trigger a fatal abort. void abort( in string afile, in long aline ); parameters afile file containing abort request. aline line number of abort request. assertion() shows an assertion and triggers optional behavior based on the xpcom_debug_break environment variable, defaulting to calling break() on windows and os/2 and warning on other plat
forms. void assertion( in string astr, in string aexpr, in string afile, in long aline ); parameters astr assertion message. aexpr expression that failed. afile file containing assertion. aline line number of assertion. break() requests the software break into a debugger. if no debugger is running then this usually results in a program crash. however, on windows a dialog is first presented ...
nsIDebug2
this is normally zero in release builds, but does include calls to nsidebug.assertion(). read only. isdebugbuild boolean whether xpcom was compiled with debug defined. ...
nsIDeviceMotionData
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: this interface was named nsidevicemotiondata prior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3). attributes attribute type description type unsigned long the type of motion data reported by this object; see motion type constants for possible values. read only. x double the amount of tilt along the x axis. read only. y double the amount of tilt along the y axis. read only. ...
nsIDictionary
utable table of objects, maintained as key/value pairs. objects can be located and managed by referencing them by key. 66 introduced gecko 1.0 obsolete gecko 1.9.1 inherits from: nsisummary last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) note: this interface was removed in firefox 3.5; use dict.jsm instead. see bug 668424 for further in
formation. method overview boolean haskey(in string key); void getkeys(out pruint32 count, [retval, array, size_is(count)] out string keys); nsisupports getvalue(in string key); void setvalue(in string key, in nsisupports value); nsisupports deletevalue(in string key); void clear(); methods haskey() check if a given key is present in the dict...
nsIDirIndex
because this has no reference back to their original source, changing these attributes won't affect the directory. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description contenttype string the content type; may be null if it is unknown. unspecified for directories. description wstring a description for the filename, which should be displayed by a viewer. lastmodified prtime last-modified time in seconds-since-epoch. if the last modified time is unknown, this value is -1. location string the fully qualified filename, expressed as a uri. ...
nsIDirIndexParser
inherits from: nsistreamlistener last changed in gecko 1.7 called for each directory entry. attributes attribute type description comment string the comment given, if any. this result is only valid after onstoprequest has occurred, because it can occur anywhere in the datastream. read only. encoding string the encoding to use. ...
nsIDownload
ue. for example, a private download and a public one might have identical ids. can only be safely used for direct database manipulation in the database that contains this download. use the guid property instead for safe, database-agnostic searching and manipulation. read only. deprecated since gecko 19.0 guid astring the guid of the download that is stored in the database. has the
form of twelve alphanumeric characters. read only. mimeinfo nsimimeinfo provides the targets relevant mime in
formation, including its mime type, helper application, and whether or not the helper should be executed automatically once the download is complete. read only. optional percentcomplete long the percentage of the file transfer that has been completed, or -1 if th...
nsIDownloadManagerUI
meters none. exceptions thrown ns_error_unexpected the user interface isn't currently open. show() shows the download manager's user interface to the user. void show( in nsiinterfacerequestor awindowcontext, optional in unsigned long aid, optional in short areason optional ); parameters awindowcontext optional the parent window context to show the user interface. with this in
formation, it's possible to put the download manager in a tab in the same window as the parent. aid optional the id of the download to be preselected upon opening the download manager ui. areason optional one of the reason constants indicating why the user interface should be displayed. see also the download manager schema ...
nsIEffectiveTLDService
e this service, use: var etldservice = components.classes["@mozilla.org/network/effective-tld-service;1"] .getservice(components.interfaces.nsieffectivetldservice); the name "effective tld service" is a historical one; today, the items this interface manipulates are called public suffixes, and the list of them is the public suffix list, or psl. see publicsuffix.org for more in
formation. the methods below implement the public suffix algorithm in full, including the implicit "*" rule. therefore, if you call getpublicsuffix("a.b.c.nonexistent"), you will get back "nonexistent" - this "tld" is not in the public suffix list, but the implicit "*" rule means that it is returned. this is the right answer for e.g. cookie setting and domain highlighting, but you should check whethe...
nsIEnvironment
ue returns the value of the env variable. an empty string will be returned when the env variable does not exist or when the value itself is an empty string - please use exists() to probe whether the env variable exists or not. exists() check the existence of an environment variable. this method checks whether an environment variable is present in the environment or not. note: * for unix/linux plat
forms we follow the unix definition: an environment variable exists when getenv() returns a non-null value. an environment variable does not exist when getenv() returns null. for non-unix/linux plat
forms we have to fall back to a "portable" definition (which is incorrect for unix/linux!!!!) which simply checks whether the string returned by get() is empty or not. boolean exists( in astring anam...
nsIException
location nsistackframe a stack trace, if available. read only. message string a custom message set by the thrower. [binaryname(messagemoz)] read only. name string the name of the error code (a string representation of result) read only. result nsresult the nsresult associated with this exception. read only. methods tostring() a generic
formatter - make it suitable to print, etc. string tostring(); parameters none. return value a string suitable for output. ...
nsIExternalHelperAppService
inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/uriloader/external-helper-app-service;1. ...
nsIExternalProtocolService
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) you can ask the external protocol service if it has an external handler for a given protocol scheme. and you can ask it to load the url using the default handler. ...
nsIExternalURLHandlerService
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 nsihandlerinfo geturlhandlerinfofromos(in nsiuri aurl, out boolean afound); methods geturlhandlerinfofromos() given a url, looks up the handler info from the operating system. this should be overridden by each operating systems implementation. ...
nsIFTPChannel
you can determine if a channel is an ftp channel by checking to see if it implements this interface, by calling nsisupports.queryinterface() on it. netwerk/protocol/ftp/nsiftpchannel.idlscriptable please add a summary to this article. ...
nsIFaviconService
uri of the favicon to associate with the page. aforcereload unset is normal behavior, we will only try to reload the favicon if we don't have it or if it has expired from the cache. if set, it will always try to reload the favicon. afaviconloadtype one of nsifaviconservice.favicon_load_private or nsifaviconservice.favicon_load_non_private to indicate that any network requests per
formed should act like ones from a private browsing context (ie. no history entries, only store in the temporary disk cache, etc.). this should be determined via privatebrowsingutils.iswindowprivate(somerelatedwindow) if the favicon may expose the user's private browsing data by per
forming a network request, otherwise favicon_load_non_private may be used. acallback optional from gecko 2.0 an ...
nsIFeedEntry
ed by podcasts, photocasts, and so forth. mediacontent nsiarray an array of all the enclosures or other media that might be displayed inline in the entry. parent nsifeedcontainer a reference to the entry's parent, which is either a feed (nsifeed or another entry. published astring a string indicating the date on which the entry was published, in rfc822
format. this date is parsable by both javascript (via date.parse()) and mail code. note, that the related updated attribute is available from the nsifeedcontainer interface. summary nsifeedtextconstruct a summary of the feed entry's content. this is generated automatically using the entry's description, subtitle, summary, content, and appropriate extensions. see also nsifeedco...
nsIFeedProgressListener
bozo); methods handleentry() called after each entry or item is processed. if the document is a standalone item or entry, the handlefeedatfirstentry() method will not already have been called, and the received nsifeedentry will have a null parent value. void handleentry( in nsifeedentry entry, in nsifeedresult result ); parameters entry pointer to an nsifeedentry containing in
formation about the entry that was just processed. result pointer to an nsifeedresult containing the current in
formation about the feed being processed. handlefeedatfirstentry() called when the first entry or item in the feed is encountered. in atom, all feed data is required to precede the entries; in rss, this isn't required but is typically the case. in other words, by the time this method is ...
nsIFeedResult
when a feed triggers a fatal error during xml parsing. there may still be feed metadata and entries that were parsed before the error occurred. doc nsifeedcontainer the parsed feed or entry. null if a non-feed was processed. headers nsiproperties the http response headers that accompanied the feed. stylesheet nsiuri an xslt stylesheet available to trans
form the source of the feed. some feeds include this in
formation in a processing instruction. it's generally intended for use by clients designed to work with specific feeds. uri nsiuri the address from which the feed was fetched. version astring the version of the feed; null if a non-feed is processed. this value will be one of the following: atom, rss2, rss09, rss091, r...
nsIFileOutputStream
a file. inherits from: nsioutputstream last changed in gecko 1.7 method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants behavior flag constants constant value description defer_open 1<<0 see the same constant in nsifileinputstream. the deferred open will be per
formed when one of the following is called: seek() tell() write() flush() defer_open is useful if we use the stream on a background thread, so that the opening and possible stating of the file happens there as well. note: using this flag results in the file not being opened during the call to init(). this means that a...
nsIFileProtocolHandler
in nsifile file ); parameters file the nsifile to convert. return value corresponding url string. the resulting string may contain url-escaped characters. geturlspecfromfile() converts the nsifile to the corresponding url string. if the nsifile is a local file, then the result will be a file:// url string. the resulting string may contain url-escaped characters. note: under some plat
forms this is a lossy conversion. note: callers should use geturlspecfromactualfile() if possible, for per
formance reasons. autf8string geturlspecfromfile( in nsifile file ); parameters file the nsifile to convert. return value corresponding url string. the resulting string may contain url-escaped characters. newfileuri() this method constructs a new file uri. nsiuri newfileuri( in n...
nsIFrameLoader
lent for cross-process event handling. void sendcrossprocesskeyevent( in astring atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault ); parameters atype the event type. akeycode the key code. acharcode the character code. amodifiers the modifier flags. apreventdefault whether or not to prevent default actions from being per
formed. sendcrossprocessmouseevent() creates and sends a mouseevent to the content viewport's process. see nsidomwindowutils.sendmouseevent() for details; this method is its equivalent for cross-process event handling. void sendcrossprocessmouseevent( in astring atype, in float ax, in float ay, in long abutton, in long aclickcount, in long amodifiers, [optional] in boolean aignoreroo...
nsIGeolocationProvider
xpcom/system/nsigeolocationprovider.idlscriptable notify the geolocation service that a new geolocation has been discovered. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) this must be called on the main thread interface provides location in
formation to the nsgeolocator via the nsidomgeolocationcallback interface. after startup() is called, any geo location change should call callback.update(). the nsigeolocationprovider interface provides in
formation about the current users location to interested parties via nsigeolocationupdate. after the provider has been initialized, any changes to location should call callback.onrequest(). you may find the wifi access point monitoring...
nsIGeolocationUpdate
provider to notify the system that a new location is available. method overview void update(in nsidomgeoposition position); methods update() notify the geolocation service that a new geolocation has been discovered. note: this must be called on the main thread. void update( in nsidomgeoposition position ); parameters position a nsidomgeoposition object describing the updated position in
formation. see also using geolocation nsigeolocationprovider w3c geolocation specification ...
nsIGlobalHistory2
it was split off from nsiglobalhistory during the transition to toolkit interfaces. inherits from: nsisupports last changed in gecko 1.7 this interface replaces and deprecates nsiglobalhistory method overview void adduri(in nsiuri auri, in boolean aredirect, in boolean atoplevel, in nsiuri areferrer); boolean isvisited(in nsiuri auri); void setpagetitle(in nsiuri auri, in astring atitle); methods adduri() add a uri to global history. note: docshell will not filter out uri schemes like chrome:, data:, about: and view-source:. ...
nsIHttpActivityObserver
ponse has started to arrive. activity_subtype_response_header 0x5004 the http response header has arrived. activity_subtype_response_complete 0x5005 the complete http response has been received. activity_subtype_transaction_close 0x5006 the http transaction has been closed. methods observeactivity() called when activity occurs on the http transport. you should implement this method to per
form whatever tasks you wish to per
form when http activity occurs. void observeactivity( in nsisupports ahttpchannel, in pruint32 aactivitytype, in pruint32 aactivitysubtype, in prtime atimestamp, in pruint64 aextrasizedata, in acstring aextrastringdata ); parameters ahttpchannel the nsihttpchannel on which the activity occurred. aactivitytype the type of activity that occurred; this wil...
nsIHttpServer
if type is empty, removes any extant * mapping, if one is present. * * @throws ns_error_invalid_arg * if the given type is not a valid header field value, i.e. if it doesn't * match the field-value production in rfc 2616 * @note * no syntax checking is done of the given type, beyond ensuring that it is * a valid header fie...
nsIHttpUpgradeListener
6.0 / seamonkey 2.3) this is used, for example, by websockets in order to upgrade an http channel to use the websocket protocol. method overview void ontransportavailable(in nsisockettransport atransport, in nsiasyncinputstream asocketin, in nsiasyncoutputstream asocketout); methods ontransportavailable() called when an http protocol upgrade attempt is completed, passing in the in
formation needed by the protocol handler to take over the channel that is no longer being used by http. note: to begin a protocol upgrade, call nsihttpchannelinternal.httpupgrade(). void ontransportavailable( in nsisockettransport atransport, in nsiasyncinputstream asocketin, in nsiasyncoutputstream asocketout ); parameters atransport the nsisockettransport describing the socket conn...
nsIInputStream
an isnonblocking(); unsigned long read(in charptr abuf, in unsigned long acount); native code only! unsigned long readsegments(in nswritesegmentfun awriter, in voidptr aclosure, in unsigned long acount); native code only! methods available() determine number of bytes available in the stream. in addition to the number of bytes available in the stream, this method also in
forms the caller of the current status of the stream. a stream that is closed will throw an exception when this method is called. that enables the caller to know the condition of the stream before attempting to read from it. if a stream is at end-of-file, but not closed, then this method returns 0 bytes available. note: some nsiinputstream implementations automatically close() when end-of-file is re...
nsIJSON
om native code, and provides a way to encode a jsval to a json string for use in your native code. astring encodefromjsval( in jsval value, in jscontext cx ); parameters value a pointer to the jsval to encode. cx the javascript runtime context to use to encode the value. return value a json string representing the value. encodetostream() encodes a javascript object into json
format, writing it to a stream. void encodetostream( in nsioutputstream stream, in string charset, in boolean writebom in jsobject value ); parameters stream the nsioutputstream to which to write the json string. charset the string encoding to use. only the five unicode encodings "utf-8", "utf-16le", "utf-16be", "utf-32le" and "utf-32be" are supported. writebom specify true if...
nsIJetpack
ticular message. void unregisterreceivers( in astring amessagename ); parameters amessagename the name of the message to unregister all callbacks from. evalscript() this asynchronously sends code to the jetpack process for evaluation. the code will be evaluated using at least javascript 1.8.1. when evaluated, the script's global scope will include all privileged apis. individual lines of the
form //@line 1 "foo.js" can be used to specify filename and line number in
formation for debugging purposes. void evalscript( in astring ascript ); parameters ascript the full contents of the script to evaluate in the jetpack process. createhandle() this creates an opaque handle that can transparently be exchanged between processes. nsivariant createhandle(); parameters none. return value the new...
nsILocaleService
he user's os setting for preferred locale. getlocalecomponentforuseragent() gets the user preference for locale from the operating system. note: this has nothing to do with any http user-agent. this method returns the same as getsystemlocale.getcategory("nsilocale_messages"). astring getlocalecomponentforuseragent(); parameters none. return value the user's os setting for preferred locale in the
format described in nsilocale. getlocalefromacceptlanguage() gets the most preferred locale from a list of locale preferences. nsilocale getlocalefromacceptlanguage( in string acceptlanguage ); parameters acceptlanguage locale preference in the same
format as the accept-language http header. return value the most preferred locale according to the acceptlanguage parameter. getsystemlocale(...
nsILoginManagerCrypto
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview astring decrypt(in astring ciphertext); astring encrypt(in astring plaintext); attributes attribute type description isloggedin boolean current login state of the token used for encryption. if the user is not logged in, per
forming a crypto operation will result in a master password prompt. read only. uibusy boolean true when a master password prompt is being displayed. read only. methods decrypt() decrypts the specified string, returning the plain text value. can throw if the user cancels entry of their master password, or if the ciphertext value can not be successfully decrypted (for example, if it was encrypted w...
nsILoginManagerIEMigrationHelper
dlscriptable imports a login from the nsiieprofilemigrator into the login manager. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void migrateandaddlogin(in nsilogininfo alogin); methods migrateandaddlogin() takes a login provided from nsieprofilemigrator, migrates it to the current login manager
format, and adds it to the list of stored logins. note: in some cases, multiple logins may be created from a single input when the
format is ambiguous. void migrateandaddlogin( in nsilogininfo alogin ); parameters alogin the login to be migrated. ...
nsIMemory
rticular nsimemory instance may choose not to implement this method. void heapminimize( in boolean immediate ); parameters immediate if true, heap minimization will occur immediately if the call was made on the main thread. if false, the flush will be scheduled to happen when the app is idle. islowmemory determine if we are in a low-memory situation (what constitutes low-memory is plat
form dependent). this can be used to trigger the memory pressure observers. note: this method was deprecated in gecko 2.0. if you need to monitor low memory conditions, you should watch for the low memory notifications "memory-pressure" notifications instead. boolean islowmemory(); parameters none. return value true if we are in a low-memory situation. otherwise false. note: from gecko 2.0 ...
nsIMemoryMultiReporterCallback
ter instances. 1.0 66 introduced gecko 7.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method overview void callback(in acstring process, in autf8string path, in print32 kind, in print32 units, in print64 amount, in autf8string description, in nsisupports closure); methods callback() called to provide in
formation from a multi-reporter. implement this method to handle the report in
formation. void callback( in acstring process, in autf8string path, in print32 kind, in print32 units, in print64 amount, in autf8string description, in nsisupports closure ); parameters process the value of the process attribute for the memory reporter. path the value of the path attribute. ...
nsIMemoryReporter
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) any piece of code that wishes to allow its memory use to be monitored may create an nsimemoryreporter object and then register it by calling nsimemoryreportermanager.registerreporter(). once that has been done, the reporter will be found by any client accessing the enumerator returned by nsimemoryreportermanager.enumeratereporters(). this includes the about:memory page. ...
nsIMessageBroadcaster
l] in astring messagename, [optional] in jsval obj, [optional] in jsval objects); nsimessagelistenermanager getchildat(in unsigned long aindex); broadcastasyncmessage() like sendasyncmessage(), but also broadcasts this message to all "child" message managers of this message manager. see nsimessagelistener::receivemessage() for the
format of the data delivered to listeners. warning: broadcasting messages can be very expensive and leak sensitive data. use with extreme caution. throws ns_error_not_initialized if the sender is not initialized. for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up. throws ns_error_failure when the m...
nsIMessageSender
[optional] in jsval obj, [optional] in jsval objects, [optional] in nsiprincipal principal); sendasyncmessage() send messagename and obj to the "other side" of this message manager. this invokes listeners who registered for messagename using a nsimessagelistenermanager. see nsimessagelistener::receivemessage() for the
format of the data delivered to listeners. throws ns_error_not_initialized if the sender is not initialized. for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up. throws ns_error_failure when the message receiver cannot be found. for example, we will throw ns_error_failure if we try to send a message...
nsIMicrosummaryGenerator
esent the actual microsummary do not. read only. uri nsiuri the canonical location and unique identifier of the generator. it tells us where the generator comes from and where to go for updates. read only. for generators referenced by web pages via <link> tags, this uri is the url specified by the tag. for generators installed via nsisidebar.addmicrosummarygenerator(), this uri is a urn of the
form urn:source:<url>, where <url> is the remote location from which we installed the generator. for generators installed via some other mechanism (for example an extension that dynamically creates generators), this uri is a urn in a
form of the extension's own choosing, with the only restriction being that the uri be globally unique. to ensure this, we recommend that such extensions incorporate uuids...
nsIMicrosummaryService
ters bookmarkid the bookmark to check. microsummary the microsummary to check. return value returns whether or not the microsummary is the current one for the bookmark. refreshmicrosummary() refreshes a microsummary, updating its value in the datastore and ui. if this method can refresh the microsummary instantly, it will. otherwise, it'll asynchronously download the necessary in
formation (the generator and/or page) before refreshing the microsummary. callers should check the content property of the returned microsummary object to distinguish between sync and async refreshes. if its value is null, then it's an async refresh, and the caller should register itself as an nsimicrosummaryobserver via nsimicrosummary.addobserver() to find out when the refresh completes. nsimicrosum...
Building an Account Manager Extension
[ 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. therefore we add the following code to the previous. the javascript file has to be saved either in the extension's or thunderbird's component directory. // define the contract in
formation needed for this component... // ... the unique component identifier (change it if you copied this example!)... devmoaccountmanagerextension.prototype.classid = components.id("{659ce960-9dfb-11dd-ad8b-0800200c9a55}"); // ... the description and ... devmoaccountmanagerextension.prototype.classdescription = "devmo account manager extension"; // ... textual unique identifier or rendez-vous po...
nsIMsgIdentity
each identity is identified by a key, which is the id string in the identity preferences, such as in mail.identity.<id>.replyto. ...
nsIMsgProtocolInfo
may be deleted. read only. canduplicate boolean unused. read only. cangetincomingmessages boolean true if junk ui actions should be enabled for the account type. read only. cangetmessages boolean true if "get messages" ui actions should be enabled for the account type. read only. canloginatstartup boolean true if the account type can per
form biff during startup. read only. defaultdobiff boolean true if the biff should be enabled by default for the account type. read only. defaultlocalfilepath nsilocalfile the default path under which all server data for this account type will be stored. folderscreateasync boolean new in thunderbird 24 (bug 832034) preflightprettynamewithemailaddre...
nsIMsgSearchCustomTerm
*/ readonly attribute acstring id; name /// name to display in term list. this should be localized. ...
nsIMsgSearchSession
(e.g. a mail folder) to the search. void addscopeterm(in nsmsgsearchscopevalue scope, in nsimsgfolder folder); parameters scope folder adddirectoryscopeterm() void adddirectoryscopeterm(in nsmsgsearchscopevalue scope); parameters scope clearscopes() void clearscopes(); scopeusescustomheaders() call this function everytime the scope changes! it in
forms the fe if the current scope support custom header use. fes should not display the custom header dialog if custom headers are not supported. [noscript] boolean scopeusescustomheaders(in nsmsgsearchscopevalue scope, in voidptr selection, in boolean forfilters); parameters scope selection could be a folder or server based on scope forfilters ...
nsIMsgWindow
description windowcommands nsimsgwindowcommands this allows the backend code to send commands to the ui, such as clearmsgpane. statusfeedback nsimsgstatusfeedback this allows the backend code to send status feedback to the ui. msgheadersink nsimsgheadersink this allows the backend code to send message header in
formation to the ui. transactionmanager nsitransactionmanager this is used to track undo/redo transactions. openfolder nsimsgfolder this is used to track the folder currently open in the ui. rootdocshell nsidocshell this is used to track the chrome window's nsidocshell object. you don't normally need to set this, inste...
nsINavHistoryContainerResultNode
s. if this container is a remote container, this flag may be redefined by the remote container provider. read-only. containeropen boolean set this to true to allow descent into this container. when closed, attempting to call getchild() or access childcount results in an error. when you're done reading the container's children, set this to false. for host and day groupings, doing this has no per
formance cost since the children have already been computed. for queries and bookmark folders, however, being open means they must keep themselves up-to-date by listening for updates and re-querying as needed. dynamiccontainertype autf8string a string representing the dynamic container api service responsible for this container. accessing this throws an exception if the node isn't a dynamic contain...
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 in
formation 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 in
formation returned in this interface is not commonly used, hence its separation into a separate query type for efficiency. attributes attribute type description referringvisitid long long the referring visit id; the referrer should have the same session id as the visit described by this record. read only...
nsINavHistoryObserver
acstring aguid ); parameters auri the uri of the page whose visits have been expired. avisittime the largest visit time in microseconds that has been expired. we guarantee that we do not have any visit older than this date. aguid the unique id associated with the page. onendupdatebatch() called once a batch of updates is completed. once this has been called, you can per
form processing, user interface updates, and so forth. this is called sometime after onbeginupdatebatch(). void onendupdatebatch(); parameters none. onpagechanged() some attribute on the specified page has 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? void onpagechanged( in nsiuri auri, in uns...
nsINavHistoryQuery
arch terms. tags nsivariant a list of tags to use for filtering query results. this attribute must be an array of strings. duplicate tags may be specified, but when reading the list, only unique tags are returned. when called as a getter, this returns an array of strings sorted in ascending lexicographical (alphabetical) order. this array may be empty, in which case no filtering by tags is per
formed. to search for items that are tagged with any given tags instead of all, multiple queries may be passed to the nsinavhistoryservice method nsinavhistoryservice.executequeries(). tagsarenot boolean if true, the results include only items that are not tagged with the specified tags. if false, only tags in the tags list are included in the results. uri nsiuri this is a uri to match, to, for ...
nsINavHistoryQueryOptions
istory. resolvenullbookmarktitles boolean if a bookmark title is null (note, not empty), attempt to use the history title. it is set to false by default. resulttype short sets the result type. see result type constants for possible values. showsessions boolean separate/group history items based on session in
formation. only matters when sorting by date. sortingannotation autf8string the annotation to use in sort_by_annotation_* sorting modes. sortingmode short the sorting annotation to use; see sorting methods for possible values. constants sorting methods you can ask for the results to be pre-sorted. since the db has indices of many items, ...
nsINavHistoryResultObserver
esult. methods batching() lets the observer know when a batch operation in places is about to start or end. the observer can then pause updates or events until the batch is completed, so that it won't handle the large number of updates that are about to be notified. this is especially useful when updating user interfaces, to avoid flicker or continuous selection changes, which may result in per
formance degradation (for example, if updating a view for each update). void batching( in boolean atogglemode ); parameters atogglemode specify true to start batch mode or false to finish the batch. containerclosed() obsolete since gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) called when a container node's state changes from opened to closed. note: this m...
nsIScriptError2
ro if the error was initialized by calling nsiscripterror.init() instead of initwithwindowid(). read only. outerwindowid unsigned long long the window id with which the error is associated. this is zero if the error was initialized by calling nsiscripterror.init() instead of initwithwindowid(). read only. timestamp long long elapsed time, in milliseconds, from a plat
form-specific zero time to the time the message was created. read only. methods initwithwindowid() void init( 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 ); parameters message the text of the message to add to the log. sourc...
nsISecurityCheckedComponent
caps/idl/nsisecuritycheckedcomponent.idlscriptable provides methods that let an xpcom component define custom rules for accessing it from potentially unprivileged code. inherits from: nsisupports last changed in gecko 1.7 capability strings in gecko, a "capability" is a string identifying a set of actions that code is allowed to per
form. two examples: code that has the "universalxpconnect" capability is allowed to access all of xpcom. this includes creating instances of arbitrary xpcom objects and calling methods and setting properties on them. code that has the "universalbrowserread" capability is allowed to per
form certain actions that allow it to read in
formation from the local system. for example, this capability allows code to set the value of <input type="file"> and a...
nsISessionStartup
verview boolean dorestore(); attributes attribute type description sessiontype unsigned long the type of session being restored; this will be one of the session type constants. read only. state jsval the session state, as a javascript object. read only. note: prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5), this was a string. it was changed in order to improve per
formance, which was suffering due to the need to parse and stringify the data. constants session type constants constant value description no_session 0 there's no data available from the previous session. recover_session 1 the last session crashed. it will either be restored or about:sessionrestore will be displayed. resume_session 2 the previous session should be restored at startup. ...
nsISessionStore
he index of the window to be restored. this should be a value from 0 to one less than that returned by getclosedwindowcount(). the list of closed windows is stored in last in/first out (lifo) order, so the window at index 0 is the last one that was closed. return value returns a reference to the reopened window as an nsidomwindow object. note on windows the nsisessionstore api stores state in
formation for certain windows inside the web brower. these windows are nsidomwindow objects that contain the tabbrowser that users see as tabs; the document in these windows is browser.xul. for many extensions, those that overlay browser.xul, the appropriate window object for nsisessionstore is the global object 'window'. for javascript running in windows other than the one you want to use in nsises...
nsISmsService
message. read a boolean indicating whether a message is marked as read or unread. return value a smsmessage getnumberofmessagesfortext() unsigned short getnumberofmessagesfortext( in domstring text ); parameters text a domstring text to check. return value the number of multi-part sms needed for a given text (160 characters for one sms). hassupport() checks if the current plat
form has sms support. boolean hassupport(); return value boolean. send() void send( in domstring number, in domstring message, in long requestid, in unsigned long long processid optional ); parameters number a domstring with a telephone number to send to. message a domstring with the text message. requestid missing description processid optional missing description see also...
nsISocketProvider
when set, the hostname parameter passed in this interface will be used instead of the address structure passed for a later request. anonymous_connect 1 << 1 when setting this flag, the socket will not apply any credentials when establishing a connection. for example, an ssl connection would not send any client-certificates if this flag is...
nsISocketTransportService
type should be used. you do not need to specify the strings "socks" or "socks4", use the aproxyinfo instead. ahost specifies the target hostname or ip address literal of the peer for this socket. aport specifies the target port of the peer for this socket. aproxyinfo specifies the transport-layer proxy type to use. set to null if no proxy should be used. for more details on communicating in
formation about proxies like socks (which are transparent to upper protocols), see nsiproxiedprotocolhandler , nsiprotocolproxyservice or proxies in necko. return value an nsisockettransport containing the sockettransport. init() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void init(); parameters none. native code only! notifywhencanattachsocket if the number ...
nsISpeculativeConnect
() to let the networking layer know what you might be doing in the future. method overview void speculativeconnect(in nsiuri auri, in nsiinterfacerequestor acallbacks, in nsieventtarget atarget); methods speculativeconnect() call this method to hint to the networking layer that a new transaction for the specified uri is likely to happen soon. the code implementing this method may use this in
formation to start a tcp and/or ssl level handshake for that resource immediately so that it is ready (or at least in the process of becoming ready) when the transaction is actually submitted. no obligation is taken on by the implementer, nor is the submitter obligated to actually open the new channel. void speculativeconnect( in nsiuri auri, in nsiinterfacerequestor acallbacks, in nsieventtarge...
nsIStackFrame
inenumber print32 valid line numbers begin at '1'. '0' indicates unknown. read only. name string the name of the function at this point in the stack. read only. sourceline string the location of this function in filename read only. example to output the stack at a particular location: var s = components.stack; while(s) { console.log(s.name); s = s.caller; } methods tostring() a generic
formatter - make it suitable to print, and so forth. string tostring(); parameters none. return value a string suitable for output. see also jsdistackframe ...
type
in
formation is now located at: nsisupportsprimitive.constants ...
nsISyncMessageSender
syncmessage() like sendasyncmessage(), except blocks the sender until all listeners of the message have been invoked. returns an array containing return values from each listener invoked. send messagename and obj to the "other side" of this message manager. this invokes listeners who registered for messagename using a nsimessagelistenermanager. see nsimessagelistener::receivemessage() for the
format of the data delivered to listeners. throws ns_error_not_initialized if the sender is not initialized. for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up. throws ns_error_failure when the message receiver cannot be found. for example, we will throw ns_error_failure if we try to send a message...
nsITXTToHTMLConv
ttohtmlconv.idlscriptable this interface allows you to modify the conversion from plain text to html. inherits from: nsistreamconverter last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by "@mozilla.org/streamconv;1?from=text/plain&to=text/html". you should normally obtain an instance via the nsistreamconverterservice interface. method overview void pre
formathtml(in boolean value); void settitle(in wstring text); prior versions of the interface named the methods using the initialcaps style instead of the intercaps style. methods pre
formathtml() specifies whether or not to wrap the resulting html in an <pre> block. void pre
formathtml( in boolean value ); parameters value true to wrap the resulting html in a <pre> block. settitle() sets th...
nsITaskbarPreviewController
omcanvasrenderingcontext2d ctx, in unsigned long width, in unsigned long height); boolean onactivate(); void onclick(in nsitaskbarpreviewbutton button); void onclose(); attributes attribute type description height unsigned long the height in pixels of the preview image. this value may change at any time. see drawpreview() for more in
formation. read only. thumbnailaspectratio float the thumbnail's aspect ratio. this doesn't need to match the preview's aspect ratio, and is allowed to be changed at any time. see drawthumbnail() for more in
formation. read only. width unsigned long the width in pixels of the preview image. this value may change at any time. see drawpreview() for more in
formation. read onl...
nsIThreadEventFilter
you should implement this interface and its acceptevent() method, then pass the object implementing it as the filter. xpcom/threads/nsithreadinternal.idlscriptable please add a summary to this article. ...
nsIToolkitProfile
attribute type description localdir nsilocalfile the location of the profile local directory, which may be the same as the root directory. see nsiprofilelock.localdirectory(). read only. name autf8string the profile's name. rootdir nsilocalfile the location of the profile directory. read only. methods lock() locks the profile using plat
form-specific locking methods. nsiprofilelock lock( out nsiprofileunlocker aunlocker ); parameters aunlocker on error, contains an nsiprofileunlocker object you can use to unlock the profile. note: the unlocker object cannot be returned to javascript as the error causes an exception to be thrown. the unlocker object is only available in gecko 34 or later when running on windows vista...
nsIXmlRpcClient
ollows: i4 or int: nsisupportsprint32 boolean: nsisupportsprbool string: nsisupportscstring double: nsisupportsdouble datetime.iso8601: nsisupportsprtime base64: nsisupportscstring array: nsisupportsarray struct: nsidictionary faults (server side errors) are indicated by returning ns_error_failure. via nsixpconnect::getpendingexception()->data a nsixmlrpcfault object can be retreieved with more in
formation on the fault. parameters listener a nsixmlrpcclientlistener that will get notified of xml-rpc events ctxt a context to be passed on to the listener methodname remote method to call arguments array of arguments to pass to the remote method count void asynccall ( in nsixmlrpcclientlistener listener, in nsisupports ctxt, in string methodname, [array, size_is(count)]...
nsMsgSearchTypeValue
defined in comm-central/ mailnews/ base/ search/ public/ nsmsgsearchcore.idl used to specify type of search to be per
formed [scriptable,uuid(964b7f32-304e-11d3-ae13-00a0c900d445)] interface nsmsgsearchtype { const nsmsgsearchtypevalue none = 0; const nsmsgsearchtypevalue rootdse = 1; const nsmsgsearchtypevalue normal = 2; const nsmsgsearchtypevalue ldapvlv = 3; const nsmsgsearchtypevalue namecompletion = 4; }; ...
NS_CStringGetData
pruint32 ns_cstringgetdata( const nsacstring& astring, const char** adata, prbool* aterminated = nsnull ); parameters astring [in] a nsacstring instance to inspect. adata [out] a const pointer to the string's internal buffer. aterminated [out] this optional result parameter indicates whether or not adata is null-terminated. it may be null if the caller is not interested in this in
formation. return values the ns_cstringgetdata function returns the length of adata, measured in storage units (bytes). example code // count the number of times a particular character appears in a string. pruint32 countchar(const nsacstring& str, char c) { const char* data; pruint32 len = ns_cstringgetdata(str, &data); pruint32 count = 0; for (pruint32 i = 0; i < len; ++i) { if ...
XPCOM reference
01, 2010) list of mozilla interfaces as listed on the xpcom interface reference page where that page lists items by alphabetical sorting, this page attempts to group them by function. grouping and category names were made by somewhat arbitrary decision by the author. (i'm fully aware that this will be a great point of di...
The Thread Manager
rocessing. only c++ code may use the thread manager and xpcom thread. application/extension javascript should consider using a chromeworker instead.") interfaces there are several interfaces that provide threading support: nsithreadmanager the thread manager itself lets you create threads. nsithread the nsithread interface encapsulates an operating system thread, providing easy cross-plat
form access to multithreading in your code. nsithreadpool a thread pool provides a limited set of worker threads. when you dispatch an event to the pool, the pool selects an available worker thread to process the event. nsithreadinternal a subclass of nsithread that is implemented by the xpcom thread object to add support for observing dispatch activity on a thread. nsithreadobserver provides th...
Troubleshooting XPCOM components registration
your contract id. if the response is your contract id instead of an error, the component was successfully registered and this is the wrong page. load failure of binary components on the mozilla trunk (firefox 3, xulrunner 1.9), components that fail to load will print an error to the error console. chrome errors must be enabled. if the error appears, you can use nspr logging to see additional in
formation about the failure by running firefox from a command prompt: rem close all firefox windows! set nspr_log_modules=nsnativemoduleloader:5 set nspr_log_file=c:\path\to\logfile "c:\program files\mozilla firefox\firefox.exe" examining this log for warning and errors may provide valuable clues why the component failed to load. if using firefox 4 / xulrunner 2.0, make sure that your extension is...
Status, Recent Changes, and Plans
tarted guide, the reference manual, or the faq. i put this section at the top so that checking for recent changes will be easy. recent changes to nscomptr most recent first made == and != between an nscomptr and a raw pointer (or a literal 0 or nsnull) work correctly on all compilers. see bug 65664. made getter_addrefs( nscomptr& ) apply the same type-safety check that the simple assignment
forms do. added do_createinstance. added do_getservice. eliminated the need to cast getter_addrefs when an nsisupports** is needed. relaxed the invariant for nscomptr<nsisupports>, so that it is now a pointer to any xpcom interface. added do_queryreferent to make using nsiweakreferences easier. plans for nscomptr bug 59212: as soon as we test on more compilers, start recommending already_add...
Using nsCOMPtr
t changes to nscomptr getting started guide introduction using nscomptr summary reference manual the basics initialization and assignment using an nscomptr<t> as a t* efficiency and correctness compiler annoyances frequently asked questions buildtime errors runtime errors how do i... general bibliography original document in
formation author(s): scott collins last updated date: december 11, 2001 copyright in
formation: copyright © 1999, 2000 by the mozilla organization; use is subject to the mpl. portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Using nsIClassInfo
re writing javascript code which uses a c++ class implementing nsiclassinfo, you don't need to do anything to activate the auto-interface magic which makes calling queryinterface unnecessary. it just happens. how do i make my c++ class implement nsiclassinfo? see nsiclassinfoimpl.h for instructions. how does nsiclassinfo work? that's also detailed in nsiclassinfoimpl.h. original document in
formation authors: mike shaver, justin lebar last updated date: july 25, 2011 copyright in
formation: portions of this content are © 1998–2011 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Weak reference
nd; this must be before the destructor, which would otherwise never be called. you might hold a raw pointer (without addrefing and releaseing it), and avoid using it in cases where it might dangle. see also the source xpcom/base/nsiweakreference.idl xpcom/glue/nsweakreference.h xpcom/glue/nsweakreference.cpp xpcom ownership guidelines using nscomptr original document in
formation author: scott collins last updated date: september 23, 2000 copyright in
formation: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
XPCOM ownership guidelines
parents point to their children with owning-pointers, children point back to their parents with non-owning-pointers. containers own the things they contain (and not the reverse). use nscomptrs to implement owning-pointers. it's explicit, efficient, and fairly bullet-proof. it's easier to write `getter's and `setter's; and you don't need to put anything in your destructor. original document in
formation author: scott collins last updated date: may 8, 2003 copyright in
formation: copyright© 1999 by netscape; use is subject to the npl. portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
already_AddRefed
lready_addrefed in this case over returning a raw pointer or nscomptr (see the nscomptr user manual). defined in: mfbt/alreadyaddrefed.h. example ... already_addrefed<nsifoo> getfoo() { nsifoo* foo = mfoo; ns_if_addref(foo); return foo; } // or already_addrefed<nsifoo> getfoo() { nscomptr<nsifoo> foo = mfoo; // ... return foo.forget(); } ... // the following assignment doesn't per
form an additional addref, // as it would do if getfoo() returned a raw pointer. nscomptr<nsifoo> foo = getfoo(); see also nscomptr, getteraddrefs(), dont_addref(). ...
nsCOMPtr versus RefPtr
awptr is a canonical t pointer (i.e., that mrawptr->queryinterface(t_iid) == mrawptr). do_queryinterface versus do_queryobject the do_queryinterface helper is only available when assigning to nscomptr. it also requires that the argument singly inherit from nsisupports (since the type of the argument is nsisupports*). for other cases, there is do_queryobject, which is essentially a more powerful
form of do_queryinterface. it differs from do_queryinterface as follows: do_queryobject inherits from nscomptr_helper, so it can be assigned into both nscomptr and refptr. the downside of this inheritance is that do_queryobject requires an extra virtual call to operator() in the helper method. do_queryobject is templated on the argument type, so it's possible to pass in objects that multiply inher...
pyxpidl
n use for a while, but replaced xpidl in the gecko sdk starting in gecko 9.0. using pyxpidl pyxpidl is in the sdk in the sdkdir/sdk/bin/ directory. 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. pyxpidl requires a directory to cache certain in
formation in. you can use a temporary directory or the current directory or whatever works best for you. 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 <outpu...
XSLT 2.0
although xslt 2.0 is not natively supported in firefox, it is possible via saxon-b (java) or, more recently, saxon-ce (javascript) to per
form xslt 2.0. for users saxon-ce no extensions are required, saxon-ce runs whenever a html page is loaded that links to the saxon-ce javascript library. saxon-b the xsl results extension uses the new incarnation of liveconnect (handled by java 1.6v12+ instead of mozilla-specific code) to connect with the java-based saxon-b library, and adds support for having xslt per
formed automatically when visiting a page with the appropriate xslt processing instruction (and which isn't processed by firefox's own xslt 1.0 processor). for developers saxon-ce a javascript api is provided for initiating an xslt 2.0 trans
form from a web page. error and diagn...
Create Custom Column
the article "creating a custom column" will get you well on the road to creating your own columns and populating them with custom data. the customdbheaders preference article provides in
formation on a preference setting that exposes custom header data for use in a custom column within thunderbird's main view. ...
Use SQLite
to use an sqlite database in your extension you'll need to look over the storage docs for an api reference, however this code should get you started. be careful of multi-thread access to your database. this will create an sqlite db named tbird.sqlite inside your profile directory with a table called attachments. you can see the schema for the attachments table in the code. to double check the in
formation you've inserted you can query the tbird.sqlite file using regular sqlite programs. const cc = components.classes; const ci = components.interfaces; var tbirdsqlite = { onload: function() { // initialization code this.initialized = true; this.dbinit(); }, dbconnection: null, dbschema: { tables: { attachments:"id integer primary key, \ ...
Tips and Tricks from the newsgroups
nt and send it repeat image display using css sprites messages use reminderfox to open a message in the default thunderbird message window (when messageuri, folderuri and gdbview are unknown) determine whether a message has been flagged as junk imap: getting message key of copied message by nsimsgcopyservice::copyfilemessage access the plain text content of the email body get in
formation about attachment without selecting message repeat image display using css sprites scan for new messages at startup and manually scan a folder initiated by user force listeners to run consecutively to prevent pop messages from getting garbled during message retrieval ...
libmime content type handlers
part of the c based object system. the following xp-com interface is implemented by libmime and is necessary for content type handler plugin development. /* * this interface is implemented by content type handlers that will be * called upon by libmime to process various attachments types. ...
Using popup notifications
, also known as "doorhanger notifications", are presented to notify the user of something that's important but may not need immediate attention. these non-modal notifications let the user make decisions when they have a moment to do so, instead of being forced to deal with them at possibly inconvenient times. for example, this popup notification is displayed when a web site requests geolocation in
formation: this lets the user decide whether or not to share their location when it's convenient to do so, instead of being compelled to do it at once. in addition, notifications can be dismissed and recalled by clicking anywhere outside the notification, then clicking on the notification icon to bring it back again. a popup notification can include a text message, a button action, and zero or mor...
Using tab-modal prompts
then apply it, like in the example below, here we apply the prompt with a checkbox: var window = gbrowser.contentwindow; var promptfact = components.classes['@mozilla.org/prompter;1'].getservice(components.interfaces.nsipromptfactory); var prompt = promptfact.getprompt(window, components.interfaces.nsiprompt); var promptbag = pr...
XPI
xpi modules (so called "bundles") are employed to install a wide variety of software, including plugins, extensions, themes, and thunderbird dictionaries. an xpi contains installation instructions (install.js or install.rdf) as well as the actual software to install, which is often itself packaged as a jar file. when downloaded or dropped into an extension manager, xpinstall automatically interacts with the installation instructions contained in the xpi, and installs the contained software. xpi archives only support files stored uncompressed or compressed using the "deflate" method. ...
Using Objective-C from js-ctypes
est.m, and run with the following command, inside the same directory as the saved file (needs xcode). $ clang -framework appkit test.m && ./a.out class, message, and selector our task at hand is to convert objective-c syntax to c syntax. let's look at the following codelet: [nsspeechsynthesizer alloc] it passes an alloc message to the nsspeechsynthesizer class, in objective-c syntax. it per
forms the following through this objective-c syntax: get the nsspeechsynthesizer class definition. register the alloc selector for the message. send a message to the class, with the selector. get a reference to a class class definitions are retrieved with the objc_getclass function, declared in /usr/include/objc/runtime.h. the objc_getclass function receives the name of the class, looks up the...
Declaring types
y, leave out the field descriptor array; this creates an opaque structure whose contents are not defined. note: at present, there isn't a way to specify that an array's c equivalent was declared as a packed structure; that is, using #pragma pack. field descriptors each field descriptor is comprised of a field name and its data type, represented as a string and a ctype object, respectively. the
format, then, looks like this: [ { field1: type1 }, { field2: type2 }, ... { fieldn: typen } ] example for example, to support the c tm structure using js-ctypes, you would use the following code: const struct_tm = new ctypes.structtype("tm", [ { "tm_sec": ctypes.int }, { "tm_min": ctypes.int }, { "tm_hour": ctype...
Using js-ctypes
sed to load the library. otherwise, the system looks for the library in its standard locations. windows on windows, the following locations are searched for the library, in this order: the application's directory. the system directory. the 16-bit system directory. the windows directory. the current working directory the directories listed in the path environment variable. note: this in
formation comes from this article on msdn. after you're done when you're finished using a library, you should close it by calling the library object's close() method: lib.close(); if you fail to close the library, it will be automatically closed when it is garbage collected. using the library you may need to declare new types. these can be simple types or more complex types such as structures. s...
ABI
-us/library/9b372w95.aspx details with respect to js-ctypes this explains how to use it in the js-ctypes scope. three different abis exist: ctypes.default_abi, ctypes.stdcall_abi, and ctypes.winapi_abi. ctypes.default_abi corresponds to cdecl; standard libraries use this abi. you can also use this for various system calls,including those on mac os x and linux. ctypes.thiscall_abi more in
formation is available at bugzilla :: 552533. ctypes.stdcall_abi used for calling functions declared with stdcall on windows. these functions' names are automatically mangled for you by js-ctypes. ctypes.winapi_abi used for calling windows system functions. these are declared as stdcall on windows, but do not have mangled names like those used by stdcall_abi above. os specific win32 and os2 cal...
Int64
64-bit integer value. you can therefore use a string to represent a 64-bit value that is too large to represent as a 32-bit javascript number. return value a new object representing the specified value. exceptions thrown typeerror the specified value cannot be converted into a 64-bit integer. either it's not a number, string, or 64-bit integer object, or it's a string that is incorrectly
formatted or contains a value outside the range that can be represented in 64 bits. this will also be thrown if the source value is a floating-point number that can't be precisely represented as a 64-bit integer. method overview number compare(a, b); number hi(a); int64 join(high, low); number lo(a); string tosource(); string tostring([radix]); ...
StructType
overview cdata addressoffield(name) methods inherited from cdata cdata address() string tosource() string tostring() structtype cdata methods addressoffield() returns a new cdata object of the appropriate pointer type, whose value points to the specified field of the structure on which the method was called. see working with strings for more in
formation on how to convert strings. cdata addressoffield( name ); parameters name the name of the field whose address is to be returned. return value a new cdata object of the appropriate pointer type, whose value points to the contents of the specified field. exceptions thrown typeerror name is not a javascript string, or doesn't name a member field of the structure. see also c...
UInt64
64-bit integer value. you can therefore use a string to represent a 64-bit value that is too large to represent as a 32-bit javascript number. return value a new object representing the specified value. exceptions thrown typeerror the specified value cannot be converted into a 64-bit integer. either it's not a number, string, or 64-bit integer object, or it's a string that is incorrectly
formatted or contains a value outside the range that can be represented in 64 bits. this will also be thrown if the source value is a floating-point number that can't be precisely represented as a 64-bit integer. method overview number compare(a, b); number hi(a); uint64 join(high, low); number lo(a); string tosource(); string tostring([radix]);...
PKCS #11 Netscape Trust Objects - Network Security Services
it does not specify a way to store trust objects. trust objects are used to assign an explicit level of trust to a certificate. examples of trust assertions are certificate authority root certificates. this document outlines the way in which nss stores trust objects via pkcs#11. this is not a new design, but documentation of the method already in use. trust objects a trust object describes a level of trust in a certificate for a given usage or purpose. ...
Animation inspector example: Web Animations API - Firefox Developer Tools
1px 1px 5px #808080; margin: 1.5em; } .channel > * { vertical-align: middle; line-height: normal; } #icon { width: 50px; height: 50px; filter: grayscale(100%); } #note { margin-left: 1em; font: 1.5em "open sans",arial,sans-serif; overflow: hidden; white-space: nowrap; display: inline-block; opacity: 0; width: 0; } javascript content var iconkeyframeset = [ { trans
form: 'scale(1)', filter: 'grayscale(100%)'}, { filter: 'grayscale(100%)', offset: 0.333}, { trans
form: 'scale(1.5)', offset: 0.666 }, { trans
form: 'scale(1.5)', filter: 'grayscale(0%)'} ]; var notekeyframeset = [ { opacity: '0', width: '0'}, { opacity: '1', width: '300px'} ]; var iconkeyframeoptions = { duration: 750, fill: 'forwards', easing: 'ease-in', enddelay: 100 } var note...
How to - Firefox Developer Tools
scss grid inspector: examine grid layoutsedit css filtersedit shape paths in cssedit fontsexamine event listenersexamine and edit cssexamine and edit htmlexamine and edit the box modelinspect and select colorsopen the inspectorreposition elements in the pageselect an elementselect and highlight elementsuse the inspector apiuse the inspector from the web consoleview background imagesvisualize trans
formswork with animations ...
UI Tour - Firefox Developer Tools
a quick tour of the main sections of the page inspector's user interface. it covers the three top-level components of the inspector's ui: the "select element" button the html pane the css pane this guide is intentionally kept as short as possible. it links to various how to guides for the details of how to work with the inspector. select element button the inspector gives you detailed in
formation about the currently selected element. the select element button is one way you can select an element for inspection: note that it's actually part of the main toolbox toolbar, so it's immediately accessible from any tool, not just the inspector. to learn how to select an element, see the guide to selecting an element. html pane the inspector is split into two or three sections, dependin...
How to - Firefox Developer Tools
to stop, press it again: you can also start and stop recording from the web console, using console.profile() and console.profileend(). save a profile to save a profile, click the link labeled "save" in the recordings pane: load a profile to load a profile, click "import..." and choose the file: clear all loaded profiles to clear all loaded profiles, click "clear". ...
Cookies - Firefox Developer Tools
. expires / max-age — the time when the cookie will expire. if the cookie is a session cookie, the value of this column will be "session" size — the size of the cookie name plus value in bytes. httponly — is this cookie http only? secure — is this cookie a secure cookie? samesite — is this cookie a same-site cookie? same-site cookies allow servers to mitigate the risk of csrf and in
formation leakage attacks by asserting that a particular cookie should only be sent with requests initiated from the same registrable domain. last accessed — date and time when the cookie was last read. created — date and time when the cookie was created. hostonly — is this cookie a domain cookie? that is, the domain value matches exactly the domain of the current website. note: some of th...
Storage Inspector - Firefox Developer Tools
cal storage, and session storage types, there's only one level in the hierarchy, so stored items are listed directly under each origin: you can click on each item in the tree to expand or collapse its children. the tree is live, so if a new origin gets added (by adding an iframe, for example), it will be added to each storage type automatically. clicking on a tree item will display detailed in
formation about that item in the table widget on the right. for example, clicking on an origin which is a child of the cookies storage type will show all the cookies belonging to that domain. table widget the table widget displays a list of all the items corresponding to the selected tree item (be it an origin, or database) are listed. depending on the storage type and tree item, the number of colum...
Web Audio Editor - Firefox Developer Tools
notice: this tool has been deprecated and will soon be removed from firefox. for details, see deprecated tools. with the web audio api, developers create an audio context. within that context they then construct a number of audio nodes, including: nodes providing the audio source, such as an oscillator or a data buffer source nodes per
forming trans
formations such as delay and gain nodes representing the destination of the audio stream, such as the speakers each node has zero or more audioparam properties that configure its operation. for example, the gainnode has a single gain property, while the oscillatornode has frequency and detune properties. the developer connects the nodes in a graph, and the complete graph defines the behavior of the audio stream. the web audio editor e...
Web Console - Firefox Developer Tools
the javascript input interpreter how to interact with a document using the console. split console use the console alongside other tools. console messages details of the messages that the console logs. helper commands commands you can use that are not part of javascript. rich output see and interact with objects logged by the console. ...
AesCtrParams - Web APIs
secret, but they must not be reused with the same key. a counter. this part of the block gets incremented each time a block is encrypted. essentially: the nonce should ensure that counter blocks are not reused from one message to the next, while the counter should ensure that counter blocks are not reused within a single message. note: see appendix b of the nist sp800-38a standard for more in
formation. properties name a domstring. this should be set to aes-ctr. counter a buffersource — the initial value of the counter block. this must be 16 bytes long (the aes block size). the rightmost length bits of this block are used for the counter, and the rest is used for the nonce. for example, if length is set to 64, then the first half of counter is the nonce and the second half is use...
Ambient Light Events - Web APIs
intensity. it allows them to react to such a change, for example by changing the color contrast of the user interface (ui) or by changing the exposure necessary to take a picture. light events when the light sensor of a device detects a change in the light level, it notifies the browser of that change. when the browser gets such a notification, it fires a devicelightevent event that provides in
formation about the exact light intensity (in lux units). this event can be captured at the window object level by using the addeventlistener method (using the devicelight event name) or by attaching an event handler to the window.ondevicelight property. once captured, the event object gives access to the light intensity expressed in lux through the devicelightevent.value property. example if ('on...
AnalyserNode.getByteFrequencyData() - Web APIs
requencybincount, excess elements are dropped. if it has more elements than needed, excess elements are ignored. return value none. example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style" output of the current audio input. for more examples/in
formation, check out our voice-change-o-matic demo (see app.js lines 128–205 for relevant code). var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); ... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, hei...
AnalyserNode.maxDecibels - Web APIs
tively. note: if a value less than or equal to analysernode.mindecibels is set, an indexsizeerror exception is thrown. example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style" output of the current audio input. for more complete applied examples/in
formation, check out our voice-change-o-matic demo (see app.js lines 128–205 for relevant code). var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); analyser.mindecibels = -90; analyser.maxdecibels = -10; ... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8ar...
AnalyserNode.minDecibels - Web APIs
respectively. note: if a value greater than analysernode.maxdecibels is set, an index_size_err exception is thrown. example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style" output of the current audio input. for more complete applied examples/in
formation, check out our voice-change-o-matic demo (see app.js lines 128–205 for relevant code). var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); analyser.mindecibels = -90; analyser.maxdecibels = -10; ... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8ar...
AnalyserNode.smoothingTimeConstant - Web APIs
good enough for most cases. note: if a value outside the range 0–1 is set, an index_size_err exception is thrown. example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style" output of the current audio input. for more complete applied examples/in
formation, check out our voice-change-o-matic demo (see app.js lines 128–205 for relevant code). if you are curious about the effect the smoothingtimeconstant() has, try cloning the above example and setting analyser.smoothingtimeconstant = 0; instead. you'll notice that the value changes are much more jarring. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser =...
Animation.onremove - Web APIs
r = animation.onremove; animation.onremove = removehandler; value a function to be called to handle the remove event, or null if no remove event handler is set. examples in our simple replace indefinite animations demo, you can see the following code: const divelem = document.queryselector('div'); document.body.addeventlistener('mousemove', evt => { let anim = divelem.animate( { trans
form: `translate(${ evt.clientx}px, ${evt.clienty}px)` }, { duration: 500, fill: 'forwards' } ); anim.commitstyles(); //anim.persist() anim.onremove = function() { console.log('animation removed'); } console.log(anim.replacestate); }); here we have a <div> element, and an event listener that fires the event handler code whenever the mouse moves. the event handler sets up an an...
Animation.pause() - Web APIs
example animation.pause() is used many times in the alice in web animations api land growing/shrinking alice game, largely because animations created with the element.animate() method immediately start playing and must be paused manually if you want to avoid that: // animation of the cupcake slowly getting eaten up var nommingcake = document.getelementbyid('eat-me_sprite').animate( [ { trans
form: 'translatey(0)' }, { trans
form: 'translatey(-80%)' } ], { fill: 'forwards', easing: 'steps(4, end)', duration: alicechange.effect.timing.duration / 2 }); // doesn't actually need to be eaten until a click event, so pause it initially: nommingcake.pause(); additionally, when resetting : // an all-purpose function to pause the animations on alice, the cupcake, and the bottle that re...
Animation.persist() - Web APIs
wise be removed due to the browser's automatically removing filling animations behavior. syntax animation.persist(); parameters none. return value none. examples in our simple replace indefinite animations demo, you can see the following code: const divelem = document.queryselector('div'); document.body.addeventlistener('mousemove', evt => { let anim = divelem.animate( { trans
form: `translate(${ evt.clientx}px, ${evt.clienty}px)` }, { duration: 500, fill: 'forwards' } ); anim.commitstyles(); //anim.persist() anim.onremove = function() { console.log('animation removed'); } console.log(anim.replacestate); }); here we have a <div> element, and an event listener that fires the event handler code whenever the mouse moves. the event handler sets up an an...
Animation.play() - Web APIs
return value undefined example in the growing/shrinking alice game example, clicking or tapping the cake causes alice's growing animation (alicechange) to play forward, causing her to get bigger, as well as triggering the cake's animation. two animation.play()s, one eventlistener: // the cake has its own animation: var nommingcake = document.getelementbyid('eat-me_sprite').animate( [ { trans
form: 'translatey(0)' }, { trans
form: 'translatey(-80%)' } ], { fill: 'forwards', easing: 'steps(4, end)', duration: alicechange.effect.timing.duration / 2 }); // pause the cake's animation so it doesn't play immediately. nommingcake.pause(); // this function will play when ever a user clicks or taps var growalice = function() { // play alice's animation. alicechange.play(); // pl...
Animation.playState - Web APIs
imation.currenttime property is not updating. previously, web animations defined a pending value to indicate that some asynchronous operation such as initiating playback was yet to complete. this is now indicated by the separate animation.pending property. example in the growing/shrinking alice game example, players can get an ending with alice crying into a pool of tears. in the game, for per
formance reasons, the tears should only be animating when they're visible. so they must be paused as soon as they are animated like so: // setting up the tear animations tears.foreach(function(el) { el.animate( tearsfalling, { delay: getrandommsrange(-1000, 1000), // randomized for each tear duration: getrandommsrange(2000, 6000), // randomized for each tear iterations...
Animation.replaceState - Web APIs
ions behavior. persisted: the animation has been explicitly persisted by invoking animation.persist() on it. removed: the animation has been explicitly removed. examples in our simple replace indefinite animations demo, you can see the following code: const divelem = document.queryselector('div'); document.body.addeventlistener('mousemove', evt => { let anim = divelem.animate( { trans
form: `translate(${ evt.clientx}px, ${evt.clienty}px)` }, { duration: 500, fill: 'forwards' } ); anim.commitstyles(); //anim.persist() anim.onremove = function() { console.log('animation removed'); } console.log(anim.replacestate); }); here we have a <div> element, and an event listener that fires the event handler code whenever the mouse moves. the event handler sets up an an...
Animation - Web APIs
is removed (i.e., put into an active replace state). methods animation.cancel() clears all keyframeeffects caused by this animation and aborts its playback. animation.commitstyles() commits the end styling state of an animation to the element being animated, even after that animation has been removed. it will cause the end styling state to be written to the element being animated, in the
form of properties inside a style attribute. animation.finish() seeks either end of an animation, depending on whether the animation is playing or reversing. animation.pause() suspends playing of an animation. animation.persist() explicitly persists an animation, when it would otherwise be removed due to the browser's automatically removing filling animations behavior. animation.play()...
AnimationEvent - Web APIs
the animationevent interface represents events providing in
formation related to animations. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line...
Attr - Web APIs
me use attr.name instead. nodetype this property now always returns 2 (attribute_node). nodevalue use attr.value instead. ownerdocument you shouldn't have been using this in the first place, so you probably don't care that this is going away. parentnode this property now always returns null. previoussibling this property now always returns null. schematypeinfo read only the type in
formation associated with this attribute. while the type in
formation contained in this attribute is guaranteed to be correct after loading the document or invoking document.normalizedocument, this property may not be reliable if the node was moved. specified this property now always returns true. textcontent use attr.value instead. the following methods have been deprecated: appendchild() obs...
AudioBuffer - Web APIs
odata() method, or from raw data using audiocontext.createbuffer(). once put into an audiobuffer, the audio can then be played by being passed into an audiobuffersourcenode. objects of these types are designed to hold small audio snippets, typically less than 45 s. for longer sounds, objects implementing the mediaelementaudiosourcenode are more suitable. the buffer contains data in the following
format: non-interleaved ieee754 32-bit linear pcm with a nominal range between -1 and +1, that is, 32bits floating point buffer, with each samples between -1.0 and 1.0. if the audiobuffer has multiple channels, they are stored in separate buffer. constructor audiobuffer() creates and returns a new audiobuffer object instance. properties audiobuffer.samplerate read only returns a float repr...
AudioBufferSourceNode.start() - Web APIs
for example, to start playback halfway through a 10-second audio clip, offset should be 5. the default value, 0, will begin playback at the beginning of the audio buffer, and offsets past the end of the audio which will be played (based on the audio buffer's duration and/or the loopend property) are silently clamped to the maximum value allowed. the computation of the offset into the sound is per
formed using the sound buffer's natural sample rate, rather than the current playback rate, so even if the sound is playing at twice its normal speed, the midway point through a 10-second audio buffer is still 5. duration optional the duration of the sound to be played, specified in seconds. if this parameter isn't specified, the sound plays until it reaches its natural conclusion or is stopped usin...
AudioContext.createMediaStreamDestination() - Web APIs
nce page. syntax var audioctx = new audiocontext(); var destination = audioctx.createmediastreamdestination(); returns a mediastreamaudiodestinationnode. examples in the following simple example, we create a mediastreamaudiodestinationnode, an oscillatornode and a mediarecorder (the example will therefore only work in firefox and chrome at this time.) the mediarecorder is set up to record in
formation from the mediastreamdestinationnode. when the button is clicked, the oscillator starts, and the mediarecorder is started. when the button is stopped, the oscillator and mediarecorder both stop. stopping the mediarecorder causes the dataavailable event to fire, and the event data is pushed into the chunks array. after that, the stop event fires, a new blob is made of type opus — which cont...
AudioListener.upY - Web APIs
m box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
AudioListener.upZ - Web APIs
m box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
AudioListener - Web APIs
m box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
AudioNode.connect() - Web APIs
e value specified as outputindex or inputindex doesn't correspond to an existing input or output. invalidaccesserror the destination node is not part of the same audio context as the source node. notsupportederror the specified connection would create a cycle (in which the audio loops back through the same nodes repeatedly) and there are no delaynodes in the cycle to prevent the resulting wave
form from getting stuck constructing the same audio frame indefinitely. examples connecting to an audio input the most obvious use of the connect() method is to direct the audio output from one node into the audio input of another node for further processing. for example, you might send the audio from a mediaelementaudiosourcenode—that is, the audio from an html5 media element such as <audio>—...
AudioNode - Web APIs
methods, or mix both, however there are advantages to using the constructors: all parameters can be set during construction time and don't need to be set individually. you can sub-class an audio node. while the actual processing is done internally by the browser and cannot be altered, you could write a wrapper around an audio node to provide custom properties and methods. slightly better per
formance: in both chrome and firefox, the factory methods call the constructors internally. keep in mind that microsoft edge does not yet appear to support the constructors; it will throw a "function expected" error when you use the constructors. brief history: the first version of the web audio spec only defined the factory methods. after a design review in october 2013, it was decided to add cons...
AudioParam.setTargetAtTime() - Web APIs
nge starts at the time specified in starttime and exponentially moves towards the value given by the target parameter. the decay rate as defined by the timeconstant parameter is exponential; therefore the value will never reach target completely, but after each timestep of length timeconstant, the value will have approached target by another 1-e-1≈63.2%1 - e^{-1} \approx 63.2%. for the complete
formula (which uses a first-order linear continuous time-invariant system), check the web audio specification. if you absolutely need to reach the target value by a specific time, you can use audioparam.exponentialramptovalueattime(). however, for mathematical reasons, that method does not work if the current value or the target value is 0. choosing a good timeconstant as mentioned above, the value...
AudioScheduledSourceNode: ended event - Web APIs
ode interface is fired when the source node has stopped playing. bubbles no cancelable no interface event event handler property audioscheduledsourcenode.onended usage notes this event occurs when a audioscheduledsourcenode has stopped playing, either because it's reached a predetermined stop time, the full duration of the audio has been per
formed, or because the entire buffer has been played. examples in this simple example, an event listener for the ended event is set up to enable a "start" button in the user interface when the node stops playing: node.addeventlistener('ended', () => { document.getelementbyid("startbutton").disabled = false; }) you can also set up the event handler using the audioscheduledsourcenode.onended prope...
AudioScheduledSourceNode - Web APIs
the node to stop playing at the specified time. if no time is specified, the node stops playing at once. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface: ended fired when the source node has stopped playing, either because it's reached a predetermined stop time, the full duration of the audio has been per
formed, or because the entire buffer has been played. also available using the onended event handler property. specification specification status comment web audio apithe definition of 'audioscheduledsourcenode' in that specification. working draft ...
AudioTrack.enabled - Web APIs
to false, the track is muted and does not produce audio. syntax isaudioenabled = audiotrack.enabled; audiotrack.enabled = true | false; value the enabled property is a boolean whose value is true if the track is enabled; enabled tracks produce audio while the media is playing. setting enabled to false effectively mutes the audio track, preventing it from contributing to the media's audio per
formance. example this example switches between the main and commentary audio tracks of a media element. function swapcommentarymain() { var videoelem = document.getelementbyid("main-video"); var audiotrackmain; var audiotrackcommentary; videoelem.audiotracks.foreach(track) { if (track.kind === "main") { audiotrackmain = track; } else if (track.kind === "commentary") { ...
AudioTrack.language - Web APIs
the read-only audiotrack property language returns a string identifying the language used in the audio track. for tracks that include multiple languages (such as a movie in english in which a few lines are spoken in other languages), this should be the video's primary language. syntax var audiotracklanguage = audiotrack.language; value a domstring specifying the bcp 47 (rfc 5646)
format language tag of the primary language used in the audio track, or an empty string ("") if the language is not specified or known, or if the track doesn't contain speech. for example, if the primary language used in the track is united states english, this value would be "en-us". for brazilian portuguese, the value would be "pt-br". example this example locates all of a media element's primary language an...
AudioTrack - Web APIs
var firsttrack = tracks[0]; the next example scans through all of the media's audio tracks, enabling any that are in the user's preferred language (taken from a variable userlanguage) and disabling any others. tracks.foreach(function(track) { if (track.language === userlanguage) { track.enabled = true; } else { track.enabled = false; } }); the language is in standard (rfc 5646)
format. for us english, this would be "en-us", for example. example this example returns an array of track kinds and labels for potential use in a user interface to select audio tracks for a specified media element. the list is filtered to only allow certain track kinds through. function gettracklist(el) { var tracklist = []; const wantedkinds = [ "main", "alternative", "main-desc", "transl...
AudioTrackList.getTrackById() - Web APIs
which the tracks are declared by the media resource. example this example suggests a hypothetical game in which movies are used as cut-scenes or other key set pieces within the game. each movie has one audio track for each character, as well as one for the music, sound effects, and so forth. this function allows the game to disable a specific character's audio in order to adjust the movie's per
formance based on occurrences within the game; if the character's dialog isn't relevant, it gets left out. obviously that would require some clever graphic design to make work, but... it's a hypothetical game. function disablecharacter(videoelem, charactername) { videoelem.audiotracks.gettrackbyid(charactername).enabled = false; } this short function gets the audiotracklist containing the video's...
AudioTrackList - Web APIs
when tracks are added to or removed from the media element's stream. see onaddtrack and onremovetrack for details and examples. examples getting a media element's audio track list to get a media element's audiotracklist, use its audiotracks property. var audiotracks = document.queryselector("video").audiotracks; monitoring track count changes in this example, we have an app that displays in
formation about the number of channels available. to keep it up to date, handlers for the addtrack and removetrack events are set up. audiotracks.onaddtrack = updatetrackcount; audiotracks.onremovetrack = updatetrackcount; function updatetrackcount(event) { trackcount = audiotracks.length; drawtrackcountindicator(trackcount); } specifications specification status comment ...
AudioWorkletGlobalScope - Web APIs
epresents a global execution context for user-supplied code, which defines custom audioworkletprocessor-derived classes. each baseaudiocontext has a single audioworklet available under the audioworklet property, which runs its code in a single audioworkletglobalscope. as the global execution context is shared across the current baseaudiocontext, it's possible to define any other variables and per
form any actions allowed in worklets — apart from defining audioworkletprocessor-derived classes. properties currentframe read only returns an integer that represents the ever-increasing current sample-frame of the audio block being processed. it is incremented by 128 (the size of a render quantum) after the processing of each audio block. currenttime read only returns a double that represe...
AudioWorkletNode() - Web APIs
syntax var node = new audioworkletnode(context, name); var node = new audioworkletnode(context, name, options); parameters context the baseaudiocontext instance this node will be associated with. name a string, which represents the name of the audioworkletprocessor this node will be based on. a processor with the provided name must first be registered using the audioworkletglobalscope.registerprocessor() method. ...
AudioWorkletProcessor - Web APIs
dering thread. in turn, an audioworkletnode based on it runs on the main thread. constructor the audioworkletprocessor and classes that derive from it cannot be instantiated directly from a user-supplied code. instead, they are created only internally by the creation of an associated audioworkletnodes. the constructor of the deriving class is getting called with an options object, so you can per
form a custom initialization procedures — see constructor page for details. audioworkletprocessor() creates a new instance of an audioworkletprocessor object. properties port read only returns a messageport used for bidirectional communication between the processor and the audioworkletnode which it belongs to. the other end is available under the port property of the node. methods the ...
AuthenticatorAssertionResponse.userHandle - Web APIs
dential.response after calling navigator.credentials.get(). note: this property may only be used in top-level contexts and will not be available in an <iframe> for example. syntax userhandle = authenticatorassertionresponse.userhandle value an arraybuffer object which is an opaque identifier for the current user. this is not human-readable and does not contain any personally identifying in
formation (e.g. username, e-mail, phone number, etc.) examples var options = { challenge: new uint8array(26), // will be another value, provided by the relying party server timeout: 60000 }; navigator.credentials.get({ publickey: options }) .then(function (assertionpkcred) { var userhandle = assertionpkcred.response.userhandle; // send response and client extensions to the server so...
AuthenticatorAssertionResponse - Web APIs
s. use from within an <iframe> element will not have any effect. properties authenticatorassertionresponse.clientdatajson secure contextread only the client data for the authentication, such as origin and challenge. the clientdatajson property is inherited from the authenticatorresponse. authenticatorassertionresponse.authenticatordata secure contextread only an arraybuffer containing in
formation from the authenticator such as the relying party id hash (rpidhash), a signature counter, test of user presence and user verification flags, and any extensions processed by the authenticator. authenticatorassertionresponse.signature secure contextread only an assertion signature over authenticatorassertionresponse.authenticatordata and authenticatorresponse.clientdatajson. the assertion s...
AuthenticatorAttestationResponse.getTransports() - Web APIs
on publickeycredential.response after calling navigator.credentials.create(). note: this method may only be used in top-level contexts and will not be available in an <iframe> for example. syntaxe arrtransports = authenticatorattestationresponse.gettransports() parameters none. return value an array containing the different transports supported by the authenticator or nothing if this in
formation is not available.of the processing of the different extensions by the client. the elements of this array are supposed to be in lexicographical order. their values may be : "usb": the authenticator can be contacted via a removable usb link "nfc": the authenticator may be used over nfc (near field communication) "ble": the authenticator may be used over ble (bluetooth low energy) "intern...
AuthenticatorAttestationResponse - Web APIs
onresponse.attestationobject secure contextread only an arraybuffer containing authenticator data and an attestation statement for a newly-created key pair. methods authenticatorattestationresponse.gettransports()secure context returns an array of strings describing which transport methods (e.g. usb, nfc) are believed to be supported with the authenticator. the array may be empty if the in
formation is not available. examples var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; navigator.credentials.create({ publickey }) .then(functi...
BaseAudioContext.createAnalyser() - Web APIs
s node, see the analysernode page. syntax var analysernode = baseaudiocontext.createanalyser(); returns an analysernode. example the following example shows basic usage of an audiocontext to create an analyser node, then use requestanimationframe() to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input. for more complete applied examples/in
formation, check out our voice-change-o-matic demo (see app.js lines 128–205 for relevant code). var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); ... analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscillos...
BaseAudioContext.createConvolver() - Web APIs
the createconvolver() method of the baseaudiocontext interface creates a convolvernode, which is commonly used to apply reverb effects to your audio. see the spec definition of convolution for more in
formation. syntax baseaudiocontext.createconvolver(); returns a convolvernode. example the following example shows basic usage of an audiocontext to create a convolver node. the basic premise is that you create an audiobuffer containing a sound sample to be used as an ambience to shape the convolution (called the impulse response,) and apply that to the convolver. the example below uses a short sample of a concert hall crowd, so the reverb effect applied is really deep and echoey. for applied examples/in
formation, check out our voice-change-o-matic demo (see app.js for relevant code). v...
BaseAudioContext.createOscillator() - Web APIs
the createoscillator() method of the baseaudiocontext interface creates an oscillatornode, a source representing a periodic wave
form. it basically generates a constant tone. syntax var oscillatornode = audioctx.createoscillator(); returns an oscillatornode. example the following example shows basic usage of an audiocontext to create an oscillator node. for applied examples/in
formation, check out our violent theremin demo (see app.js for relevant code); also see our oscillatornode page for more in
formation. // create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(3000, audioctx.currenttime); // value in ...
BaseAudioContext.createPanner() - Web APIs
m box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. ...
BaseAudioContext.createWaveShaper() - Web APIs
the createwaveshaper() method of the baseaudiocontext interface creates a waveshapernode, which represents a non-linear distortion. it is used to apply distortion effects to your audio. syntax baseaudioctx.createwaveshaper(); returns a waveshapernode. example the following example shows basic usage of an audiocontext to create a wave shaper node. for applied examples/in
formation, check out our voice-change-o-matic demo (see app.js for relevant code). note: sigmoid functions are commonly used for distortion curves because of their natural properties. their s-shape, for instance, helps create a smoother sounding result. we found the below distortion curve code on stack overflow. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var distortion = audioctx.create...
BaseAudioContext - Web APIs
to an audio signal. baseaudiocontext.creategain() creates a gainnode, which can be used to control the overall volume of the audio graph. baseaudiocontext.createiirfilter() creates an iirfilternode, which represents a second order filter configurable as several different common filter types. baseaudiocontext.createoscillator() creates an oscillatornode, a source representing a periodic wave
form. it basically generates a tone. baseaudiocontext.createpanner() creates a pannernode, which is used to spatialise an incoming audio stream in 3d space. baseaudiocontext.createperiodicwave() creates a periodicwave, used to define a periodic wave
form that can be used to determine the output of an oscillatornode. baseaudiocontext.createscriptprocessor() creates a scriptprocessornode, which c...
BasicCardResponse.billingAddress - Web APIs
esponse.details); }) .catch(function(err) { // do something with the error from request.show(). }); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details. this has to con
form to the structure defined by the basiccardresponse dictionary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'mr. dick straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification...
BasicCardResponse.cardNumber - Web APIs
esponse.details); }) .catch(function(err) { // do something with the error from request.show(). }); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details. this has to con
form to the structure defined by the basiccardresponse dictionary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'mr. dick straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification...
BasicCardResponse.cardSecurityCode - Web APIs
esponse.details); }) .catch(function(err) { // do something with the error from request.show(). }); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details. this has to con
form to the structure defined by the basiccardresponse dictionary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'mr. dick straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification...
BasicCardResponse.cardholderName - Web APIs
esponse.details); }) .catch(function(err) { // do something with the error from request.show(). }); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details. this has to con
form to the structure defined by the basiccardresponse dictionary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'mr. dick straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification...
BasicCardResponse.expiryMonth - Web APIs
esponse.details); }) .catch(function(err) { // do something with the error from request.show(). }); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details. this has to con
form to the structure defined by the basiccardresponse dictionary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'mr. dick straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification...
BasicCardResponse.expiryYear - Web APIs
esponse.details); }) .catch(function(err) { // do something with the error from request.show(). }); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details. this has to con
form to the structure defined by the basiccardresponse dictionary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'mr. dick straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification...
BatteryManager - Web APIs
the navigator.getbattery() method returns a battery promise that is resolved in a batterymanager interface which you can use to interact with the battery status api. properties batterymanager.charging read only a boolean value indicating whether or not the battery is currently being charged. batterymanager.chargingtime read only a number representing the remaining time in seconds until the battery is fully charged, or 0 if the battery is already fully charged. batterymanager.dischargingtime read only a number representing the remaining time in seconds until the battery is completely discharged and the system will suspend. ...
Battery Status API - Web APIs
this can be used to adjust your app's resource usage to reduce battery drain when the battery is low, or to save changes before the battery runs out in order to prevent data loss. the battery status api extends window.navigator with a navigator.getbattery() method returning a battery promise, which is resolved in a batterymanager object providing also some new events you can handle to monitor the battery status. ...
Using the Beacon API - Web APIs
page unloads. this document contains examples of the beacon interfaces. see beacon api for an overview. navigator.sendbeacon() the beacon api's navigator.sendbeacon() method sends a beacon request to the server in the global browsing context. the method takes two arguments: the url and the data to send. the data argument is optional and its type may be an arraybufferview, blob, domstring, or
formdata. if the browser successfully queues the request for delivery, the method returns true and returns false otherwise. the following example specifies a handler for the load and beforeunload events. the handler calls sendbeacon() with the current url. window.onload = window.onunload = function analytics(event) { if (!navigator.sendbeacon) return; var url = "https://example.com/analytics";...
BeforeUnloadEvent - Web APIs
unloaded. when a non-empty string is assigned to the returnvalue event property, a dialog box appears, asking the users for confirmation to leave the page (see example below). when no value is provided, the event is processed silently. some implementations only show the dialog box if the frame or any embedded frame receives a user gesture or user interaction. see browser compatibility for more in
formation. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff...
Blob.arrayBuffer() - Web APIs
in the blob interface returns a promise that resolves with the contents of the blob as binary data contained in an arraybuffer. syntax var bufferpromise = blob.arraybuffer(); blob.arraybuffer().then(buffer => /* process the arraybuffer */); var buffer = await blob.arraybuffer(); parameters none. returns a promise that resolves with an arraybuffer that contains the blob's data in binary
form. exceptions while this method doesn't throw exceptions, it may reject the promise. this can happen, for example, if the reader used to fetch the blob's data throws an exception. any exceptions thrown while getting the data will be converted into rejections. usage notes while similar to the filereader.readasarraybuffer() method, arraybuffer() returns a promise rather than being an event-based ...
Blob.stream() - Web APIs
reamdefaultreader interface's read() method. call the returned stream's pipeto() method to pipe the blob's data to a writable stream. call the returned stream's tee() method to tee the readable stream. this returns an array containing two new readablestream objects, each of which returns the contents of the blob. call the returned stream's pipethrough() method to pipe the stream through a trans
formstream or any other readable and writable pair. specifications specification status comment file apithe definition of 'blob.stream()' in that specification. working draft ...
Blob.text() - Web APIs
urns a promise that resolves with a string containing the contents of the blob, interpreted as utf-8. syntax var textpromise = blob.text(); blob.text().then(text => /* do something with the text */); var text = await blob.text(); parameters none. returns a promise that resolves with a usvstring which contains the blob's data as a text string. the data is always presumed to be in utf-8
format. usage notes the filereader method readastext() is an older method that per
forms a similar function. it works on both blob and file objects. there are two key differences: blob.text() returns a promise, whereas filereader.readastext() is an event based api. blob.text() always uses utf-8 as encoding, while filereader.readastext() can use a different encoding depending on the blob's type an...
Blob - Web APIs
the file interface is based on blob, inheriting blob functionality and expanding it to support files on the user's system. ...
productID - Web APIs
syntax var productid = instanceofbluetoothdevice.productid returns the 16-bit product id field. ...
productVersion - Web APIs
syntax var productversion = instanceofbluetoothdevice.productversion returns the 16-bit product version field. ...
CSSPageRule - Web APIs
interface csspagerule : cssrule { attribute domstring selectortext; readonly attribute cssstyledeclaration style; }; properties as a cssrule, csspagerule also implements the properties of this interface. it has the following specific properties: csspagerule.selectortext represents the text of the page selector associated with the at-rule. ...
CSSPseudoElement.type - Web APIs
the type read-only property of the csspseudoelement interface returns the type of the pseudo-element as a string, represented in the
form of a css selector. syntax var typeofpseudoelement = csspseudoelement.type; value a cssomstring containing one of the following values: "::before" "::after" "::marker" examples the example below demonstrates the relationship between csspseudoelement.type and element.pseudo(): const myelement = document.queryselector('q'); const myselector = '::after'; const csspseudoelement = myelement.pseudo(myselector); const typeofpseudoelement = csspseudoelement.type; console.log(myselector === typeofpseudoelement); // outputs true specifications specification status comment css pseudo-elements level 4the definition of 'type' i...
CSSRule.cssText - Web APIs
longer be set directly, as it is now specified to be functionally modify-only, and silently so. in other words, attempting to set it does absolutely nothing, and doesn't even omit a warning or error. furthermore, it has no settable sub-properties. therefore, to modify it, use the stylesheet's cssrules[index] properties .selectortext and .style (or its sub-properties). see using dynamic styling in
formation for details. syntax string = cssrule.csstext example <style> body { background-color: darkblue; } </style> <script> var stylesheet = document.stylesheets[0]; alert(stylesheet.cssrules[0].csstext); // body { background-color: darkblue; } </script> specifications specification status comment css object model (cssom)the definition of 'cssrule: cs...
CSSRule - Web APIs
specifications specification status comment css object model (cssom)the definition of 'cssrule' in that specification. working draft obsoleted values charset_rule and unknown_rule. added value namespace_rule. css animationsthe definition of 'cssrule' in that specification. working draft added va...
CSSStyleDeclaration - Web APIs
a cssstyledeclaration object can be exposed using three different apis: via htmlelement.style, which deals with the inline styles of a single element (e.g., <div style="...">). via the cssstylesheet api. for example, document.stylesheets[0].cssrules[0].style returns a cssstyledeclaration object on the first css rule in the document's first stylesheet. via window.getcomputedstyle(), which exposes the cssstyledeclaration object as a read-only interface. ...
CSSStyleRule.selectorText - Web APIs
syntax string = cssrule.selectortext example // for cssrule: body { background-color: darkblue; } var stylesheet = document.stylesheets[0]; alert(stylesheet.cssrules[0].selectortext); // body notes the implementation may have stripped out insignificant whitespace while parsing the selector. ...
CSSStyleSheet.addRule() - Web APIs
stylesheet's cssrulelist at which to insert the new rule. if index is not specified, the next index after the last item currently in the list is used (that is, the value of cssstylesheet.cssrules.length). return value always returns -1. note that due to somewhat estoteric rules about where you can legally insert rules, it's possible that an exception may be thrown. see insertrule() for more in
formation. usage notes this method is implemented by browsers by constructing a string using the template literal `${selector}{${styleblock}}`, then passing it into the standard insertrule() method. therefore, given existing code such as the following: cssstylesheet.addrule(selector, styles, 0); you can rewrite this to use the more standard insertrule() like this: cssstylesheet.insertrule(`${sel...
CSSStyleSheet.insertRule() - Web APIs
han just @import at-rules and/or @namespace at-rules, the method aborts with an invalidstateerror. examples inserting a new rule this snippet pushes a new rule onto the top of my stylesheet. mystyle.insertrule('#blanc { color: white }', 0); function to add a stylesheet rule /** * add a stylesheet rule to the document (it may be better practice * to dynamically change classes, so style in
formation can be kept in * genuine stylesheets and avoid adding extra elements to the dom). * note that an array is needed for declarations and rules since ecmascript does * not guarantee a predictable object iteration order, and since css is * order-dependent. * @param {array} rules accepts an array of json-encoded declarations * @example addstylesheetrules([ ['h2', // also accepts a second a...
CSSStyleSheet - Web APIs
ner object (node or cssimportrule), if any. a cssstylesheet object is created and inserted into the document's document.stylesheets list automatically by the browser, when a stylesheet is loaded for a document. as the stylesheet list cannot be modified directly, there's no useful way to create a new cssstylesheet object manually (although constructable stylesheet objects is coming to the web plat
form soon and is already supported in blink). to create a new stylesheet, insert a <style> or <link> element into the document. a (possibly incomplete) list of ways a stylesheet can be associated with a document follows: reason for the style sheet to be associated with the document appears in document. stylesheets list getting the owner element/rule given the style sheet object ...
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. an instance of this class may be used anywhere a string is expected. interfaces based on cssstylevalue below is a list of interfaces based on the cssstylevalue interface. cssimagevalue csskeywordvalue cssnumericvalue csspositionvalue csstrans
formvalue cssunparsedvalue methods cssstylevalue.parse() sets a specific css property to the specified values and returns the first value as a cssstylevalue object. cssstylevalue.parseall() sets all occurences of a specific css property to the specified valueand returns an array of cssstylevalue objects, each containing one of the supplied values. specifications specification status...
CSSSupportsRule - Web APIs
interface csssupportsrule : cssconditionrule { } properties as a cssconditionrule and therefore a cssrule and a cssgroupingrule, csssupportsrule also implements the properties of these interfaces. ...
Determining the dimensions of elements - Web APIs
roperties. how much room does it use up? if you need to know the total amount of space an element occupies, including the width of the visible content, scrollbars (if any), padding, and border, you want to use the htmlelement.offsetwidth and htmlelement.offsetheight properties. most of the time these are the same as width and height of element.getboundingclientrect(), when there aren't any trans
forms applied to the element. in case of trans
forms, the offsetwidth and offsetheight returns the element's layout width and height, while getboundingclientrect() returns the rendering width and height. as an example, if the element has width: 100px; and trans
form: scale(0.5); the getboundingclientrect() will return 50 as the width, while offsetwidth will return 100. what's the size of the displaye...
CSS Object Model (CSSOM) - Web APIs
t, range, mouseevent, and svgelement. css typed object model cssimagevalue csskeywordvalue cssmathinvert cssmathmax cssmathmin cssmathnegate cssmathproduct cssmathsum cssmathvalue cssmatrixcomponent cssnumericarray cssnumericvalue cssperspective csspositionvalue cssrotate cssscale cssskew cssskewx cssskewy cssstylevalue csstrans
formcomponent csstrans
formvalue csstranslate cssunitvalue cssunparsedvalue cssvariablereferencevalue stylepropertymap stylepropertymapreadonly obsolete cssom interfaces cssprimitivevalue cssvalue cssvaluelist tutorials determining the dimensions of elements (it needs some updating as it was made in the dhtml/ajax era). managing screen orientation spe...
Cache.delete() - Web APIs
you are looking to delete. this can be a request object or a url. options optional an object whose properties control how matching is done in the delete operation. the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url. if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when per
forming a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that, when set to true, tells the matching operation not to per
form vary header matching. in other words, if the url matches you will get a match regardless ...
Cache.keys() - Web APIs
if a specific key is desired. this can be a request object or a url. options optional an object whose properties control how matching is done in the keys operation. the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url. if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when per
forming a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that, when set to true, tells the matching operation not to per
form vary header matching. in other words, if the url matches you will get a match regardless ...
Cache.match() - Web APIs
request for which you are attempting to find responses in the cache. this can be a request object or a url. options optional an object that sets options for the match operation. the available options are: ignoresearch: a boolean that specifies whether to ignore the query string in the url. for example, if set to true the ?value=bar part of http://foo.com/?value=bar would be ignored when per
forming a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that when set to true tells the matching operation not to per
form vary header matching — i.e. if the url matches you will get a match regardless of whether ...
CacheStorage.match() - Web APIs
match. this can be a request object or a url string. options optional an object whose properties control how matching is done in the match operation. the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url. for example, if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when per
forming a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that, when set to true, tells the matching operation not to per
form vary header matching. in other words, if the url matches you will get a match regardless o...
CanvasPattern - Web APIs
the canvaspattern interface represents an opaque object describing a pattern, based on an image, a canvas, or a video, created by the canvasrenderingcontext2d.createpattern() method. it can be used as a fillstyle or strokestyle. properties as an opaque object, this has no exposed property. methods there are no inherited method. canvaspattern.settrans
form() applies an svgmatrix or dommatrix representing a linear trans
form to the pattern. specifications specification status comment html living standardthe definition of 'canvaspattern' in that specification. living standard added settrans
form() method in v5. ...
CanvasRenderingContext2D.arcTo() - Web APIs
the x-axis coordinate of the second control point. y2 the y-axis coordinate of the second control point. radius the arc's radius. must be non-negative. examples how arcto works one way to think about arcto() is to imagine two straight segments: one from the starting point to a first control point, and another from there to a second control point. without arcto(), these two segments would
form a sharp corner: arcto() creates a circular arc that fits this corner and smooths is out. in other words, the arc is tangential to both segments. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // tangential lines ctx.beginpath(); ctx.strokestyle = 'gray'; ctx.moveto(200, 20); ctx.lineto(200, 130); ctx.lineto...
CanvasRenderingContext2D.drawWindow() - Web APIs
r than pure white "rgb(255,255,255)" or transparent, as this is what all browsers do, and many websites expect that transparent parts of their interface will be drawn on white background. with this method, it is possible to fill a hidden iframe with arbitrary content (e.g., css-styled html text, or svg) and draw it into a canvas. it will be scaled, rotated and so on according to the current trans
formation. ted mielczarek's tab preview extension uses this technique in chrome to provide thumbnails of web pages, and the source is available for reference. specifications not part of any current specification or draft. this is a non-standard and internal only api. ...
CanvasRenderingContext2D.getImageData() - Web APIs
the canvasrenderingcontext2d method getimagedata() of the canvas 2d api returns an imagedata object representing the underlying pixel data for a specified portion of the canvas. this method is not affected by the canvas's trans
formation matrix. if the specified rectangle extends outside the bounds of the canvas, the pixels outside the canvas are transparent black in the returned imagedata object. note: image data can be painted onto a canvas using the putimagedata() method. you can find more in
formation about getimagedata() and general manipulation of canvas contents in pixel manipulation with canvas. syntax ctx.getimagedata(sx, sy, sw, sh); parameters sx the x-axis coordinate of the top-left corner of the rectangle from which the imagedata will be extracted. sy the y-axis coor...
CanvasRenderingContext2D.isPointInPath() - Web APIs
the canvasrenderingcontext2d.ispointinpath() method of the canvas 2d api reports whether or not the specified point is contained in the current path. syntax ctx.ispointinpath(x, y [, fillrule]); ctx.ispointinpath(path, x, y [, fillrule]); parameters x the x-axis coordinate of the point to check, unaffected by the current trans
formation of the context. y the y-axis coordinate of the point to check, unaffected by the current trans
formation of the context. fillrule the algorithm by which to determine if a point is inside or outside the path. possible values: "nonzero": the non-zero winding rule. default rule. "evenodd": the even-odd winding rule. path a path2d path to check against. if unspecified, the current path is used. return value boolean a boolean, which is ...
CanvasRenderingContext2D.miterLimit - Web APIs
ore info about miters, see applying styles and color in the canvas tutorial. syntax ctx.miterlimit = value; options value a number specifying the miter limit ratio, in coordinate space units. zero, negative, infinity, and nan values are ignored. the default value is 10.0. examples using the miterlimit property see the chapter applying styles and color in the canvas tutorial for more in
formation. playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"> ctx.beginpath(); ctx.moveto(0,0); ctx.linewidth = 15; ctx.lineto(100, 100); ctx.stroke();</textarea> var canvas = ...
CanvasRenderingContext2D.putImageData() - Web APIs
the canvasrenderingcontext2d.putimagedata() method of the canvas 2d api paints data from the given imagedata object onto the canvas. if a dirty rectangle is provided, only the pixels from that rectangle are painted. this method is not affected by the canvas trans
formation matrix. note: image data can be retrieved from a canvas using the getimagedata() method. you can find more in
formation about putimagedata() and general manipulation of canvas contents in the article pixel manipulation with canvas. syntax void ctx.putimagedata(imagedata, dx, dy); void ctx.putimagedata(imagedata, dx, dy, dirtyx, dirtyy, dirtywidth, dirtyheight); parameters imagedata an imagedata object containing the array of pixel values. dx horizontal position (x coordinate) at which to place the image data in ...
CanvasRenderingContext2D.restore() - Web APIs
syntax void ctx.restore(); examples restoring a saved state this example uses the save() method to save the default state and restore() to restore it later, so that you are able to draw a rect with the default state later. ...
ClipboardItem() - Web APIs
see the browser compatibility table for the clipboard interface. syntax var clipboarditem = new clipboarditem(clipboarditemdata); parameters clipboarditemdata an object with the mime type as the key and blob as the value. ...
ClipboardItem - Web APIs
that is clipboard.read() and clipboard.write() respectively. 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. access to the contents of the clipboard is gated behind the permissions api: the clipboard-write permission is granted automatically to pages when they are in the active tab. the clipboard-read permission must be requested, which you can do by trying to read data from the clipboard. ...
Clipboard API - Web APIs
ith the class editor. since readtext() (and read(), for that matter) returns an empty string if the clipboard isn't text, this code is safe. interfaces clipboard secure context provides an interface for reading and writing text and data to or from the system clipboard. the specification refers to this as the 'async clipboard api.' clipboardevent secure context represents events providing in
formation related to modification of the clipboard, that is cut, copy, and paste events. the specification refers to this as the 'clipboard event api'. clipboarditem secure context represents a single item
format, used when reading or writing data. specifications specification status comment clipboard api and events working draft initial definition. ...
CloseEvent.initCloseEvent() - Web APIs
in this way must have been created with the document.createevent() method. this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent(). once dispatched, it doesn't do anything anymore. do not use this method anymore as it is deprecated. instead use specific event constructors, like closeevent(). the page on creating and triggering events gives more in
formation about the way to use these. 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. canbubble whether or not the event can bubble. sets the value of event.bubbles. cancelable whether or not the e...
CloseEvent - Web APIs
nection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients. [ref] 1014 bad gateway the server was acting as a gateway or proxy and received an invalid response from the upstream server. this is similar to 502 http status code. 1015 tls handshake reserved. indicates that the connection was closed due to a failure to per
form a tls handshake (e.g., the server certificate can't be verified). 1016–1999 reserved for future use by the websocket standard. 2000–2999 reserved for use by websocket extensions. 3000–3999 available for use by libraries and frameworks. may not be used by applications. available for registration at the iana via first-come, first-...
console.debug() - Web APIs
. the string representations of each of these objects are appended together in the order listed and output to the console. msg a javascript string containing zero or more substitution strings, which are replaced with subst1 through substn in consecutive order. subst1 ... substn javascript objects with which to replace substitution strings within msg. this gives you additional control over the
format of the output. see using string substitutions in console for a description of how substitutions work. see outputting text to the console in the documentation of the console object for details. specifications specification status comment console apithe definition of 'console.debug()' in that specification. living standard initial definition ...
Console.error() - Web APIs
ly identical. parameters obj1 ... objn a list of javascript objects to output. the string representations of each of these objects are appended together in the order listed and output. msg a javascript string containing zero or more substitution strings. subst1 ... substn javascript objects with which to replace substitution strings within msg. this gives you additional control over the
format of the output. see outputting text to the console in the documentation of console for details. specifications specification status comment console apithe definition of 'console.error()' in that specification. living standard initial definition ...
Console.info() - Web APIs
the console.info() method outputs an in
formational message to the web console. in firefox, a small "i" icon is displayed next to these items in the web console's log. note: this feature is available in web workers. syntax console.info(obj1 [, obj2, ..., objn]); console.info(msg [, subst1, ..., substn]); parameters obj1 ... objn a list of javascript objects to output. the string representations of each of these objects are appended together in the order listed and output. msg a javascript string containing zero or more substitution strings. subst1 ... substn javascript objects with which to replace substitution strings within msg. this gives you additional control over the
format of the output. see outputting text to the console in the documentation of console for details. spec...
Console.profile() - Web APIs
you can optionally supply an argument to name the profile and this then enables you to stop only that profile if multiple profiles being recorded. see console.profileend() to see how this argument is interpreted. to stop recording call console.profileend(). note: this feature is available in web workers. ...
Console.timeEnd() - Web APIs
specifications specification status comment console apithe definition of 'console.timeend()' in that specification. living standard initial definition ...
Console.timeLog() - Web APIs
specifications specification status comment console apithe definition of 'console.timelog()' in that specification. living standard initial definition ...
Console.timeStamp() - Web APIs
this lets you correlate a point in your code with the other events recorded in the timeline, such as layout and paint events. you can optionally supply an argument to label the timestamp, and this label will then be shown alongside the marker. note: this feature is available in web workers. ...
console.trace() - Web APIs
the console interface's trace() method outputs a stack trace to the web console. note: this feature is available in web workers. see stack traces in the console documentation for details and examples. syntax console.trace( [...any, ...data ]); parameters ...any, ...data optional zero or more objects to be output to console along with the trace. these are assembled and
formatted the same way they would be if passed to the console.log() method. example function foo() { function bar() { console.trace(); } bar(); } foo(); in the console, the following trace will be displayed: bar foo <anonymous> specifications specification status comment console apithe definition of 'console.trace()' in that specification. living standard initial def...
Console.warn() - Web APIs
.., substn]); parameters obj1 ... objn a list of javascript objects to output. the string representations of each of these objects are appended together in the order listed and output. msg a javascript string containing zero or more substitution strings. subst1 ... substn javascript objects with which to replace substitution strings within msg. this gives you additional control over the
format of the output. see outputting text to the console in the documentation of console for details. specifications specification status comment console apithe definition of 'console.warn()' in that specification. living standard initial definition ...
ContentIndex.add() - Web APIs
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. if icons images are not of image type. examples here we're declaring an item in the correct
format and creating an asynchronous function which uses the add method to register it with the content index. // our content const item = { id: 'post-1', url: '/posts/amet.html', title: 'amet consectetur adipisicing', description: 'repellat et quia iste possimus ducimus aliquid a aut eaque nostrum.', icons: [{ src: '/media/dark.png', sizes: '128x128', type: 'image/png', }], ...
DOMPointInit.y - Web APIs
the dompointinit dictionary's y property is used to specify the y-coordinate of a point in 2d or 3d space when either creating or serializing to json a dompoint or dompointreadonly object. in general, the value of y increases to the right and decreases to the left, becoming negative to the left of the origin. this may change if trans
forms have been applied causing the axes' orientation to change. syntax var dompointinit = { y: ypos }; dompointinit.y = ypos; var ypos = dompointinit.y; value a double-precision floating-point value indicating the point's y-coordinate. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). if this property is missing when the dompointinit object is passed into frompoint(), the valu...
DOMPointInit.z - Web APIs
2d or 3d space when either creating or serializing to json a dompoint or dompointreadonly object. typically, a z value of 0 represents the plane of the screen. as the value increases, the point moves outward from the screen toward the user. as the value decreases, the point moves farther from the user, with negative values being behind the screen, receding into the distance. of course, if trans
forms have been applied, the axes may have changed orientation. syntax var dompointinit = { z: zpos }; dompointinit.z = zpos; var zpos = dompointinit.z; value a double-precision floating-point value indicating the point's z-coordinate. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). there are two methods which use...
DOMPointReadOnly.toJSON() - Web APIs
syntax pointjson = dompointreadonly.tojson(); parameters none. return value a new dompointinit object whose properties are set to the values in the dompoint or dompointreadonly on which the method was called. example this example creates a dompoint object representing the top-left corner of the current window, in screen coordinates, then converts that to json. ...
DOMPointReadOnly.x - Web APIs
the dompointreadonly interface's x property holds the horizontal coordinate, x, for a read-only point in space. this property cannot be changed by javascript code in this read-only version of the dompoint object. in general, positive values x mean to the right, and negative values of x means to the left, assuming no trans
forms have resulted in a reversal. syntax const xpos = somedompointreadonly.x; value a double-precision floating-point value indicating the x coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'x' in that specification. candidate recom...
DOMPointReadOnly.y - Web APIs
the dompointreadonly interface's y property holds the vertical coordinate, y, for a read-only point in space. if your script needs to be able to change the value of this property, you should instead use the dompoint object. in general, positive values of y mean downward, and negative values of y mean upward, assuming no trans
forms have resulted in a reversal. syntax const ypos = somedompointreadonly.y; value a double-precision floating-point value indicating the y coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'y' in that specification. candidate r...
DOMPointReadOnly.z - Web APIs
the dompointreadonly interface's z property holds the depth coordinate, z, for a read-only point in space. if your script needs to be able to change the value of this property, you should instead use the dompoint object. in general, positive values of z mean toward the user (out from the screen), and negative values of z mean away from the user (into the screen), assuming no trans
forms have resulted in a reversal. syntax const zpos = somedompointreadonly.z; value a double-precision floating-point value indicating the z coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the...
DOMPointReadOnly - Web APIs
dompointreadonly.y read only the point's vertical coordinate, y. dompointreadonly.z read only the point's depth coordinate, z. dompointreadonly.w read only the point's perspective value, w. static methods dompointreadonly.frompoint() a static method that creates a new dompointreadonly object given the coordinates provided in the specified dompointinit object. methods matrixtrans
form() applies a matrix trans
form specified as a dommatrixinit object to the dompointreadonly object. tojson() returns a json representation of the dompointreadonly object. specifications specification status comment geometry interfaces module level 1the definition of 'dompoint' in that specification. candidate recommendation latest spec version is an ed. ...
DOMQuad - Web APIs
it has a handy bounds attribute returning a domrectreadonly for those cases where you just want an axis-aligned bounding rectangle. constructor domquad.domquad() creates a new domquad object. properties p1,p2,p3,p4 read only are dompoint objects for each of the domquad object's four corners. methods domquad.fromrect() returns a new domquad object based on the passed set of coordinates. ...
DataTransfer.dropEffect - Web APIs
t is created, dropeffect is set to a string value. on getting, it returns its current value. on setting, if the new value is one of the values listed below, then the property's current value will be set to the new value and other values will be ignored. for the dragenter and dragover events, dropeffect will be initialized based on what action the user is requesting. how this is determined is plat
form specific, but typically the user can press modifier keys such as the alt key to adjust the desired action. within event handlers for dragenter and dragover events, dropeffect should be modified if a different action is desired than the action that the user is requesting. for the drop and dragend events, dropeffect will be set to the action that was desired, which will be the value dropeffect ha...
DataTransfer.effectAllowed - Web APIs
the datatransfer.effectallowed property specifies the effect that is allowed for a drag operation. the copy operation is used to indicate that the data being dragged will be copied from its present location to the drop location. the move operation is used to indicate that the data being dragged will be moved, and the link operation is used to indicate that some
form of relationship or connection will be created between the source and drop locations. this property should be set in the dragstart event to set the desired drag effect for the drag source. within the dragenter and dragover event handlers, this property will be set to whatever value was assigned during the dragstart event, thus effectallowed may be used to determine which effect is permitted. assigning a value to effectallowed in ...
DataTransfer.getData() - Web APIs
the datatransfer.getdata() method retrieves drag data (as a domstring) for the specified type. if the drag operation does not include data, this method returns an empty string. 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. return value domstring a domstring representing the drag data for the specified
format. if the drag operation has no data or the operation has no data for the specified
format, this method returns an empty string. caveats data availability the html5 drag and drop specification dictates a drag data store mode. this may result in unexpected behavior, being datatransfer.getdata() not returning an expected value. example this example shows ...
DataTransfer.items - Web APIs
types[" + i + "] = " + ev.datatransfer.types[i]); } } // print each item's "kind" and "type" if (ev.datatransfer.items != null) { for (var i=0; i < ev.datatransfer.items.length; i++) { console.log("... items[" + i + "].kind = " + ev.datatransfer.items[i].kind ...
DataTransfer.mozGetDataAt() - Web APIs
this method returns null if the specified item does not exist or if the index is not in the range from zero to the number of items minus one. note: this method is gecko-specific. syntax nsivariant datatransfer.mozgetdataat([type], index); arguments type a string representing the type of the drag data to retrieve from the drag data object. index a unsigned long representing the index of the data to retrieve. return value nsivariant the data item requested. ...
DataTransfer.mozSetDataAt() - Web APIs
t's data transfer object. a data transfer may store multiple items, each at a given zero-based index. mozsetdataat() may only be called with an index argument less than mozitemcount in which case an existing item is modified, or equal to mozitemcount in which case a new item is added, and the mozitemcount is incremented by one. data should be added in order of preference, with the most specific
format added first and the least specific
format added last. if data of the given
format already exists, it is replaced in the same position as the old data. the data should be either a string, a boolean or number type (which will be converted into a string) or an nsisupports. note: this method is gecko-specific. syntax void datatransfer.mozsetdataat([type], data, index); arguments type a st...
DataTransfer.setDragImage() - Web APIs
use the event target's id for the data ev.datatransfer.setdata("text/plain", ev.target.id); // create an image and use it for the drag image // note: change "example.gif" to an existing image or the image will not // be created and the default drag image will be used. var img = new image(); img.src = 'example.gif'; ev.datatransfer.setdragimage(img, 10, 10); } function dragover...
Document.all - Web APIs
er (like an array) and by id (like a regular object). syntax var htmlallcollection = document.all; value an htmlallcollection which contains every element in the document. conversion to boolean document.all is the only falsy object accessible to javascript, because it has the [[ishtmldda]] internal slot. this was done because of compatibility with older versions of internet explorer. more in
formation about this can be found in this answer from stackoverflow. specifications specification status comment html living standardthe definition of 'all' in that specification. living standard initial definition. defined in the obsolete and legacy apis section. ...
Document.createDocumentFragment() - Web APIs
nts to the document fragment and then append the document fragment to the dom tree. in the dom tree, the document fragment is replaced by all its children. since the document fragment is in memory and not part of the main dom tree, appending children to it does not cause page reflow (computation of element's position and geometry). historically, using document fragments could result in better per
formance. you can also use the documentfragment constructor to create a new fragment: let fragment = new documentfragment(); example this example creates a list of major web browsers in a documentfragment, then adds the new dom subtree to the document to be displayed. html <ul id="ul"> </ul> javascript var element = document.getelementbyid('ul'); // assuming ul exists var fragment = document.
Document.createElementNS() - Web APIs
ining a single property named is, whose value is the tag name for a custom element previously defined using customelements.define(). for backwards compatibility with previous versions of the custom elements specification, some browsers will allow you to pass a string here instead of an object, where the string's value is the custom element's tag name. see extending native html elements for more in
formation on how to use this parameter. the new element will be given an is attribute whose value is the custom element's tag name. custom elements are an experimental feature only available in some browsers. return value the new element. important namespace uris html http://www.w3.org/1999/xhtml svg http://www.w3.org/2000/svg mathml http://www.w3.org/1998/math/mathml xul http://www.m...
Document.exitFullscreen() - Web APIs
occurs while attempting to exit full-screen mode, the catch() handler for the promise is called. example this example causes the current document to toggle in and out of a full-screen presentation whenever the mouse button is clicked within it. document.onclick = function (event) { if (document.fullscreenelement) { document.exitfullscreen() .then(() => console.log("document exited
form full screen mode")) .catch((err) => console.error(err)) } else { document.documentelement.requestfullscreen(); } } note: for a more complete example, see the example in element.requestfullscreen(). specifications specification status comment fullscreen apithe definition of 'document.exitfullscreen()' in that specification. living standard initi...
Document.getElementById() - Web APIs
lementbyid(). when creating an element and assigning it an id, you have to insert the element into the document tree with node.insertbefore() or a similar method before you can access it with getelementbyid(): var element = document.createelement('div'); element.id = 'testqq'; var el = document.getelementbyid('testqq'); // el will be null! non-html documents. the dom implementation must have in
formation that says which attributes are of type id. attributes with the name "id" are not of type id unless so defined in the document's dtd. the id attribute is defined to be of id type in the common cases of xhtml, xul, and other. implementations that do not know whether attributes are of type id or not are expected to return null. specification specification status comment ...
Document.hasStorageAccess() - Web APIs
syntax var promise = document.hasstorageaccess(); parameters none. return value a promise that resolves with a boolean value indicating whether the document has access to its first-party storage. ...
Document.implementation - Web APIs
the document.implementation property returns a domimplementation object associated with the current document. syntax domimpobj = document.implementation; example var modname = "html"; var modver = "2.0"; var con
formtest = document.implementation.hasfeature( modname, modver ); alert( "dom " + modname + " " + modver + " supported?: " + con
formtest ); // alerts with: "dom html 2.0 supported?: true" if dom level 2 html module is supported. a list of module names (e.g., core, html, xml, etc.) is available in the dom level 2 con
formance section. notes the w3c's dom level 1 recommendation only specified the hasfeature method, which is one way to determine if a dom module is supported by a browser (see example above and what does your user agent claim to support?). if available, other domi...
Document.lastModified - Web APIs
the lastmodified property of the document interface returns a string containing the date and time on which the current document was last modified. syntax var string = document.lastmodified; examples simple usage this example alerts the value of lastmodified. alert(document.lastmodified); // returns: tuesday, december 16, 2017 11:09:42 trans
forming lastmodified into a date object this example trans
forms lastmodified into a date object. let olastmodif = new date(document.lastmodified); trans
forming lastmodified into milliseconds this example trans
forms lastmodified into the number of milliseconds since january 1, 1970, 00:00:00, local time. let nlastmodif = date.parse(document.lastmodified); notes note that as a string, lastmodified cannot easily be used for comparing the modi...
Document.location - Web APIs
though document.location is a read-only location object, you can also assign a domstring to it. this means that you can work with document.location as if it were a string in most cases: document.location = 'http://www.example.com' is a synonym of document.location.href = 'http://www.example.com'. to retrieve just the url as a string, the read-only document.url property can also be used. if the current document is not in a browsing context, the returned value is null. ...
Document.open() - Web APIs
nt document.open() browsers used to support a two-argument document.open(), with the following signature: document.open(type, replace) where type specified the mime type of the data you are writing (e.g. text/html) and replace if set (i.e. a string of "replace") specified that the history entry for the new document would replace the current history entry of the document being written to. this
form is now obsolete; it won't throw an error, but instead just forwards to document.open() (i.e. is the equivalent of just running it with no arguments). the history-replacement behavior now always happens. specifications specification status comment html living standardthe definition of 'document.open()' in that specification. living standard document o...
Document.queryCommandEnabled() - Web APIs
command for which to determine support. return value returns a boolean which is true if the command is enabled and false if the command isn't. notes for 'cut' and 'copy' commands the method only returns true when called from a user-initiated thread. the 'paste' command return false not only if the feature is unavailable, but also if the script calling it has insufficient privileges to per
form the action. example var flg = document.querycommandenabled("selectall"); if(flg) { document.execcommand("selectall", false, null); // command is enabled, run it } specifications specification status comment execcommand ...
Document.querySelector() - Web APIs
't, a syntax_err exception is thrown. see locating dom elements using selectors for more about selectors and how to manage them. note: characters that are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backslash escaping, be especially careful when writing string literals using these characters. see escaping special characters for more in
formation. return value an htmlelement object representing the first element in the document that matches the specified set of css selectors, or null is returned if there are no matches. if you need a list of all elements matching the specified selectors, you should use queryselectorall() instead. exceptions syntax_err the syntax of the specified selectors is invalid. usage notes if the sp...
Document.requestStorageAccess() - Web APIs
o_grants preference to 1. syntax var promise = document.requeststorageaccess(); parameters none. return value a promise that fulfills with undefined if the access to first-party storage was granted, and rejects if access was denied. when the promise gets resolved, the resolve handler will run as if a user gesture is being processed, whether the promise was fulfilled or rejected: in the
former case, code can then start to call apis that require user activation and things can move forward. in the latter case, code can run to in
form the user of why the request failed and what they can do to continue (for example asking them to log in, if that is a requirement). examples document.requeststorageaccess().then( () => { console.log('access granted') }, () => { console.log('access de...
Document: transitioncancel event - Web APIs
bubbles yes cancelable no interface transitionevent event handler property globaleventhandlers.ontransitioncancel the original target for this event is the element that had the transition applied. you can listen for this event on the document interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: transitioncancel. ...
Document: visibilitychange event - Web APIs
the visibilitychange event is fired at the document when the content of its tab have become visible or have been hidden. bubbles yes cancelable no interface event event handler property onvisibilitychange usage notes the event doesn't include the document's updated visibility status, but you can get that in
formation from the document's visibilitystate property. examples this example begins playing a music track when the document becomes visible, and pauses the music when the document is no longer visible. document.addeventlistener("visibilitychange", function() { if (document.visibilitystate === 'visible') { backgroundmusic.play(); } else { backgroundmusic.pause(); } }); specifications specification statu...
Document: wheel event - Web APIs
items: center; justify-content: center; } div { width: 105px; height: 105px; background: #cdf; padding: 5px; } function zoom(event) { event.preventdefault(); if (event.deltay < 0) { // zoom in scale *= event.deltay * -2; } else { // zoom out scale /= event.deltay * 2; } // restrict scale scale = math.min(math.max(.125, scale), 4); // apply scale trans
form el.style.trans
form = `scale(${scale})`; } let scale = 1; const el = document.queryselector('div'); document.onwheel = zoom; addeventlistener equivalent the event handler can also be set up using the addeventlistener() method: document.addeventlistener('wheel', zoom); specifications specification status comment ui eventsthe definition of 'wheel' in that specificat...
Document.writeln() - Web APIs
es document.writeln is the same as document.write but adds a newline. note: document.writeln (like document.write) does not work in xhtml documents (you'll get a "operation is not supported" (ns_error_dom_not_supported_err) error on the error console). this is the case if opening a local file with a .xhtml file extension or for any document served with an application/xhtml+xml mime type. more in
formation is available in the w3c xhtml faq. specifications specification status comment html living standardthe definition of 'document.writeln()' in that specification. living standard document object model (dom) level 2 html specificationthe definition of 'document.writeln()' in that specification. obsolete ...
Document.xmlEncoding - Web APIs
ermined by the xml declaration. should be null if unspecified or unknown. warning: do not use this attribute; it has been removed from the dom level 4 specification and is no longer supported in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7). if the xml declaration states: <?xml version="1.0" encoding="utf-16"?> ...the result should be "utf-16". however, firefox 3.0 includes in
formation on endianness (e.g., utf-16be for big endian encoding), and while this extra in
formation is removed as of firefox 3.1b3, firefox 3.1b3 is still consulting the file's encoding, rather than the xml declaration as the spec defines it ("an attribute specifying, as part of the xml declaration, the encoding of this document."). specification http://www.w3.org/tr/dom-level-3-cor...ment3-encodin...
DocumentFragment - Web APIs
esents a minimal document object that has no parent. it is used as a lightweight version of document that stores a segment of a document structure comprised of nodes just like a standard document. the key difference is due to the fact that the document fragment isn't part of the active document tree structure. changes made to the fragment don't affect the document (even on reflow) or incur any per
formance impact when changes are made. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rec...
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
cell if (col === 0) { mycurrent_cell.style.background = "rgb(255,0,0)"; } else { mycurrent_cell.style.display = "none"; } } mytablebody.appendchild(mycurrent_row); } mytable.appendchild(mytablebody); mybody.appendchild(mytable); } </script> </html> original document in
formation author(s) marcio galli migrated from http://web.archive.org/web/20000815054125/http://mozilla.org/docs/dom/technote/tn-dom-table/ ...
EXT_color_buffer_float - Web APIs
the ext_color_buffer_float extension is part of webgl and adds the ability to render a variety of floating point
formats. webgl extensions are available using the webglrenderingcontext.getextension() method. for more in
formation, see also using extensions in the webgl tutorial. availability: this extension is available to webgl 2 contexts only. for webgl 1, see the ext_color_buffer_half_float and webgl_color_buffer_float extensions. extended methods the following sized
formats become color-renderable: gl.r16f, gl.rg16f, gl.rgba16f, gl.r32f, gl.rg32f, gl.rgba32f, gl.r11f_g11f_b10f. color-renderable means: the webglrenderingcontext.renderbufferstorage() method now accepts these
formats. framebuffers with attached textures of these
formats may now be framebuffer_complete. ...
EXT_disjoint_timer_query.getQueryEXT() - Web APIs
must be ext.current_query_ext or ext.query_counter_bits_ext. return value depends on pname: if pname is ext.current_query_ext: a webglquery object, which is the currently active query for the given target. if pname is ext.query_counter_bits_ext: a glint indicating the number of bits used to hold the query result for the given target. ...
EXT_frag_depth - Web APIs
availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. it requires glsl #version 300 es. ...
EXT_texture_compression_rgtc - Web APIs
the ext_texture_compression_rgtc extension is part of the webgl api and exposes 4 rgtc compressed texture
formats. rgtc is a block-based texture compression
format suited for unsigned and signed red and red-green textures (red-green texture compression). webgl extensions are available using the webglrenderingcontext.getextension() method. for more in
formation, see also using extensions in the webgl tutorial. availability: support depends on the system's graphics driver. there is no support on windows. this extension is available to both, webgl1 and webgl2 contexts. constants the compressed texture
formats are exposed by 4 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d(). ext.compressed_red_rgtc1_ext each 4x4 block of texels consists o...
EXT_texture_filter_anisotropic - Web APIs
_texture_filter_anisotropic extension is part of the webgl api and exposes two constants for anisotropic filtering (af). af improves the quality of mipmapped texture access when viewing a textured primitive at an oblique angle. using just mipmapping, these lookups have a tendency to average to grey. webgl extensions are available using the webglrenderingcontext.getextension() method. for more in
formation, see also using extensions in the webgl tutorial. availability: this extension is available to both, webgl1 and webgl2 contexts. constants ext.max_texture_max_anisotropy_ext this is the pname argument to the gl.getparameter() call, and it returns the maximum available anisotropy. ext.texture_max_anisotropy_ext this is the pname argument to the gl.gettexparameter() and gl.texparamet...
EffectTiming.direction - Web APIs
ation playback starts by going from the end of the animation sequence toward the beginning the first iteration, then goes forward during the second, and so forth. examples in the forgotten key example, alice waves her arm up and down by passing her an alternate value for her direction property: // get alice's arm, and wave it up and down document.getelementbyid("alice_arm").animate([ { trans
form: 'rotate(10deg)' }, { trans
form: 'rotate(-40deg)' } ], { easing: 'steps(2, end)', iterations: infinity, direction: 'alternate', duration: 600 }); specifications specification status comment web animationsthe definition of 'direction' in that specification. working draft editor's draft. ...
EffectTiming.iterationStart - Web APIs
ot +infinity, indicating the offset into the number of iterations the animation sequence is to run at which to start animating. iterationstart represents the iteration index at which the animation effect begins as well as its progress through that iteration. usually you'll use a value between 0.0 and 1.0 to indicate an offset into the first run of the animation at which to begin the animation per
formance, but any positive, non-infinite value is allowed. since all animations' iteration indexes start at 0, a value of 0.5 would start the animation halfway through its first iteration or loop. meanwhile, a value of 1.2 means the animation will begin playback 20% of the way through its second iteration, and so forth. it's currently undefined what happens if you specify a value of iterationstart w...
EffectTiming.iterations - Web APIs
error an attempt was made to set the value of this property to a negative number or nan. the property's value is left unchanged. examples in the forgotten key example, alice waves her arm up and down the entire time the page is open by passing infinity as the value for her iterations property: // get alice's arm, and wave it up and down document.getelementbyid("alice_arm").animate([ { trans
form: 'rotate(10deg)' }, { trans
form: 'rotate(-40deg)' } ], { easing: 'steps(2, end)', iterations: infinity, direction: 'alternate', duration: 600 }); specifications specification status comment web animationsthe definition of 'iterations' in that specification. working draft editor's draft. ...
Element: DOMMouseScroll event - Web APIs
olling upward. if the event represents scrolling up by a page, the value of detail is -32768. if the event indictes scrolling down by a page, the value is +32768. any other value represents the number of lines to scroll, with the direction indicated by the value's sign. note: trusted events are never sent with a value of 0 for detail. trusted events are never fired with 0. note: if the plat
form's native mouse wheel events only provide scroll distance by pixels, or if the speed can be customized by the user, the value is computed using the line height of the nearest scrollable ancestor element of the event's target. if that element's font size is smaller than mousewheel.min_line_scroll_amount, that preference's value is used as the line height. ...
Element: MozMousePixelScroll event - Web APIs
wheel event. bubbles yes cancelable yes interface mousescrollevent getting the distance scrolled the event's detail property indicates the scroll distance in terms of lines, with negative values indicating the scrolling movement is either toward the bottom or toward the right, and positive values indicating scrolling to the top or left. if the plat
form's native mouse wheel events indicate the scroll distance in terms of lines or pages, the value of detail is computed using that value and the line height or page width/height of the nearest ancestor scrollable element that contains the target element. note: on macos, the scroll distance (and therefore the value of detail) is computed based on the accelerated scroll distance. the value of deta...
Element: auxclick event - Web APIs
wn event. additionally, you may need to avoid opening a system context menu after a right click. due to timing differences between operating systems, this too is not a preventable default behavior of auxclick. instead, this can be done by preventing the default behavior of the contextmenu event. examples in this example we define functions for two event handlers — onclick and onauxclick. the
former changes the color of the button background, while the latter changes the button foreground (text) color. you also can see the two functions in action by trying the demo out with a multi-button mouse (see it live on github; also see the source code). javascript let button = document.queryselector('button'); let html = document.queryselector('html'); function random(number) { return math.flo...
Element: copy event - Web APIs
the copy event fires when the user initiates a copy action through the browser's user interface. bubbles yes cancelable yes interface clipboardevent event handler property oncopy the event's default action is to copy the selection (if any) to the clipboard. a handler for this event can modify the clipboard contents by calling setdata(
format, data) on the event's clipboardevent.clipboarddata property, and cancelling the event's default action using event.preventdefault(). however, the handler cannot read the clipboard data. it's possible to construct and dispatch a synthetic copy event, but this will not affect the system clipboard. examples live example html <div class="source" contenteditable="true">try copying text from this bo...
Element: cut event - Web APIs
event still fires but the event object contains no data. bubbles yes cancelable yes interface clipboardevent event handler property oncut the event's default action is to copy the current selection (if any) to the system clipboard and remove it from the document. a handler for this event can modify the clipboard contents by calling setdata(
format, data) on the event's clipboardevent.clipboarddata property, and cancelling the default action using event.preventdefault(). note though that cancelling the default action will also prevent the document from being updated. so an event handler which wants to emulate the default action for "cut" while modifying the clipboard must also manually remove the selection from the document. the handler...
Element: dblclick event - Web APIs
mple toggles the size of a card when you double click on it. javascript const card = document.queryselector('aside'); card.addeventlistener('dblclick', function (e) { card.classlist.toggle('large'); }); html <aside> <h3>my card</h3> <p>double click to resize this object.</p> </aside> css aside { background: #fe9; border-radius: 1em; display: inline-block; padding: 1em; trans
form: scale(.9); trans
form-origin: 0 0; transition: trans
form .6s; } .large { trans
form: scale(1.3); } result specifications specification status ui eventsthe definition of 'dblclick' in that specification. working draft document object model (dom) level 3 events specificationthe definition of 'dblclick' in that specification. obsolete ...
Element.getAttributeNames() - Web APIs
the getattributenames() method of the element interface returns the attribute names of the element as an array of strings. if the element has no attributes it returns an empty array. using getattributenames() along with getattribute(), is a memory-efficient and per
formant alternative to accessing element.attributes. syntax let attributenames = element.getattributenames(); example // iterate over element's attributes for (let name of element.getattributenames()) { let value = element.getattribute(name); console.log(name, value); } polyfill if (element.prototype.getattributenames == undefined) { element.prototype.getattributenames = function () { var attributes = this.attributes; var length = attributes.length; var result = new array(length); for (var i = 0; i < l...
Element.getClientRects() - Web APIs
x, in pixels, with the top-left relative to the top-left of the viewport. for tables with captions, the caption is included even though it's outside the border box of the table. when called on svg elements other than an outer-<svg>, the "viewport" that the resulting rectangles are relative to is the viewport that the element's outer-<svg> establishes (and to be clear, the rectangles are also trans
formed by the outer-<svg>'s viewbox trans
form, if any). originally, microsoft intended this method to return a textrectangle object for each line of text. however, the cssom working draft specifies that it returns a domrect for each border box. for an inline element, the two definitions are the same. but for a block element, mozilla will return only a single rectangle. firefox 3.5 note fire...
Element.insertAdjacentText() - Web APIs
an element parent. example beforebtn.addeventlistener('click', function() { para.insertadjacenttext('afterbegin',textinput.value); }); afterbtn.addeventlistener('click', function() { para.insertadjacenttext('beforeend',textinput.value); }); have a look at our insertadjacenttext.html demo on github (see the source code too.) here we have a simple paragraph. you can enter some text into the
form element, then press the insert before and insert after buttons to insert it before or after the existing paragraph text using insertadjacenttext(). note that the existing text node is not added to — further text nodes are created containing the new additions. polyfill you can polyfill the insertadjacenttext() method in internet explorer 5.5 (maybe earlier) and higher with the following code: ...
Element: mouseenter event - Web APIs
of the hierarchy when entering them. here 4 events are sent to the four elements of the hierarchy when the pointer reaches the text. a single mouseover event is sent to the deepest element of the dom tree, then it bubbles up the hierarchy until it is canceled by a handler or reaches the root. with deep hierarchies, the number of mouseenter events sent can be quite huge and cause significant per
formance problems. in such cases, it is better to listen for mouseover events. combined with the corresponding mouseleave (which is fired at the element when the mouse exits its content area), the mouseenter event acts in a very similar way to the css :hover pseudo-class. examples the mouseover documentation has an example illustrating the difference between mouseover and mouseenter. mouseenter t...
Element: paste event - Web APIs
example, in a <textarea> or an element with contenteditable attribute set to true) then the default action is to insert the contents of the clipboard into the document at the cursor position. a handler for this event can access the clipboard contents by calling getdata() on the event's clipboarddata property. to override the default behavior (for example to insert some different data or a trans
formation of the clipboard contents) an event handler must cancel the default action using event.preventdefault(), and then insert its desired data manually. it's possible to construct and dispatch a synthetic paste event, but this will not affect the document's contents. examples live example html <div class="source" contenteditable="true">try copying text from this box...</div> <div class="targ...
Element.querySelector() - Web APIs
("output").innerhtml = (baseelement.queryselector("div span").innerhtml); result the result looks like this: notice how the "div span" selector still successfully matches the <span> element, even though the baseelement's child nodes do not include the div element (it is still part of the specified selector). more examples see document.queryselector() for additional examples of the proper
format for the selectors. specifications specification status comment domthe definition of 'queryselector()' in that specification. living standard selectors api level 2the definition of 'queryselectorall()' in that specification. obsolete selectors api level 1the definition of 'queryselectorall()' in that specification. obsolete ...
Element: select event - Web APIs
the select event fires when some text has been selected. bubbles yes cancelable no interface uievent if generated from a user interface, event otherwise event handler property onselect the event is not available for all elements in all languages. for example, in html, select events can be dispatched only on
form <input type="text"> and <textarea> elements. examples selection logger <input value="try selecting some text in this element."> <p id="log"></p> function logselection(event) { const log = document.getelementbyid('log'); const selection = event.target.value.substring(event.target.selectionstart, event.target.selectionend); log.textcontent = `you selected: ${selection}`; } const input = document.queryselector('input'); i...
FileReader.result - Web APIs
syntax var file = instanceoffilereader.result value an appropiate string or arraybuffer based on which of the reading methods was used to initiate the read operation. the value is null if the reading is not yet complete or was unsuccessful. the result types are described below. method description readasarraybuffer() the result is a javascript arraybuffer containing binary data. ...
FileReader - Web APIs
r indicating the state of the filereader. this is one of the following: empty 0 no data has been loaded yet. loading 1 data is currently being loaded. done 2 the entire read request has been completed. filereader.result read only the file's contents. this property is only valid after the read operation is complete, and the
format of the data depends on which of the methods was used to initiate the read operation. event handlers filereader.onabort a handler for the abort event. this event is triggered each time the reading operation is aborted. filereader.onerror a handler for the error event. this event is triggered each time the reading operation encounter an error. filereader.onload a handler for the load ev...
FileReaderSync.readAsArrayBuffer() - Web APIs
buffer representing the file's data. exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g. because it has been erased. securityerror is raised when one of the following problematic situation is detected: the resource has been modified by a third party; too many read are per
formed simultaneously; the file pointed by the resource is unsafe for a use from the web (like it is a system file). notreadableerror is raised when the resource cannot be read due to a permission problem, like a concurrent lock. encodingerror is raised when the resource is a data url and exceed the limit length defined by each browser. specifications specification status c...
FileReaderSync.readAsBinaryString() - Web APIs
mstring representing the input data. exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g. because it has been erased. securityerror is raised when one of the following problematic situation is detected: the resource has been modified by a third party; too many read are per
formed simultaneously; the file pointed by the resource is unsafe for a use from the web (like it is a system file). notreadableerror is raised when the resource cannot be read due to a permission problem, like a concurrent lock. encodingerror is raised when the resource is a data url and exceed the limit length defined by each browser. specifications specification status c...
FileReaderSync.readAsDataURL() - Web APIs
enting the input data as a data url. exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g. because it has been erased. securityerror is raised when one of the following problematic situation is detected: the resource has been modified by a third party; too many read are per
formed simultaneously; the file pointed by the resource is unsafe for a use from the web (like it is a system file). notreadableerror is raised when the resource cannot be read due to a permission problem, like a concurrent lock. encodingerror is raised when the resource is a data url and exceed the limit length defined by each browser. specifications specification status c...
FileReaderSync.readAsText() - Web APIs
mstring representing the input data. exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g. because it has been erased. securityerror is raised when one of the following problematic situation is detected: the resource has been modified by a third party; too many read are per
formed simultaneously; the file pointed by the resource is unsafe for a use from the web (like it is a system file). notreadableerror is raised when the resource cannot be read due to a permission problem, like a concurrent lock. encodingerror is raised when the resource is a data url and exceed the limit length defined by each browser. specifications specification status c...
FileSystemEntry.getParent() - Web APIs
value undefined. errors fileerror.invalid_state_err the operation failed because the file system's state doesn't permit it. this can happen, for example, if the file system's cached state differs from the actual state of the file system. fileerror.not_found_err the specified path could not be found. fileerror.security_err security restrictions prohibit obtaining the parent directory's in
formation. example this example renames the file specified by the variable fileentry to "newname.html". fileentry.getparent(function(parent) { fileentry.moveto(parent, "newname.html", function(updatedentry) { console.log("file " + fileentry.name + " renamed to newname.html."); }); }, function(error) { console.error("an error occurred: unable to rename " + fileentry.name + " to n...
FileSystemEntry - Web APIs
the filesystementry interface of the file and directory entries api represents a single in a file system. the entry can be a file or a directory (directories are represented by the directoryentry interface). it includes methods for working with files—including copying, moving, removing, and reading files—as well as in
formation about a file it points to—including the file name and its path from the root to the entry. because this is a non-standard api, whose specification is not currently on a standards track, it's important to keep in mind that not all browsers implement it, and those that do may implement only small portions of it. check the browser compatibility section for details. basic concepts you don't create filesystementry objects directly. instead, you will rece...
Fullscreen API - Web APIs
e same origin as the top-most document. see using feature policy to learn more about using feature policy to control access to an api. usage notes users can choose to exit full-screen mode simply by pressing the esc (or f11) key, rather than waiting for the site or app to programmatically do so. make sure you provide, somewhere in your user interface, appropriate user interface elements that in
form the user that this option is available to them. note: navigating to another page, changing tabs, or switching to another application using any application switcher (or alt-tab) will likewise exit full-screen mode. example in this example, a video is presented in a web page. pressing the return or enter key lets the user toggle between windowed and full-screen presentation of the video. view...
Gamepad.id - Web APIs
the gamepad.id property of the gamepad interface returns a string containing some in
formation about the controller. the exact syntax is not strictly specified, but in firefox it will contain three pieces of in
formation separated by dashes (-): two 4-digit hexadecimal strings containing the usb vendor and product id of the controller the name of the controller as provided by the driver. for example, a ps2 controller returned 810-3-usb gamepad. this in
formation is intended to allow you to find a mapping for the controls on the device as well as display useful feedback to the user. syntax readonly attribute domstring id; example window.addeventlistener("gamepadconnected", function() { var gp = navigator.getgamepads()[0]; gamepadinfo.innerhtml = "gamepad connected at ...
Gamepad.timestamp - Web APIs
the gamepad.timestamp property of the gamepad interface returns a domhighrestimestamp representing the last time the data for this gamepad was updated. the idea behind this is to allow developers to determine if the axes and button data have been updated from the hardware. the value must be relative to the navigationstart attribute of the per
formancetiming interface. values are monotonically increasing, meaning that they can be compared to determine the ordering of updates, as newer values will always be greater than or equal to older values. note: this property is not currently supported anywhere. syntax readonly attribute domhighrestimestamp timestamp; example var gp = navigator.getgamepads()[0]; console.log(gp.timestamp); value a domhighrestimestamp. specifications ...
Geolocation - Web APIs
ble to programmatically obtain the position of the device. it gives web content access to the location of the device. this allows a web site or app to offer customized results based on the user's location. an object with this interface is obtained using the navigator.geolocation property implemented by the navigator object. note: for security reasons, when a web page tries to access location in
formation, the user is notified and asked to grant permission. be aware that each browser has its own policies and methods for requesting this permission. properties the geolocation interface neither implements, nor inherits any property. methods the geolocation interface doesn't inherit any method. geolocation.getcurrentposition() secure context determines the device's current location and g...
GeolocationCoordinates.heading - Web APIs
presenting the direction in which the device is traveling. this value, specified in degrees, indicates how far off from heading due north the device is. zero degrees represents true true north, and the direction is determined clockwise (which means that east is 90 degrees and west is 270 degrees). if geolocationcoordinates.speed is 0, heading is nan. if the device is not able to provide heading in
formation, this value is null. syntax let heading = geolocationcoordinatesinstance.heading value a double representing the direction in which the device is traveling. specifications specification status comment geolocation apithe definition of 'geolocationcoordinates.heading' in that specification. recommendation initial specification. ...
GeolocationCoordinates - Web APIs
e context returns a double representing the direction towards which the device is facing. this value, specified in degrees, indicates how far off from heading true north the device is. 0 degrees represents true north, and the direction is determined clockwise (which means that east is 90 degrees and west is 270 degrees). if speed is 0, heading is nan. if the device is unable to provide heading in
formation, this value is null. geolocationcoordinates.speed read only secure context returns a double representing the velocity of the device in meters per second. this value can be null. methods the geolocationcoordinates interface neither implements, nor inherits any method. specifications specification status comment geolocation apithe definition of 'geolocationc...
GeolocationPosition.coords - Web APIs
the geolocationposition.coords read-only property returns a geolocationcoordinates object representing a geographic position. it contains the location, that is longitude and latitude on the earth, the altitude, and the speed of the object concerned, regrouped inside the returned value. it also contains accuracy in
formation about these values. syntax let coord = geolocationpositioninstance.coords value a geolocationcoordinates object instance. specifications specification status comment geolocation apithe definition of 'geolocationposition.coords' in that specification. recommendation initial specification. ...
GlobalEventHandlers.ontouchmove - Web APIs
it is specified in the touch events – level 2 draft specification and not in touch events recommendation. this attribute is not widely implemented. syntax var movehandler = someelement.ontouchmove; return value movehandler the touchmove event handler for element someelement. example this example shows two ways to use ontouchmove to set an element's touchmove event handler. ...
GlobalEventHandlers.ontouchstart - Web APIs
it is specified in the touch events – level 2 draft specification and not in touch events recommendation. this attribute is not widely implemented. syntax var starthandler = someelement.ontouchstart; return value starthandler the touchstart event handler for element someelement. example this example shows two ways to use ontouchstart to set an element's touchstart event handler. ...
GlobalEventHandlers.ontransitioncancel - Web APIs
ses the box to rotate, while the mouse cursor hovers over it. .box { margin-left: 70px; margin-top: 30px; border-style: solid; border-width: 1px; display: block; width: 100px; height: 100px; background-color: #0000ff; color: #ffffff; padding: 20px; font: bold 1.6em "helvetica", "arial", sans-serif; -webkit-transition: width 2s, height 2s, background-color 2s, -webkit-trans
form 2s, color 2s; transition: width 2s, height 2s, background-color 2s, trans
form 2s, color 2s; } .box:hover { background-color: #ffcccc; color: #000000; width: 200px; height: 200px; -webkit-trans
form: rotate(180deg); trans
form: rotate(180deg); } javascript next, we need to establish our event handlers to change the text content of the box when the transition begins and ends. let b...
GlobalEventHandlers.ontransitionend - Web APIs
change, and causes the box to rotate, while the mouse cursor hovers over it. .box { margin-left: 70px; margin-top: 30px; border-style: solid; border-width: 1px; display: block; width: 100px; height: 100px; background-color: #0000ff; color: #ffffff; padding: 20px; font: bold 1.6em "helvetica", "arial", sans-serif; transition: width 2s, height 2s, background-color 2s, trans
form 2s, color 2s; } .box:hover { background-color: #ffcccc; color: #000000; width: 200px; height: 200px; trans
form: rotate(180deg); } javascript next, we need to establish our event handlers to change the text content of the box when the transition begins and ends. let box = document.queryselector(".box"); box.ontransitionrun = function(event) { box.innerhtml = "zooming..."; } box.on...
GlobalEventHandlers - Web APIs
aised. globaleventhandlers.ondurationchange is an eventhandler representing the code to be called when the durationchange event is raised. globaleventhandlers.onemptied is an eventhandler representing the code to be called when the emptied event is raised. globaleventhandlers.onended is an eventhandler representing the code to be called when the ended event is raised. globaleventhandlers.on
formdata is an eventhandler for processing
formdata events, fired after the entry list representing the
form's data is constructed. globaleventhandlers.ongotpointercapture is an eventhandler representing the code to be called when the gotpointercapture event type is raised. globaleventhandlers.oninput is an eventhandler representing the code to be called when the input event is raised. globaleve...
HTMLAnchorElement.referrerPolicy - Web APIs
t.referrerpolicy = refstr; values "no-referrer" meaning that the referer: http header will not be sent. "origin" meaning that the referrer will be the origin of the page, that is roughly the scheme, the host and the port. "unsafe-url" meaning that the referrer will include the origin and the path (but not the fragment, password, or username). this case is unsafe as it can leak path in
formation that has been concealed to third-party by using tls. examples var elt = document.createelement("a"); var linktext = document.createtextnode("my link"); elt.appendchild(linktext); elt.href = "https://developer.mozilla.org/"; elt.referrerpolicy = "no-referrer"; var div = document.getelementbyid("divaround"); div.appendchild(elt); // when clicked, the link will not send a referrer heade...
HTMLAreaElement.referrerPolicy - Web APIs
t.referrerpolicy = refstr; values "no-referrer" meaning that the referer: http header will not be sent. "origin" meaning that the referrer will be the origin of the page, that is roughly the scheme, the host and the port. "unsafe-url" meaning that the referrer will include the origin and the path (but not the fragment, password, or username). this case is unsafe as it can leak path in
formation that has been concealed to third-party by using tls. examples <img usemap="#maparound" width="100" height="100" src="/img/logo@2x.png" /> <map id="mymap" name="maparound" />> var elt = document.createelement("area"); elt.href = "/img2.png"; elt.shape = "rect"; elt.referrerpolicy = "no-referrer"; elt.coords = "0,0,100,100"; var map = document.getelementbyid("mymap"); map.appendchild(...
HTMLAudioElement - Web APIs
s given. properties no specific properties; inherits properties from its parent, htmlmediaelement, and from htmlelement. methods inherits methods from its parent, htmlmediaelement, and from htmlelement. it offers no methods of its own. obsolete mozilla-only methods the following methods are non-standard and should not be used. mozcurrentsampleoffset() returns the number of samples
form the beginning of the stream that have been written so far into the audio stream created by calling mozwriteaudio(). mozsetup() sets up the audio stream to allow writing, given the number of audio channels (1 or 2) and the sample rate in khz. mozwriteaudio() writes a batch of audio frames to the stream at the current offset, returning the number of bytes actually written to the stream.
HTMLBaseFontElement - Web APIs
he <basefont> element has been deprecated in html4 and removed in html5. this latest specification requires that this element implements htmlunknownelement rather than htmlbasefontelement. properties inherits properties from its parent, htmlelement. htmlbasefontelement.color is a domstring representing the text color using either a named color or a color specified in the hexadecimal #rrggbb
format. htmlbasefontelement.face is a domstring representing a list of one or more font names. the document text in the default style is rendered in the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. htmlbasefontelement.size is a domstring representing th...
HTMLCanvasElement.mozFetchAsStream() - Web APIs
the htmlcanvaselement.mozfetchasstream() internal method used to create a new input stream that, when ready, would provide the contents of the canvas as image data. however, this non-standard and internal method has been removed. syntax void canvas.mozfetchasstream(callback, type); parameters callback an nsiinputstreamcallback. type optional a domstring indicating the image
format. the default type is image/png. return value none. examples save to disk with mozfetchasstream (chrome context only) this technique also converts it to ico, however it will not work in windows xp as winxp cannot convert from png to ico. it saves to the desktop it uses fileutils.jsm. also uses netutil.jsm var canvas = document.getelementbyid('canvas'); var d = canvas.width; ctx = canvas.ge...
HTMLCanvasElement.mozGetAsFile() - Web APIs
the non-standard, firefox-specific the htmlcanvaselement method mozgetasfile() returns a memory-based file object representing the image contained in the canvas. 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. return value a file object representing the image contained in the canvas. the file's data is entirely located in memory until such time as it is explicitly written to disk. examples this example creates an image file from the <canvas> element on the page, then use...
HTMLCanvasElement: webglcontextcreationerror event - Web APIs
the webglcontextcreationerror event of the webgl api is fired if the user agent is unable to create a webglrenderingcontext context. this event has a webglcontextevent.statusmessage property, which can contain a plat
form dependent string with more in
formation about the failure. bubbles yes cancelable yes interface webglcontextevent event handler property none example var canvas = document.getelementbyid('canvas'); canvas.addeventlistener('webglcontextcreationerror', function(e) { console.log(e.statusmessage || 'unknown error'); }, false); var gl = canvas.getcontext('webgl'); // logs statusmessage or "unknown error" if unable to create webgl context specifications specification status comment webgl 1.0th...
HTMLDataElement - Web APIs
-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldataelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmldataelement.value is a domstring reflecting the value html attribute, containing a machine-readable
form of the element's value. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmldataelement' in that specification. living standard html5the definition of 'htmldataelement' in that specification. recommendation ...
HTMLDetailsElement: toggle event - Web APIs
nature is caprice. </details> <details id="ch2"> <summary>chapter ii</summary> philosophy in fortune's name replies to boethius' reproaches, and proves that the gifts of fortune are hers to give and to take away. </details> <details id="ch3"> <summary>chapter iii</summary> boethius falls back upon his present sense of misery. philosophy reminds him of the brilliancy of his
former fortunes. </details> </section> css body { display: flex; flex-direction: row-reverse; } #log { flex-shrink: 0; padding-left: 3em; } #summaries { flex-grow: 1; } javascript function logitem(e) { const item = document.queryselector(`[data-id=${e.target.id}]`); item.toggleattribute('hidden'); } const chapters = document.queryselectorall('details'); chapters.foreach((chapter...
HTMLElement: animationcancel event - Web APIs
n class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: 0.2rem; padding: 0.2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { trans
form: translatex(100%) scalex(3); } to { trans
form: translatex(0) scalex(1); } } js const animation = document.queryselector('p.animation'); const animationeventlog = document.queryselector('.animation-example>.event-log'); const applyanimation = document.queryselector('.animation-example>button.activate'); let iterationcount = 0; animation.addeventlistener('animationstart', () => { an...
HTMLElement: animationiteration event - Web APIs
n class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: 0.2rem; padding: 0.2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { trans
form: translatex(100%) scalex(3); } to { trans
form: translatex(0) scalex(1); } } js const animation = document.queryselector('p.animation'); const animationeventlog = document.queryselector('.animation-example>.event-log'); const applyanimation = document.queryselector('.animation-example>button.activate'); let iterationcount = 0; animation.addeventlistener('animationstart', () => { an...
HTMLElement: animationstart event - Web APIs
n class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: 0.2rem; padding: 0.2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { trans
form: translatex(100%) scalex(3); } to { trans
form: translatex(0) scalex(1); } } js const animation = document.queryselector('p.animation'); const animationeventlog = document.queryselector('.animation-example>.event-log'); const applyanimation = document.queryselector('.animation-example>button.activate'); let iterationcount = 0; animation.addeventlistener('animationstart', () => { an...
HTMLElement.dir - Web APIs
erty gets or sets the text writing directionality of the content of the current element. the text writing directionality of an element is which direction that text goes (for support of different language systems). arabic languages and hebrew are typical languages using the rtl directionality. an image can have its dir property set to "rtl" in which case the html attributes title and alt will be
formatted and defined as "rtl". when a table has its dir set to "rtl", the column order is arranged from right to left. when an element has its dir set to "auto", the direction of the element is determined based on its first strong directionality character, or default to the directionality of its parent element. browsers might allow users to change the directionality of <input> and <textarea>s in ...
HTMLElement.innerText - Web APIs
elf is not being rendered (e.g detached from the document or is hidden from view), the returned value is the same as the node.textcontent property. example this example compares innertext with node.textcontent. note how innertext is aware of things like <br> elements, and ignores hidden elements. ...
HTMLElement.onpaste - Web APIs
syntax target.onpaste = functionref; value functionref is a function name or a function expression. the function receives a clipboardevent object as its sole argument. ...
HTMLElement: pointermove event - Web APIs
the pointermove event is fired when a pointer changes coordinates, and the pointer has not been canceled by a browser touch-action. bubbles yes cancelable yes interface pointerevent event handler property onpointermove usage notes the event, which is of type pointerevent, provides all the in
formation you need to know about the user's interaction with the pointing device, including the position, movement distance, button states, and much more. examples to add a handler for pointermove events using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointermove', (event) => { console.log('pointer moved'); }); you can also use the onpointermove event handler property: const para = document.querysele...
HTMLElement - Web APIs
ing the declarations of an element's style attributes. htmlorforeignelement.tabindex is a long representing the position of the element in the tabbing order. htmlelement.title is a domstring containing the text that appears in a popup box when mouse is over the element. htmlelement.translate is a boolean representing the translation. event handlers most event handler properties, of the
form onxyz, are defined on the documentandelementeventhandlers, globaleventhandlers or toucheventhandlers interfaces and implemented by htmlelement. in addition, the following handlers are specific to htmlelement. htmlelement.oncopy returns the event handling code for the copy event (bug 280959). htmlelement.oncut returns the event handling code for the cut event (bug 280959). htmlelement.o...
HTMLFieldSetElement - Web APIs
rties inherits properties from its parent, htmlelement. htmlfieldsetelement.disabled a boolean reflecting the disabled html attribute, indicating whether the user can interact with the control. htmlfieldsetelement.elementsread only the elements belonging to this field set. the type of this property depends on the version of the spec that is implemented by the browser. htmlfieldsetelement.
formread only an html
formcontrolscollection or htmlcollection referencing the containing
form element, if this element is in a
form. if the field set is not a descendant of a
form element, then the attribute can be the id of any
form element in the same document it is related to, or the null value if none matches. htmlfieldsetelement.name a domstring reflecting the name html attribute, containing...
HTMLFontElement.face - Web APIs
lfontelement.face property is a domstring that reflects the face html attribute, containing a comma-separated list of one or more font names. the document text, in the default style, is rendered as the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. ...
HTMLFontElement.size - Web APIs
the obsolete htmlfontelement.size property is a domstring that reflects the size html attribute. it contains either an integer number in the range of 1-7 or a relative value to increase/decrease the value of the size attribute of the <basefont> element. ...
HTMLFontElement - Web APIs
implements the document object model (dom) representation of the font element. the html font element <font> defines the font size, font face and color of text. properties inherits properties from its parent, htmlelement. htmlfontelement.color is a domstring that reflects the color html attribute, containing either a named color or a color specified in the hexadecimal #rrggbb
format. htmlfontelement.face is a domstring that reflects the face html attribute, containing a comma-separated list of one or more font names. htmlfontelement.size is a domstring that reflects the size html attribute, containing either a font size number ranging from 1 to 7 or a relative size to the size attribute of the <basefont> element, for example -2 or +1. methods no specific method; inherits methods...
HTMLHtmlElement.version - Web APIs
this property has been declared as deprecated by the w3c technical recommendation for html 4.01 in favor of use of the dtd for obtaining version in
formation for a document. returns version in
formation about the document type definition (dtd) of a document. while this property is recognized by mozilla, the return value for this property is always an empty string. ...
HTMLImageElement.border - Web APIs
e notes do not use border. it is obsolete. instead, use the css border property and its longhand properties to establish borders around images. for example, if you have the following html: <img src="image.png" border="2"> the following will provide the same appearance using css instead of this obsolete property: <img src="image.png" style="border: 2px;"> you can further provide additional in
formation to change the color and other features of the border: <img src="image.png" style="border: dashed 2px #333388;"> specifications specification status comment html living standardthe definition of 'htmlimageelement.border' in that specification. living standard html 4.01 specificationthe definition of 'htmlimageelement.border' in that specification...
HTMLImageElement.complete - Web APIs
to library app that provides the ability to open images into a lightbox mode for improved viewing as well as editing of the image. these photos may be very large, so you don't want to wait for them to load, so your code uses async/await to load the images in the background. but imagine that you have other code that needs to only run when the image has completed loading, such as a command that per
forms red-eye removal on the image in the lightbox. while ideally this command wouldn't even be executed if the image hasn't fully loaded, for improved reliability you want to check to ensure this is the case. so the fixredeyecommand() function, which is called by the button that triggers red-eye removal, checks the value of the lightbox image's complete property before attempting to do its work. thi...
HTMLImageElement.hspace - Web APIs
t.hspace; value an integer value specifying the width, in pixels, of the horizontal margin to apply to the left and right sides of the image. usage notes the value specified for hspace is mapped to the margin-left and margin-right properties to specify the width of those margins in pixels. important: this property is obsolete. you should instead use the css margin property and its longhand
forms to establish margins around an <img>. specifications specification status comment html living standardthe definition of 'htmlimageelement.hspace' in that specification. living standard html 4.01 specificationthe definition of 'htmlimageelement.hspace' in that specification. recommendation provides additional details not present in the newer sp...
HTMLImageElement.loading - Web APIs
to optimize the loading of the document's contents by postponing loading the image until it's expected to be needed, rather than immediately during the initial page load. syntax let imageloadscheduling = htmlimageelement.loading; htmlimageelement.loading = eagerorlazy; value a domstring providing a hint to the user agent as to how to best schedule the loading of the image to optimize page per
formance. the possible values are: eager the default behavior, eager tells the browser to load the image as soon as the <img> element is processed. lazy tells the user agent to hold off on loading the image until the browser estimates that it will be needed imminently. for instance, if the user is scrolling through the document, a value of lazy will cause the image to only be loaded shortly befo...
HTMLImageElement.lowSrc - Web APIs
ere are a number of ways to achieve this; primary among them: higher compression levels (for example, a primary image saved as a jpeg using 85% quality might have a lowsrc version saved at 15%. reduced color depth; a primary image in 32-bit color might have an alternate image in 8-bit color. important: the lowsrc property is obsolete and should not be used. instead, you should use an image
format which loads progressively (such as progressive jpeg). or simply make sure your images are all well-optimized and balanced for appearance versus size. usage notes lowsrc is a strange case. it was never technically part of the html specification (it was a mozilla extension to html); however, html 5 does list it among the obsolete attributes. browser compatibility the compatibility table on t...
HTMLImageElement.naturalHeight - Web APIs
ight at which the image is naturally drawn when no constraint or specific value is established for the image. this natural height is corrected for the pixel density of the device on which it's being presented, unlike height. if the intrinsic height is not available—either because the image does not specify an intrinsic height or because the image data is not available in order to obtain this in
formation, naturalheight returns 0. example this example simply displays both the natural, density-adjusted size of an image as well as its rendered size as altered by the page's css and other factors. html <div class="box"> <img src="/files/16797/clock-demo-400px.png" class="image"> </div> <div class="output"> </div> the html features a 400x398 pixel image which is placed inside a <div>. css ...
HTMLImageElement.naturalWidth - Web APIs
hich the image is naturally drawn when no constraint or specific value is established for the image. this natural width is corrected for the pixel density of the device on which it's being presented, unlike the value of width. if the intrinsic width is not available—either because the image does not specify an intrinsic width or because the image data is not available in order to obtain this in
formation, naturalwidth returns 0. example this example simply displays both the natural, density-adjusted size of an image as well as its rendered size as altered by the page's css and other factors. html <div class="box"> <img src="/files/16797/clock-demo-400px.png" class="image"> </div> <div class="output"> </div> the html features a 400x398 pixel image which is placed inside a <div>. css ...
HTMLImageElement.referrerPolicy - Web APIs
errer policy. possible values are: "no-referrer" meaning that the referer: http header will not be sent. "origin" meaning that the referrer will be the origin of the page, that is roughly the scheme, the host and the port. "unsafe-url" meaning that the referrer will include the origin and the path (but not the fragment, password, or username). this case is unsafe as it can leak path in
formation that has been concealed to third-party by using tls. examples var img = new image(); img.src = 'img/logo.png'; img.referrerpolicy = 'origin'; var div = document.getelementbyid('divaround'); div.appendchild(img); // fetch the image using the origin as the referrer specifications specification status comment referrer policythe definition of 'referrerpolic...
HTMLImageElement.vspace - Web APIs
t.vspace; value an integer value specifying the height, in pixels, of the vertical margin to apply to the top and bottom sides of the image. usage notes the value specified for vspace is mapped to the margin-top and margin-bottom properties to specify the height of those margins in pixels. important: this property is obsolete. you should instead use the css margin property and its longhand
forms to establish margins around an <img>. specifications specification status comment html living standardthe definition of 'htmlimageelement.vspace' in that specification. living standard html 4.01 specificationthe definition of 'htmlimageelement.vspace' in that specification. recommendation the html 4.01 specification offers additional details. ...
HTMLImageElement.width - Web APIs
iles/16864/clock-demo-200px.png" alt="clock" srcset="/files/16864/clock-demo-200px.png 200w, /files/16797/clock-demo-400px.png 400w" sizes="(max-width: 400px) 200px, 400px"> javascript the javascript code looks at the width to determine the width of the image at the moment. this is done in the window's load and resize event handlers, in order to always provide this in
formation. var clockimage = document.queryselector("img"); let output = document.queryselector(".size"); const updatewidth = event => { output.innertext = clockimage.width; }; window.addeventlistener("load", updatewidth); window.addeventlistener("resize", updatewidth); result this example may be easier to try out in its own window. specifications specification status comment ...
HTMLImageElement.x - Web APIs
image's display property is either table-column or table-column-group; in other words, either of those are set directly on the <img> or they're inherited from a containing element or by being located within a column described by either <col> or <colgroup>. example the example below demonstrates the use of the htmlimageelement properties x and y. html in this example, we see a table showing in
formation about users of a web site, including their user id, their full name, and their avatar image. <table id="userinfo"> <colgroup> <col span="2" class="group1"> <col> </colgroup> <tr> <th>userid</th> <th>name</th> <th>avatar</th> </tr> <tr> <td>12345678</td> <td>johnny rocket</td> <td><img src="https://udn.realityripple.com/samples/d6/7ab36d79bb.jpg"</td...
HTMLImageElement.y - Web APIs
image's display property is either table-column or table-column-group; in other words, either of those are set directly on the <img> or they're inherited from a containing element or by being located within a column described by either <col> or <colgroup>. example the example below demonstrates the use of the htmlimageelement properties x and y. html in this example, we see a table showing in
formation about users of a web site, including their user id, their full name, and their avatar image. <table id="userinfo"> <colgroup> <col span="2" class="group1"> <col> </colgroup> <tr> <th>userid</th> <th>name</th> <th>avatar</th> </tr> <tr> <td>12345678</td> <td>johnny rocket</td> <td><img src="https://udn.realityripple.com/samples/d6/7ab36d79bb.jpg"</td...
HTMLIsIndexElement - Web APIs
es (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <isindex> elements. the <isindex> element has been deprecated in html4 and removed in html5. this latest specification requires that this element implements htmlunknownelement rather than htmlisindexelement. properties inherits properties from its parent, htmlelement. htmlisindexelement.
form read only is a html
formelement representing the <
form> element it belongs too. it can have the null value, if <isindex> isn't part of any
form. htmlisindexelement.prompt is a domstring representing a text to be prompted for the field. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html5the def...
HTMLLabelElement.control - Web APIs
syntax control = htmllabelelement.control value an htmlelement derived object representing the control with which the <label> is associated, or null if the label stands alone. if this property has a value and htmllabelelement.htmlfor has a value, the htmllabelelement.htmlfor property must refer to the same control. ...
HTMLLabelElement - Web APIs
solas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmllabelelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmllabelelement.control read only is a htmlelement representing the control with which the label is associated. htmllabelelement.
form read only is a html
formelement object representing the
form with which the labeled control is associated, or null if there is no associated control, or if that control isn't associated with a
form. in other words, this is just a shortcut for htmllabelelement.control.
form. htmllabelelement.htmlfor is a string containing the id of the labeled control. this reflects the for attribute. methods ...
HTMLLinkElement.rel - Web APIs
ty reflects the rel attribute. it is a domstring containing a space-separated list of link types indicating the relationship between the resource represented by the <link> element and the current document. the most common use of this attribute is to specify a link to an external style sheet: the property is set to stylesheet, and the href attribute is set to the url of an external style sheet to
format the page. syntax var relstr = linkelt.rel; linkelt.rel = relstr; example var links = document.getelementsbytagname('link'); var length = links.length; for (var i = 0; i < length; i++) { alert(links[i]); } specifications specification status comment html living standardthe definition of 'rel' in that specification. living standard no change from docume...
HTMLMediaElement.audioTracks - Web APIs
st to learn more about watching for changes to a media element's track list. syntax var audiotracks = mediaelement.audiotracks; value a audiotracklist object representing the list of audio tracks included in the media element. the list of tracks can be accessed using array notation, or using the object's gettrackbyid() method. each track is represented by a audiotrack object which provides in
formation about the track. examples in this example, all of the audio tracks on a given element are muted. html the html establishes the element itself. <video id="video" src="somevideo.mp4"></video> javascript the javascript code handles muting the video element's audio tracks. var video = document.getelementbyid("video"); for (var i = 0; i < video.audiotracks.length; i += 1) { video.audi...
HTMLTableCaptionElement - Web APIs
element. specifications specification status comment html living standardthe definition of 'htmltablecaptionelement' in that specification. living standard no change from html5. html5the definition of 'htmltablecaptionelement' in that specification. recommendation no change from document object model (dom) level 2 html specification, though align was
formerly obsoleted. document object model (dom) level 2 html specificationthe definition of 'htmltablecaptionelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe definition of 'htmltablecaptionelement' in that specification. obsolete initial definition. ...
HTMLTimeElement - Web APIs
px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmltimeelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmltimeelement.datetime is a domstring that reflects the datetime html attribute, containing a machine-readable
form of the element's date and time value. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmltimeelement' in that specification. living standard html 5.1the definition of 'htmltimeelement' in that specification. recommendation no change fro...
HTMLVideoElement.getVideoPlaybackQuality() - Web APIs
the htmlvideoelement method getvideoplaybackquality() creates and returns a videoplaybackquality object containing metrics including how many frames have been lost. the data returned can be used to evaluate the quality of the video stream. syntax videopq = videoelement.getvideoplaybackquality(); return value a videoplaybackquality object providing in
formation about the video element's current playback quality. example this example updates an element to indicate the total number of video frames that have elapsed so far in the playback process. this value includes any dropped or corrupted frames, so it's not the same as "total number of frames played." var videoelem = document.getelementbyid("my_vid"); var counterelem = document.getelementbyid("counter"); var quality = videoelem.getvide...
HTMLVideoElement.msIsLayoutOptimalForPlayback - Web APIs
or may change in the future. msislayoutoptimalforplayback is a read-only property which indicates whether the video can be rendered more efficiently. this proprietary property is specific to internet explorer and microsoft edge. syntax htmlvideoelement.msislayoutoptimalforplayback: domstring; value boolean value set to true indicates that video is being rendered optimally (better per
formance and using less battery power). if false, improvements can be made to optimize per
formance. for msislayoutoptimalforplayback to be true, avoid the following: video elements with cascading style sheets (css) outlines set. rendering a video element through a canvas element. embedding video elements in a scalable vector graphics (svg). you can listen to the onmsvideooptimallayoutchanged e...
HTMLVideoElement.msZoom - Web APIs
value set to true trims the video frame to the display space. set to false the video frame uses letter box or pillarbox to display video. if the native aspect ratio of a video frame, which is defined by the videowidth and videoheight attributes, does not match the aspect ratio of the video tag, which is defined by the width and height attributes, the video is rendered with letterbox or pillarbox
format. letterbox and pillarbox are the black bars on either the left and right of the video or the top and bottom of the video. when the mszoom attribute is set to true, the rendered video is trimmed to fit the dimensions of the video object. either the top and bottom of the video is trimmed or the left and right of the video is trimmed. for instance, if the layout space for the video tag is a 4:3 ...
File drag and drop - Web APIs
the main steps to drag and drop are to define a drop zone (i.e. a target element for the file drop) and to define event handlers for the drop and dragover events. these steps are described below, including example code snippets. the full source code is available in mdn's drag-and-drop repository (pull requests and/or issues are welcome). ...
Recommended Drag Types - Web APIs
ed by a linebreak. for example: http://www.mozilla.org mozilla http://www.example.com example dragging html and xml html content may use the text/html type. the data for this type should be serialized html source code. for example, it would be suitable to set its data to the value of the innerhtml property of an element. xml content may use the text/xml type, but ensure that the data is well-
formed xml. you may also include a plain text representation of the html or xml data using the text/plain type. the data should be just the text without any of the source tags or attributes. for instance: var dt = event.datatransfer; dt.setdata("text/html", "hello there, <strong>stranger</strong>"); dt.setdata("text/plain", "hello there, stranger"); dragging files a local file is dragged using th...
History - Web APIs
lets you specify a string, instead of an integer, to go to a specific url in the history list. pushstate() pushes the given data onto the session history stack with the specified title (and, if provided, url). the data is treated as opaque by the dom; you may specify any javascript object that can be serialized. note that all browsers but safari currently ignore the title parameter. for more in
formation, see working with the history api. replacestate() updates the most recent entry on the history stack to have the specified data, title, and, if provided, url. the data is treated as opaque by the dom; you may specify any javascript object that can be serialized. note that all browsers but safari currently ignore the title parameter. for more in
formation, see working with the history api. ...
HkdfParams - Web APIs
a-512 salt a buffersource. the hkdf specification states that adding salt "adds significantly to the strength of hkdf". ideally, the salt is a random or pseudo-random value with the same length as the output of the digest function. unlike the input key material passed into derivekey(), salt does not need to be kept secret. info a buffersource representing application-specific contextual in
formation. this is used to bind the derived key to an application or context, and enables you to derive different keys for different contexts while using the same input key material. it's important that this should be independent of the input key material itself. this property is required but may be an empty buffer. examples see the examples for subtlecrypto.derivekey(). specifications s...
IDBCursor - Web APIs
tore it is iterating over. it has a position within the range, and moves in a direction that is increasing or decreasing in the order of record keys. the cursor enables an application to asynchronously process all the records in the cursor's range. you can have an unlimited number of cursors at the same time. you always get the same idbcursor object representing a given cursor. operations are per
formed on the underlying index or object store. note: this feature is available in web workers. properties note: idbcursorwithvalue is an idbcursor interface with an additional value property. idbcursor.source read only returns the idbobjectstore or idbindex that the cursor is iterating. this function never returns null or throws an exception, even if the cursor is currently being iterated, ...
IDBCursorSync - Web APIs
use its need was questionable. it may however be reintroduced in the future if there is enough demand from web developers. the idbcursorsync interface of the indexeddb api represents a cursor for iterating over multiple records in a database. you can have only one instance of idbcursorsync representing a cursor, but you can have an unlimited number of cursors at the same time. operations are per
formed on the underlying index or object store. it enables an application to synchronously process all the records in the cursor's range. method overview bool continue (in optional any key); void remove () raises (idbdatabaseexception); attributes attribute type description count readonly unsigned long long the total number of objects that ...
IDBCursorWithValue - Web APIs
s iterating over. it has a position within the range, and moves in a direction that is increasing or decreasing in the order of record keys. the cursor enables an application to asynchronously process all the records in the cursor's range. you can have an unlimited number of cursors at the same time. you always get the same idbcursorwithvalue object representing a given cursor. operations are per
formed on the underlying index or object store. note: this feature is available in web workers. <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">...
IDBDatabaseException - Web APIs
attributes attribute type description code unsigned short the most appropriate error code for the condition. message domstring error message describing the exception raised. ...
IDBFactory.deleteDatabase() - Web APIs
if the database is successfully deleted, then a success event is fired on the request object returned from this method, with its result set to undefined. if an error occurs while the database is being deleted, then an error event is fired on the request object that is returned from this method. when deletedatabase() is called, any other open connections to this particular database will get a versionchange event. ...
installChrome - Web APIs
* the theme somust match exactly the name in the internal manifest.rdf file. returns a boolean value indicating false if the software install feature has been turned off, and true if it's on. note that this return value does not indicate anything about the success of the installation. description installchrome is a special method for installing new chrome in netscape 6 and mozilla. the method per
forms a simplified installation of language packs or netscape 6/mozilla skins, and saves you the trouble of writing separate installation scripts in the xpi files or using the more sophisticated methods of the install and file objects. ...
startSoftwareUpdate - Web APIs
returns true. description the startsoftwareupdate method triggers a software download and install from the specified url. ...
InstallTrigger - Web APIs
n objects. in either case, you must trigger the installation process by creating a web page script in which installtrigger methods download the specified xpi file and "trigger" the execution of the install.js script at the top level of that xpi. the principal method on the installtrigger object is install, which downloads and installs one or more software packages archived in the xpi file
format. the following is a basic example of an install trigger on a web page: xpi={'xpinstall dialog display name':'simple.xpi'}; installtrigger.install(xpi); you can also use the installtrigger object to install netscape 6/mozilla skins and language packs, and per
form multiple-package installations with install. compareversion compares the version of a file or p...
IntersectionObserver.IntersectionObserver() - Web APIs
n the visible area of the root is not considered visible. rootmargin a string which specifies a set of offsets to add to the root's bounding_box when calculating intersections, effectively shrinking or growing the root for calculation purposes. the syntax is approximately the same as that for the css margin property; see the root element and root margin in intersection observer api for more in
formation on how the margin works and the syntax. the default is "0px 0px 0px 0px". threshold either a single number or an array of numbers between 0.0 and 1.0, specifying a ratio of intersection area to total bounding box area for the observed target. a value of 0.0 means that even a single visible pixel counts as the target being visible. 1.0 means that the entire target element is visible. see ...
KeyboardEvent: code values - Web APIs
the reason is that some browsers choose to interpret physical keys differently, there are some differences in which keys map to which codes. these tables show those variations when known. code values code values on windows this table shows the windows scan codes representing keys and the keyboardevent.code values which correspond to those hardware keys. only keys which generate scan codes on windows are listed. ...
KeyboardEvent.key - Web APIs
, the returned value is unidentified. keyboardevent sequence every keyboardevent is fired in a pre-determined sequence. for a given key press, the sequence of keyboardevents fired is as follows assuming that event.preventdefault is not called: a keydown event is first fired. if the key is held down further and the key produces a character key, then the event continues to be emitted in a plat
form implementation dependent interval and the keyboardevent.repeat read only property is set to true. 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. note that some other implementations may fire keypress e...
Keyboard API - Web APIs
de attribute contains the physical location of the key that was pressed, and the key attribute contains the string generated by pressing the key at that physical location on the keyboard. the key value takes into account the keyboard's locale (for example, 'en-us'), layout (for example, 'qwerty'), and modifier-key state (shift, control, etc.). historically there has been no way to retrieve that in
formation. the keyboard map api provides a way to retrieve the string generated by a particular key press, through the keyboard interface and the keyboardlayoutmap interface. the keyboard interface is accessed through navigator.keyboard. keyboard provides the keyboard.getlayoutmap method, which returns a promise that resolves with a keyboardlayoutmap object that contains members for converting codes ...
KeyframeEffect.KeyframeEffect() - Web APIs
ct instance. its parameter is as follows: sourcekeyframes a keyframeeffect object that you want to clone. examples in the follow the white rabbit example, the keyframeeffect constructor is used to create a set of keyframes that dictate how the white rabbit should animate down the hole: var rabbitdownkeyframes = new keyframeeffect( whiterabbit, // element to animate [ { trans
form: 'translatey(0%)' }, // keyframe { trans
form: 'translatey(100%)' } // keyframe ], { duration: 3000, fill: 'forwards' } // keyframe options ); specifications specification status comment web animations level 2the definition of 'keyframeeffectoptions.iterationcomposite' in that specification. draft added the iterationcomposite option. web ...
KeyframeEffect.getKeyframes() - Web APIs
the getkeyframes() method of a keyframeeffect returns an array of the computed keyframes that make up this animation along with their computed offsets. syntax var keyframes = keyframeeffect.getkeyframes(); parameters none. return value returns a sequence of objects with the following
format: property value pairs as many property value pairs as are contained in each keyframe of the animation. offset the offset of the keyframe specified as a number between 0.0 and 1.0 inclusive or null. this is equivalent to specifying start and end states in percentages in css stylesheets using @keyframes. this will be null if the keyframe is automatically spaced using keyframeeffect.spacing. computedoffset the computed offset for this keyframe, calculated when the list of computed...
KeyframeEffect - Web APIs
keyframes that make up this effect. animationeffect.updatetiming() updates the specified timing properties. examples in the follow the white rabbit example, the keyframeeffect constructor is used to create a set of keyframes that dictate how the white rabbit should animate down the hole: var rabbitdownkeyframes = new keyframeeffect( whiterabbit, // element to animate [ { trans
form: 'translatey(0%)' }, // keyframe { trans
form: 'translatey(100%)' } // keyframe ], { duration: 3000, fill: 'forwards' } // keyframe options ); specifications specification status comment web animationsthe definition of 'keyframeeffect' in that specification. working draft initial definition ...
KeyframeEffectOptions - Web APIs
from keyframe to keyframe, and how to behave when the animation begins and ends. properties composite optional determines how values are combined between this animation and other, separate animations that do not specify their own specific composite operation. defaults to replace. add dictates an additive effect, where each successive iteration builds on the last. for instance with trans
form, a translatex(-200px) would not override an earlier rotate(20deg) value but result in translatex(-200px) rotate(20deg). accumulate is similar but a little smarter: blur(2) and blur(5) become blur(7), not blur(2) blur(5). replace overwrites the previous value with the new one. iterationcomposite optional determines how values build from iteration to iteration in this animation. can be ...
LayoutShiftAttribution - Web APIs
properties layoutshiftattribution.node returns the element that has shifted (null if it has been removed). layoutshiftattribution.previousrect returns a domrect representing the position of the element before the shift. layoutshiftattribution.currentrect returns a domrect representing the position of the element after the shift. ...
Location: reload() - Web APIs
the location.reload() method reloads the current url, like the refresh button. the reload may be blocked and a security_error domexception thrown. this happens if the origin of the script calling location.reload() differs from the origin of the page that owns the location object. see same-origin policy for more in
formation. syntax location.reload(); specifications specification status comment html living standardthe definition of 'location.reload()' in that specification. living standard no change from html5. html5the definition of 'location.reload()' in that specification. recommendation initial definition. ...
Location - Web APIs
cation.search is a usvstring containing a '?' followed by the parameters or "querystring" of the url. modern browsers provide urlsearchparams and url.searchparams to make it easy to parse out the parameters from the querystring. location.hash is a usvstring containing a '#' followed by the fragment identifier of the url. location.origin read only returns a usvstring containing the canonical
form of the origin of the specific location. methods location.assign() loads the resource at the url provided in parameter. location.reload() reloads the current url, like the refresh button. location.replace() replaces the current resource with the one at the provided url (redirects to the provided url). the difference from the assign() method and setting the href property is that after usi...
LockManager.query() - Web APIs
syntax var promise<lockmanagersnapshot> = lockmanager.query() parameters none. return value a promise that resolves with a lockmanagersnapshot containing the following properties. held: an array of lock objects for held locks. pending: an array of lock objects for pending lock requests. ...
LockManager - Web APIs
er interface of the the web locks api provides methods for requesting a new lock object and querying for an existing lock object. to get an instance of lockmanager, call navigator.locks. methods lockmanager.request() requests a lock object with parameters specifying its name and characteristics. lockmanager.query() returns a promise that resolves with a lockmanagersnapshot which contains in
formation about held and pending locks. specifications specification status comment web locks apithe definition of 'lockmanager' in that specification. draft initial definition. ...
LockedFile.abort() - Web APIs
nd the behavior may change in the future. summary the abort method is used to release the lock on the lockedfile object, making it inactive: its active property is set to false and all ongoing operations are canceled. note: when an ongoing operation is canceled, there is no rollback (it is not a database transaction), therefore the file can be corrupted if the canceled operation was per
forming some writing. syntax var request = instanceoflockedfile.abort(); return a filerequest object to handle the success or failure of the operation. specifications specification status comment filesystem api editor's draft draft proposal ...
LockedFile.active - Web APIs
non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the active property allows to know if the lockedfile object is still usable (true) or not (false). if the object is inactive then it is impossible to per
form any read or write operation with it. typically, a lockedfile object becomes inactive when the lockedfile.abort() method is called or if an error occurs. syntax var state = instanceoflockedfile.active value a boolean. specifications specification status comment filesystem api editor's draft draft proposal. ...
LockedFile.append() - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. summary the append method is used to write some data at the end of the file. the write operation is per
formed at the end of the file, regardless of the lockedfile.location value, and actually sets this value to null. syntax var request = instanceoflockedfile.append(data); parameters data the data to write into the file. it can be a string or an arraybuffer. return a filerequest object to handle the success or failure of the operation. specifications specification status comme...
LockedFile.flush() - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. summary the flush method is used to ensure any change made to a file is properly written on disk. for per
formance reasons, a lockedfile object buffers all its operation in memory. this allows fast writing and reading operations. periodically, the data are written onto disk. however, if something goes wrong before that, some operations can be lost. to avoid that, it's possible to force a write onto the disk by calling the flush method. syntax var request = instanceoflockedfile.flush(); return a filere...
LockedFile.readAsArrayBuffer() - Web APIs
d is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. summary the readasarraybuffer method is used to read the content of the lockedfile object and provide the result of that reading as an arraybuffer. in many ways, it per
forms like the filereader.readasarraybuffer() method. the reading operation starts at the position given by the lockedfile.location property. syntax var request = instanceoflockedfile.readasarraybuffer(size); parameters size a number representing the number of bytes to read in the file. return a filerequest object to handle the success or failure of the operation. in case of success, the re...
LockedFile.readAsText() - Web APIs
n-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. summary the readastext method is used to read the content of the lockedfile object and provide the result of that reading as a string. in many ways, it per
forms like the filereader.readastext() method. the reading operation starts at the position given by the lockedfile.location property. syntax var request = instanceoflockedfile.readastext(size[, encoding]); parameters size a number representing the number of bytes to read in the file. encoding optional a string indicating the encoding to use for the returned data. by default, utf-8 is assume...
MIDIAccess - Web APIs
stance. event handlers midiaccess.onstatechange called whenever a new midi port is added or an existing port changes state. examples navigator.requestmidiaccess() .then(function(access) { // get lists of available midi controllers const inputs = access.inputs.values(); const outputs = access.outputs.values(); access.onstatechange = function(e) { // print in
formation about the (dis)connected midi controller console.log(e.port.name, e.port.manufacturer, e.port.state); }; }); specifications specification status comment web midi api working draft initial definition. ...
MIDIMessageEvent - Web APIs
midi message is sent from a device represented by a midiinput, for example when a midi keyboard key is pressed, a knob is tweaked, or a slider is moved. constructor midimessageevent.midimessageevent creates a new midimessageevent object instance. properties midiconnectionevent.data a uint8array containing the data bytes of a single midi message. see the midi specification for more in
formation on its
form. note: even though the web midi api specifies a receivedtime property that returns a domhighrestimestamp, chrome (the only implementation at the time of writing) does not support that property since the basic event.timestamp property already returns a domhighrestimestamp in chrome. examples // printing all messages to console navigator.requestmidiaccess().then(midiaccess =>...
MSCandidateWindowShow - Web APIs
s event is supported in windows 8.1 imes of all languages. syntax event property object.oncandidatewindowshow = handler; addeventlistener method object.addeventlistener("mscandidatewindowshow", handler, usecapture) parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event. this event fires after the positioning in
formation of the ime candidate window has been determined. you can obtain the positioning in
formation using the getcandidatewindowclientrect method, and adjust your layout as needed to avoid any occlusions with the ime candidate window. web applications need only register for this event once per element (the handler will remain valid for the lifetime of the element). example in ie11, developers can...
MSManipulationEvent.initMSManipulationEvent() - Web APIs
pagate upward. when false the event does not propagate upward. cancelablearg [in] type: boolean indicates whether the event’s default action can be prevented. when true, the default action can be canceled. when false, the default action cannot be canceled. viewarg [in] type: abstractview the view in which the event is taking place. detailarg [in] type: integer specifies some detailed in
formation depending upon the event. laststate [in] type: integer indicates the last state of the manipulation event. currentstate [in] type: integer indicates the current state of the manipulation event. return value this method does not return a value. example interface msmanipulationevent extends uievent { readonly currentstate: number; readonly inertiadestinationx: number; rea...
MSManipulationEvent - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. msmanipulationevent provides contextual in
formation when contact is made to the screen and an element is manipulated. this proprietary method is specific to internet explorer. events msmanipulationstatechanged: event fires when the state of an element being manipulated has changed. methods msmanipulationevent.initmsmanipulationevent(): used to create a manipulation event that can be called from javascript. properties property description currentstateread only return...
MSSiteModeEvent - Web APIs
nd is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. mssitemodeevent provides event properties that are specific to pinned site events. this proprietary method is specific to internet explorer and microsoft edge. dom in
formation inheritance hierarchy event mssitemodeevent methods method description initevent initializes a new generic event that the createevent method created. *note that as of microsoft edge, the createevent()/initevent() constructor pattern for synthetic events is deprecated. preventdefault cancels the default action of an event. stopimmediat...
Magnetometer.Magnetometer() - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. syntax var magnetometer = new magnetometer([options]) parameters options optional options are as follows: frequency: the desired number of times per second a sample should be taken, meaning the number of times per second that sensor.onreading will be called. ...
Magnetometer - Web APIs
to use this sensor, the user must grant permission to the 'magnetometer' device sensor through the permissions api. if a feature policy blocks use of a feature, it's because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. constructor magnetometer.magnetometer() creates a new magnetometer object. properties magnetometer.x read only returns a double containing the magnetic field around the device's x axis. ...
MediaCapabilities.decodingInfo() - Web APIs
iguration to be tested const mediaconfig = { type : 'file', // or 'media-source' audio : { contenttype : "audio/ogg", // valid content type channels : 2, // audio channels used by the track bitrate : 132700, // number of bits used to encode 1s of audio samplerate : 5200 // number of audio samples making up that 1s. ...
MediaCapabilities.encodingInfo() - Web APIs
g = { type : 'record', // or 'transmission' video : { contenttype : "video/webm;codecs=vp8.0", // valid content type width : 1920, // width of the video height : 1080, // height of the video bitrate : 120000, // number of bits used to encode 1s of video framerate : 48 // number of frames making up that 1s. ...
MediaConfiguration - Web APIs
apabilities api describes how media and audio files must be configured, or defined, to be passed as a parameter of the mediacapabilities.encodinginfo() and mediacapabilities.encodinginfo() methods. 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 in
formation, set the media type to record or transmission. for decoding, set the type to file or media-source. if the media is an audio file, the audio configuration must include a valid audio mime type as contenttype, the number of channels, the bitrate, and the sample rate. video configurations mush include a valid video mime type as contenttype, the bitrate, and framerate, along with the width and ...
MediaDecodingConfiguration - Web APIs
iaconfig = { type : 'file', // or 'media-source' video : { contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; // check support and per
formance navigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ? '' : 'not ') + 'supported.') }); specifications specification status comment media capabilitiesthe definition of 'mediadecodingconfiguration' in that specification. draft initial definition ...
MediaDeviceInfo - Web APIs
the list of devices obtained by calling navigator.mediadevices.enumeratedevices() is an array of mediadeviceinfo objects, one per media device. properties mediadeviceinfo.deviceidread only returns a domstring that is an identifier for the represented device that is persisted across sessions. it is un-guessable by other applications and unique to the origin of the calling application. it is reset when the user clears cookies (for private browsing, a different identifier is used that is not persisted across sessions). mediadeviceinfo.groupidread only returns a domstring that is a group identifier. ...
MediaDevices.getDisplayMedia() - Web APIs
encouraged to provide a warning to users about sharing displays or windows that contain browsers, and to keep a close eye on what other content might be getting captured and shown to other users. example in the example below, a startcapture() method is created which initiates screen capture given a set of options specified by the displaymediaoptions parameter. the options are specified in the
form of a mediastreamconstraints object which specifies the preferred stream configuration and the display surface from which video is to be captured. async function startcapture(displaymediaoptions) { let capturestream = null; try { capturestream = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); } catch(err) { console.error("error: " + err); } return capturestre...
MediaDevices - Web APIs
access to any hardware source of media data. properties inherits properties from its parent interface, eventtarget. events devicechange fired when a media input or output device is attached to or removed from the user's computer. also available via the ondevicechange property. methods inherits methods from its parent interface, eventtarget. enumeratedevices() obtains an array of in
formation about the media input and output devices available on the system. getsupportedconstraints() returns an object con
forming to mediatracksupportedconstraints indicating which constrainable properties are supported on the mediastreamtrack interface. see capabilities and constraints in media capture and streams api (media stream) to learn more about constraints and how to use them. getdisplaym...
MediaEncodingConfiguration - Web APIs
config = { type : 'record', // or 'transmission' video : { contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; // check support and per
formance navigator.mediacapabilities.encodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ? '' : 'not ') + 'supported.') }); specifications specification status comment media capabilitiesthe definition of 'mediaencodingconfiguration' in that specification. draft initial definition ...
MediaError.code - Web APIs
syntax var myerror = mediaerror.code; value a numeric value indicating the general type of error which occurred. the possible values are described below, in media error code constants. media error code constants name value description media_err_aborted 1 the fetching of the associated resource was aborted by the user's request. ...
msExtendedCode - Web APIs
and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. in the event of an error, the media element's error event will be fired. the element's error property will then contain an msextendedcode read-only property with plat
form-specific error code in
formation. msextendedcode is a read-only proprietary property specific to internet explorer and microsoft edge. value type: long; the plat
form specific error code. example var video1 = object.getelementbyid("video1"); video1.addeventlistener('error', function () { var error = video1.error.msextendedcode; //... }, false); video.addeventlistener('canplay', function ...
MediaError - Web APIs
aving previously been determined to be usable, an error occurred while trying to decode the media resource, resulting in an error. media_err_src_not_supported 4 the associated resource or media provider object (such as a mediastream) has been found to be unsuitable. mediaerror.message a domstring object containing a human-readable string which provides specific diagnostic in
formation to help the reader understand the error condition which occurred; specifically, it isn't simply a summary of what the error code means, but actual diagnostic in
formation to help in understanding what exactly went wrong. this text and its
format is not defined by the specification and will vary from one user agent to another. if no diagnostics are available, or no explanation can be provided,...
initDataTypes - Web APIs
the mediakeysystemconfiguration.initdatatypes read-only property returns a list of supported initialization data type names. an initialization data type is a string indicating the
format of the initialization data. syntax var datatypes[] = mediasystemconfiguration.initdatatypes; specifications specification status comment encrypted media extensionsthe definition of 'initdatatypes' in that specification. recommendation initial definition ...
MediaKeySystemConfiguration - Web APIs
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. mediakeysystemconfiguration.distinctiveidentifier read only indicates whether a persistent distinctive identifier is required. ...
MediaMetadata - Web APIs
constructor mediametadata.mediametadata() creates a new mediametadata object. properties mediametadata.title returns or sets the title of the media to be played. mediametadata.artist returns or sets the name of the artist, group, creator, etc. of the media to be played. mediametadata.album returns or sets the name of the album or collection containing the media to be played. mediametadata.artwork returns or sets an array of images associated with playing media. ...
MediaQueryList - Web APIs
you can create a mediaquerylist by calling matchmedia() on the window object. the resulting object handles sending notifications to listeners when the media query state changes (i.e. when the media query test starts or stops evaluating to true). this is very useful for adaptive design, since this makes it possible to observe a document to detect when its media queries change, instead of polling the values periodically, and allows you to programmatically make changes to a document based on media query status. ...
MediaQueryListEvent - Web APIs
constructor mediaquerylistevent() creates a new mediaquerylistevent instance. properties the mediaquerylistevent interface inherits properties from its parent interface, event. mediaquerylistevent.matchesread only a boolean that returns true if the document currently matches the media query list, or false if not. mediaquerylistevent.mediaread only a domstring representing a serialized media query. ...
MediaRecorder() - Web APIs
syntax var mediarecorder = new mediarecorder(stream[, options]); parameters stream the mediastream that will be recorded. this source media can come from a stream created using navigator.mediadevices.getusermedia() or from an <audio>, <video> or <canvas> element. options optional a dictionary object that can contain the following properties: mimetype: a mime type specifying the
format for the resulting media; you may simply specify the container
format (the browser will select its preferred codecs for audio and/or video), or you may use the codecs parameter and/or the profiles parameter to provide detailed in
formation about which codecs to use and how to configure them. applications can check in advance if a mimetype is supported by the user agent by calling mediarecorder.is...
MediaRecorder.isTypeSupported - Web APIs
arecorder.istypesupported(mimetype) parameters mimetype the mime media type to check. return value true if the mediarecorder implementation is capable of recording blob objects for the specified mime type. recording may still fail if there are insufficient resources to support the recording and encoding process. if the value is false, the user agent is incapable of recording the specified
format. example var types = ["video/webm", "audio/webm", "video/webm\;codecs=vp8", "video/webm\;codecs=daala", "video/webm\;codecs=h264", "audio/webm\;codecs=opus", "video/mpeg"]; for (var i in types) { console.log( "is " + types[i] + " supported? " + (mediarecorder.istypesupported(types[i]) ? "maybe!" : "nope :(")); } ...
MediaRecorder.start() - Web APIs
r the number of tracks on the stream being recorded has changed. you can't add or remove tracks while recording media. invalidstateerror the mediarecorder is not in the inactive state; you can't start recording media if it's already being recorded. see the state property. notsupportederror the media stream you're attempting to record is inactive, or one or more of the stream's tracks is in a
format that can't be recorded using the current configuration. securityerror the mediastream is configured to disallow recording. this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an input device. this also happens when a mediastreamtrack within the stream is marked as isolated due to the peeridentity constraint on the source stream...
MediaRecorderErrorEvent() - Web APIs
parameters errorinfo an object describing the error object to be created. it must contain the error property at a minimum. error a domexception that describes the error that occurred. this object's name property should indicate the name of the error that occurred. the other fields may or may not be present. some user agents add to the error object other properties that provide in
formation such as stack dumps, the name of the javascript file and the line number where the error occurred, and other debugging aids, but you should not rely on this in
formation in a production environment. specifications specification status comment mediastream recordingthe definition of 'mediarecordererrorevent()' in that specification. working draft initial definit...
MediaRecorderErrorEvent.error - Web APIs
c ones to various scenarios in which they may occur in the corresponding method references. invalidstateerror an operation was attempted in a context in which it isn't allowed, or a request has been made on an object that's deleted or removed. notsupportederror a mediarecorder couldn't be created because the specified options weren't valid. the message atttribute should provide additional in
formation, if it exists. securityerror the mediastream is configured to disallow recording. this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an input device. this also happens when a mediastreamtrack within the stream is marked as isolated due to the peeridentity constraint on the source stream. example this function creates and...
MediaSession.metadata - Web APIs
the metadata property of the mediasession interface contains a mediametadata object providing descriptive in
formation about the currently playing media, or null if the metadata has not been set. this metadata is provided by the browser to the device for presentation in any standard media control user interface the device might offer. syntax var mediametadata = navigator.mediasession.metadata; navigator.mediasession.metadata = mediametadata; value an instance of mediametadata containing in
formation about the media currently being played. example the following example creates a new media session and assigns action handlers to it: if ('mediasession' in navigator){ navigator.mediasession.metadata = new mediametadata({ title: "podcast episode title", artist: "podcast host", ...
MediaSession - Web APIs
ce elements. for example, a smartphone might have a standard panel in its lock screen that provides controls for media. a browser on that device might deliver the metadata provided by calling mediasession to the device in order to be controllable using the global user interface. properties metadata returns an instance of mediametadata which contains rich media metadata, for display in a plat
form ui. playbackstate indicates whether the current media session is playing. valid values are none, paused, or playing. methods setactionhandler() sets an event handler for a media session action, such as play or pause. see the method page for a full list. setpositionstate() sets the current playback position and speed of the media currently being presented. examples the following examp...
MediaSessionActionDetails.action - Web APIs
strack moves back to the previous track. seekbackward seeks backward through the media from the current position. seekforward seeks forward from the current position through the media. seekto moves the playback position to the specified time within the media. skipad skips past the currently playing advertisement or commercial. this action may or may not be available, depending on the plat
form and user agent, or may be disabled due to subscription level or other circumstances. stop halts playback entirely. specifications specification status comment media session standardthe definition of 'mediasessionactiondetails.action' in that specification. draft initial definition. ...
MediaSessionActionDetails.seekTime - Web APIs
he time by an offset rather than moving to an absolute time, the seekforward or seekbackward actions should be used instead. syntax let mediasessionactiondetails = { seektime: abstimeinseconds }; let abstime = mediasessionactiondetails.seektime; value a floating-point value indicating the absolute time in seconds into the media to which to move the current play position. usage notes to per
form a "fast" seek (such as when issuing multiple seekto actions in sequence while handling a scrubbing operation, the details object's fastseek property's value is set to true, indicating that you should minimize or eliminate anything you do while handling the action that is only necessary at the final step. if the value of fastseek is false, or fastseek is missing, the action should be treated as t...
MediaSource.isTypeSupported() - Web APIs
the mediasource.istypesupported() static method returns a boolean value which is true if the given mime type is likely to be supported by the current user agent. that is, if it can successfully create sourcebuffer objects for that mime type. if the returned value is false, then the user agent is certain that it cannot access media of the specified
format. syntax var isitsupported = mediasource.istypesupported(mimetype); parameters mimetype the mime media type that you want to test support for in the current browser. this may include the codecs parameter to provide added details about the codecs used within the file. return value a boolean which is true if the browser feels that it can probably play media of the specified type. this is not a guarantee, however, and your code must be ...
MediaStreamAudioSourceNode - Web APIs
(through getusermedia()) or from a remote peer on a webrtc call (using the rtcpeerconnection's audio tracks). a mediastreamaudiosourcenode has no inputs and exactly one output, and is created using the audiocontext.createmediastreamsource() method. the mediastreamaudiosourcenode takes the audio from the first mediastreamtrack whose kind attribute's value is audio. see track ordering for more in
formation about the order of tracks. the number of channels output by the node matches the number of tracks found in the selected audio track. number of inputs 0 number of outputs 1 channel count defined by the first audio mediastreamtrack passed to the audiocontext.createmediastreamsource() method that created it. constructor new mediastreamaudiosourcen...
MediaStreamTrack.applyConstraints() - Web APIs
nstraints can be used to ensure that the media meets certain guidelines you prefer. for example, you may prefer high-density video but require that the frame rate be a little low to help keep the data rate low enough not overtax the network. constraints can also specify ideal and/or acceptable sizes or ranges of sizes. see applying constraints in capabilities, constraints, and settings for more in
formation on how to apply your preferred constraints. syntax const appliedpromise = track.applyconstraints([constraints]) parameters constraints optional a mediatrackconstraints object listing the constraints to apply to the track's constrainable properties; any existing constraints are replaced with the new values specified, and any constrainable properties not included are restored to their d...
MediaStreamTrack.getCapabilities() - Web APIs
once you know what the browser's capabilities are, your script can use applyconstraints() to ask for the track to be configured to match ideal or acceptable settings. see capabilities, constraints, and settings for details on how to work with constrainable properties. ...
MediaStreamTrack.getSettings() - Web APIs
iastreamtrack. see capabilities, constraints, and settings for details on how to work with constrainable properties. syntax const settings = track.getsettings() returns a mediatracksettings object describing the current configuration of the track's constrainable properties. note: the returned object identifies the current values of every constrainable property, including those which are plat
form defaults rather than having been expressly set by the site's code. to instead fetch the most-recently established constraints for the track's properties, as specified by the site's code, use getconstraints(). specifications specification status comment media capture and streamsthe definition of 'getsettings()' in that specification. candidate recommendation initia...
MediaStream Image Capture API - Web APIs
conversely, the api allows the capabilities to be configured within the constraints what the device allows. mediastream image capture concepts and usage the process of retrieving an image or video stream happens as described below. the example code is adapted from chrome's image capture examples. ...
MediaTrackConstraints.displaySurface - Web APIs
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. later code can use this flag to determine whether or not to per
form special processing, such as to remove or replace the backdrop, or to "cut" the individual display areas out of the received frames of video. examples here are some example constraints objects for getdisplaymedia() that make use of the displaysurface property. in addition, see example: constraint exerciser in capabilities, constraints, and settings for a complete example showing how constraints ...
MediaTrackConstraints.echoCancellation - Web APIs
ocancellation constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.echocancellation as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this in
formation, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { echocancellation: constraint }; constraintsobject.echocancellation = constraint; value if this value is a simple true or false, the user agent will attempt to obtain media with echo cancellation enabled or disabled as specified, if possible, but will not fail if this ca...
MediaTrackConstraints.facingMode - Web APIs
e of the facingmode constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.facingmode as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this in
formation, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { facingmode: constraint }; constraintsobject.facingmode = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) facing modes are acceptable for a video track. an exact value in this case indicates that...
MediaTrackConstraints.groupId - Web APIs
e microphone and speaker on the same headset would share a group id. this makes it possible to use the group id to ensure that the audio and input devices are on the same headset by retrieving the group id of the input device and specifying it when asking for an output device, perhaps. however, the value of the groupid is determined by the source of the track's content, and there's no particular
format mandated by the specification (although some kind of guid is recommended). that means that a given track will only return one value for the groupid when you call getcapabilities(), and keep in mind that this value will change for each browsing session. because of this, there's no use for the group id when calling mediastreamtrack.applyconstraints(), since there is only one possible value, and ...
MediaTrackConstraints - Web APIs
whitebalancemode a string specifying one of "none", "manual", "single-shot", or "continuous". exposuremode a string specifying one of "none", "manual", "single-shot", or "continuous". focusmode a string specifying one of "none", "manual", "single-shot", or "continuous". pointsofinterest the pixel coordinates on the sensor of one or more points of interest. this is either an object in the
form { x:value, y:value } or an array of such objects, where value is a double-precision integer. exposurecompensation a constraindouble (a double-precision integer) specifying f-stop adjustment by up to ±3. colortemperature a constraindouble (a double-precision integer) specifying a desired color temperature in degrees kelvin. iso a constraindouble (a double-precision integer) specifying a d...
MediaTrackSettings.echoCancellation - Web APIs
track generated from the microphone. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.echocancellation as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this in
formation, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var echocancellation = mediatracksettings.echocancellation; value a boolean value which is true if the track has echo cancellation functionality enabled or false if echo cancellation is disabled. example see example: constraint exerciser in capabilities, constraints, and settings for an example...
MediaTrackSettings.facingMode - Web APIs
a() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.facingmode as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this in
formation, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var facingmode = mediatracksettings.facingmode; value a domstring whose value is one of the strings in videofacingmodeenum. videofacingmodeenum the following strings are permitted values for the facing mode. these may represent separate cameras, or they may represent directions in which an adju...
MediaTrackSettings.latency - Web APIs
uding cpu, transmission, and storage overhead. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.latency as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this in
formation, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var latency = mediatracksettings.latency; value a double-precision floating-point number indicating the estimated latency, in seconds, of the audio track as currently configured. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications...
MerchantValidationEvent.methodName - Web APIs
ame is a read-only value which returns a string indicating the payment method identifier which represents the payment handler that requires merchant validation. syntax methodid = merchantvalidationevent.methodname; value a read-only domstring which uniquely identifies the payment handler which is requesting merchant validation. see merchant validation in payment processing concepts for more in
formation on the process. specifications specification status comment payment request apithe definition of 'merchantvalidationevent.methodname' in that specification. candidate recommendation initial definition. ...
MerchantValidationEvent.validationURL - Web APIs
ete the transaction. syntax validationurl = merchantvalidationevent.validationurl; value a read-only usvstring giving the url from which to load payment handler specific data needed to complete the merchant verification process. once this has been loaded, it should be passed into complete(), either directly or using a promise. see merchant validation in payment processing concepts for more in
formation on the merchant validation process. specifications specification status comment payment request apithe definition of 'merchantvalidationevent.validationurl' in that specification. candidate recommendation initial definition. ...
MerchantValidationEvent - Web APIs
r for the payment handler that's requiring validation. this may be either one of the standard payment method identifier strings or a url that both identifies and handles requests for the payment handler, such as https://apple.com/apple-pay. merchantvalidationevent.validationurl secure context a usvstring specifying a url from which the site or app can fetch payment handler specific validation in
formation. once this data is retrieved, the data (or a promise resolving to the validation data) should be passed into complete() to validate that the payment request is coming from an authorized merchant. methods merchantvalidationevent.complete() secure context pass the data retrieved from the url specified by validationurl into complete() to complete the validation process for the paymentrequ...
MessageEvent - Web APIs
in channel messaging or when sending a message to a shared worker). methods this interface also inherits methods from its parent, event. initmessageevent() initializes a message event. do not use this anymore — use the messageevent() constructor instead. examples in our basic shared worker example (run shared worker), we have two html pages, each of which uses some javascript to per
form a simple calculation. the different scripts are using the same worker file to per
form the calculation — they can both access it, even if their pages are running inside different windows. the following code snippet shows creation of a sharedworker object using the sharedworker() constructor. both scripts contain this: var myworker = new sharedworker('worker.js'); both scripts then access the...
Metadata.modificationTime - Web APIs
syntax var modificationtime = metadata.modificationtime; value a date timestamp indicating when the file system entry was last changed. example this example tries to get a particular working file at tmp/workfile.json. once that file has been found, its metadata is obtained and the file's modification timestamp year is compared to the current year. if it was last modified in a ye...
Metadata - Web APIs
this metadata includes the file's size and modification date and time. this interface isn't available through the global scope; instead, you obtain a metadata object describing a filesystementry using the method filesystementry.getmetadata(). properties modificationtime read only a date object indicating the date and time the entry was modified. size read only a 64-bit unsigned integer indicating the size of the entry in bytes. ...
Microsoft API extensions - Web APIs
saudiocategory htmlaudioelement.msaudiodevicetype htmlmediaelement.mscleareffects() htmlmediaelement.msinsertaudioeffect() mediaerror.msextendedcode msgraphicstrust msgraphicstruststatus msisboxed msplaytodisabled msplaytopreferredsourceuri msplaytoprimary msplaytosource msrealtime mssetmediaprotectionmanager mssetvideorectangle msstereo3dpackingmode msstereo3drendermode onmsvideo
formatchanged onmsvideoframestepcompleted onmsvideooptimallayoutchanged msfirstpaint pinned sites apis mssitemodeevent mssitemodejumplistitemremoved msthumbnailclick other apis x-ms-aria-flowfrom x-ms-acceleratorkey x-ms-
format-detection mscaching mscachingenabled mscapslockwarningoff event.msconverturl() mselementresize document.mselementsfromrect() msisstatichtml navigat...
MimeTypeArray - Web APIs
this object is returned by navigatorplugins.mimetypes. properties mimetypearray.length the number of items in the array. methods mimetypearray.item() returns the mimetype object with the specified index. mimetypearray.nameditem() returns the mimetype object with the specified name. example the following example tests whether a plugin is available for the application/pdf mime type and if so, which plugin that is. ...
MouseEvent.initMouseEvent() - Web APIs
in this way must have been created with the document.createevent() method. this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent(). once dispatched, it doesn't do anything anymore. do not use this method anymore as it is deprecated. instead use specific event constructors, like mouseevent(). the page on creating and triggering events gives more in
formation about the way to use these. 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, mouse...
MouseEvent.mozInputSource - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mouseevent.mozinputsource read-only property on mouseevent provides in
formation indicating the type of device that generated the event. this lets you, for example, determine whether a mouse event was generated by an actual mouse or by a touch event (which might affect the degree of accuracy with which you interpret the coordinates associated with the event). syntax var source = instanceofmouseevent.mozinputsource; return value the following values are possible. constant name val...
msGraphicsTrustStatus - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. msgraphicstruststatus is a read-only property which returns an object containing in
formation on protected video playback. this proprietary property is specific to internet explorer and microsoft edge. syntax status = object.msgraphicstruststatus; example //specifies the output device id that the audio will be sent to. msaudiodevicetype: string; readonly msgraphicstruststatus: msgraphicstrust; ...
msPlayToPreferredSourceUri - Web APIs
er and microsoft edge. syntax ptr = object.msplaytopreferredsourceuri; value msplaytopreferredsourceuri enables a playto reference (a uri or url) for streaming content on the playto target device from a different location, such as a cloud media server. this enables web pages and microsoft store apps to play digital rights management (drm) protected content. the app specifies a preferred uni
form resource identifier (uri). this uri can point to a cloud based media server allowing streaming directly from the cloud, which can be drm protected, instead of streaming content from the windows machine which must be unprotected content. a forward slash ("/") is appended to the uri string when it is sent over the network to a playto device. this is done to con
form to uri standards. example <v...
msPlayToSource - Web APIs
msplaytosource is a read-only property which gets the source associated with the media element for use by the playtomanager. this proprietary property is specific to internet explorer and microsoft edge. syntax ptr = object.msplaytosource; value playto is a means through which an app can connect local playback/display for audio, video, and img elements to a remote device. for more in
formation, see the windows.media.playto apis. msplaytosource is used in the sourcerequested handler -- get the playtosource object from an audio, video, or img element using the msplaytosource property and pass it to e.setsource, then set the playtosource.next property to the msplaytosource of another element for continual playing. the property value for msplaytosource is the source associated with ...
MutationEvent - Web APIs
eprecated in the dom events specification, as the api's design is flawed (see details in the "dom mutation events replacement: the story so far / existing points of consensus" post to public-webapps). mutation observers are the proposed replacement for mutation events in dom4. they are expected to be included in firefox 14 and chrome 18. the practical reasons to avoid the mutation events are per
formance issues and cross-browser support. per
formance adding dom mutation listeners to a document profoundly degrades the per
formance of further dom modifications to that document (making them 1.5 - 7 times slower!). moreover, removing the listeners does not reverse the damage. the per
formance effect is limited to the documents that have the mutation event listeners. cross-browser support these ...
MutationObserver.MutationObserver() - Web APIs
erve only changes to the parent node subtree: true } const observer = new mutationobserver(callback); observer.observe(targetnode, observeroptions); the desired subtree is located by finding an element with the id someelement. a set of options for the observer is also established in the observeroptions record. in it, we specify values of true for both childlist and attributes, so we get the in
formation we want. then the observer is instantiated, specifying the callback() function. we begin observing the dom nodes of interest by calling observe(), specifying the target node and the options object. from this point until disconnect() is called, callback() will be called each time an element is added to or removed from the dom tree rooted at targetnode, or any of those elements' attributes a...
MutationObserverInit.attributeFilter - Web APIs
representing an attribute change (which can be detected by the value of mutationrecord.type being "attributes"), we use the attribute's name, obtained using mutationrecord.attributename, to identify the type of change that occurred and then dispatch to the appropriate handler function. note the use of mutationrecord.oldvalue to get the previous value of the "username" property so we have that in
formation when doing lookups in our local array of users. when observe() is called, the specified options include both attributefilter and subtree, so that we monitor the attribute values for all of the nodes contained within the subtree rooted at the node with the id "userlist". the attributeoldvalue option is set to true because we want the prior value of the changed attributes recorded and reporte...
MutationObserverInit.characterDataOldValue - Web APIs
the mutationobserverinit dictionary's optional characterdataoldvalue property is used to specify whether or not the mutationrecord.oldvalue property for dom mutations should be set to the previous value of text nodes which changed. if you set the mutationobserverinit.characterdata property to true but don't set characterdataoldvalue to true as well, the mutationrecord will not include in
formation describing the prior state of the text node's contents. character data changes are detectable on any text node, including nodes based on the text, processinginstruction, and comment interfaces. syntax var options = { characterdataoldvalue: true | false } value a boolean value indicating whether or not to set the mutationrecord's oldvalue property to be a string containing the value of the ch...
NDEFRecord.lang - Web APIs
the lang property ofthe ndefrecord interface is usvstring containing the language tag of the record contents, if it is a vailable. the record might be missing a language tag, for example, if the recorded in
formation is not locale-specific. syntax ndefrecord.lang value a usvstring. specifications specification status comment web nfc, ndefrecord.lang draft initial definition. ...
Navigator.battery - Web APIs
this interface was introduced in early drafts of the battery status api and but has been replaced with promise-based navigator.getbattery(). ...
Navigator.buildID - Web APIs
returns the build identifier of the browser. in modern browsers this property now returns a fixed timestamp as a privacy measure, e.g. 20181001000000 in firefox 64 onwards. syntax buildid = navigator.buildid; value a string representing the build identifier of the application. the build id is in the
form yyyymmddhhmmss. example console.log(window.navigator.buildid); specification not part of any public standard. ...
Navigator.connection - Web APIs
the navigator.connection read-only property returns a networkin
formation object containing in
formation about the system's connection, such as the current bandwidth of the user's device or whether the connection is metered. this could be used to select high definition content or low definition content based on the user's connection. syntax networkin
formation = navigator.connection value a networkin
formation object. specifications specification status comment network in
formation apithe definition of 'navigator.connection' in that specification. draft initial specification ...
Navigator.geolocation - Web APIs
the navigator.geolocation read-only property returns a geolocation object that gives web content access to the location of the device. this allows a web site or app to offer customized results based on the user's location. note: for security reasons, when a web page tries to access location in
formation, the user is notified and asked to grant permission. be aware that each browser has its own policies and methods for requesting this permission. syntax geo = navigator.geolocation specifications specification status comment geolocation apithe definition of 'navigator.geolocation' in that specification. recommendation initial definition ...
Navigator.msLaunchUri() - Web APIs
s not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mslaunchuri() method is a microsoft extension to the navigator interface, which starts a service or app, such as an email client, that handles a given protocol. the uni
form resource identifier (uri) contains the protocol for the default service or app, such as mailto://test@contoso.com. this proprietary method is specific to internet explorer, and microsoft edge versions 18 and lower. syntax navigator.mslaunchuri(uri, successcallback, nohandlercallback); parameters uri a domstring specifying the url containing including the protocol of the document or resour...
Navigator.requestMediaKeySystemAccess() - Web APIs
s input just one parameter: mediakeysystemaccess a mediakeysystemaccess object representing the media key system configuration described by keysystem and supportedconfigurations exceptions in case of an error, the returned promise is rejected with a domexception whose name indicates what kind of error occurred. notsupportederror either the specified keysystem isn't supported by the plat
form or the browser, or none of the configurations specified by supportedconfigurations can be satisfied (if, for example, none of the codecs specified in contenttype are available). typeerror either keysystem is an empty string or the supportedconfigurations array is empty. specifications specification status comment encrypted media extensionsthe definition of 'requestmed...
Navigator.sendBeacon() - Web APIs
return values the sendbeacon() method returns true if the user agent successfully queued the data for transfer. otherwise, it returns false. ...
NavigatorID.appVersion - Web APIs
returns either "4.0" or a string representing version in
formation about the browser. note: do not rely on this property to return the correct browser version. syntax window.navigator.appversion value either "4.0" or a string representing version in
formation about the browser. example alert('your browser version is reported as ' + navigator.appversion); notes the window.navigator.useragent property may also contain the version number (for example "mozilla/5.0 (windows; u; win98; en-us; rv:0.9.2) gecko/20010725 netscape 6/6.1"), but you should be aware of how easy it is to change the user agent string and "spoof" other browsers, plat
forms, or user agents, and also how cavalier the browser vendor themselves are with these properties. the window.navigator.appversion, window.navigator.
NavigatorID - Web APIs
terface doesn't inherit any properties. navigatorid.appcodename read only always returns "mozilla", in any browser. this property is kept only for compatibility purposes. navigatorid.appname read only always returns "netscape", in any browser. this property is kept only for compatibility purposes. navigatorid.appversion read only returns either "4.0" or a string representing version in
formation about the browser. do not rely on this property to return a useful value. navigatorid.plat
form read only returns either the empty string or a string representing the plat
form the browser is running on. do not rely on this property to return a useful value. navigatorid.product read only always returns "gecko", in any browser. this property is kept only for compatibility purposes. navig...
NavigatorStorage - Web APIs
there are many apis which provide ways for web content to store data on a user's computer, including cookies, the web storage api (window.localstorage and window.sessionstorage), and indexeddb. ...
Node.compareDocumentPosition() - Web APIs
hernode is located earlier in the document and contains the node on which comparedocumentposition() was called, then both the document_position_contains and document_position_preceding bits would be set, producing a value of 10 (0x0a). example const head = document.head; const body = document.body; if (head.comparedocumentposition(body) & node.document_position_following) { console.log('well-
formed document'); } else { console.error('<head> is not before <body>'); } note: because the result returned by comparedocumentposition() is a bitmask, the bitwise and operator must be used for meaningful results. specifications specification status comment domthe definition of 'node.comparedocumentposition()' in that specification. living standard docu...
Node.getRootNode() - Web APIs
f it is available. syntax var root = node.getrootnode(options); parameters options optional an object that sets options for getting the root node. the available options are: composed: a boolean that indicates whether the shadow root should be returned (false, the default), or a root node beyond shadow root (true). returns an object inheriting from node. this will differ in exact
form depending on where you called getrootnode(); for example: calling it on an element inside a standard web page will return an htmldocument object representing the entire page. calling it on an element inside a shadow dom will return the associated shadowroot. examples the first simple example returns a reference to the html/document node: rootnode = node.getrootnode(); this more complex e...
Node.isSupported() - Web APIs
ements a specific feature and this feature is supported by the specific node. syntax boolvalue = element.issupported(feature, version) parameters feature is a domstring containing the name of the feature to test. this is the same name which can be passed to the method hasfeature on domimplementation. possible values defined within the core dom specification are listed on the dom level 2 con
formance section. version is a domstring containing the version number of the feature to test. in dom level 2, version 1, this is the string 2.0. if the version is not specified, supporting any version of the feature will cause the method to return true. example <div id="doc"> </div> <script> // get an element and check to see if its supports the dom2 html module. var main = document.getelemen...
PaymentMethodChangeEvent - Web APIs
s the paymentmethodchangeevent interface. options optional an optional paymentmethodchangeeventinit dictionary which may contain zero or more of the following properties: methodname optional a domstring containing the payment method identifier for the payment handler being used. this is an empty string by default. methoddetails optional an object providing payment method-specific in
formation describing the changes made to the payment, or null if there is no additional in
formation available or required. this is null by default. return value a newly-created paymentmethodchangeevent object describing a change to the options specified for the payment method given in the methodname property. the type of the methoddetails property depends on the payment method. for example, if...
PaymentMethodChangeEvent.methodDetails - Web APIs
te a discount if the user chooses to use a visa card as their payment method. request.onpaymentmethodchange = function(ev) { const { type: cardtype } = ev.methoddetails; const newstuff = {}; if (ev.methodname === "https://apple.com/apple-pay") { switch (cardtype) { case "visa": // do apple pay specific handling for visa card... // methoddetails contains the card in
formation const result = calculatediscount(ev.methoddetails); object.assign(newstuff, result); break; } } // finally... ev.updatewith(newstuff); }; const response = await request.show(); note that the methoddetails property is being used by the calculatediscount() function to compute any payment discount, then updatewith() is called to update the event with the compu...
PaymentMethodChangeEvent - Web APIs
thodchangeevent object, optionally initialized with values taken from a given paymentmethodchangeeventinit dictionary. properties in addition to the properties below, this interface includes properties inherited from paymentrequestupdateevent. methoddetails read only secure context an object containing payment method-specific data useful when handling a payment method change. if no such in
formation is available, this value is null. methodname read only secure context a domstring containing the payment method identifier, a string which uniquely identifies a particular payment method. this identifier is usually a url used during the payment process, but may be a standardized non-url string as well, such as basic-card. the default value is the empty string, "". methods this interfac...
PaymentRequest.canMakePayment() - Web APIs
pple pay? if (await supportsapplepay) { // show apple pay logo, for instance return; } // otherwise... let's see if we can use basic card const supportsbasiccard = await new paymentrequest( [{ supportedmethods: "basic-card" }], details ).canmakepayment(); if (supportsbasiccard) { // show basic card support return; } // otherwise, make payments using html
form element } specifications specification status comment payment request apithe definition of 'canmakepayment()' in that specification. candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/brow...
PaymentRequest.prototype.id - Web APIs
amount: { currency: "usd", value: "65.00" }, }, }; const request = new paymentrequest(methoddata, details); console.log(request.id); // super-store-order-123-12312 the id is then also available in the paymentresponse returned from the show() method, but under the requestid attribute. const response = await request.show(); console.log(response.requestid === request.id); // and in serialized
form too const json = response.tojson(); console.log(json.requestid,response.requestid, request.id); syntax var id = paymentrequest.id value a domstring. specifications specification status comment payment request apithe definition of 'id' in that specification. candidate recommendation initial definition. browser compatibility the compatibility table on t...
PaymentRequest: merchantvalidation event - Web APIs
related events payerdetailchange, paymentmethodchange, shippingaddresschange, and shippingoptionchange specifications specification status comment payment request apithe definition of 'merchantvalidation' in that specification. candidate recommendation ...
PaymentRequest.onpaymentmethodchange - Web APIs
ndles changes made to the payment method when using apple pay, specifically: request.onpaymentmethodchange = ev => { const { type: cardtype } = ev.methoddetails; const newstuff = {}; if (ev.methodname === "https://apple.com/apple-pay") { switch (cardtype) { case "store": // do apple pay specific handling for store card... // methoddetails contains the store card in
formation const result = calculatediscount(ev.methoddetails); object.assign(newstuff, result); break; } } // finally... ev.updatewith(newstuff); }; const response = await request.show(); specifications specification status comment payment request apithe definition of 'onpaymentmethodchange' in that specification. candidate recommendation ...
PaymentRequest.onshippingaddresschange - Web APIs
hippingaddresschangeevent => { ... }); paymentrequest.onshippingaddresschange = function(shippingaddresschangeevent) { ... }; examples the shippingaddresschange event is triggered by a user-agent controlled interaction. if the address stored by the user agent changes at any time during a payment process, the event is triggered. to make sure an updated address is included when sending payment in
formation to the server, you should add event listeners for a paymentrequest object after instantiation, but before the call to show(). // initialization of paymentrequest arguments are excerpted for clarity. var payment = new paymentrequest(supportedinstruments, details, options); request.addeventlistener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(resolve) { ...
PaymentRequest.onshippingoptionchange - Web APIs
ge', shippingoptionchangeevent => { ... }); paymentrequest.onshippingoptionchange = function(shippingoptionchangeevent) { ... }; examples the shippingoptionchange event is triggered by a user-agent controlled interaction. if the option stored by the user agent changes at any time during a payment process, the event is triggered. to make sure an updated option is included when sending payment in
formation to the server, you should add event listeners for a paymentrequest object after instantiation, but before the call to show(). // initialization of paymentrequest arguments are excerpted for clarity. var request = new paymentrequest(supportedinstruments, details, options); // when user selects a shipping address request.addeventlistener('shippingaddresschange', e => { e.updatewith(((detai...
PaymentRequest: shippingaddresschange event - Web APIs
the shippingaddresschange event is sent to the paymentrequest object when the user selects a shipping address or changes details of their shipping address. bubbles no cancelable no interface paymentrequestupdateevent event handler property onshippingaddresschange usage notes depending on the browser, the shipping address in
formation may be redacted for privacy reasons. that is, the paymentaddress which contains the shipping address may have some portions of its content altered, obscured, or left out entirely in order to prevent identifying the user without their consent (since if they choose to have you ship products to them, you'll need their address). example in this example, a handler for the shippingaddresschange event is set up...
PaymentRequest: shippingoptionchange event - Web APIs
the string identifying the currently-selected shipping option can be found in the shippingoption property. bubbles no cancelable no interface paymentrequestupdateevent event handler property onshippingoptionchange examples this code snippet sets up a handler for the shippingoptionchange event. the code recalculates the total charge for the payment based on the selected shipping option. ...
PaymentResponse.requestId - Web APIs
syntax var id = paymentrequest.id value a domstring. specifications specification status comment payment request apithe definition of 'requestid' in that specification. candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
Pbkdf2Params - Web APIs
mber of times the hash function will be executed in derivekey(). this determines how computationally expensive (that is, slow) the derivekey() operation will be. in this context, slow is good, since it makes it more expensive for an attacker to run a dictionary attack against the keys. the general guidance here is to use as many iterations as possible, subject to keeping an acceptable level of per
formance for your application. examples see the examples for subtlecrypto.derivekey(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.pbkdf2params' in that specification. recommendation ...
PeriodicWave.PeriodicWave() - Web APIs
options dictionary. context a baseaudiocontext representing the audio context you want the node to be associated with. options optional a periodicwaveoptions dictionary object defining the properties you want the periodicwave to have (it also inherits the options defined in the periodicwaveconstraints dictionary.): real: a float32array containing the cosine terms that you want to use to
form the wave (equivalent to the real parameter of audiocontext.createperiodicwave). imag: a float32array containing the sine terms that you want to use to
form the wave (equivalent to the imag parameter of audiocontext.createperiodicwave). return value a new periodicwave object instance. example var real = new float32array(2); var imag = new float32array(2); var ac = new audiocontext(); r...
Permissions.query() - Web APIs
tor.permissions.query() will return true for both notifications and push. note: the persistent-storage permission allows an origin to use a persistent box (i.e persistent storage) for its storage, as per the storage api. returns a promise that resolves to a permissionstatus object. exceptions exception explanation typeerror retrieving the permissiondescriptor in
formation failed in some way, or the permission doesn't exist or is currently unsupported (e.g. midi, or push with uservisibleonly). example navigator.permissions.query({name:'geolocation'}).then(function(result) { if (result.state == 'granted') { showlocalnewswithgeolocation(); } else if (result.state == 'prompt') { showbuttontoenablelocalnews(); } // don't do anything if the permis...
Permissions.revoke() - Web APIs
ns.query() will return true for both notifications and push. note: the persistent-storage permission allows an origin to use a persistent box (i.e persistent storage) for its storage, as per the storage api. returns a promise that calls its fulfillment handler with a permissionstatus object indicating the result of the request. exceptions typeerror retrieving the permissiondescriptor in
formation failed in some way, or the permission doesn't exist or is currently unsupported (e.g. midi, or push with uservisibleonly). example this function can be used by an app to request that its own geolocation api permission be revoked. function revokepermission() { navigator.permissions.revoke({name:'geolocation'}).then(function(result) { report(result.state); }); } ...
Using the Permissions API - Web APIs
.onchange = function() { report(result.state); } }); } function report(state) { console.log('permission ' + state); } handlepermission(); permission descriptors the permissions.query() method takes a permissiondescriptor dictionary as a parameter — this contains the name of the api you are interested in. some apis have more complex permissiondescriptors containing additional in
formation, which inherit from the default permissiondescriptor. for example, the pushpermissiondescriptor should also contain a boolean that specifies if uservisibleonly is true or false. revoking permissions starting in firefox 47, you can now revoke existing permissions, using the permissions.revoke() method. this works in exactly the same way as the permissions.query() method, except that it cau...
Permissions API - Web APIs
er user experience as far as permissions are concerned. the permissions property has been made available on the navigator object, both in the standard browsing context and the worker context (workernavigator — so permission checks are available inside workers), and returns a permissions object that provides access to the permissions api functionality. once you have this object you can then per
form permission-related tasks, for example querying a permission using the permissions.query() method to return a promise that resolves with the permissionstatus for a specific api. not all apis' permission statuses can be queried using the permissions api. notable apis that are permissions-aware include: clipboard api notifications api push api web midi api more apis will gain permissions ap...
Plugin - Web APIs
note: own properties of plugin objects are no longer enumerable in the latest browser versions. properties plugin.description read only a human readable description of the plugin. plugin.filename read only the filename of the plugin file. plugin.name read only the name of the plugin. plugin.version read only the plugin's version number string. 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. specifications specification status comment html living standardthe definition of 'plugin' in that specification. ...
PluginArray - Web APIs
var pluginslength = navigator.plugins.length; document.write( pluginslength.tostring() + " plugin(s)<br>" + "name | filename | description<br>" ); for(var i = 0; i < pluginslength; i++) { document.write( navigator.plugins[i].name + " | " + navigator.plugins[i].filename + " | " + navigator.plugins[i].description + " | " + nav...
PointerEvent.isPrimary - Web APIs
xisted. when two or more pointer device types are being used concurrently, multiple pointers (one for each pointertype) are considered primary. for example, a touch contact and a mouse cursor moved simultaneously will produce pointers that are both considered primary. if there are multiple primary pointers, these pointers will all produce compatibility mouse events (see pointer_events for more in
formation about pointer, mouse and touch interaction). syntax var isprimary = pointerevent.isprimary; return value isprimary returns true if the pointer for this event is the primary pointer and returns false otherwise. example this example illustrates using the value of isprimary to call the appropriate processing function. target.addeventlistener('pointerdown', function(event) { if (e...
ProgressEvent() - Web APIs
he name of the type of the progressevent. it is case-sensitive. lengthcomputable optional is a boolean flag indicating if the total work to be done, and the amount of work already done, by the underlying process is calculable. in other words, it tells if the progress is measurable or not. it defaults to false. loaded optional is an unsigned long long representing the amount of work already per
formed by the underlying process. the ratio of work done can be calculated with the property and progressevent.total. when downloading a resource using http, this only represent the part of the content itself, not headers and other overhead. it defaults to 0. total optional is an unsigned long long representing the total amount of work that the underlying process is in the progress of per
forming. wh...
ProgressEvent.initProgressEvent() - Web APIs
earg is a boolean flag indicating if the event associated action can be avoided (true) or not (false). lengthcomputable is a boolean flag indicating if the total work to be done, and the amount of work already done, by the underlying process is calculable. in other words, it tells if the progress is measurable or not. loaded is an unsigned long long representing the amount of work already per
formed by the underlying process. the ratio of work done can be calculated with the property and progressevent.total. when downloading a resource using http, this only represent the part of the content itself, not headers and other overhead. total is an unsigned long long representing the total amount of work that the underlying process is in the progress of per
forming. when downloading a resource u...
ProgressEvent.loaded - Web APIs
the ratio of work done can be calculated with the property and progressevent.total. when downloading a resource using http, this only represent the part of the content itself, not headers and other overhead. ...
ProgressEvent - Web APIs
es also inherits properties from its parent event. progressevent.lengthcomputable read only is a boolean flag indicating if the total work to be done, and the amount of work already done, by the underlying process is calculable. in other words, it tells if the progress is measurable or not. progressevent.loaded read only is an unsigned long long representing the amount of work already per
formed by the underlying process. the ratio of work done can be calculated with the property and progressevent.total. when downloading a resource using http, this only represent the part of the content itself, not headers and other overhead. progressevent.total read only is an unsigned long long representing the total amount of work that the underlying process is in the progress of per
forming. when...
PromiseRejectionEvent.promise - Web APIs
sets up an idle callback that will retry the task that failed to execute correctly. event.preventdefault() is called to indicate that the promise has now been handled. window.onunhandledrejection = function(event) { if (event.reason.code && event.reason.code == "module not ready") { window.requestidlecallback(function(deadline) { loadmodule(event.reason.modulename) .then(per
formstartup); }); event.preventdefault(); } } specifications specification status comment html living standardthe definition of 'promiserejectionevent.promise' in that specification. living standard initial definition. ...
Proximity Events - Web APIs
any change, and a userproximityevent event in the case of a more rough change. this event can be captured at the window object level by using the addeventlistener method (using the deviceproximity or userproximity event name) or by attaching an event handler to the window.ondeviceproximity or window.onuserproximity properties. once captured, the event object gives access to different kinds of in
formation: the deviceproximityevent event provides an exact match for the distance between the device and the object through its value property. it also provides the closest and farthest distance the device is able to detect something through its min and max properties. the userproximityevent event provides a rough approximation of the distance, expressed through a boolean. the userproximityevent.
PublicKeyCredential.getClientExtensionResults() - Web APIs
ers and their results from the processing. warning! as of march 2019, only appid (used during creation with publickeycredentialrequestoptions.extensions) is supported by chrome and edge. firefox does not seem to support any extension. ...
PublicKeyCredential.response - Web APIs
an authenticatorresponse is either: an authenticatorattestationresponse (when the publickeycredential is created via credentialscontainer.create()) an authenticatorassertionresponse (when the publickeycredential is obtained via credentialscontainer.get()). ...
PublicKeyCredentialCreationOptions.attestation - Web APIs
attestation is an optional property of the publickeycredentialcreationoptions dictionary. this is a string whose value indicates the preference regarding the attestation transport, between the authenticator, the client and the relying party. the attestation is a mean for the relying party to verify the origin of the authenticator with an attestation certificate authority. the in
formation contained in the attestation may thus disclose some in
formation about the user (e.g. which device they are using). syntax attestation = publickeycredentialcreationoptions.attestation value a string which may be "none": the relying party is not interested in this attestation. this avoids making a check with the attestation certificate authority and asking the user consent for sharing identifying info...
PublicKeyCredentialCreationOptions.extensions - Web APIs
s, this may be used server side to check if the current operation is based on the same biometric data that the previous authentication. loc boolean location. if true, the client outputs a coordinates object representing the geolocation of the authenticator. uvm boolean user verification method. if true, the client outputs an array of arrays with 3 values containing in
formation about how the user was verified (e.g. fingerprint, pin, pattern), how the key is protected, how the matcher (tool used for the authentication operation) is protected. biometricperfbounds object with two numerical properties: far and frr biometric authenticator per
formance bounds. the client must not use any authenticator with false acceptance rate (far) and false rejection rat...
PublicKeyCredentialRequestOptions.extensions - Web APIs
s, this may be used server side to check if the current operation is based on the same biometric data that the previous authentication. loc boolean location. if true, the client outputs a coordinates object representing the geolocation of the authenticator. uvm boolean user verification method. if true, the client outputs an array of arrays with 3 values containing in
formation about how the user was verified (e.g. fingerprint, pin, pattern), how the key is protected, how the matcher (tool used for the authentication operation) is protected. note: extensions are optional and different browsers may recognize different extensions. all extensions are optional for the client to process them: if a browser does not know a given extension, that will not cause any ...
PushEvent - Web APIs
constructor pushevent.pushevent() creates a new pushevent object. properties inherits properties from its parent, extendableevent. additional properties: pushevent.data read only returns a reference to a pushmessagedata object containing data sent to the pushsubscription. methods inherits methods from its parent, extendableevent. ...
PushManager - Web APIs
le.log(pushsubscription.endpoint); // the push subscription details needed by the application // server are now available, and can be sent to it using, // for example, an xmlhttprequest. }, function(error) { // during development it often helps to log errors to the // console. in a production environment it might make sense to // also report in
formation about errors back to the // application server. console.log(error); } ); }); specifications specification status comment push apithe definition of 'pushmanager' in that specification. working draft initial definition. ...
PushMessageData - Web APIs
unlike the similar methods in the fetch api, which only allow the method to be invoked once, these methods can be called multiple times. messages received through the push api are sent encrypted by push services and then automatically decrypted by browsers before they are made accessible through the methods of the pushmessagedata interface. properties none. methods pushmessagedata.arraybuffer() extracts the data as an arraybuffer object. pushmessagedata.blob() extracts the data as a blob object. ...
PushSubscription.endpoint - Web APIs
for this reason, it is a good idea to keep your endpoint a secret, so others do not hijack it and abuse the push functionality. syntax var myend = pushsubscription.endpoint; value a usvstring. ...
PushSubscription.getKey() - Web APIs
a server and used in encrypting push message data. syntax var key = subscription.getkey(name); parameters name a domstring representing the encryption method used to generate a client key. the value can be: p256dh: an elliptic curve diffie–hellman public key on the p-256 curve (that is, the nist secp256r1 elliptic curve). the resulting key is an uncompressed point in ansi x9.62
format. auth: an authentication secret, as described in message encryption for web push. returns an arraybuffer. example reg.pushmanager.getsubscription() .then(function(subscription) { // enable any ui which subscribes / unsubscribes from // push messages. subbtn.disabled = false; if (!subscription) { console.log('not yet subscribed to push') // we aren't subscribed to ...
Web Push API Notifications best practices - Web APIs
to accepting push notifications. browser mitigations because of abuses of push notifications in the past, web browser developers have begun to implement strategies to help mitigate this problem. for example, safari 12.1 now requires—and other browsers either already do, or are planning[1] to do so—that the user interact with the page in some way before the page can request permission to per
form push notifications. this at least prevents the user from getting spontaneously asked this question on web pages thaty've only glanced at once may rarely if ever look at again. [1] in the case of firefox, see bug 1524619, in which we find that firefox 68 implements this, disabled by default, behind the preference dom.webnotifications.requireuserinteraction. ...
RTCConfiguration.bundlePolicy - Web APIs
ocess. any other transports that were used during negotiation are then closed. in technical terms, an sdp bundle lets all of the media tracks (identified in the sdp from the m= lines) stream between two peers across a single 5-tuple, that is, from a single ip and port on one peer to a single ip and port on another peer, all using the same rtcdtlstransport. the goal of bundling is to optimize per
formance by reducing the overhead of having multiple transports in play. the fewer rtp transports or bundles of rtp streams you have, the better the network per
formance will be. all current major browsers are bundle compatible. examples the following example creates a new rtcpeerconnection with a configuration setting the connection's bundlepolicy to max-compat to maximize compatibility while att...
RTCConfiguration.iceServers - Web APIs
will negotiate without the use of any servers, which will limit the connection to local peers. description how the list of servers you provide is used is up to the implementation of the user agent. while it can be useful to provide a second server as a fallback in case the first is offline, listing too many servers can delay the user's connection being established, depending on the network's per
formance and how many servers get used for negotiation before a connection is established. if the list of servers is changed while a connection is already active by calling the the rtcpeerconnection method setconfiguration(), no immediate effect occurs. however, the new list of servers is used for any future renegotiation, such as while handling an ice restart. examples the configuration below open...
RTCConfiguration.iceTransportPolicy - Web APIs
ansportpolicy = policy; let policy = rtcconfiguration.icetransportpolicy; value a domstring which indicates what ice candidate policy the ice agent should use during the negotiation process, per the jsep standard. the permitted values are: all the ice agent is permitted to use any kind of candidate, including both local and relay candidates. the agent—or the browser itself—may still per
form some
form of ip filtering on the incoming candidates for reasons including privacy and security, as well as to simply limit the number of candidates. this is the default. relay the ice agent only considers media relay candidates when evaluating candidates. this includes, for example, those candidates relayed by a stun or turn server. this can be used to prevent the remote endpoint from rece...
RTCDTMFSender.insertDTMF() - Web APIs
as long as the connection is active, you can send tones at any time. calling insertdtmf() will append the specified tones to the end of the current tone buffer, so that those tones play after the previously-enqueued tones. ...
RTCDTMFSender.toneBuffer - Web APIs
the dtmf tones currently queued for sending to the remote peer over the rtcpeerconnection. to place tones into the buffer, call insertdtmf(). tones are removed from the string as they're played, so only upcoming tones are listed. syntax var tonebuffer = rtcdtmfsender.tonebuffer; value a domstring listing the tones to be played. if the string is empty, there are no tones pending. tone buffer
format the tone buffer is a string which can contain any combination of the characters that are permitted by the dtmf standard. dtmf tone characters the digits 0-9 these characters represent the digit keys on a telephone keypad. the letters a-d these characters represent the "a" through "d" keys which are part of the dtmf standard but not included on most telephones. these are not interpreted ...
RTCDTMFSender - Web APIs
xt-anchor="middle" alignment-baseline="middle">rtcdtmfsender</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties rtcdtmfsender.tonebuffer read only a domstring which contains the list of dtmf tones currently in the queue to be transmitted (tones which have already been played are no longer included in the string). see tonebuffer for details on the
format of the tone buffer. methods rtcdtmfsender.insertdtmf() given a string describing a set of dtmf codes and, optionally, the duration of and inter-tone gap between the tones, insertdtmf() starts sending the specified tones. calling insertdtmf() replaces any already-pending tones from the tonebuffer. you can abort sending queued tones by specifying an empty string ("") as the set of tones to ...
RTCDataChannel.negotiated - Web APIs
syntax var negotiated = adatachannel.negotiated; value true if the rtcdatachannel's connection was negotiated by the web app itself; false if the negotiation was handled by the webrtc layer. the default is false. ...
RTCDataChannel.onerror - Web APIs
a function which the browser will call to handle the error event when it occurs on the data channel. this function receives as its only input an errorevent object describing the event which was received. that event object, in turn, describes the error that took place. example in the example below, a data channel is established, and an onerror handler is added to it. the error handler passes in
formation about the error to a ui library's alert box function to present an error message to the user. let pc = new rtcpeerconnection(); let dc = pc.createdatachannel("playercontrol"); dc.onerror = function(event) { myuilibrary.doalertbox({ 'network error', // alert title 'the error "' + event.message + '" occurred while handling player control network messages.', ev...
RTCDataChannel.protocol - Web APIs
when the data channel was created, then this property's value is "" (the empty string). the permitted values of this property are defined by the web site or app using the data channel. the ability for each channel to have a defined subprotocol lets your app, for example, use json objects as messages on one channel while another channel is plaintext and another is raw binary or even some other
format. syntax var subprotocol = adatachannel.protocol; value a string identifying the app-defined subprotocol being used for exchanging data on the channel. if none has been established, this is an empty string (""). example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel", { protocol: "json" }); function handlechannelmessage(datachannel, msg) { switch...
RTCDataChannel.send() - Web APIs
receive. since there are multiple techniques for breaking up large data into smaller pieces for transfer, it's possible to encounter scenarios in which the other peer does not support the same ones. for example, if one peer is a modern browser that supports using the eor (end of record) flag to indicate when a received message is the last piece of a multi-part object sent using send(). for more in
formation about message size restrictions, see understanding message size limits in using webrtc data channels. example in this example, a routine called sendmessage() is created; it accepts an object as input and sends to the remote peer, over the rtcdatachannel, a json string with the specified object and a time stamp. var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("backchannel"...
RTCDataChannel - Web APIs
rror sent to the onerror event handler when an error occurs on the data channel. message sent to the onmessage event handler when a message has been received from the remote peer. the message contents can be found in the event's data property. open sent to the onopen event handler when the data channel is first opened, or when an existing data channel's underlying connection re-opens. data
format the underlying data
format is defined by the ieee draft specification draft-ietf-mmusic-sctp-sdp. the current
format specifies its protocol as either "udp/dtls/sctp" (udp carrying dtls carrying sctp) or "tcp/dtls/sctp" (tcp carrying dtls carrying sctp). older browsers may only specify "dtls/sctp". example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); dc.onme...
RTCDtlsTransport.state - Web APIs
syntax let mystate = dtlstransport.state; value a string whose value is taken from the rtcdtlstransportstate enumerated type. its value is one of the following: new the initial state when dtls has not started negotiating yet. connecting dtls is in the process of negotiating a secure connection and verifying the remote fingerprint. connected dtls has completed negotiation of a secure connection and verified the remote fingerprint. ...
RTCIceCandidate.candidate - Web APIs
acted from this string. this property can be configured by specifying the value of the candidate property when constructing the new candidate object using rtcicecandidate(). syntax var candidate = rtcicecandidate.candidate; value a domstring describing the properties of the candidate, taken directly from the sdp attribute "candidate". the candidate string specifies the network connectivity in
formation for the candidate. if the candidate is an empty string (""), the end of the candidate list has been reached; this candidate is known as the "end-of-candidates" marker. the syntax of the candidate string is described in rfc 5245, section 15.1. for an a-line (attribute line) that looks like this: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the corresponding candidate...
RTCIceCandidate.relatedAddress - Web APIs
f a relay or reflexive candidate. if the candidate is a host candidate (that is, its ip is in fact the real ip address of the remote peer), relatedaddress is null. the relatedaddress field's value is set when the rtcicecandidate() constructor is used. you can't specify the value of relatedaddress in the options object, but the address is automatically extracted from the candidate a-line, if it's
formatted properly, being taken from its rel-address field. the related address and port (relatedport) are not used at all by ice itself; they are provided for analysis and diagnostic purposes only, and their inclusion may be blocked by security systems, so do not rely on them having non-null values. syntax var reladdress = rtcicecandidate.relatedaddress; value a domstring which contains the cand...
RTCIceCandidate.relatedPort - Web APIs
t number of reflexive or relay candidates. if the candidate is a host candidate (that is, its ip is in fact the real ip address of the remote peer), relatedport is null. the relatedport field's value is set when the rtcicecandidate() constructor is used. you can't specify the value of relatedport in the options object, but the address is automatically extracted from the candidate a-line, if it's
formatted properly, being taken from its rel-port field. the related address (relatedaddress) and port are not used at all by ice itself; they are provided for analysis and diagnostic purposes only, and their inclusion may be blocked by security systems, so do not rely on them having non-null values. syntax var relport = rtcicecandidate.relatedport; value an unsigned 16-bit value containing the c...
RTCIceCandidate.tcpType - Web APIs
the rtcicecandidate interface's read-only tcptype property is included on tcp candidates to provide additional details about the candidate type. the tcptype field's value is set when the rtcicecandidate() constructor is used. you can't directly set its value; instead, its value is automatically extracted from the candidate a-line, if it's
formatted properly. syntax var tcptype = rtcicecandidate.tcptype; value a domstring whose value is one of those defined by the rtcicetcpcandidatetype enumerated type. "active" the transport will try to open an outbound connection but won't receive inoming connection requests. "passive" the transport will receive incoming connection requests but won't try to open an outbound connection. "so" the transport will try to open a connection simultaneou...
RTCIceCandidate. toJSON() - Web APIs
you can then get a stringified version of the object by calling stringify() on the returned object. see the example below. example this simple example obtains a json string representing an rtcicecandidate found in the variable candidate. ...
RTCIceCandidateInit.candidate - Web APIs
the optional property candidate in the rtcicecandidateinit dictionary specifies the value of the rtcicecandidate object's candidate property. value a domstring describing the properties of the candidate, taken directly from the sdp attribute "candidate". the candidate string specifies the network connectivity in
formation for the candidate. if the candidate is an empty string (""), the end of the candidate list has been reached; this candidate is known as the "end-of-candidates" marker. the syntax of the candidate string is described in rfc 5245, section 15.1. for an a-line (attribute line) that looks like this: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the corresponding candidate string's value will be "candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 ty...
RTCIceCandidateInit - Web APIs
rtcicecandidateinit is used when using new rtcicecandidate() to create a new ice candidate object. it's also used as the return value from the rtcicecandidate.tojson() method, and can be passed directly into rtcpeerconnection.addicecandidate() to add a candidate to the peer connection. properties candidate optional the ice candidate-attribute. if the candidate is an indicator that there are no further candidates (rather than representing a new candidate), this is the empty string (""). the default is the empty string. ...
RTCIceCandidatePairStats.currentRoundTripTime - Web APIs
rstats.currentroundtriptime; value a floating-point value indicating the round-trip time, in seconds for the connection described by the pair of candidates for which this rtcicecandidatepairstats object offers statistics. this value is computed by observing the time that elapsed between the most recent stun request being sent to the remote peer and the response to that request arriving. this in
formation may come from ongoing stun connectivity checks as well as from consent requests made when the connection was initially being opened. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.currentroundtriptime' in that specification. candidate recommendation initial specification. ...
RTCInboundRtpStreamStats.averageRtcpInterval - Web APIs
ue indicating the average rtcp transmission interval, in seconds. the rtcp interval is the amount of time that should elapse between transmissions of rtcp packets. syntax var averagertcpinterval = rtcinboundrtpstreamstats.averagertcpinterval; value a floating-point value indicating the average interval, in seconds, between transmissions of rtcp packets. this interval is computed following the
formula outlined in rfc 1889: a.7. because the interval's value is determined in part by the number of active senders, it will be different for each user of a service. since this value is also used to determine the number of seconds after a stream starts to flow before the first rtcp packet should be sent, the result is that if many users try to start using the service at the same time, the server wo...
RTCInboundRtpStreamStats.pliCount - Web APIs
video data has been lost for one or more frames. syntax var plicount = rtcinboundrtpstreamstats.plicount; value an integer value indicating the number of times a pli packet was sent by the rtcrtpreceiver to the sender. these are sent by the receiver's decoder to notify the encoder (the sender) that an undefined amount of coded video data, which may span frame boundaries, has been lost. this in
formation is only available for video streams. this may trigger the sender to send a full frame in order to allow the receiver to re-synchronize, since lost data may be an irrecoverable situation for decoding media. however, the primary purpose of this message is to allow the sender to consider techniques to mitigate network per
formance issues. this is often achieved by methods such as increasing the...
RTCInboundRtpStreamStats.receiverId - Web APIs
the receiverid property of the rtcinboundrtpstreamstats dictionary specifies the id of the rtcaudioreceiverstats or rtcvideoreceiverstats object representing the rtcrtpreceiver receiving the stream. syntax var receiverstatsid = rtcinboundrtpstreamstats.receiverid; value a domstring which contains the id of the rtcaudioreceiverstats or rtcvideoreceiverstats object which provides in
formation about the rtcrtpreceiver which is receiving the streamed media. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.receiverid' in that specification. candidate recommendation initial definition. ...
RTCOutboundRtpStreamStats.averageRtcpInterval - Web APIs
rtcoutboundrtpstreamstats dictionary is a floating-point value indicating the average time that should pass between transmissions of rtcp packets on this stream. syntax var averagertcpinterval = rtcoutboundrtpstreamstats.averagertcpinterval; value a floating-point value indicating the average interval, in seconds, between transmissions of rtcp packets. this interval is computed following the
formula outlined in rfc 1889: a.7. because the interval's value is determined in part by the number of active senders, it will be different for each user of a service. since this value is also used to determine the number of seconds after a stream starts to flow before the first rtcp packet should be sent, the result is that if many users try to start using the service at the same time, the server wo...
RTCOutboundRtpStreamStats.nackCount - Web APIs
the nackcount property of the rtcoutboundrtpstreamstats dictionary is a numeric value indicating the number of times the rtcrtpsender described by this object received a nack packet from the remote receiver. a nack (negative acknowledgement, also called "generic nack") packet is used by the rtcrtpreceiver to in
form the sender that one or more rtp packets it sent were lost in transport. syntax var nackcount = rtcoutboundrtpstreamstats.nackcount; value an integer value indicating how many times the sender received a nack packet from the receiver, indicating the loss of one or more packets. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.nackcount' in that specification. candidate rec...
RTCOutboundRtpStreamStats.pliCount - Web APIs
e: this property is only used for video streams. usage notes upon receiving a pli packet, the sender may have responded by sending a full frame to the remote peer to allow it to re-synchronize with the media. however, the primary purpose of a pli packet is to allow the rtcrtpsender for which this rtcoutboundrtpstreamstats object provides statistics to consider techniques to mitigate network per
formance issues. this is often achieved by methods such as increasing the compression or lowering resolution, although the mechanisms available to reduce the bit rate of the stream vary from codec to codec. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.plicount' in that specification. candida...
RTCOutboundRtpStreamStats.qualityLimitationReason - Web APIs
this quality reduction may include changes such as reduced frame rate or resolution, or an increase in compression factor. the amount of time the encoded media has had its quality reduced in each of the potential ways that can be done can be found in qualitylimitationdurations. ...
RTCPeerConnection() - Web APIs
e which are used by the connection for authentication. if this property isn't specified, a set of certificates is generated automatically for each rtcpeerconnection instance. although only one certificate is used by a given connection, providing certificates for multiple algorithms may improve the odds of successfully connecting in some circumstances. see using certificates below for additional in
formation. this configuration option cannot be changed after it is first specified; once the certificates have been set, this property is ignored in future calls to rtcpeerconnection.setconfiguration(). icecandidatepoolsize optional an unsigned 16-bit integer value which specifies the size of the prefetched ice candidate pool. the default value is 0 (meaning no candidate prefetching will occur). ...
RTCPeerConnection.addTransceiver() - Web APIs
a bidirectional stream, with both an rtcrtpsender and an rtcrtpreceiver associated with it. syntax rtptransceiver = rtcpeerconnection.addtransceiver(trackorkind, init); parameters trackorkind a mediastreamtrack to associate with the transceiver, or a domstring which is used as the kind of the receiver's track, and by extension of the rtcrtpreceiver itself. init optional an object that con
forms to the rtcrtptransceiverinit dictionary which provides any options that you may wish to specify when creating the new transceiver. possible values are: direction optional the new transceiver's preferred directionality. this value is used to initialize the new rtcrtptransceiver object's rtcrtptransceiver.direction property. sendencodings optional a list of encodings to allow when sending rtp...
RTCPeerConnection: addstream event - Web APIs
important: this event has been removed from the webrtc specification. you should instead watch for the track event, which is sent for each media track added to the rtcpeerconnection. bubbles no cancelable no interface mediastreamevent event handler property rtcpeerconnection.onaddstream you can, similarly, watch for streams to be removed from the connection by monitoring the removestream event. examples this example looks to determine if the user's browser supports the track event. ...
RTCPeerConnection: datachannel event - Web APIs
the remote peer calling rtcpeerconnection.createdatachannel(). note: this event is not dispatched when the local end of the connection creates the channel. bubbles no cancelable no interface rtcdatachannelevent event handler property ondatachannel examples this example sets up a function that handles datachannel events by gathering the in
formation needed to communicate with the newly added rtcdatachannel and by adding event handlers for the events that occur on that channel. pc.addeventlistener("datachannel", ev => { receivechannel = ev.channel; receivechannel.onmessage = myhandlemessage; receivechannel.onopen = myhandleopen; receivechannel.onclose = myhandleclose; }, false); receivechannel is set to the value of the event'...
RTCPeerConnection.getConfiguration() - Web APIs
ns an rtcconfiguration object which indicates the current configuration of the rtcpeerconnection on which the method is called. the returned configuration is the last configuration applied via setconfiguration(), or if setconfiguration() hasn't been called, the configuration the rtcpeerconnection was constructed with. the configuration includes a list of the ice servers used by the connection, in
formation about transport policies, and identity in
formation. syntax var configuration = rtcpeerconnection.getconfiguration(); parameters this method takes no input parameters. return value an rtcconfiguration object describing the rtcpeerconnection's current configuration. example this example adds a new certificate to an active connection if it doesn't already have one in use. let configura...
RTCPeerConnection: iceconnectionstatechange event - Web APIs
iceconnectionstatechange event is sent to an rtcpeerconnection object each time the ice connection state changes during the negotiation process. the new ice connection state is available in the object's iceconnectionstate} property. bubbles no cancelable no interface event event handler property oniceconnectionstatechange one common task per
formed by the iceconnectionstatechange event listener: to trigger ice restart when the state changes to failed. see ice restart in lifetime of a webrtc session for further in
formation. usage notes a successful connection attempt will typically involve the state starting at new, then transitioning through checking, then connected, and finally completed. however, under certain circumstances, the conne...
RTCPeerConnection: icecandidate event - Web APIs
peerconnection object's icegatheringstate has made the transition to complete, an icecandidate event is sent with the value of complete set to null. this signal exists for backward compatibility purposes and does not need to be delivered onward to the remote peer (which is why the code snippet above checks to see if event.candidate is null prior to sending the candidate along. ...
RTCPeerConnection: icecandidateerror event - Web APIs
bubbles no cancelable no interface rtcpeerconnectioniceerrorevent event handler property rtcpeerconnection.onicecandidateerror description the error object's errorcode property is one of the numeric stun error codes. there is one additional, webrtc-specific, error which lies outside the valid stun error code range: 701. ...
RTCRemoteOutboundRtpStreamStats.reportsSent - Web APIs
far sent by the remote peer to the local peer. usage notes sender reports, described in rfc 3550, section 6.4.1 with an overview in rfc 3550, section 6.4, are used by rtp to share data transmission quality feedback between the two peers. the data in these reports is used by webrtc to fill out various fields within the statistics objects, and this property's value indicates how many times that in
formation was shared. examples <<<--- add an example --->>> ...
RTCRtpContributingSource.audioLevel - Web APIs
de relative to the point at which clipping of the audio begins to occur. a value of 1.0 represents 0 dbov (maximum volume), a value of 0.0 represents silence, and a value of 0.5 represents approximately 6 db spl (decibels of sound pressure level) change in the sound pressure level from 0 dbov. for both rtcrtpcontributingsource and rtcrtpsynchronizationsource, the audio level is converted to this
form from the values defined in the specifications corresponding to each type of source. audiolevel may be absent from rtcrtpcontributingsource objects, which indicates that no volume level was provided by the source; however, it is required and always available on all rtcrtpsynchronizationsource objects. specifications specification status comment webrtc 1.0: real-time co...
RTCRtpContributingSource.source - Web APIs
the read-only source property of the rtcrtpcontributingsource interface returns the source identifier of a particular stream of rtp packets. the value is the contributing source (csrc) or synchronization source (ssrc) identifier, depending on whether the object is an rtcrtpcontributingsource or rtcrtpsynchronizationsource, which is based on the
former. syntax var sourceid = rtcrtpcontributingsource.source value an unsigned, 32-bit integer value which uniquely identifies the source of rtp packets described by this rtcrtpcontributingsource (in which case the value is a csrc identifier) or rtcrtpsynchronizationsource (the value is an ssrc identifier). specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 's...
RTCRtpContributingSource - Web APIs
properties audiolevel optional a double-precision floating-point value between 0 and 1 specifying the audio level contained in the last rtp packet played from this source. rtptimestamp optional the rtp timestamp of the media played out at the time indicated by timestamp. ...
RTCRtpParameters - Web APIs
to obtain the parameters of a sender or receiver, call its getparameters() method: getparameters() getparameters() properties codecs an array of rtcrtpcodecparameters objects describing the set of codecs from which the sender or receiver will choose. this parameter cannot be changed once initially set. ...
RTCRtpReceiver.getCapabilities() static function - Web APIs
apability to receive. all browsers support the primary media kinds: audio and video. return value an rtcrtpcapabilities object stating what capabilities the browser has for receiving the specified media kind over an rtcpeerconnection. if the browser doesn't have any support for the given media kind, the returned value is null. description as a static function, this is always called using the
form: capabilities = rtcrtpreceiver.getcapabilities("audio"); the returned set of capabilities is the most optimistic possible list. it is entirely possible that certain combinations of options may fail to work when you actually try to use them. calling rtcrtpreceiver.getcapabilities() doesn't prime the browser in any way to handle media. nothing is loaded, fetched, or otherwise prepared. it's simp...
RTCRtpReceiver - Web APIs
sports have been combined into a single transport. use the transport property instead. methods rtcrtpreceiver.getcontributingsources() returns an array of rtcrtpcontributingsource instances for each unique csrc (contributing source) identifier received by the current rtcrtpreceiver in the last ten seconds. rtcrtpreceiver.getparameters() returns an rtcrtpparameters object which contains in
formation about how the rtc data is to be decoded. rtcrtpreceiver.getstats() returns a promise whose fulfillment handler receives a rtcstatsreport which contains statistics about the incoming streams and their dependencies. rtcrtpreceiver.getsynchronizationsources() returns an array including one rtcrtpsynchronizationsource instance for each unique ssrc (synchronization source) identifier receive...
RTCRtpSendParameters.encodings - Web APIs
the rtcrtpsendparameters dictionary's encodings property is an rtcrtpencodingparameters object providing configuration settings for the encoder being used for the rtcrtpsender's track. syntax sendparameters.encodings = encodingparameterlist; encodingparameterlist = sendparameters.encodings; value an array of objects con
forming to the rtcrtpencodingparameters dictionary, each of which contains properties which provide settings and parameters that describe and configure a single codec that could be used to encode the track. each object's properties are: active if true, the described encoding is currently actively being used. that is, for rtp senders, the encoding is currently being used to send data, while for receivers, the encoding is being used to decode received data. the default ...
RTCRtpSender.getCapabilities() static function - Web APIs
capability to receive. all browsers support the primary media kinds: audio and video. return value an rtcrtpcapabilities object stating what capabilities the browser has for sending the specified media kind over an rtcpeerconnection. if the browser doesn't have any support for the given media kind, the returned value is null. description as a static function, this is always called using the
form: capabilities = rtcrtpsender.getcapabilities("audio"); the returned set of capabilities is the most optimistic possible list. it is entirely possible that certain combinations of options may fail to work when you actually try to use them. calling rtcrtpsender.getcapabilities() doesn't prime the browser in any way to handle media. nothing is loaded, fetched, or otherwise prepared. it's simply a...
RTCRtpSender.setParameters() - Web APIs
ies changes the configuration of sender's track, which is the mediastreamtrack for which the rtcrtpsender is responsible. in other words, setparameters() updates the configuration of the rtp transmission as well as the encoding configuration for a specific media track on the webrtc connection. syntax var promise = rtcrtpsender.setparameters(parameters) parameters parameters an object con
forming with the rtcrtpsendparameters dictionary, specifying options for the rtcrtpsender; these include potential codecs that could be use for encoding the sender's track. the available options are: degradationpreference specifies the preferred way the webrtc layer should handle optimizing bandwidth against quality in constrained-bandwidth situations; the value comes from the rtcdegradationpre...
RTCRtpStreamStats.pliCount - Web APIs
encoder (the sender) that an undefined amount of coded video data, which may span frame boundaries, has been lost. this may trigger the sender to send a full frame in order to allow the receiver to re-synchronize, since lost data may be an irrecoverable situation for decoding media. however, the primary purpose of this message is to allow the sender to consider techniques to mitigate network per
formance issues. this is often achieved by methods such as increasing the compression, lowering resolution, or finding other ways to reduce the bit rate of the stream. note: this value is only available on the receiver, and only for video media. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats: p...
RTCRtpStreamStats.ssrc - Web APIs
red by the rtcstatsreport object of which this rtcrtpstreamstats object is a component. the manner in which these values are generated is not mandated by the specification, although it does make recommendations. you should not make any assumptions based on the value of ssrc other than that any two objects with the same ssrc value refer to the same source. see rfc 3550, section 8 for additional in
formation about ssrc. note: the specification includes an example that generates values for ssrc using md5. while not part of the standard, exactly, it is a good mechanism that may be used by some browsers; others may use other methods, such as random number generators. do not rely upon these values meaning anything other than "these objects are associated with the same source." specifications ...
RTCRtpStreamStats - Web APIs
ields mediatype renamed to kind in the specification in february 2018. see browser compatibility in rtcrtpstreamstats.kind to determine when browsers made the transition. local-only measurements these properties are computed locally, and are only available to the device receiving the media stream. their primary purpose is to examine the error resiliency of the connection, as they provide in
formation about lost packets, lost frames, and how heavily compressed the data is. fircount a count of the total number of full intra request (fir) packets received by the sender. this statistic is only available to the device which is receiving the stream and is only available for video tracks. a fir packet is sent by the receiving end of the stream when it falls behind or has lost packets and is...
RTCRtpSynchronizationSource - Web APIs
the rtcrtpsynchronizationsource dictionary of the the webrtc api is used by getsynchronizationsources() to describe a particular synchronization source (ssrc). a synchronization source is a single source that shares timing and sequence number space. since rtcrtpsynchronizationsource implements rtcrtpcontributingsource, its properties are also available. the in
formation provided is based on the last ten seconds of media received. while the published specification describes this as an interface, it has since been changed to a dictionary in follow-up drafts. properties also implements the properties of rtcrtpcontributingsource. voiceactivityflag optional a boolean value indicating whether or not voice activity is included in the last rtp packet played from the source. if the peer has i...
RTCSctpTransport.state - Web APIs
syntax var mystate = sctptransport.state; value a string whose value is taken from the rtcsctptransportstate enumerated type. its value is one of the following: connecting the initial state when the connection is being estabilished. connected the connection is open for data transmission. closed the connection is closed and can no longer be used. ...
RTCSctpTransport - Web APIs
you don't create rtcsctptransport objects yourself; instead, you get access to the rtcsctptransport for a given rtcpeerconnection through its sctp property. possibly the most useful property on this interface is its maxmessagesize property, which you can use to determine the upper limit on the size of messages you can send over a data channel on the peer connection. ...
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). syntax rtcsessiondescriptioncallback(description); parameters description an rtcsessiondescriptioninit (or rtcsessiondescription) object describing the session being offered or being accepted. this object contains the type and sdp properties which are part of rtcsessiondescription. return value the callback doesn't need to return anything, so the return value is undefined. example var pc = new rt...
RTCStats.id - Web APIs
hich this rtcstats object provides statistics. using the id, you can correlate two or more rtcstats-based objects in order to monitor statistics over time for a given webrtc object, such as an rtp stream, an rtcpeerconnection, or an rtcdatachannel. syntax var id = rtcstats.id; value a domstring which uniquely identifies the object for which this rtcstats-based object provides statistics. the
format of the id string is not defined by the specification, so you cannot reliably make any assumptions about the contents of the string, or assume that the
format of the string will remain unchanged for a given object type. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcstats.id' in that specification. ...
RTCStats.timestamp - Web APIs
mp; value a domhighrestimestamp value indicating the time at which the activity described by the statistics in this object was recorded, in milliseconds elapsed since the beginning of january 1, 1970, utc. this should be accurate to within a few milliseconds but may not be entirely pricise, either because of hardware or operating system limitations or because of fingerprinting protection in the
form of reduced clock precision or accuracy. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcstats.timestamp' in that specification. candidate recommendation initial definition. ...
RTCTrackEvent() - Web APIs
figured to describe the track which has been added to the rtcpeerconnection. in general, you won't need to use this constructor, as rtctrackevent objects are created by webrtc and delivered to your rtcpeerconnector's ontrack event handler as appropriate. syntax trackevent = new rtctrackevent(eventinfo); parameters eventinfo an object based on the rtctrackeventinit dictionary, providing in
formation about the track which has been added to the rtcpeerconnection. this object has the following properties: receiver the rtcrtpreceiver which is being used to receive the track's media. streams optional an array of mediastream objects representing each of the streams that comprise the event's corresponding track. track the mediastreamtrack the event is associated with. transceiver the r...
RTCTrackEventInit - Web APIs
properties rtctrackeventinit inherits properties from the eventinit dictionary, and also includes the following properties: receiver the rtcrtpreceiver which is being used to receive the track's media. streams optional an array of mediastream objects representing each of the streams that comprise the event's corresponding track. track the mediastreamtrack the event is associated with. transceiver the rtcrtptransceiver associated with the event. ...
RadioNodeList - Web APIs
the radionodelist interface represents a collection of radio elements in a <
form> or a <fieldset> element. <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/nodelist" target="_top"><rect x="1" y="1" width="80" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="41" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">nodelist</text></a><polyline points="81,25 91,20 91,30 81,25" stroke="#d4dde4" fill="non...
Range - Web APIs
o a documentfragment. range.insertnode() insert a node at the start of a range. range.surroundcontents() moves content of a range into a new node. range.compareboundarypoints() compares the boundary points of the range with another range. range.clonerange() returns a range object with boundary points identical to the cloned range. range.detach() releases the range from use to improve per
formance. range.tostring() returns the text of the range. range.comparenode() returns a constant representing whether the node is before, after, inside, or surrounding the range. range.comparepoint() returns -1, 0, or 1 indicating whether the point occurs before, inside, or after the range. range.createcontextualfragment() returns a documentfragment created from a given string of code. ...
ReadableStream.pipeTo() - Web APIs
a promise that resolves when the piping process has completed. exceptions typeerror the writablestream and/or readablestream objects are not a writable stream/readable stream, or one or both of the streams are locked. examples // fetch the original image fetch('png-logo.png') // retrieve its body as readablestream .then(response => response.body) .then(body => body.pipethrough(new pngtrans
formstream())) .then(rs => rs.pipeto(new finaldestinationstream())) specifications specification status comment streamsthe definition of 'pipeto()' in that specification. living standard initial definition. ...
ReadableStream - Web APIs
iterator instance and locks the stream to it. while the stream is locked, no other reader can be acquired until this one is released. readablestream.getreader() creates a reader and locks the stream to it. while the stream is locked, no other reader can be acquired until this one is released. readablestream.pipethrough() provides a chainable way of piping the current stream through a trans
form stream or any other writable/readable pair. readablestream.pipeto() pipes the current readablestream to a given writablestream and returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered. readablestream.tee() the tee method tees this readable stream, returning a two-element array containing the two resulting branches as new rea...
ReadableStreamBYOBReader.read() - Web APIs
ding access to the next chunk in the byte stream's internal queue. syntax var promise = readablestreambyobreader.read(view); parameters view the view to be read into. return value a promise, which fulfills/rejects with a result depending on the state of the stream. the different possibilities are as follows: if a chunk is available, the promise will be fulfilled with an object of the
form { value: thechunk, done: false }. if the stream becomes closed, the promise will be fulfilled with an object of the
form { value: undefined, done: true }. if the stream becomes errored, the promise will be rejected with the relevant error. exceptions typeerror the source object is not a readablestreambyobreader, the stream has no owner, the view is not an object or has become detached, or...
ReadableStreamDefaultReader.read() - Web APIs
r interface returns a promise providing access to the next chunk in the stream's internal queue. syntax var promise = readablestreamdefaultreader.read(); parameters none. return value a promise, which fulfills/rejects with a result depending on the state of the stream. the different possibilities are as follows: if a chunk is available, the promise will be fulfilled with an object of the
form { value: thechunk, done: false }. if the stream becomes closed, the promise will be fulfilled with an object of the
form { value: undefined, done: true }. if the stream becomes errored, the promise will be rejected with the relevant error. exceptions typeerror the source object is not a readablestreamdefaultreader, or the stream has no owner. examples example 1 - simple example this e...
Report.body - Web APIs
the body read-only property of the report interface returns the body of the report, which is a reportbody object containing the detailed report in
formation. syntax let reportbody = reportinstance.body returns a reportbody object containing the detailed report in
formation. 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 in
formation 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 ...
Report - Web APIs
he callback function passed into the reportingobserver() constructor upon creation of a new observer instance. this contains the list of reports currently contained in the observer's report queue. by sending requests to the endpoints defined via the report-to http header. properties report.body read only the body of the report, which is a reportbody object containing the detailed report in
formation. report.type read only the type of report generated, e.g. deprecation or intervention. report.url read only the url of the document that generated the report. methods this interface has no methods defined on it. events this interface has no events that fire on it. examples in our deprecation_report.html example, we create a simple reporting observer to observe usage of deprecate...
Request() - Web APIs
ons object containing any custom settings that you want to apply to the request. the possible options are: method: the request method, e.g., get, post. the default is get. headers: any headers you want to add to your request, contained within a headers object or an object literal with bytestring values. body: any body that you want to add to your request: this can be a blob, buffersource,
formdata, urlsearchparams, usvstring, or readablestream object. note that a request using the get or head method cannot have a body. mode: the mode you want to use for the request, e.g., cors, no-cors, same-origin, or navigate. the default is cors. credentials: the request credentials you want to use for the request: omit, same-origin, or include. the default is same-origin. cache: the cache mod...
Request.context - Web APIs
fetched. this has been replaced by the destination property. the context of a request is only relevant in the serviceworker api; a service worker can make decisions based on whether the url is for an image, or an embeddable object such as a <video>, iframe, etc. note: you can find a full list of the different available contexts including associated context frame types, csp directives, and plat
form feature examples in the fetch spec request context section. syntax var mycontext = request.context; value a requestcontext value. example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the request context in a variable: var myrequest = new request('flowers.jpg'); var mycontext = m...
Request.referrerPolicy - Web APIs
the referrerpolicy read-only property of the request interface returns the referrer policy, which governs what referrer in
formation, sent in the referer header, should be included with the request. syntax var myreferrerpolicy = request.referrerpolicy; value a domstring representing the request's referrerpolicy. for more in
formation and possible values, see the referrer-policy http header page. example in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the request referrer policy in a variable: var myrequest = new request('flowers.jpg'); var myreferrer = myrequest.referrerpolicy; // returns "" by default specifications specification status comment fetchthe ...
RequestDestination - Web APIs
ct. "paintworklet" the target is a paint worklet. "report" the target is a report. "script" the target is a script. "serviceworker" the target is a service worker. "sharedworker" the target is a shared worker. "style" the target is a style "track" the target is an html <track>. "video" the target is video data. "worker" the target is a worker. "xslt" the target is an xlst trans
form. specifications specification status comment fetchthe definition of 'requestdestination' in that specification. living standard initial definition ...
Response() - Web APIs
the response() constructor creates a new response object. syntax var myresponse = new response(body, init); parameters body optional an object defining a body for the response. this can be null (which is the default value), or one of: blob buffersource
formdata readablestream urlsearchparams usvstring init optional an options object containing any custom settings that you want to apply to the response, or an empty object (which is the default value). the possible options are: status: the status code for the reponse, e.g., 200. statustext: the status message associated with the status code, e.g., ok. headers: any headers you want to add to your response, contained within a headers object or object literal of bytestring key/value pairs (see http headers for a ...
Response.type - Web APIs
the type read-only property of the response interface contains the type of the response. it can be one of the following: basic: normal, same origin response, with all headers exposed except “set-cookie” and “set-cookie2″. cors: response was received from a valid cross-origin request. certain headers and the body may be accessed. error: network error. no useful in
formation describing the error is available. the response’s status is 0, headers are empty and immutable. this is the type for a response obtained from response.error(). opaque: response for “no-cors” request to cross-origin resource. severely restricted. opaqueredirect: the fetch request was made with redirect: "manual". the response's status is 0, headers are empty, body is null and trailer is empty. note: an...
Response - Web APIs
eates a new response with a different url. body interface methods response implements body, so it also has the following methods available to it: body.arraybuffer() takes a response stream and reads it to completion. it returns a promise that resolves with an arraybuffer. body.blob() takes a response stream and reads it to completion. it returns a promise that resolves with a blob. body.
formdata() takes a response stream and reads it to completion. it returns a promise that resolves with a
formdata object. body.json() takes a response stream and reads it to completion. it returns a promise that resolves with the result of parsing the body text as json. body.text() takes a response stream and reads it to completion. it returns a promise that resolves with a usvstring (text). ex...
SVGAltGlyphElement.glyphRef - Web APIs
the svgaltglyphelement.glyphref property is a domstring representing a glyph identifier. it has the same meaning as the ‘glyphref’ property on the svgglyphrefelement interface of the <glyphref> element. syntax string = myglyph.glyphref; myglyph.glyphref = string; value the return value is a glyph identifier, the value of which depends on the
format of the given font. example myglyph.glypref = "#glyphid"; specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'glyphref' in that specification. recommendation ...
SVGAltGlyphElement - Web APIs
n alternate glyphs such as asian text strings it is required that a different set of glyphs be used than the normal given character data. properties this interface also inherits properties from its parent interface, svggraphicselement. svgaltglyphelement.glyphref it corresponds to the attribute glyphref on the given element. it's data type is 'string'. it defines the glyph identifier, whose
format is dependent on the ‘
format’ of the given font. svgaltglyphelement.
format it corresponds to the attribute
format on the given element. it's data type is 'string'. this property specifies the
format of the given font. methods this interface has no methods but inherits methods from its parent, svgelement. specifications specification status comment scalable vec...
SVGAnimationElement - Web APIs
the svganimationelement interface is the base interface for all of the animation element interfaces: svganimateelement, svgsetelement, svganimatecolorelement, svganimatemotionelement and svganimatetrans
formelement. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignm...
SVGCircleElement - Web APIs
+ change, 10), 250); circle.setattribute("r", newvalue); } click on the circle. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgcircleelement' in that specification. candidate recommendation replaced the inheritance from svgelement, svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtrans
formable by svggeometryelement scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgcircleelement' in that specification. recommendation initial definition browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send u...
SVGClipPathElement - Web APIs
this interface doesn't implement any specific methods, but inherits methods from its parent, svgelement. specifications specification status comment css masking module level 1the definition of 'svgclippathelement' in that specification. candidate recommendation removed the inheritance from svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, svgtrans
formable, and svgunittypes scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgclippathelement' in that specification. recommendation initial definition ...
SVGDefsElement - Web APIs
lement any specific methods, but inherits properties from its parent, svggraphicselement. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgdefselement' in that specification. candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtrans
formable by svggraphicselement scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgdefselement' in that specification. recommendation initial definition ...
SVGElement - Web APIs
inherits properties from: documentandelementeventhandlers, element, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement, svgelementinstance svgelement.datasetread only a domstringmap object which provides a list of key/value pairs of named data attributes which correspond to custom data attributes attached to the element. these can also be defined in svg using attributes of the
form data-*, where * is the key name for the pair. this works just like html's htmlelement.dataset property and html's data-* global attribute. svgelement.classname read only an svganimatedstring that reflects the value of the class attribute on the given element, or the empty string if class is not present. this attribute is deprecated and may be removed in a future version of this specification.
SVGForeignObjectElement - Web APIs
om its parent, svggraphicselement and implements methods from svgurireference. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgforeignobjectelement' in that specification. candidate recommendation replaced the inheritance from svgelement, svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtrans
formable by svggraphicselement and svgurireference scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgforeignobjectelement' in that specification. recommendation initial definition ...
SVGGElement - Web APIs
interface, svggraphicselement. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svggelement' in that specification. candidate recommendation changed the inheritance from svgelement to svggraphicselement and removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtrans
formable. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svggelement' in that specification. recommendation initial definition ...
SVGGlyphRefElement - Web APIs
ignment-baseline="middle">svgglyphrefelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, svgelement and implements properties from svgurireference and svgstylable. svgglyphrefelement.glyphref a domstring corresponding to the glyphref attribute of the given element. svgglyphrefelement.
format a domstring corresponding to the
format attribute of the given element. svgglyphrefelement.x a float corresponding to the x attribute of the given element. svgglyphrefelement.y a float corresponding to the y attribute of the given element. svgglyphrefelement.dx a float corresponding to the dx attribute of the given element. svgglyphrefelement.dy a float corresponding to the dy attribut...
SVGGradientElement - Web APIs
3 corresponds to value repeat. properties this interface also inherits properties from its parent, svgelement, and implements those of svgurireference. svggradientelement.gradientunits read only returns an svganimatedenumeration corresponding to the gradientunits attribute on the given element. takes one of the constants defined in svgunittypes. svggradientelement.gradienttrans
form read only returns an svganimatedtrans
formlist corresponding to attribute gradienttrans
form on the given element. svggradientelement.spreadmethod read only returns an svganimatedenumeration corresponding to attribute spreadmethod on the given element. one of the spread method types defined on this interface. methods this interface does not provide any specific methods, but implements those...
SVGGraphicsElement: copy event - Web APIs
ires on svggraphicselements when the user initiates a copy action through the browser's user interface. bubbles yes cancelable yes interface clipboardevent event handler property oncopy the event's default action is to copy the selection (if any) to the clipboard. a handler for this event can modify the clipboard contents by calling setdata(
format, data) on the event's clipboardevent.clipboarddata property, and cancelling the event's default action using event.preventdefault(). however, the handler cannot read the clipboard data. it's possible to construct and dispatch a synthetic copy event, but this will not affect the system clipboard. example html <?xml version="1.0" encoding="utf-8"?> <svg viewbox="0 0 100 30" width="600" heig...
SVGGraphicsElement: cut event - Web APIs
event still fires but the event object contains no data. bubbles yes cancelable yes interface clipboardevent event handler property oncut the eventʼs default action is to copy the current selection (if any) to the system clipboard and remove it from the document. a handler for this event can modify the clipboard contents by calling setdata(
format, data) on the event's clipboardevent.clipboarddata property, and cancelling the default action using event.preventdefault(). note though that cancelling the default action will also prevent the document from being updated. so an event handler which wants to emulate the default action for "cut" while modifying the clipboard must also manually remove the selection from the document. the handle...
SVGGraphicsElement: paste event - Web APIs
example, in a <textarea> or an element with contenteditable attribute set to true) then the default action is to insert the contents of the clipboard into the document at the cursor position. a handler for this event can access the clipboard contents by calling getdata() on the event's clipboarddata property. to override the default behavior (for example to insert some different data or a trans
formation of the clipboard contents) an event handler must cancel the default action using event.preventdefault(), and then insert its desired data manually. it's possible to construct and dispatch a synthetic paste event, but this will not affect the document's contents. example html <?xml version="1.0" encoding="utf-8"?> <svg viewbox="0 0 140 30" width="600" height="320" xmlns="http://www.w3.org...
SVGImageElement - Web APIs
age data is ready to be used. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgimageelement' in that specification. candidate recommendation changed the inheritance from svgelement to svggraphicselement, removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtrans
formable and added the crossorigin property. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgimageelement' in that specification. recommendation initial definition ...
SVGLineElement - Web APIs
terface, svggeometryelement. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svglineelement' in that specification. candidate recommendation changed the inheritance from svgelement to svggeometryelement and removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtrans
formable. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svglineelement' in that specification. recommendation initial definition ...
SVGMaskElement - Web APIs
doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. specifications specification status comment css masking module level 1the definition of 'svgmaskelement' in that specification. candidate recommendation removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtrans
formable. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgmaskelement' in that specification. recommendation initial definition ...
SVGPolygonElement - Web APIs
lement any specific methods, but inherits methods from its parent, svggeometryelement. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgpolygonelement' in that specification. candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtrans
formable by svggeometryelement scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgpolygonelement' in that specification. recommendation initial definition ...
SVGPolylineElement - Web APIs
ement any specific methods, but inherits methods from its parent, svggeometryelement. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgpolylineelement' in that specification. candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtrans
formable by svggeometryelement scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgpolylineelement' in that specification. recommendation initial definition ...
SVGRectElement - Web APIs
55); myrect.style.fill = 'rgb(' + r + ', ' + g + ' , ' + b + ')'; } click the rect. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgrectelement' in that specification. candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtrans
formable by svggeometryelement scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgrectelement' in that specification. recommendation initial definition ...
SVGSwitchElement - Web APIs
rface, svggraphicselement. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgswitchelement' in that specification. candidate recommendation changed the inheritance from svgelement to svggraphicselement and removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtrans
formable. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgswitchelement' in that specification. recommendation initial definition ...
SVGTextElement - Web APIs
svgtextpositioningelement. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgtextpositioningelement. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgtextelement' in that specification. candidate recommendation removed the implemented interface svgtrans
formable. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgtextelement' in that specification. recommendation initial definition ...
ScreenOrientation - Web APIs
properties screenorientation.typeread only returns the document's current orientation type, one of "portrait-primary", "portrait-secondary", "landscape-primary", or "landscape-secondary". screenorientation.angleread only returns the document's current orientation angle. event handlers screenorientation.onchange the eventhandler called whenever the screen changes orientation. methods screenorientation.lock() locks the orientation of the containing document to its default orientation and returns a promise. ...
Screen Orientation API - Web APIs
interfaces screenorientation specifications specification status comment screen orientation api working draft initial definition. browser compatibility screenorientation the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
SecurityPolicyViolationEvent.SecurityPolicyViolationEvent() - Web APIs
the securitypolicyviolationevent constructor creates a new securitypolicyviolationevent object instance. syntax let spvevt = new securitypolicyviolationevent(type, eventinitdict); properties type a domstring representing the type of security policy violation that occurred. eventinitdict optional a dictionary object containing in
formation about the properties of the securitypolicyviolationevent to be constructed. this can include the following properties, but bear in mind that if you do include an eventinitdict, certain properties must be included (marked below with required): blockeduri: the blockeduri of the securitypolicyviolationevent. if not included, the default value is "". columnnumber: the columnnumber of the securitypolicyviolationevent. if not included, the ...
Selection.modify() - Web APIs
character", "word", "sentence", "line", "paragraph", "lineboundary", "sentenceboundary", "paragraphboundary", or "documentboundary". note: gecko does not implement "sentence", "paragraph", "sentenceboundary", "paragraphboundary", or "documentboundary". webkit and blink do. note: starting in gecko 5.0, the "word" granularity no longer includes the following space, regardless of the default plat
form behavior. this makes the behavior more consistent, as well as making it work the same way webkit used to work, but unfortunately they have recently changed their behavior. example this example demonstrates the various granularity options for modifying a selection. click somewhere inside the example (optionally selecting some text), and then click the button to expand the selection. html <p>c...
Selection.setBaseAndExtent() - Web APIs
hornode, or if focusoffset is larger than the number of child nodes inside focusnode, an indexsizeerror exception is thrown. examples in this example, we have two paragraphs containing spans, each one containing a single word. the first one is set as the anchornode and the second is set as the focusnode. we also have an additional paragraph that sits in between the two nodes. next, we have two
form inputs that allow you to set the anchoroffset and focusoffset — they both have a default value of 0. we also have a button that when pressed invokes a function that runs the setbaseandextent() method with the specified offsets, and copies the selection into the output paragraph at the very bottom of the html. <h1>setbaseandextent example</h1> <div> <p class="one"><span>fish</span><span>dog<...
Selection API - Web APIs
the selection api provides functionality for reading and manipulating the range of text selected by the user. concepts and usage to retrieve the current text range the user has selected, you can use the window.getselection() or document.getselection() method, storing the return value — a selection object — in a variable for futher use. once your selection is in a variable, you per
form a variety of operations on it, for example copying the selection to a text string using selection.tostring(), adding a range (as represented by a standard range object) to the selection (or removing one) with selection.addrange()/selection.removerange(), or changing the selection to be the entire contents of a dom node using selection.selectallchildren(). you can run code in response to the selection b...
SensorErrorEvent.SensorErrorEvent() - Web APIs
syntax sensorerrorevent = new sensorerrorevent(type, {error: domexception}); parameters type will always be 'sensorerrorevent'. options optional currently only one option is supported: error: an instance of domexception. ...
SensorErrorEvent - Web APIs
constructor sensorerrorevent.sensorerrorevent() creates a new sensorerrorevent object. properties sensorerrorevent.error read only returns the domexception object passed in the event's contructor. ...
ServiceWorkerContainer.register() - Web APIs
scope: a usvstring representing a url that defines a service worker's registration scope; that is, what range of urls a service worker can control. this is usually a relative url. it is relative to the base url of the application. by default, the scope value for a service worker registration is set to the directory where the service worker script is located. see the examples section for more in
formation on how it works. return value a promise that resolves with a serviceworkerregistration object. examples the examples described here should be taken together to get a better understanding of how service workers scope applies to a page. the following example uses the default value of scope (by omitting it). the service worker code in this case, if included in example.com/index.html, ...
ServiceWorkerContainer - Web APIs
/sw.js').then(function(registration) { console.log('service worker registration succeeded:', registration); // at this point, you can optionally do something // with registration. see /docs/web/api/serviceworkerregistration }).catch(function(error) { console.log('service worker registration failed:', error); }); // independent of the registration, let's also display // in
formation about whether the current page is controlled // by an existing service worker, and when that // controller changes. // first, do a one-off check if there's currently a // service worker in control. if (navigator.serviceworker.controller) { console.log('this page is currently controlled by:', navigator.serviceworker.controller); } // then, register a handler to detect when...
ServiceWorkerGlobalScope: push event - Web APIs
rker's global scope (represented by the serviceworkerglobalscope interface) when the service worker has received a push message. bubbles no cancelable no interface pushevent event handler property onpush example this example sets up a handler for push events that takes json data, parses it, and dispatches the message for handling based on in
formation contained within the message. self.addeventlistener("push", event => { let message = event.data.json(); switch(message.type) { case "init": doinit(); break; case "shutdown": doshutdown(); break; } }, false); specifications specification status comment push apithe definition of 'push' in that specification. working draft...
ServiceWorkerGlobalScope.skipWaiting() - Web APIs
re, it's common to call self.skipwaiting() from inside of an installevent handler. the following example causes a newly installed service worker to progress into the activating state, regardless of whether there is already an active service worker. self.addeventlistener('install', function(event) { // the promise that skipwaiting() returns can be safely ignored. self.skipwaiting(); // per
form any other actions required for your // service worker to install, potentially inside // of event.waituntil(); }); specifications specification status comment service workersthe definition of 'skipwaiting()' in that specification. working draft initial definition. ...
ServiceWorkerRegistration.pushManager - Web APIs
le.log(pushsubscription.endpoint); // the push subscription details needed by the application // server are now available, and can be sent to it using, // for example, an xmlhttprequest. }, function(error) { // during development it often helps to log errors to the // console. in a production environment it might make sense to // also report in
formation about errors back to the // application server. console.log(error); } ); }); specifications specification status comment push apithe definition of 'pushmanager' in that specification. working draft initial definition. ...
SharedWorker - Web APIs
event of type error bubbles through the worker. sharedworker.port read only returns a messageport object used to communicate with and control the shared worker. methods inherits methods from its parent, eventtarget, and implements methods from abstractworker. example in our basic shared worker example (run shared worker), we have two html pages, each of which uses some javascript to per
form a simple calculation. the different scripts are using the same worker file to per
form the calculation — they can both access it, even if their pages are running inside different windows. the following code snippet shows creation of a sharedworker object using the sharedworker() constructor. both scripts contain this: var myworker = new sharedworker('worker.js'); both scripts then access the...
SharedWorkerGlobalScope - Web APIs
ion associated with the worker. workerlocation is a specific location object, mostly a subset of the location for browsing scopes, but adapted to workers. workerglobalscope.navigator read only returns the workernavigator associated with the worker. workernavigator is a specific navigator object, mostly a subset of the navigator for browsing scopes, but adapted to workers. workerglobalscope.per
formance read only returns the per
formance object associated with the worker, which is a regular per
formance object, but with a subset of its properties and methods available. event handlers this interface inherits event handlers from the workerglobalscope interface, and its parent eventtarget, and therefore implements event handlers from windowtimers, windowbase64, and windoweventhandlers. ...
VTTRegion - Web APIs
.width = 50; // use 50% of the video width region.lines = 4; // use 4 lines of height. region.viewportanchorx = 25; // have the region start at 25% from the left. var cue = new vttcue(2, 3, 'cool text to be displayed'); cue.region = region; // this cue will be drawn only within this region. specifications specification status comment webvtt: the web video text tracks
format candidate recommendation ...
ValidityState.stepMismatch - Web APIs
the read-only stepmismatch property of a validitystate object indicates if the value of an <input>, after having been edited by the user, does not con
form to the constraints set by the element's step attribute. 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 con
form to the constraints set by the step and min values, then stepmismatch will be true. if the remainder of the
form control's value less the min value, divided by the step value (which defaults to 1 if ommitted) is not zero, there is a mismatch. given the following: <input type="number" min="20" max="40" step="2"/> if (value - min) / 2 != 0, stepmismatch will be true. if true, the element matches the ...
VideoPlaybackQuality.creationTime - Web APIs
lliseconds since the browsing context was created this quality sample was recorded. syntax value = videoplaybackquality.creationtime; value a domhighrestimestamp object which indicates the number of milliseconds that elapased between the time the browsing context was created and the time at which this sample of the video quality was obtained. for details on how the time is determined, see per
formance.now(). example this example calls getvideoplaybackquality() to obtain a videoplaybackquality object, then determines what percentage of frames have been lost by either corruption or being dropped. if that exceeds 10% (0.1), a function called lostframesthresholdexceeded() is called to, perhaps, update a quality indicator to show an increase in frame loss. var videoelem = document.getelement...
VideoPlaybackQuality.droppedVideoFrames - Web APIs
lity interface returns the number of video frames which have been dropped rather than being displayed since the last time the media was loaded into the htmlvideoelement. syntax value = videoplaybackquality.droppedvideoframes; value an unsigned 64-bit value indicating the number of frames that have been dropped since the last time the media in the <video> element was loaded or reloaded. this in
formation can be used to determine whether or not to downgrade the video stream to avoid dropping frames. frames are typically dropped either before or after decoding them, when it's determined that it will not be possible to draw them to the screen at the correct time. example this example calls getvideoplaybackquality() to obtain a videoplaybackquality object, then determines what percentage of...
Videotrack.language - Web APIs
the read-only videotrack property language returns a string identifying the language used in the video track. for tracks that include multiple languages (such as a movie in english in which a few lines are spoken in other languages), this should be the video's primary language. syntax var videotracklanguage = videotrack.language; value a domstring specifying the bcp 47 (rfc 5646)
format language tag of the primary language used in the video track, or an empty string ("") if the language is not specified or known, or if the track doesn't contain speech. for example, if the primary language used in the track is united states english, this value would be "en-us". for brazilian portuguese, the value would be "pt-br". specifications specification status comment h...
VideoTrack - Web APIs
on the media: var firsttrack = tracks[0]; the next example scans through all of the media's video tracks, activating the first video track that is in the user's preferred language (taken from a variable userlanguage). for (var i = 0; i < tracks.length; i++) { if (tracks[i].language === userlanguage) { tracks[i].selected = true; break; } }); the language is in standard (rfc 5646)
format. for us english, this would be "en-us", for example. specifications specification status comment html living standardthe definition of 'videotrack' in that specification. living standard ...
VideoTrackList - Web APIs
when tracks are added to or removed from the media element's stream. see onaddtrack and onremovetrack for details and examples. examples getting a media element's video track list to get a media element's videotracklist, use its videotracks property. var videotracks = document.queryselector("video").videotracks; monitoring track count changes in this example, we have an app that displays in
formation about the number of channels available. to keep it up to date, handlers for the addtrack and removetrack events are set up. videotracks.onaddtrack = updatetrackcount; videotracks.onremovetrack = updatetrackcount; function updatetrackcount(event) { trackcount = videotracks.length; drawtrackcountindicator(trackcount); } specifications specification status comment ...
VisualViewport - Web APIs
tion: fixed we need to offset it by the visual // viewport's offset from the layout viewport origin. var offsetleft = viewport.offsetleft; var offsettop = viewport.height - layoutviewport.getboundingclientrect().height + viewport.offsettop; // you could also do this by setting style.left and style.top if you // use width: 100% instead. ...
WEBGL_compressed_texture_astc.getSupportedProfiles() - Web APIs
the implementation. syntax sequence<domstring> ext.getsupportedprofiles(); return value an array of domstring elements indicating which astc profiles are supported by the implementation. currently, this can be: "ldr": low dynamic range. "hdr": high dynamic range. dynamic range refers to ratio between the brightest and darkest parts of the scene. low dynamic ranges are for example jpeg
format images which won't exceed 255:1, or crt monitors which won't exceed 100:1. an hdr image stores pixel values that span the whole tonal range of real-world scenes (100,000:1). examples var ext = gl.getextension('webgl_compressed_texture_astc'); ext.getsupportedprofiles(); // ["ldr"] specifications specification status comment webgl_compressed_texture_astcthe definition...
WEBGL_compressed_texture_etc1 - Web APIs
the webgl_compressed_texture_etc1 extension is part of the webgl api and exposes the etc1 compressed texture
format. compressed textures reduce the amount of memory needed to store a texture on the gpu, allowing for higher resolution textures or more of the same resolution textures. webgl extensions are available using the webglrenderingcontext.getextension() method. for more in
formation, see also using extensions in the webgl tutorial. availability: this extension is available to both, webgl1 and webgl2 contexts. constants the compressed texture
format is exposed by a constant and can be used with the compressedteximage2d() method (note that etc1 is not supported with the compressedtexsubimage2d() method). ext.compressed_rgb_etc1_webgl compresses 24-bit rgb data with no alpha chan...
WEBGL_debug_shaders - Web APIs
the webgl_debug_shaders extension is part of the webgl api and exposes a method to debug shaders from privileged contexts. this extension is not directly available to web sites as the way of how the shader is translated may uncover personally-identifiable in
formation to the web page about the kind of graphics card in the user's computer. webgl extensions are available using the webglrenderingcontext.getextension() method. for more in
formation, see also using extensions in the webgl tutorial. availability: depending on the privacy settings of the browser, this extension might only be available to privileged contexts. this extension is available to both, webgl1 and webgl2 contexts. methods webgl_debug_shaders.gettranslatedshadersource() returns the translated shader source. specifi...
WEBGL_depth_texture - Web APIs
the webgl_depth_texture extension is part of the webgl api and defines 2d depth and depth-stencil textures. webgl extensions are available using the webglrenderingcontext.getextension() method. for more in
formation, see also using extensions in the webgl tutorial. availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. the constant in webgl2 is gl.unsigned_int_24_8. constants this extension adds a new constant: ext.unsigned_int_24_8_webgl unsigned integer type for 24-bit depth texture data. extended methods this extension extends webglrenderingcontext.teximage2d(): the
format and internal
format parameters now accept gl.depth_component and gl.depth_stencil. the type paramet...
WEBGL_draw_buffers - Web APIs
availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. ...
WEBGL_lose_context - Web APIs
availability: this extension is available to both, webgl1 and webgl2 contexts. methods webgl_lose_context.losecontext() simulates losing the context. webgl_lose_context.restorecontext() simulates restoring the context. ...
WakeLock.request() - Web APIs
prevents devices from dimming or locking the screen. return value a promise that resolves with a wakelocksentinel object. exceptions notallowederror thrown when wake lock is not available, which can happen because: document is not allowed to use screen wake lock due to screen-wake-lock policy. document is not fully active. document is hidden. user agent could not acquire plat
form's wake lock. examples the following asynchronous function requests a wakelocksentinel object. the request() method is wrapped in a try...catch statement to account for if the browser refuses the request for any reason. const requestwakelock = async () => { try { const wakelock = await navigator.wakelock.request('screen'); } catch (err) { // the wake lock request fails - usua...
WakeLockSentinel - Web APIs
the wakelocksentinel interface of the screen wake lock api provides a handle to the underlying plat
form wake lock and can be manually released and reacquired. an object representing the wake lock is returned via the navigator.wakelock.request() method. an acquired wakelocksentinel can be released manually via the release() method, or automatically via the plat
form wake lock. this can happen if the document becomes inactive or looses visibility, if the device is low on power or the user turns on a power save mode. releasing all wakelocksentinel instances of a given wake lock type will cause the underlying plat
form wake lock to be released. properties this interface provides the following properties. type read only returns a string representation of the currently acquired wak...
WaveShaperNode.curve - Web APIs
array can be a null value: in that case, no distortion is applied to the input signal. syntax var audioctx = new audiocontext(); var distortion = audioctx.createwaveshaper(); distortion.curve = mycurvedataarray; // mycurvedataarray is a float32array value a float32array. example the following example shows basic usage of an audiocontext to create a wave shaper node. for applied examples/in
formation, check out our voice-change-o-matic demo (see app.js for relevant code). note: sigmoid functions are commonly used for distortion curves because of their natural properties. their s-shape, for instance, helps create a smoother sounding result. we found the below distortion curve code on stack overflow. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var distortio...
WaveShaperNode - Web APIs
versample is an enumerated value indicating if oversampling must be used. oversampling is a technique for creating more samples (up-sampling) before applying the distortion effect to the audio signal. methods no specific method; inherits methods from its parent, audionode. example the following example shows basic usage of an audiocontext to create a wave shaper node. for applied examples/in
formation, check out our voice-change-o-matic demo (see app.js for relevant code). note: sigmoid functions are commonly used for distortion curves because of their natural properties. their s-shape, for instance, helps create a smoother sounding result. we found the below distortion curve code on stack overflow. var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var distortio...
WebGL2RenderingContext.beginQuery() - Web APIs
query); parameters target a glenum specifying the target of the query. possible values: gl.any_samples_passed: specifies an occlusion query: these queries detect whether an object is visible (whether the scoped drawing commands pass the depth test and if so, how many samples pass). gl.any_samples_passed_conservative: same as above above, but less accurate and faster version. gl.trans
form_feedback_primitives_written: number of primitives that are written to trans
form feedback buffers. query a webglquery object for which to start the querying. return value none. examples var query = gl.createquery(); gl.beginquery(gl.any_samples_passed, query); // ... specifications specification status comment webgl 2.0the definition of 'beginquery' in that s...
WebGL2RenderingContext.bindBufferBase() - Web APIs
the webgl2renderingcontext.bindbufferbase() method of the webgl 2 api binds a given webglbuffer to a given binding point (target) at a given index. syntax void gl.bindbufferbase(target, index, buffer); parameters target a glenum specifying the target for the bind operation. possible values: gl.trans
form_feedback_buffer gl.uni
form_buffer index a gluint specifying the index of the target. buffer a webglbuffer which to bind to the binding point (target). return value none. examples gl.bindbufferbase(gl.trans
form_feedback_buffer, 0, buffer); specifications specification status comment webgl 2.0the definition of 'bindbufferbase' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definiti...
WebGL2RenderingContext.copyBufferSubData() - Web APIs
attributes, such as vertex coordinates, texture coordinate data, or vertex color data. gl.element_array_buffer: buffer used for element indices. gl.copy_read_buffer: buffer for copying from one buffer object to another (provided specifically for copy operations). gl.copy_write_buffer: buffer for copying from one buffer object to another (provided specifically for copy operations). gl.trans
form_feedback_buffer: buffer for trans
form feedback operations. gl.uni
form_buffer: buffer used for storing uni
form blocks. gl.pixel_pack_buffer: buffer used for pixel transfer operations. gl.pixel_unpack_buffer: buffer used for pixel transfer operations. readoffset writeoffset a glintptr specifying the byte offset from which to start reading from or writing to the buffer. size a glsizei...
WebGL2RenderingContext.createQuery() - Web APIs
syntax webglquery gl.createquery(); parameters none. return value a webglquery object. examples gl must be a webgl2renderingcontext. webglquery objects are not available in webgl 1. var query = gl.createquery(); specifications specification status comment webgl 2.0the definition of 'createquery' in that specification. ...
WebGL2RenderingContext.endQuery() - Web APIs
arget); parameters target a glenum specifying the target of the query. possible values: gl.any_samples_passed: specifies an occlusion query: these queries detect whether an object is visible (whether the scoped drawing commands pass the depth test and if so, how many samples pass). gl.any_samples_passed_conservative: same as above above, but less accurate and faster version. gl.trans
form_feedback_primitives_written: number of primitives that are written to trans
form feedback buffers. return value none. examples var query = gl.createquery(); gl.beginquery(gl.any_samples_passed, query); // ... gl.endquery(gl.any_samples_passed); specifications specification status comment webgl 2.0the definition of 'endquery' in that specification. editor's ...
WebGL2RenderingContext.getQuery() - Web APIs
pname); parameters target a glenum specifying the target of the query. possible values: gl.any_samples_passed: specifies an occlusion query: these queries detect whether an object is visible (whether the scoped drawing commands pass the depth test and if so, how many samples pass). gl.any_samples_passed_conservative: same as above above, but less accurate and faster version. gl.trans
form_feedback_primitives_written: number of primitives that are written to trans
form feedback buffers. pname a glenum specifying the query object target. must be gl.current_query. return value a webglquery object. examples var currentquery = gl.getquery(gl.any_samples_passed, gl.current_query); specifications specification status comment webgl 2.0the definition of...
WebGL2RenderingContext.getQueryParameter() - Web APIs
possible values: gl.query_result: returns a gluint containing the query result. gl.query_result_available: returns a glboolean indicating whether or not a query result is available. return value depends on the pname parameter, either a gluint or a glboolean. ...
WebGL2RenderingContext.getSamplerParameter() - Web APIs
possible values: gl.texture_compare_func: returns a glenum indicating the texture comparison function. gl.texture_compare_mode: returns a glenum indicating the texture comparison mode. gl.texture_mag_filter: returns a glenum indicating the texture magnification filter. gl.texture_max_lod: returns a glfloat indicating the maximum level-of-detail value. ...
WebGL2RenderingContext.getSyncParameter() - Web APIs
possible values: gl.object_type: returns a glenum indicating the type of the sync object (always gl.sync_fence). gl.sync_status: returns a glenum indicating the status of the sync object (gl.signaled or gl.unsignaled). gl.sync_condition: returns a glenum indicating the sync objects' condition (always gl.sync_gpu_commands_complete). ...
WebGL2RenderingContext.renderbufferStorageMultisample() - Web APIs
the webgl2renderingcontext.renderbufferstoragemultisample() method of the webgl 2 api returns creates and initializes a renderbuffer object's data store and allows specifying a number of samples to be used. syntax void gl.renderbufferstoragemultisample(target, samples, internal
format, width, height); parameters target a glenum specifying the target renderbuffer object. possible values: gl.renderbuffer: buffer data storage for single images in a renderable internal
format. samples a glsizei specifying the number of samples to be used for the renderbuffer storage. internal
format a glenum specifying the internal
format of the renderbuffer. possible values: gl.r8 gl.r8ui gl.r8i gl.r16ui gl.r16i gl.r32ui gl.r32i gl.rg8 gl.rg8ui gl.rg8i gl.rg16u...
WebGL2RenderingContext.texStorage3D() - Web APIs
the webgl2renderingcontext.texstorage3d() method of the webgl api specifies all levels of a three-dimensional texture or two-dimensional array texture. syntax void gl.texstorage3d(target, levels, internal
format, width, height, depth); parameters target a glenum specifying the binding point (target) of the active texture. possible values: gl.texture_3d: a three-dimensional texture. gl.texture_2d_array: a two-dimensional array texture. level a glint specifying the number of texture levels. internal
format a glenum specifying the texture store
format. possible values: gl.r8 gl.r16f gl.r32f gl.r8ui gl.rg8 gl.rg16f gl.rg32f gl.rgui gl.rgb8 gl.srgb8 gl.rgb565 gl.r11f_g11f_b10f gl.rgb9_e5 gl.rgb16f gl.rgb32f gl.rgb8ui gl.rgba8 gl.s...
WebGLActiveInfo.name - Web APIs
the read-only webglactiveinfo.name property represents the name of the requested data returned by calling the getactiveattrib() or getactiveuni
form() methods. examples var activeattrib = gl.getactiveattrib(program, index); activeattrib.name; var activeuni
form = gl.getactiveuni
form(program, index); activeuni
form.name; specifications specification status comment webgl 1.0the definition of 'webglactiveinfo.name' in that specification. recommendation initial definition. ...
WebGLActiveInfo.size - Web APIs
the read-only webglactiveinfo.size property is a number representing the size of the requested data returned by calling the getactiveattrib() or getactiveuni
form() methods. examples var activeattrib = gl.getactiveattrib(program, index); activeattrib.size; var activeuni
form = gl.getactiveuni
form(program, index); activeuni
form.size; specifications specification status comment webgl 1.0the definition of 'webglactiveinfo.size' in that specification. recommendation initial definition. ...
WebGLActiveInfo.type - Web APIs
the read-only webglactiveinfo.type property represents the type of the requested data returned by calling the getactiveattrib() or getactiveuni
form() methods. examples var activeattrib = gl.getactiveattrib(program, index); activeattrib.type; var activeuni
form = gl.getactiveuni
form(program, index); activeuni
form.type; specifications specification status comment webgl 1.0the definition of 'webglactiveinfo.type' in that specification. recommendation initial definition. ...
WebGLContextEvent - Web APIs
" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">webglcontextevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface inherits properties from its parent interface, event. webglcontextevent.statusmessage a read-only property containing additional in
formation about the event. methods this interface doesn't define any own methods, but inherits methods from its parent interface, event. examples with the help of the webgl_lose_context extension, you can simulate the webglcontextlost and webglcontextrestored events: var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextlost', ...
WebGLProgram - Web APIs
gram. this is shown in the code below. var program = gl.createprogram(); // attach pre-existing shaders gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); if ( !gl.getprogramparameter( program, gl.link_status) ) { var info = gl.getprograminfolog(program); throw 'could not compile webgl program. \n\n' + info; } see webglshader for in
formation on creating the vertexshader and fragmentshader in the above example. examples using the program the steps to actually do some work with the program involve telling the gpu to use the program, bind the appropriate data and configuration options, and finally draw something to the screen. // use the program gl.useprogram(program); // bind existing attribute data gl.bindbuffer(gl.array_buf...
WebGLRenderingContext.bindRenderbuffer() - Web APIs
the webglrenderingcontext.bindrenderbuffer() method of the webgl api binds a given webglrenderbuffer to a target, which must be gl.renderbuffer. syntax void gl.bindrenderbuffer(target, renderbuffer); parameters target a glenum specifying the binding point (target). possible values: gl.renderbuffer: buffer data storage for single images in a renderable internal
format. renderbuffer a webglrenderbuffer object to bind. return value none. exceptions a gl.invalid_enum error is thrown if target is not gl.renderbuffer. examples binding a renderbuffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var renderbuffer = gl.createrenderbuffer(); gl.bindrenderbuffer(gl.renderbuffer, renderbuffer); getting current bindings to check the curr...
WebGLRenderingContext.blendFunc() - Web APIs
alue is gl.zero. for possible values, see below. return value none. exceptions if sfactor or dfactor is not one of the listed possible values, a gl.invalid_enum error is thrown. if a constant color and a constant alpha value are used together as source and destination factors, a gl.invalid_enum error is thrown. constants the following constants can be used for sfactor and dfactor. the
formula for the blending color can be described like this: color(rgba) = (sourcecolor * sfactor) + (destinationcolor * dfactor). the rbga values are between 0 and 1. constant factor description gl.zero 0,0,0,0 multiplies all colors by 0. gl.one 1,1,1,1 multiplies all colors by 1. gl.src_color rs, gs, bs, as multiplies all colors by the s...
WebGLRenderingContext.blendFuncSeparate() - Web APIs
rn value none. exceptions if srcrgb, dstrgb, srcalpha, or dstalpha is not one of the listed possible values, a gl.invalid_enum error is thrown. if a constant color and a constant alpha value are used together as source (srcrgb) and destination (dstrgb) factors, a gl.invalid_enum error is thrown. constants the following constants can be used for srcrgb, dstrgb, srcalpha, and dstalpha the
formulas for the blending factors can be described like this (all rgba values are between 0 and 1): color(rgb) = (sourcecolor * srcrgb) + (destinationcolor * dstrgb) color(a) = (sourcealpha * srcalpha) + (destinationalpha * dstalpha) constant rgb factor alpha factor description gl.zero 0,0,0 0 multiplies all colors by 0. gl.one 1,1,1,1 1 ...
WebGLRenderingContext.checkFramebufferStatus() - Web APIs
fer_complete: the framebuffer is ready to display. gl.framebuffer_incomplete_attachment: the attachment types are mismatched or not all framebuffer attachment points are framebuffer attachment complete. gl.framebuffer_incomplete_missing_attachment: there is no attachment. gl.framebuffer_incomplete_dimensions: height and width of the attachment are not the same. gl.framebuffer_unsupported: the
format of the attachment is not supported or if depth and stencil attachments are not the same renderbuffer. when using a webgl 2 context, the following values can be returned additionally: gl.framebuffer_incomplete_multisample: the values of gl.renderbuffer_samples are different among attached renderbuffers, or are non-zero if the attached images are a mix of renderbuffers and textures. ...
WebGLRenderingContext.createProgram() - Web APIs
.. examples creating a webgl program var program = gl.createprogram(); // attach pre-existing shaders gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); if ( !gl.getprogramparameter( program, gl.link_status) ) { var info = gl.getprograminfolog(program); throw 'could not compile webgl program. \n\n' + info; } see webglshader for in
formation on creating the vertexshader and fragmentshader in the above example. specifications specification status comment webgl 1.0the definition of 'createprogram' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glcreateprogram' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.disable() - Web APIs
_test deactivates stencil testing and updates to the stencil buffer. see webglrenderingcontext.stencilfunc(). when using a webgl 2 context, the following values are available additionally: constant description gl.rasterizer_discard deactivates that primitives are discarded immediately before the rasterization stage, but after the optional trans
form feedback stage. gl.clear() commands are ignored. return value none. examples gl.disable(gl.dither); to check if a capability is disabled, use the webglrenderingcontext.isenabled() method: gl.isenabled(gl.dither); // false specifications specification status comment webgl 1.0the definition of 'disable' in that specification. recommendation initia...
WebGLRenderingContext.enable() - Web APIs
gl.stencil_test activates stencil testing and updates to the stencil buffer. see webglrenderingcontext.stencilfunc(). when using a webgl 2 context, the following values are available additionally: constant description gl.rasterizer_discard primitives are discarded immediately before the rasterization stage, but after the optional trans
form feedback stage. gl.clear() commands are ignored. return value none. examples gl.enable(gl.dither); to check if a capability is enabled, use the webglrenderingcontext.isenabled() method: gl.isenabled(gl.dither); // true specifications specification status comment webgl 1.0the definition of 'enable' in that specification. recommendation initial de...
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
you can disable the attribute array by calling disablevertexattribarray(). in webgl, values that apply to a specific vertex are stored in attributes. these are only available to the javascript code and the vertex shader. attributes are referenced by an index number into the list of attributes maintained by the gpu. some vertex attribute indices may have predefined purposes, depending on the plat
form and/or the gpu. others are assigned by the webgl layer when you create the attributes. either way, since attributes cannot be used unless enabled, and are disabled by default, you need to call enablevertexattribarray() to enable individual attributes so that they can be used. once that's been done, other methods can be used to access the attribute, including vertexattribpointer(), vertexattrib*(...
WebGLRenderingContext.framebufferRenderbuffer() - Web APIs
t.color_attachment10_webgl ext.color_attachment11_webgl ext.color_attachment12_webgl ext.color_attachment13_webgl ext.color_attachment14_webgl ext.color_attachment15_webgl renderbuffertarget a glenum specifying the binding point (target) for the render buffer. possible values: gl.renderbuffer: buffer data storage for single images in a renderable internal
format. renderbuffer a webglrenderbuffer object to attach. return value none. exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer, gl.draw_framebuffer, or gl.read_framebuffer. a gl.invalid_enum error is thrown if renderbuffertarget is not gl.renderbuffer. a gl.invalid_enum error is thrown if attachment is not one of the allowed enums. examples gl.framebufferr...
WebGLRenderingContext.getError() - Web APIs
syntax glenum gl.geterror(); parameters none. return value constant description gl.no_error no error has been recorded. the value of this constant is 0. gl.invalid_enum an unacceptable value has been specified for an enumerated argument. the command is ignored and the error flag is set. gl.invalid_value a numeric argument is out of range. the command is ignored and the error flag is set. gl.invalid_operation the specified command is not allowed for the current state. the command is ignored and the error flag is set. ...
WebGLRenderingContext.getProgramInfoLog() - Web APIs
the webglrenderingcontext.getprograminfolog returns the in
formation log for the specified webglprogram object. it contains errors that occurred during failed linking or validation of webglprogram objects. syntax gl.getprograminfolog(program); parameters program the webglprogram to query. return value a domstring that contains diagnostic messages, warning messages, and other in
formation about the last linking or validation operation. when a webglprogram object is initially created, its in
formation log will be a string of length 0. examples checking program errors var program = gl.createprogram(); // attach pre-existing shaders gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); gl.getprograminfolog(program); specification...
WebGLRenderingContext.getShaderParameter() - Web APIs
the webglrenderingcontext.getshaderparameter() method of the webgl api returns in
formation about the given shader. syntax any gl.getshaderparameter(shader, pname); parameters shader a webglshader to get parameter in
formation from. pname a glenum specifying the in
formation to query. possible values: gl.delete_status: returns a glboolean indicating whether or not the shader is flagged for deletion. gl.compile_status: returns a glboolean indicating whether or not the last shader compilation was successful. gl.shader_type: returns a glenum indicating whether the shader is a vertex shader (gl.vertex_shader) or fragment shader (gl.fragment_shader) object. return value returns the requested shader in
formation (as specified with pname). examples gl.getshaderparameter(shader...
WebGLRenderingContext.isContextLost() - Web APIs
re-establish the context before resuming rendering. examples include: two or more pages are using the gpu, but together place too high a demand on the gpu, so the browser tells the two contexts that they've lost the connection, then selects one of the two to restore access for. the user's computer has multiple graphics processors (such as a laptop with both mobile and desktop class gpus, the
former used primarily when on battery power), and the user or system decides to switch gpus. in this case, all contexts are lost, then restored after switching gpus. another page running in the user's browser per
forms an operation using the gpu that takes too long, causing hte browser to decide to reset the gpu in order to break the stall. this would cause every webgl context to be lost throughout th...
WebGLRenderingContext.isEnabled() - Web APIs
sor(). gl.stencil_test stencil testing and updates to the stencil buffer. see webglrenderingcontext.stencilfunc(). when using a webgl 2 context, the following values are available additionally: constant description gl.rasterizer_discard primitives are discarded immediately before the rasterization stage, but after the optional trans
form feedback stage. gl.clear() commands are ignored. return value a glboolean indicating if the capability cap is enabled (true), or not (false). examples gl.isenabled(gl.stencil_test); // false to activate or deactivate a specific capability, use the webglrenderingcontext.enable() and webglrenderingcontext.disable() methods: gl.enable(gl.stencil_test); gl.disable(gl.stencil_test)...
WebGLRenderingContext.polygonOffset() - Web APIs
syntax void gl.polygonoffset(factor, units); parameters factor a glfloat which sets the scale factor for the variable depth offset for each polygon. the default value is 0. units a glfloat which sets the multiplier by which an implementation-specific value is multiplied with to create a constant depth offset. the default value is 0. return value none. ...
WebGLRenderingContext.stencilFunc() - Web APIs
ed stencil value when the test is done. the default value is all 1. return value none. examples the stencil testing is disabled by default. to enable or disable stencil testing, use the enable() and disable() methods with the argument gl.stencil_test. gl.enable(gl.stencil_test); gl.stencilfunc(gl.less, 0, 0b1110011); to get the current stencil function, reference value, or other stencil in
formation, query the following constants with getparameter(). gl.getparameter(gl.stencil_func); gl.getparameter(gl.stencil_value_mask); gl.getparameter(gl.stencil_ref); gl.getparameter(gl.stencil_back_func); gl.getparameter(gl.stencil_back_value_mask); gl.getparameter(gl.stencil_back_ref); gl.getparameter(gl.stencil_bits); specifications specification status comment webgl 1...
WebGLRenderingContext.stencilFuncSeparate() - Web APIs
hen the test is done. the default value is all 1. return value none. examples the stencil testing is disabled by default. to enable or disable stencil testing, use the enable() and disable() methods with the argument gl.stencil_test. gl.enable(gl.stencil_test); gl.stencilfuncseparate(gl.front, gl.less, 0.2, 1110011); to get the current stencil function, reference value, or other stencil in
formation, query the following constants with getparameter(). gl.getparameter(gl.stencil_func); gl.getparameter(gl.stencil_value_mask); gl.getparameter(gl.stencil_ref); gl.getparameter(gl.stencil_back_func); gl.getparameter(gl.stencil_back_value_mask); gl.getparameter(gl.stencil_back_ref); gl.getparameter(gl.stencil_bits); specifications specification status comment webgl 1...
WebGLRenderingContext.stencilOp() - Web APIs
epresentable unsigned value when decrementing a stencil buffer value of 0. gl.invert inverts the current stencil buffer value bitwise. examples the stencil testing is disabled by default. to enable or disable stencil testing, use the enable() and disable() methods with the argument gl.stencil_test. gl.enable(gl.stencil_test); gl.stencilop(gl.incr, gl.decr, gl.invert); to get the current in
formation about stencil and depth pass or fail, query the following constants with getparameter(). gl.getparameter(gl.stencil_fail); gl.getparameter(gl.stencil_pass_depth_pass); gl.getparameter(gl.stencil_pass_depth_fail); gl.getparameter(gl.stencil_back_fail); gl.getparameter(gl.stencil_back_pass_depth_pass); gl.getparameter(gl.stencil_back_pass_depth_fail); gl.getparameter(gl.stencil_bits); speci...
WebGLRenderingContext.stencilOpSeparate() - Web APIs
ned value when decrementing a stencil buffer value of 0. gl.invert inverts the current stencil buffer value bitwise. examples the stencil testing is disabled by default. to enable or disable stencil testing, use the enable() and disable() methods with the argument gl.stencil_test. gl.enable(gl.stencil_test); gl.stencilopseparate(gl.front, gl.incr, gl.decr, gl.invert); to get the current in
formation about stencil and depth pass or fail, query the following constants with getparameter(). gl.getparameter(gl.stencil_fail); gl.getparameter(gl.stencil_pass_depth_pass); gl.getparameter(gl.stencil_pass_depth_fail); gl.getparameter(gl.stencil_back_fail); gl.getparameter(gl.stencil_back_pass_depth_pass); gl.getparameter(gl.stencil_back_pass_depth_fail); gl.getparameter(gl.stencil_bits); speci...
WebGLRenderingContext.vertexAttrib[1234]f[v]() - Web APIs
d to specify values which are different for each vertex (using vertexattribpointer), it can be useful to specify a constant value. for example, if you have a shader which has a color vertex attribute, but you want to draw everything in a single color, you can use vertexattrib to achieve that without creating a buffer filled with only one value or having to create a separate shader which uses a uni
form for the color. this value will be used if a bound array buffer has not been enabled with enablevertexattribarray. attributes may be matrices, in which case columns of the matrix must be loaded into successive vertex attribute slots. the values set with vertexattribpointer are context-global, i.e. they aren't part of the shader state (like generix vertex attribute indexes to shader variable bin...
WebGLRenderingContext.viewport() - Web APIs
syntax void gl.viewport(x, y, width, height); parameters x a glint specifying the horizontal coordinate for the lower left corner of the viewport origin. default value: 0. y a glint specifying the vertical coordinate for the lower left corner of the viewport origin. default value: 0. width a non-negative glsizei specifying the width of the viewport. default value: width of the canvas. height a non-negative glsizei specifying the height of the viewport. ...
Raining rectangles - Web APIs
ainingrect.velocity; if (rainingrect.position[1] < 0) { misses += 1; missesdisplay.innerhtml = misses; rainingrect = new rectangle(); } // we are using settimeout for animation. so we reschedule // the timeout to call drawanimation again in 17ms. // otherwise we won't get any animation. timer = settimeout(drawanimation, 17); } function playerclick (evt) { // we need to trans
form the position of the click event from // window coordinates to relative position inside the canvas. // in addition we need to remember that vertical position in // webgl increases from bottom to top, unlike in the browser // window. var position = [ evt.pagex - evt.target.offsetleft, gl.drawingbufferheight - (evt.pagey - evt.target.offsettop), ]; // if the click falls ins...
Simple color animation - Web APIs
color animation with clear this example provides a simple illustration of color animation with webgl, as well as user interaction. the user can start, stop and restart the animation by clicking the button. this time we put the webgl function calls within a timer event handler. a click event handler additionally enables the basic user interaction of starting and stopping the animation. ...
Animating objects with WebGL - Web APIs
you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. making the square rotate let's start by making the square rotate. the first thing we'll need is a variable in which to track the current rotation of the square: var squarerotation = 0.0; now we need to update the drawscene() function to apply the current rotation to the square when drawing it. ...
Window.onmozbeforepaint - Web APIs
obsolete since gecko 11 (firefox 11 / thunderbird 11 / seamonkey 2.8)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. summary an event handler for the mozbeforepaint event. this is used in concert with the window.mozrequestanimationframe() method to per
form smooth, synchronized animations from javascript code. syntax window.onmozbeforepaint = funcref; funcref is the handler function. example see window.mozrequestanimationframe() for an example. notes this event fires immediately before the browser window is repainted, if the event has been requested by one or more scripts calling window.mozrequestanimationframe(). the event handler receives as an input parameter an event wh...
Window.openDialog() - Web APIs
supply modal as a windowfeatures parameter. note that this also means the user won't be able to interact with the opener window until he closes the modal dialog. syntax newwindow = opendialog(url, name, features, arg1, arg2, ...) newwindow the opened window url the url to be loaded in the newly opened window. name the window name (optional). see window.open() description for detailed in
formation. features see window.open() for details. arg1, arg2, ... the arguments to be passed to the new window (optional). example var win = opendialog("http://example.tld/zzz.xul", "dlg", "", "pizza", 6.98); notes new features all - initially activates (or deactivates ("all=no")) all chrome (except the behavior flags chrome, dialog and modal). these can be overridden (so "menubar=no,all" ...
Window: pagehide event - Web APIs
ession's history. for example, when the user clicks the browser's back button, the current page receives a pagehide event before the previous page is shown. bubbles no cancelable no interface pagetransitionevent event handler property onpagehide examples in this example, an event handler is established to watch for pagehide events and to per
form special handling if the page is being persisted for possible reuse. window.addeventlistener("pagehide", event => { if (event.persisted) { /* the page isn't being discarded, so it can be reused later */ } }, false); this can also be written using the onpagehide event handler property on the window: window.onpagehide = event => { if (event.persisted) { /* the page isn't being disc...
Window.pkcs11 - Web APIs
time. try to avoid using it. summary returns the pkcs11 object, which is used to install drivers and other software associated with the pkcs11 protocol. if pkcs11 isn't supported, this property returns null. note: this property has been returned null since gecko 1.9.0.14 (firefox 3.0.14) and removed in gecko 29.0 (firefox 29 / thunderbird 29 / seamonkey 2.26)) for security reasons. for more in
formation on installing pkcs11 modules, see installing pkcs11 modules. see bug 326628 for details on why the property was removed. syntax objref = window.pkcs11 example window.pkcs11.addmodule(smod, secpath, 0, 0); notes see nsidompkcs11 for more in
formation about how to manipulate pkcs11 objects. specification not part of specification. ...
window.postMessage() - Web APIs
ed by the current value of document.domain in the calling window. for idn host names only, the value of the origin property is not consistently unicode or punycode; for greatest compatibility check for both the idn and punycode values when using this property if you expect messages from idn sites. this value will eventually be consistently idn, but for now you should handle both idn and punycode
forms. the value of the origin property when the sending window contains a javascript: or data: url is the origin of the script that loaded the url. using window.postmessage in extensions window.postmessage is available to javascript running in chrome code (e.g., in extensions and privileged code), but the source property of the dispatched event is always null as a security restriction. (the othe...
Window.resizeBy() - Web APIs
specifications specification status comment css object model (cssom) view modulethe definition of 'window.resizeby()' in that specification. working draft ...
Window.sessionStorage - Web APIs
ndow ends the session and clears objects in sessionstorage. data stored in sessionstorage is specific to the protocol of the page. in particular, data stored by a script on a site accessed with http (e.g., http://example.com) is put in a different sessionstorage object from the same site accessed with https (e.g., https://example.com). the keys and the values are always in the utf-16 domstring
format, which uses two bytes per character. as with objects, integer keys are automatically converted to strings. syntax mystorage = window.sessionstorage; value a storage object which can be used to access the current origin's session storage space. exceptions securityerror the request violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the or...
Window: transitioncancel event - Web APIs
bubbles yes cancelable no interface transitionevent event handler property globaleventhandlers.ontransitioncancel the original target for this event is the element that had the transition applied. you can listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: transitioncancel. ...
Window.updateCommands() - Web APIs
indow.updatecommands("scommandname") parameters scommandname is a particular string which describes what kind of update event this is (e.g. whether we are in bold right now). notes this enables or disables items (setting or clearing the "disabled" attribute on the command node as appropriate), or ensures that the command state reflects the state of the selection by setting current state in
formation in the "state" attribute of the xul command nodes. specification dom level 0. not part of specification. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariand...
WindowEventHandlers.onpopstate - Web APIs
two history entries for the same document. if the activated history entry was created by a call to history.pushstate(), or was affected by a call to history.replacestate(), the popstate event's state property contains a copy of the history entry's state object. note: calling history.pushstate() or history.replacestate() won't trigger a popstate event. the popstate event is only triggered by per
forming a browser action, such as clicking on the back button (or calling history.back() in javascript), when navigating between two history entries for the same document. syntax window.onpopstate = funcref; funcref is a handler function. examples for example, a page at http://example.com/example.html running the following code will generate alerts as indicated: window.onpopstate = function...
WindowEventHandlers - Web APIs
the windoweventhandlers mixin describes the event handlers common to several interfaces like window, or htmlbodyelement and htmlframesetelement. each of these interfaces can implement additional specific event handlers. note: windoweventhandlers is a mixin and not an interface; you can't actually create an object of type windoweventhandlers. properties the events properties, of the
form onxyz, are defined on the windoweventhandlers, and implemented by window, and workerglobalscope for web workers. windoweventhandlers.onafterprint is an eventhandler representing the code to be called when the afterprint event is raised. windoweventhandlers.onbeforeprint is an eventhandler representing the code to be called when the beforeprint event is raised. windoweventhandlers.onbeforeunload is...
WindowOrWorkerGlobalScope.queueMicrotask() - Web APIs
loop. this lets your code run without interfering with any other, potentially higher priority, code that is pending, but before the browser regains control over the execution context, potentially depending on work you need to complete. you can learn more about how to use microtasks and why you might choose to do so in our microtask guide. the importance of microtasks comes in its ability to per
form tasks asynchronously but in a specific order. see using microtasks in javascript with queuemicrotask() for more details. microtasks are especially useful for libraries and frameworks that need to per
form final cleanup or other just-before-rendering tasks. queuemicrotask() is exposed on the windoworworkerglobalscope mixin. syntax scope.queuemicrotask(function); parameters function a func...
WindowProxy - Web APIs
therefore, interacting with a windowproxy object is almost identical to directly interacting with a window object. when a browsing context is navigated, the window object its windowproxy wraps is changed. ...
Worker.onmessage - Web APIs
when the worker's parent receives a message (i.e. from the dedicatedworkerglobalscope.postmessage method). note: the message payload is available in the message event's data property. syntax myworker.onmessage = function(e) { ... } example the following code snippet shows creation of a worker object using the worker() constructor. messages are passed to the worker when the value inside the
form input first changes. an onmessage handler is also present, to deal with messages that are passed back from the worker. var myworker = new worker('worker.js'); first.onchange = function() { myworker.postmessage([first.value,second.value]); console.log('message posted to worker'); } myworker.onmessage = function(e) { result.textcontent = e.data; console.log('message received from worker'...
XMLHttpRequestEventTarget - Web APIs
tion to call when an http request returns after successfully fetching content and the load event is received by this object. xmlhttprequesteventtarget.onloadstart contains the function that gets called when the http request first begins loading data and the loadstart event is received by this object. xmlhttprequesteventtarget.onprogress contains the function that is called periodically with in
formation about the progress of the request and the progress event is received by this object. xmlhttprequesteventtarget.ontimeout contains the function that is called if the event times out and the timeout event is received by this object; this only happens if a timeout has been previously established by setting the value of the xmlhttprequest object's timeout attribute. xmlhttprequesteventtarget.
XMLSerializer.serializeToString() - Web APIs
the xmlserializer method serializetostring() constructs a string representing the specified dom tree in xml
form. syntax xmlstring = anxmlserializer.serializetostring(rootnode); parameters rootnode the node to use as the root of the dom tree or subtree for which to construct an xml representation. return value a domstring containing the xml representation of the specified dom tree. exceptions typeerror the specified rootnode is not a compatible node type. the root node must be either node or attr. invalidstateerror the tree could not be successfully serialized, probably due to issues with the content's compatibility with xml serialization. syntaxerror a serialization of html was requested but could not succeed due to the content not being well-
formed. usage notes compati...
XPathEvaluator.createExpression() - Web APIs
on. syntax xpathexpression xpathevaluator.createexpression(expression, resolver); parameters expression a domstring representing representing the xpath expression to be created. resolver optional permits translation of all prefixes, including the xml namespace prefix, within the xpath expression into appropriate namespace uris. return value a xpathexpression representing the compiled
form of the xpath 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. namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified xpathnsresolver, a domexception of type namespace_error is raised. example the following examp...
XPathEvaluator.createNSResolver() - Web APIs
this method adapts any dom node to resolve namespaces so that an xpath expression can be easily evaluated relative to the context of the node where it appeared within the document. this adapter works like the dom level 3 method node.lookupnamespaceuri() in resolving the namespace uri from a given prefix using the current in
formation available in the node's hierarchy at the time the method is called, also correctly resolving the implicit xml prefix. syntax xpathnsresolver xpathevaluator.creatensresolver(noderesolver); parameters noderesolver a node to be used as a context for namespace resolution. return value an xpathnsresolver object which resolves namespaces with respect to the definitions in scope for a specified node. specifications specification status commen...
XPathException - Web APIs
properties xpathexception.code read only returns a short that contains one of the error code constants. constants constant value description invalid_expression_err 51 if the expression has a syntax error or otherwise is not a legal expression according to the rules of the specific xpathevaluator or contains specialized extension functions or variables not supported by this implementation. type_err 52 if the expression cannot be converted to return the specified type. ...
XPathExpression - Web APIs
this is useful when an expression will be reused in an application, because it is just compiled once and all namespace prefixes which occur within the expression are preresolved. objects of this type are created by calling xpathevaluator.createexpression(). methods xpathexpression.evaluate() evaluates the xpath expression on the given node or document. example the following example shows the use of the xpathexpression interface. ...
XRBoundedReferenceSpace.boundsGeometry - Web APIs
space's bounds points are all defined relative to the xrboundedreferencespace's effective origiin. usage notes bounded reference spaces always have their origin located at ground level, where y is 0. as a general rule, with the origin for x and z located in or near the center of the space, and with the orientation set facing in a logical forward direction, as appropriate for the underlying plat
form or xr hardware. in order to reduce the risk of the room boundaries being used for fingerprinting purposes, each point in the boundsgeometry array may be rounded or adjusted by some amount. the specification recommends that browsers shift the points to the nearest 5 centimeters (while avoiding going outside the physical limitations of the hardware). boundary size xrboundedreferencespace is not ...
XRInputSource.gripSpace - Web APIs
e x and z axes). examples in tis example, taken from the frame rendering callback, the gripspace is used to render a mesh that represents the position and orieintation of the controller in the virtual environment. for (let source in xrsession.inputsources) { if (source.gripspace) { let grippose = frame.getpose(source.gripspace, xrrefspace); if (grippose) { mydrawmeshusingtrans
form(controllermesh, grippose.trans
form.matrix); } } } for each input source which has a value for gripspace, this loop obtains the xrpose representing the position and orientation that are described by gripspace. if a valid pose is returned, a method mydrawmeshusingtrans
form() is called to draw the controller's mesh trans
formed using the grip pose's trans
form matrix. specifications ...
XRInputSourceArray.entries() - Web APIs
operty, as an input for other devices, we look for tracked-pointer devices in the player's main hand, dispatching those to a handlemainhandinput() method. specifications specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in in
formation contained in a webidl file for in
formation on how an iterable declaration in an interface definition causes entries(), foreach(), keys(), and values() methods to be exposed from objects that implement the interface. ...
XRInputSourceArray.keys() - Web APIs
...of is used to iterate over each of the keys. for each key, the input is retrieved using the index with array notation: xrsession.inputsources[inputidx]. specifications specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in in
formation contained in a webidl file for in
formation on how an iterable declaration in an interface definition causes entries(), foreach(), keys(), and values() methods to be exposed from objects that implement the interface. ...
XRInputSourceArray.values() - Web APIs
y's contents. each pass through the loop, source is the next xrinputsource in the list. the loop exits once every input has been delivered to checkinput(). specifications specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in in
formation contained in a webidl file for in
formation on how an iterable declaration in an interface definition causes entries(), foreach(), keys(), and values() methods to be exposed from objects that implement the interface. ...
XRInputSourceEvent() - Web APIs
e, or grip the controller. examples the code below sets up handlers for primary action events in order to determine when the user clicks on (shoots at/pokes at/whatever) objects in the scene. xrsession.addeventlistener("select", event => { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { let hit = myhittest(targetraypose.trans
form); if (hit) { /* handle the hit */ } } }); specifications specification status comment webxr device apithe definition of 'xrinputsourceevent' in that specification. working draft initial definition. ...
XRInputSourceEvent.inputSource - Web APIs
syntax let inputsource = xrinputsourceevent.inputsource; value an xrinputsource object identifying the source of the user input event. this event indicates an action the user has taken using a webxr input controller, such as a hand controller, motion sensing device, or other input apparatus. ...
XRInputSourceEventInit.frame - Web APIs
of course, as a general rule, you won't need to create xrinputsourceeventinit objects yourself. these events are generated by and sent to you by the webxr infrastructure. ...
XRInputSourceEventInit - Web APIs
uctor to provide configuration options for the newly-created xrinputsourceevent object to take on. properties the xrinputsourceeventinit dictionary inherits properties from the eventinit dictionary. it also offers the following: frame an xrframe object representing the event frame during which the event took place. this event is not associated with the animation process, and has no viewer in
formation contained within it. inputsource an xrinputsource object representing the input device from which the event is being sent. specifications specification status comment webxr device apithe definition of 'xrinputsourceeventinit' in that specification. working draft initial definition. ...
XRWebGLLayerInit.depth - Web APIs
false will request that the new layer be created without a depth buffer. syntax let layerinit = { depth: false }; let gllayer = new xrwebgllayer(xrsession, gl, layerinit); let gllayer = new xrwebgllayer(xrsession, gl, { depth: false }); value a boolean which can be set to false to specify that the new webgl layer should not have a depth buffer. this means that the only source for depth in
formation is the vertex coordinates, and reduces the accuracy and quality of rendering, but may potentially affect the per
formance of rendering as well. the default value is true. usage notes this property differs from ignoredepthvalues in that a layer created with ignoredepthvalues set to true may still have a depth buffer, but will not make use of it. you can determine whether or not the depth b...
XRWebGLLayerInit.framebufferScaleFactor - Web APIs
that the frame buffer should be the same resolution as the actual display, while a value of 0.5 indicates that the frame buffer should be half the resolution of the display. a value of 2.0, on the other hand, creates a frame buffer whose resolution is double that of the actual display buffer. there are valid use cases for all of these kinds of scaling. see managing rendering quality in webxr per
formance guide for more in
formation. you can determine the scaling factor that you would need to apply to match the default frame buffer resolution by using the xrwebgllayer.getnativeframebufferscalefactor() static function. syntax let layerinit = { framebufferscalefactor: scalefactor }; let gllayer = new xrwebgllayer(xrsession, gl, layerinit); let gllayer = new xrwebgllayer(xrsession, gl, { fra...
XRWebGLLayerInit.ignoreDepthValues - Web APIs
assed into the xrwebgllayer() constructor to indicate that the depth buffer, if it exists, should be ignored while composing the scene. the depth buffer is typically used to assist in ordering vertices and, by extension, polygons while compositing, to ensure that the scene is correctly composited, with objects the correct distance away and with clipping and other distance-related computations per
formed as accurately as possible. without the depth buffer, these computations must rely entirely on the coordinates of each pixel. this property differs from depth in that depth requests a webgl layer that does not have a depth buffer at all, while ignoredepthvalues merely asks that the depth layer be ignored. syntax let layerinit = { ignoredepthvalues: boolvalue }; let gllayer = new xrwebgllaye...
Browser Differences - Web APIs
ie 5.0 and 5.5 (both windows) supported only the working draft of xslt, and thus are not compatible with xslt 1.0 stylesheets. ...
Resources - Web APIs
resources trans
forming xml: netscape and xslt what kind of language is xslt? at ibm developerworks xslt tutorial at zvon.org xpath tutorial at zvon.org using the mozilla javascript interface to do xsl trans
formations at mozilla.org mozilla.org's xslt project page, which includes a frequently encountered issues section. ...
ARIA guides - Accessibility
accessible rich internet applications (aria) defines ways to make the web more accessible to people with disabilities. a few guidelines to follow that ensure better accessibility, like using drag and drop for placement of the widgets. error handling in
forms labeling widgets labeling composite widgets and regions managing focus in composite widgets (aria-activedescendant vs roving tabindex) using landmark roles handling dynamic updates & live regions virtual vs. non virtual mode in at products using drag & drop notifying users of non-aria screen readers fixing structure with presentation role hiding layout tables managing modal and non modal dialogs using aria with html5 how to test aria aria on mobile devices ...
How to file ARIA-related bugs - Accessibility
otice an implementation issue, please take a little time and let the developers know. here's where to file bugs: when finding a bug, please also update the relevant compatibility tables in the examples page. ...
ARIA: article role - Accessibility
ication or other widget that causes screen readers and other assistive technologies to be in pass-through mode, an article can be used to indicate that these should switch back to treating the enclosed content as regular web content. instead of including the article role on a non-semantic element, the <article> element should be used. user agents translate this to the appropriate accessibility in
formation just like the article role. using the <article> element also helps search engines better discover the structure of a page. examples of appropriate uses of the role="article", or preferably <article>, include blog posts, forum posts, a comment to a forum or blog post, a comment to a comment to a forum or blog post, any an item in a social media feed. associated wai-aria roles, states, and pr...
ARIA: banner role - Accessibility
this usually includes a logo, company name, search icon, photo related to the page, or slogan. <div role="banner"> <img src="companylogo.svg" alt="my company name" /> <h1>title</h1> <h2>subtitle</h2> </div> by default, the html5 <header> element has an identical meaning to the banner landmark, unless it is a descendant of <aside>, <article>, <main>, <nav>, or <section>. description a banner landmark role converts the container element upon which it is applied into a header. it should be reserved for the site header content that is common across the site generally at the top of every page. ...
ARIA: contentinfo role - Accessibility
this section is commonly called a footer. <div role="contentinfo"> <h2>footer</h2> <!-- footer content --> </div> this is a website footer. using the <footer> element instead is recommended: <footer> <h2>footer</h2> <!-- footer content --> </footer> description the contentinfo role is a landmark used to identify a page footer. landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. pages should only include one top-level contentinfo landmark role per page. ...
ARIA: document role - Accessibility
generally used in complex composite widgets or applications, the document role can in
form assistive technologies to switch context to a reading mode: the document role tells assistive technologies with reading or browse modes to use the document mode to read the content contained within this element. <div role="dialog"> ... <div id="infotext" role="document" tabindex="0"> <p>some in
formational text goes here.</p> </div> ... <button>close</button> </div> this example shows a dialog widget with some controls and a section with some in
formational text that the assistive technology user can read when tabbing to it. description by default, web pages are treated as documents; assistive technologies (at) enter browse or read mode when entering a new web page. this mode can be altered thr...
ARIA: figure role - Accessibility
the aria figure role can be used to identify a figure inside page content where appropriate semantics do not already exist. a figure is generally considered to be one or more images, code snippets, or other content that puts across in
formation in a different way to a regular flow of text. <div role="figure" aria-labelledby="caption"> <img src="image.png" alt="full alternative image description"> <p id="caption">figure 1: the caption</p> </div> in the above example, we have a figure that consists of two separate content items — an image and a caption. this is wrapped by a <div> element that identifies the content as a figure using role="figure". instead of using aria to create a figure, consider using the native, semantic html <figure> element. along with the <figcaption> eleme...
ARIA: grid role - Accessibility
="-1"> <button id="2b" tabindex="-1">2b</button> </td> <!-- more columns --> </tr> </tbody> </table> description a grid widget contains one or more rows with one or more cells of thematically related interactive content. while it does not imply a specific visual presentation, it implies a relationship among elements. uses fall into two categories: presenting tabular in
formation (data grids) and grouping other widgets (layout grids). even though both data grids and layout grids employ the same aria roles, states, and properties, differences in their content and purpose surface factors that are important to consider in keyboard interaction design. see aria authoring practices for more details cell elements have the role gridcell, unless they are a row or column head...
ARIA: Main role - Accessibility
s avocados. subsections of this document could discuss their history, the different types, regions where they grow, etc. description the main role is a navigational landmark role identifying the main content of a document. landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. by classifying and labeling sections of a page, structural in
formation conveyed visually through layout can be represented programmatically. screen readers use landmark roles to provide keyboard navigation to important sections of a page. for those navigating via landmark roles, the main role is an alternative for "skip to main content" links.there should only be one main landmark role per document. the <main> element has a role of main. developers should alwa...
ARIA: Navigation Role - Accessibility
ks used for navigating through a website or page content. <div role="navigation" aria-label="main"> <!-- list of links to main website locations --> </div> this is a website's main navigation. description the navigation role is a landmark role. landmark roles provide a way to identify the organization and structure of a web page. by classifying and labeling sections of a page, structural in
formation conveyed visually through layout is represented programmatically. screen readers use landmark roles to provide keyboard navigation to important sections of a page. like the html <nav> element, navigation landmarks provide a way to identify groups (e.g. lists) of links that are intended to be used for website or page content navigation. if a page includes more than one navigation landmark, ea...
ARIA: Region role - Accessibility
e a generic landmark for people to be able to navigate to easily when none of the other landmark roles are appropriate. <div role="region" aria-label="example"> <!-- region content --> </div> description the region role is an aria landmark role. landmark roles provide a way to identify the organization and structure of a web page. by classifying and labeling sections of a page, structural in
formation conveyed visually through layout is represented programmatically. screen readers use landmark roles to provide keyboard navigation to important sections of a page. the region role should be reserved for sections of content sufficiently important that users will likely want to navigate to the section easily and to have it listed in a summary of the page. a region role is a more generic term,...
ARIA: img role - Accessibility
the aria img role can be used to identify multiple elements inside page content that should be considered as a single image. these elements could be images, code snippets, text, emojis, or other content that can be combined to deliver in
formation in a visual manner. <div role="img" aria-label="description of the overall image"> <img src="graphic1.png" alt=""> <img src="graphic2.png"> </div> description any set of content that should be consumed as a single image (which could include images, video, audio, code snippets, emojis, or other content) can be identified using role="img". you shouldn't count on the alt text of individual elements images for conveying context to assistive technologies; most screenreaders will consider the element with role="img" set on it to be to be like a bl...
ARIA: Suggestion role - Accessibility
s no way for a screenreader user to work out if the two are related or not. this is the job of role="suggestion", which should be set on an element wrapping both of them like so: <p>freida’s pet is a <span role="suggestion"> <span role="deletion">black cat called luna</span> <span role="insertion">purple tyrannosaurus rex called tiny</span> </span>. </p> we could even provide an in
formation box saying who made the suggestion and when, and associate it with the suggestion via aria-details: <p>freida’s pet is a <span role="suggestion" aria-details="comment-source"> <span role="deletion">black cat called luna</span> <span role="insertion">purple tyrannosaurus rex called tiny</span> </span>. </p> <div id="comment-source">suggested by chris, <time datetime="2019-03-3...
ARIA: tab role - Accessibility
ore prominent than the other tabs. elements with the role tab must either be a child of an element with the tablist role, or have their id part of the aria-owns property of a tablist. this combination identifies to assistive technology that the element is part of a group of related elements. some assistive technology will provide a count of the number of tab role elements inside a tablist, and in
form users of which tab they currently have targeted. they should contain the aria-controls property identifying an element with the tabpanel role. when an element with the tabpanel role has focus, or a child of it has focus, that indicates that the connected element with the tab role is the active tab in a tablist. when working with elements with the tab role, when they are selected or active, they ...
ARIA: heading role - Accessibility
ships between sections. <div role="heading" aria-level="1">this is a main page heading</div> this defines the text in the div to be the main heading of the page, indicated by being level 1 via the aria-level attribute. description the heading role indicates to assistive technologies that this element should be treated like a heading. screen readers would read the text and indicate that it is
formatted like a heading. in addition, the level tells assistive technologies which part of the page structure this heading represents. a level 1 heading usually indicates the main heading of a page, a level 2 heading the first subsection, a level 3 is a subsection of that, and so on. associated wai-aria roles, states, and properties aria-level the aria-level attribute specifies the heading level...
overview - Accessibility
menu control slider from the paciello group blog: aria slider, part one, part two, part threet (example) creating an accessible, internationalized dojo rating widget tabs enhancing tabview accessibility with wai-aria roles and states, from the yui blog enhancing the jquery ui tabs accordingly to wcag 2.0 and aria tab panel example here on codetalks lightbox wcag 2.0 and aria-con
formant lightbox application http://majx-js.digissime.net/js/popin/
form validation wcag 2.0 and aria-con
formant live
form validation tables german tutorial on creating an accessible
form simple grid example at codetalks date picker grid at codetalks wcag 2.0 and aria-con
formant sortable tables ...
Accessibility and Spacial Patterns - Accessibility
of response than other kinds of neurological responses believed to cause photosensitive seizures. stripes and patterns are typical of the kinds of images that create problems, and stripes have been studied most closely. there's the potential for causing harm if there are more than five light-dark pairs of stripes in any orientation. they can be parallel, radial, curved or straight, and may be
formed by rows of repeating elements. in 2005, arnold wilkins, john emmett, and graham harding evaluated the guidelines for characterizing patterned images that could precipitate seizures. they revised the guidelines to their fundamental core, and came up with a surprisingly simple, but powerful test. which they published in the paper, characterizing the patterned images that precipitate seizures ...
HTML To MSAA - Accessibility
ystem_ haspopup state_system_ focusable n/a "open"/"close" depending on state event_object_ valuechange when selected option is changed table role_system_ table from @summary attribute n/a described_by (0x100e) points to caption element n/a n/a td, th role_system_ cell n/a n/a n/a n/a n/a n/a thead role_system_ columnheader n/a n/a n/a n/a n/a n/a abbr, acronym, blockquote,
form, frame, h1-h6, iframe bstr role n/a n/a n/a n/a n/a n/a ...
Color contrast - Accessibility
body text 4.5 : 1 7 : 1 large-scale text (120-150% larger than body text) 3 : 1 4.5 : 1 active user interface components and graphical objects such as icons and graphs 3 : 1 not defined these ratios do not apply to "incidental" text, such as inactive controls, logotypes, or purely decorative text. see the solution section below for further in
formation. 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. this is because they don't see bright and dark areas as readily as those without such conditions, and therefore have trouble seein...
Custom properties (--*): CSS variables - CSS: Cascading Style Sheets
0000ff; --somecomplexvalue: 3px 6px rgb(20, 32, 54); <declaration-value> this value matches any sequence of one or more tokens, so long as the sequence does not contain an unallowed token. it represents the entirety of what a valid declaration can have as its value. note: custom property names are case sensitive — --my-color will be treated as a separate custom property to --my-color. ...
-moz-user-input - CSS: Cascading Style Sheets
element accepts user input. for textboxes, this is the default behavior. please note that this value is no longer supported in firefox 60 onwards (bug 1405087). disabled the element does not accept user input. however, this is not the same as setting disabled to true, in that the element is drawn normally. please note that this value is no longer supported in firefox 60 onwards (bug 1405087).
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax auto | none | enabled | disabled examples disabling user input for an element input.example { /* the user will be able to select the text, but not change it. */ -moz-user-input: disabled; } specifications not part of any standard. ...
-webkit-line-clamp - CSS: Cascading Style Sheets
lue */ -webkit-line-clamp: none; /* <integer> values */ -webkit-line-clamp: 3; -webkit-line-clamp: 10; /* global values */ -webkit-line-clamp: inherit; -webkit-line-clamp: initial; -webkit-line-clamp: unset; none this value specifies that the content wonʼt be clamped. <integer> this value specifies the number of lines after which the content will be clamped. it must be greater than 0.
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type
formal syntax none | <integer> examples truncating a paragraph html <p> in this example the <code>-webkit-line-clamp</code> property is set to <code>3</code>, which means the text is clamped after three lines. an ellipsis will be shown at the point where the tex...
-webkit-mask-attachment - CSS: Cascading Style Sheets
values */ -webkit-mask-attachment: inherit; -webkit-mask-attachment: initial; -webkit-mask-attachment: unset; syntax values scroll if scroll is specified, the mask image scrolls within the viewport along with the block that contains the mask image. fixed if fixed is specified, the mask image does not scroll with its containing element, instead remaining stationary within the viewport.
formal definition initial valuescrollapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax <attachment>#where <attachment> = scroll | fixed | local examples fixing a mask image to the viewport body { -webkit-mask-image: url('images/mask.png'); -webkit-mask-attachment: fixed; } specifications not part of any standard. ...
-webkit-mask-box-image - CSS: Cascading Style Sheets
ask image does not divide evenly into the border box. stretch the mask image is stretched to contain the border box exactly. round the mask image is stretched somewhat and repeated such that there is no partial mask image at the end of the border box. space the mask image is repeated as many times as possible without stretching. there is no partial mask image at the end of the border box.
formal definition value not found in db!
formal syntax syntax not found in db! examples setting an image .exampleone { -webkit-mask-box-image: url('mask.png'); } offsetting and filling an image .exampletwo { -webkit-mask-box-image: url('logo.png') 100 100 0 0 round round; } specifications not part of any standard. ...
-webkit-overflow-scrolling - CSS: Cascading Style Sheets
ntent immediately ceases to scroll when you remove your finger from the touchscreen. touch use momentum-based scrolling, where the content continues to scroll for a while after finishing the scroll gesture and removing your finger from the touchscreen. the speed and duration of the continued scrolling is proportional to how vigorous the scroll gesture was. also creates a new stacking context.
formal definition initial valueautoapplies toscrolling boxesinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax auto | touch examples html <div class="scroll-touch"> <p> this paragraph has momentum scrolling </p> </div> <div class="scroll-auto"> <p> this paragraph does not. </p> </div> css div { width: 100%; overflow: auto; } p { width: 200%; bac...
-webkit-print-color-adjust - CSS: Cascading Style Sheets
x the -webkit-print-color-adjust property is specified as one of the keyword values listed below. values economy normal behavior. background colors and images are only printed if the user explicitly allows it in their browser's print settings dialog. exact background colors and images of the element to which this rule is applied are always printed, user's print settings are overridden.
formal definition value not found in db!
formal syntax syntax not found in db! examples forcing white-on-black printing article { -webkit-print-color-adjust: exact; background: #222; color: #eee; } specifications not part of any standard, though there is a proposal in the csswg wiki to standardize it. ...
:-moz-focusring - CSS: Cascading Style Sheets
or should be drawn around it. if :-moz-focusring matches, then :focus also matches, but the converse is not always true: it depends on whether the user agent has focus ring drawing enabled and how the element was focused. whether the user agent has focus ring drawing enabled can depend on operating system settings and other factors, so the precise behavior of this pseudo-class will vary from plat
form to plat
form. this feature is not defined in any specification yet, though it was discussed in the working group and it was decided to add it to selectors 4 or 5. note: developers tend to use :-moz-focusring to differentiate between the focus state when the user focuses an element via a mouse click versus keyboard tabbing. it is also potentially useful if you are creating a custom element and y...
:-moz-submit-invalid - CSS: Cascading Style Sheets
the :-moz-submit-invalid css pseudo-class is a mozilla extension that represents any submit <button> on
forms whose contents aren't valid based on their validation constraints. by default, no style is applied. you can use this pseudo-class to customize the appearance of the submit button when there are invalid
form fields. syntax syntax not found in db! specifications not part of any standard. ...
:-moz-ui-invalid - CSS: Cascading Style Sheets
the :-moz-ui-invalid css pseudo-class represents any validated
form element whose value isn't valid based on their validation constraints, in certain circumstances. this pseudo-class is applied according to the following rules: if the control does not have focus, and the value is invalid, apply this pseudo-class. if the control has focus, and the value was valid (including empty) when it gained focus, do not apply the pseudo-class. if the control has focus, and the value was invalid when it gained focus, re-validate on every keystroke. if the element is required, the preceding rules apply only if the user has changed the value or attempted to submit the
form. the result is that if the control was valid when the user started interacting with it, the validity styling is change...
:-moz-ui-valid - CSS: Cascading Style Sheets
the :-moz-ui-valid css pseudo-class represents any validated
form element whose value validates correctly based on its validation constraints. this pseudo-class is applied according to the following rules: if the control does not have focus, and the value is valid, apply this pseudo-class. if the control has focus, and the value was valid (including empty) when it gained focus, apply this pseudo-class. if the control has focus, and the value was invalid when it gained focus, re-validate on every keystroke. if the element is required, the preceding rules apply only if the user has changed the value or attempted to submit the
form. the result is that if the control was valid when the user started interacting with it, the validity styling is changed only when the user shifts f...
::-webkit-file-upload-button - CSS: Cascading Style Sheets
the ::-webkit-file-upload-button css pseudo-element represents the button of an <input> of type="file". this pseudo-element is non-standard and only supported in webkit/blink compatible browsers like chrome, opera and safari (indicated by the -webkit prefix). syntax selector::-webkit-file-upload-button examples html <
form> <label for="fileupload">upload file</label><br> <input type="file" id="fileupload"> </
form> css input, label { display: block; } input[type=file]::-webkit-file-upload-button { border: 1px solid grey; background: #fffaaa; } below is the example for you to try. the screenshot to the left shows what the button will look like if you are without access to chrome, opera or safari. screenshotlive sample specifications not part of any standard. ...
::after (:after) - CSS: Cascading Style Sheets
in css, ::after creates a pseudo-element that is the last child of the selected element. it is often used to add cosmetic content to an element with the content property. it is inline by default. /* add an arrow after links */ a::after { content: "→"; } note: the pseudo-elements generated by ::before and ::after are contained by the element's
formatting box, and thus don't apply to replaced elements such as <img>, or to <br> elements. syntax /* css3 syntax */ ::after /* css2 syntax */ :after note: css3 introduced the ::after notation (with two colons) to distinguish pseudo-classes from pseudo-elements. browsers also accept :after, introduced in css2. examples simple usage let's create two classes: one for boring paragraphs and one for exciting ones. we can use these classes t...
::first-letter (:first-letter) - CSS: Cascading Style Sheets
-blend-mode all margin properties: margin, margin-top, margin-right, margin-bottom, margin-left all padding properties: padding, padding-top, padding-right, padding-bottom, padding-left all border properties: the shorthands border, border-style, border-color, border-width, border-radius, border-image, and the longhands properties the color property the text-decoration, text-shadow, text-trans
form, letter-spacing, word-spacing (when appropriate), line-height, text-decoration-color, text-decoration-line, text-decoration-style, box-shadow, float, vertical-align (only if float is none) css properties syntax /* css3 syntax */ ::first-letter /* css2 syntax */ :first-letter examples simple drop cap in this example we will use the ::first-letter pseudo-element to create a simple drop cap e...
::slotted() - CSS: Cascading Style Sheets
this only works when used inside css placed within a shadow dom. note also that this selector won't select a text node placed into a slot; it only targets actual elements. ...
:default - CSS: Cascading Style Sheets
the :default css pseudo-class selects
form elements that are the default in a group of related elements. what this selector matches is defined in html standard §4.16.3 pseudo-classes — it may match the <button>, <input type="checkbox">, <input type="radio">, and <option> elements: a default option element is the first one with the selected attribute, or the first enabled option in dom order. multiple <select>s can have more than one selected option, so all will match :default. <input type="checkbox"> and <input type="radio"> match if they have the checked attribute. <button> matches if it is a <
form>’s default submission button: the first <button> in dom order that belongs to the
form. this also applies to <input> types that submit
forms, like image or submit. syntax :default ...
:dir() - CSS: Cascading Style Sheets
:dir() will match the value calculated by the user agent, even if inherited. note: in html, the direction is determined by the dir attribute. other document types may have different methods. syntax the :dir() pseudo-class requires one parameter, representing the text directionality you want to target. parameters ltr target left-to-right elements. rtl target right-to-left elements. ...
:empty - CSS: Cascading Style Sheets
} result accessibility concerns assistive technology such as screen readers cannot parse interactive content that is empty. all interactive content must have an accessible name, which is created by providing a text value for the interactive control's parent element (anchors, buttons, etc.). accessible names expose the interactive control to the accessibility tree, an api that communicates in
formation useful for assistive technologies. the text that provides the interactive control's accessible name can be hidden using a combination of properties that remove it visually from the screen but keep it parseable by assistive technology. this is commonly used for buttons that rely solely on an icon to convey purpose. what is an accessible name? | the paciello group hidden content for bette...
:focus-visible - CSS: Cascading Style Sheets
a screen in a brightly lit space (like outside in the sun). wcag 2.1 sc 1.4.11 non-text contrast requires that the visual focus indicator be at least 3 to 1. accessible visual focus indicators: give your site some focus! tips for designing useful and usable focus indicators cognition it may not be obvious as to why the focus indicator is appearing and disappearing if a person is using mixed
forms of input. for users with cognitive concerns, or who are less technologically literate, this lack of consistent behavior for interactive elements may be confusing. specifications specification status comment selectors level 4the definition of ':focus-visible' in that specification. working draft initial definition. ...
:focus - CSS: Cascading Style Sheets
it is generally triggered when the user clicks or taps on an element or selects it with the keyboard's tab key. /* selects any <input> when focused */ input:focus { color: red; } note: this pseudo-class applies only to the focused element itself. use :focus-within if you want to select an element that contains a focused element. ...
:has() - CSS: Cascading Style Sheets
']'where <attr-matcher> = [ '~' | | | '^' | '$' | '*' ]? '='<attr-modifier> = i | s description the :has() pseudo-class takes a relative selector list as an argument. in earlier revisions of the css selectors level 4 specification, :has had a limitation that it couldn't be used within stylesheets. instead, it could only be used with functions like document.queryselector(); this was due to per
formance concerns. this limitation has been removed because no browser implemented it that way. instead, browsers currently only support the use of :has() within stylesheets. examples matching <a> elements that directly contain an <img> the following selector matches only <a> elements that directly contain an <img> child: a:has(> img) matching <h1> elements that are followed by a <p> the follow...
:lang() - CSS: Cascading Style Sheets
the :lang() css pseudo-class matches elements based on the language they are determined to be in. /* selects any <p> in english (en) */ p:lang(en) { quotes: '\201c' '\201d' '\2018' '\2019'; } note: in html, the language is determined by a combination of the lang attribute, the <meta> element, and possibly by in
formation from the protocol (such as http headers). for other document types there may be other document methods for determining the language. syntax
formal syntax :lang( <language-code> ) parameter <language-code> a <string> representing the language you want to target. acceptable values are specified in the html spec. examples in this example, the :lang() pseudo-class is used to match the parents of quote elements (<q>) using child combinators. note that this doesn't ...
:nth-last-child() - CSS: Cascading Style Sheets
even represents elements whose numeric position in a series of siblings is even: 2, 4, 6, etc., counting from the end. functional notation <an+b> represents elements whose numeric position in a series of siblings matches the pattern an+b, for every positive integer or zero value of n. the index of the first element, counting from the end, is 1. the values a and b must both be <integer>s. ...
:nth-last-of-type() - CSS: Cascading Style Sheets
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. see :nth-last-child for a more detailed explanation of its syntax. ...
:nth-of-type() - CSS: Cascading Style Sheets
lass 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. see :nth-child for a more detailed explanation of its syntax. ...
:optional - CSS: Cascading Style Sheets
the :optional css pseudo-class represents any <input>, <select>, or <textarea> element that does not have the required attribute set on it. /* selects any optional <input> */ input:optional { border: 1px dashed black; } this pseudo-class is useful for styling fields that are not required to submit a
form. note: the :required pseudo-class selects required
form fields. syntax :optional examples see :invalid for an example. accessibility concerns if a
form contains optional <input>s, required inputs should be indicated using the required attribute. this will ensure that people navigating with the aid of assistive technology such as a screen reader will be able to understand which inputs need valid content to ensure a successful
form submission. required inputs should also be indica...
:visited - CSS: Cascading Style Sheets
styles will be ignored. the alpha component of the element's non-:visited state will be used instead, except when that component is 0, in which case the style set in :visited will be ignored entirely. although these styles can be change the appearance of colors to the end user, the window.getcomputedstyle method will lie and always return the value of the non-:visited color. note: for more in
formation on these limitations and the reasons behind them, see privacy and the :visited selector. syntax :visited examples properties that would otherwise have no color or be transparent cannot be modified with :visited. of the properties that can be set with this pseudo-class, your browser probably has a default value for color and column-rule-color only. thus, if you want to modify the other p...
@charset - CSS: Cascading Style Sheets
t "iso-8859-15"; where: charset is a <string> denoting the character encoding to be used. it must be the name of a web-safe character encoding defined in the iana-registry, and must be double-quoted, following exactly one space character (u+0020), and immediately terminated with a semicolon. if several names are associated with an encoding, only the one marked with preferred must be used. ...
@counter-style - CSS: Cascading Style Sheets
d a non negative integer weight. the additive tuples must be specified in the descending order of their weights. speak-as describes how to read out the counter style in speech synthesizers, such as screen readers. for example, the value of the marker symbol can be read out as numbers or alphabets for ordered lists or as audio cues for unordered lists, based on the value of this descriptor. ...
@document - CSS: Cascading Style Sheets
r, you could try using this polyfill by @an-error94, which uses a combination of a user script, data-* attributes, and attribute selectors. note: there is a -moz-prefixed version of this property — @-moz-document. this has been limited to use only in user and ua sheets in firefox 59 in nightly and beta — an experiment designed to mitigate potential css injection attacks (see bug 1035091). ...
font-family - CSS: Cascading Style Sheets
the font-family css descriptor allows authors to specify the font family for the font specified in an @font-face rule. syntax /* <string> values */ font-family: "font family"; font-family: 'another font family'; /* <custom-ident> value */ font-family: examplefont; values <family-name> specifies the name of the font family.
formal definition related at-rule@font-faceinitial valuen/a (required)computed valueas specified
formal syntax <family-name>where <family-name> = <string> | <custom-ident>+ examples setting the font family name @font-face { font-family: examplefont; src: url('examplefont.ttf'); } specifications specification status comment css fonts module level 3the definition of 'font-family' in that specification. candidate recommend...
unicode-range - CSS: Cascading Style Sheets
t resources to be segmented so that a browser only needs to download the font resource needed for the text content of a particular page. for example, a site with many localizations could provide separate font resources for english, greek and japanese. for users viewing the english version of a page, the font resources for greek and japanese fonts wouldn't need to be downloaded, saving bandwidth.
formal definition related at-rule@font-faceinitial valueu+0-10ffffcomputed valueas specified
formal syntax <unicode-range># examples using a different font for a single character in this example we create a simple html containing a single <div> element, including an ampersand, that we want to style with a different font. to make it obvious, we will use a sans-serif font, helvetica, for the text,...
-ms-high-contrast - CSS: Cascading Style Sheets
m is placed in high contrast mode with any color variation. black-on-white indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with a black-on-white color variation. white-on-black indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with a white-on-black color variation.
formal syntax syntax not found in db! examples the following declarations will match applications that are being displayed in high contrast mode with any color variation, a black-on-white color variation, and a white-on-black color variation, respectively. @media screen and (-ms-high-contrast: active) { /* all high contrast styling rules */ } @media screen and (-ms-high-contrast: black-on-white)...
display-mode - CSS: Cascading Style Sheets
on, but can include other ui elements such as a status bar. minimal-ui minimal-ui the application will look and feel like a standalone application, but will have a minimal set of ui elements for controlling navigation. the elements will vary by browser. browser browser the application opens in a conventional browser tab or new window, depending on the browser and plat
form. (none) examples @media all and (display-mode: fullscreen) { body { margin: 0; border: 5px solid black; } } specifications specification status comment web app manifestthe definition of 'display-mode' in that specification. working draft initial definition. ...
grid - CSS: Cascading Style Sheets
esenting whether or not the ouput device is grid-based. examples html <p class="unknown">i don't know if you're using a grid device. :-(</p> <p class="bitmap">you are using a bitmap device.</p> <p class="grid">you are using a grid device! neato!</p> css :not(.unknown) { color: lightgray; } @media (grid: 0) { .unknown { color: lightgray; } .bitmap { color: red; text-trans
form: uppercase; } } @media (grid: 1) { .unknown { color: lightgray; } .grid { color: black; text-trans
form: uppercase; } } result specifications specification status comment media queries level 4the definition of 'grid' in that specification. candidate recommendation no change. media queriesthe definition of 'grid' in that specif...
hover - CSS: Cascading Style Sheets
the hover css media feature can be used to test whether the user's primary input mechanism can hover over elements. syntax the hover feature is specified as a keyword value chosen from the list below. none the primary input mechanism cannot hover at all or cannot conveniently hover (e.g., many mobile devices emulate hovering when the user per
forms an inconvenient long tap), or there is no primary pointing input mechanism. hover the primary input mechanism can conveniently hover over elements. examples html <a href="#">try hovering over me!</a> css @media (hover: hover) { a:hover { background: yellow; } } result specifications specification status comment media queries level 4the definition of 'hover' in that specification. candidate re...
prefers-reduced-data - CSS: Cascading Style Sheets
ata: no-preference)" crossorigin> <link rel="stylesheet" href="style.css"> </head> css @media (prefers-reduced-data: no-preference) { @font-face { font-family: montserrat; font-style: normal; font-weight: 400; font-display: swap; /* latin */ src: local('montserrat regular'), local('montserrat-regular'), url('fonts/montserrat-regular.woff2')
format('woff2'); unicode-range: u+0000-00ff, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da, u+02dc, u+2000-206f, u+2074, u+20ac, u+2122, u+2191, u+2193, u+2212, u+2215, u+feff, u+fffd; } } body { font-family: montserrat, -apple-system, blinkmacsystemfont, "segoe ui", roboto, helvetica, arial, "microsoft yahei", sans-serif, "apple color emoji", "segoe ui emoji", "segoe ui symbol"; } ...
update - CSS: Cascading Style Sheets
r severely underpowered devices. fast the layout may change dynamically according to the usual rules of css, and the output device is not unusually constrained in speed, so regularly-updating things like css animations can be used. example: computer screens. examples html <p>if this text animates for you, you are using a fast-updating device.</p> css @keyframes jiggle { from { trans
form: translatey(0); } to { trans
form: translatey(25px); } } @media (update: fast) { p { animation: 1s jiggle linear alternate infinite; } } result specifications specification status comment media queries level 4the definition of 'update' in that specification. candidate recommendation initial definition. ...
@namespace - CSS: Cascading Style Sheets
ssigned their proper namespaces (http://www.w3.org/2000/svg and http://www.w3.org/1998/math/mathml). note: in xml, unless a prefix is defined directly on an attribute (e.g., xlink:href), that attribute has no namespace. in other words, attributes do not inherit the namespace of the element they're on. to match this behaviour, the default namespace in css does not apply to attribute selectors. ...
bleed - CSS: Cascading Style Sheets
re enabled using the marks property. syntax /* keyword values */ bleed: auto; /* <length> values */ bleed: 8pt; bleed: 1cm; values auto computes to 6pt if the value of marks is crop. otherwise it computes to zero. <length> specifies by how far outward, in each direction, the bleed area extends past the page box. values may be negative, but there may be implementation-specific limits.
formal definition related at-rule@pageinitial valueautocomputed valueas specified
formal syntax auto | <length> examples setting a page bleed of 1cm @page { bleed: 1cm; } specifications specification status comment css paged media module level 3the definition of 'bleed' in that specification. working draft initial definition ...
marks - CSS: Cascading Style Sheets
align sheets. crop marks and cross marks are printed outside the page box. to have room to show crop and cross marks, the final pages will have to be somewhat bigger than the page box. syntax /* keyword values */ marks: none; marks: crop; marks: cross; marks: crop cross; values crop crop marks will be displayed. cross cross marks will be displayed. none no marks will be displayed.
formal definition related at-rule@pageinitial valuenonecomputed valueas specified
formal syntax none | [ crop | cross ] examples adding crop and cross marks @page { marks: crop cross; } specifications specification status comment css paged media module level 3the definition of 'marks' in that specification. working draft initial definition this css p...
@page - CSS: Cascading Style Sheets
roperties with @page. you can only change the margins, orphans, widows, and page breaks of the document. attempts to change any other css properties will be ignored. the @page at-rule can be accessed via the css object model interface csspagerule. note: the w3c is discussing how to handle viewport-related <length> units, vh, vw, vmin, and vmax. meanwhile do not use them within a @page at-rule. ...
user-zoom - CSS: Cascading Style Sheets
oom; user-zoom: fixed; syntax values zoom the user can zoom in or out. fixed the user cannot zoom in or out. accessibility concerns disabling zooming capabilities prevents people experiencing low vision conditions from being able to read and understand page content. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | understanding wcag 2.0
formal definition related at-rule@viewportinitial valuezoompercentagesrefer to the size of bounding boxcomputed valueas specified
formal syntax zoom | fixed examples disabling user zoom @viewport { user-zoom: fixed; } specifications specification status comment css device adaptationthe definition of '"user-zoom" descriptor' in that specification. working draft ...
viewport-fit - CSS: Cascading Style Sheets
the safe area inset variables to ensure that important content doesn't end up outside the display. this descriptor hasn't been added to https://github.com/mdn/data/blob/master/css/at-rules.json yet. accessibility concerns when using the viewport-fit descriptor, one must keep in mind that not all device displays are rectangular, and should therefore make use of the safe area inset variables.
formal definition related at-rule@viewportinitial valueautocomputed valueas specified
formal syntax auto | contain | cover examples scaling viewport to fit device display @viewport { viewport-fit: cover; } specifications specification status comment css round display level 1the definition of '"viewport-fit" descriptor' in that specification. working draft in...
@viewport - CSS: Cascading Style Sheets
hand descriptor for setting both min-height and max-height. zoom sets the initial zoom factor. min-zoom sets the minimum zoom factor. max-zoom sets the maximum zoom factor. user-zoom controls whether or not the user should be able to change the zoom factor. orientation controls the document's orientation. viewport-fit controls the display of the document on non-rectangular displays. ...
Adjacent sibling combinator - CSS: Cascading Style Sheets
the adjacent sibling combinator (+) separates two selectors and matches the second element only if it immediately follows the first element, and both are children of the same parent element. /* paragraphs that come immediately after any image */ img + p { font-weight: bold; } syntax
former_element + target_element { style properties } examples css li:first-of-type + li { color: red; } html <ul> <li>one</li> <li>two!</li> <li>three</li> </ul> result specifications specification status comment selectors level 4the definition of 'next-sibling combinator' in that specification. working draft renames it the "next-sibling" combinator. selectors level 3the definition of 'adjacent sibling combinator' in that specification. recomme...
CSS Animations tips and tricks - CSS: Cascading Style Sheets
; background-color: darkgreen; font: 14px "open sans", "arial", sans-serif; } @keyframes colorchange { 0% { background: yellow } 100% { background: blue } } .box { width: 100px; height: 100px; border: 1px solid black; } .changing { animation: colorchange 2s; } there are two classes here. the "box" class is the basic description of the box's appearance, without any animation in
formation included. the animation details are included in the "changing" class, which says that the @keyframes named "colorchange" should be used over the course of two seconds to animate the box. note that because of this, the box doesn't start with any animation effects in place, so it won't be animating. javascript content next we'll look at the javascript that does the work. the meat of this te...
Mastering margin collapsing - CSS: Cascading Style Sheets
avior known as margin collapsing. note that the margins of floating and absolutely positioned elements never collapse. margin collapsing occurs in three basic cases: adjacent siblings the margins of adjacent siblings are collapsed (except when the latter sibling needs to be cleared past floats). no content separating parent and descendants if there is no border, padding, inline part, block
formatting context created, or clearance to separate the margin-top of a block from the margin-top of one or more of its descendant blocks; or no border, padding, inline content, height, min-height, or max-height to separate the margin-bottom of a block from the margin-bottom of one or more of its descendant blocks, then those margins collapse. the collapsed margin ends up outside the parent. empty b...
Basic Concepts of Multicol - CSS: Cascading Style Sheets
olumns on the .container element. the content, including the children of .container is then split between the three columns. in the above example the content is wrapped in paragraph p tags with default styling. therefore, there is a margin above each paragraph. you can see how this margin causes the first line of text to be pushed down. this is because a multicol container creates a new block
formatting context (bfc) which means margins on child elements do not collapse with any margin on the container. the column-width property the column-width property is used to set the optimal width for every column box. if you declare a column-width, the browser will work out how many columns of that width will fit into the multicol container and distribute any extra space equally between the column...
Descendant combinator - CSS: Cascading Style Sheets
s parent's parent, etc) element matching the first selector. selectors that utilize a descendant combinator are called descendant selectors. /* list items that are descendants of the "my-things" list */ ul.my-things li { margin: 2em; } the descendant combinator is technically one or more css white space characters — the space character and/or one of four control characters: carriage return,
form feed, new line, and tab characters — between two selectors in the absence of another combinator. additionally, the white space characters of which the combinator is comprised may contain any number of css comments. syntax selector1 selector2 { /* property declarations */ } examples css li { list-style-type: disc; } li li { list-style-type: circle; } html <ul> <li> <div>item...
General sibling combinator - CSS: Cascading Style Sheets
the general sibling combinator (~) separates two selectors and matches the second element only if it follows the first element (though not necessarily immediately), and both are children of the same parent element. /* paragraphs that are siblings of and subsequent to any image */ img ~ p { color: red; } syntax
former_element ~ target_element { style properties } examples css p ~ span { color: red; } html <span>this is not red.</span> <p>here is a paragraph.</p> <code>here is some code.</code> <span>and here is a red span!</span> <code>more code...</code> <span>and this is a red span!</span> result specifications specification status comment selectors level 4the definition of 'subsequent-sibling combinator' in that specification. working dra...
Center an element - CSS: Cascading Style Sheets
other. centering both horizontally and vertically was difficult before flexbox, with the box alignment properties it is now straightforward. requirements to place an item into the center of another box horizontally and vertically. recipe download this example choices made to center one box inside another we make the containing box a flex container. then set align-items to center to per
form centering on the block axis, and justify-content to center to per
form centering on the inline axis. in the future we may be able to center elements without needing to turn the parent into a flex container, as the box alignment properties used here are specified to apply to block layout too. however, support is currently limited for box alignment properties on block layout, so currently centering...
Cookbook template - CSS: Cascading Style Sheets
description of the problem this recipe solves or the pattern you are demonstrating. requirements what does this pattern need to include, or what problems does it need to solve? list that here. recipe change the path to the example below to point to your merged example. the last parameter is the live example height, which you can change as needed. change the link to point to your merged download version. ...
Grid wrapper - CSS: Cascading Style Sheets
accessibility concerns although grid enables us to position items anwhere (within reason), it is important when placing items using css grid that your underlying markup follows a logical order (see css grid layout and accessibility for more d...
CSS Layout cookbook - CSS: Cascading Style Sheets
tion links to pages of content (such as search results). flexbox, box alignment card a card component, which displays in a grid of cards. grid layout grid wrapper for aligning grid content within a central wrapper, while also allowing items to break out. css grid contribute a recipe as with all of mdn we would love you to contribute a recipe in the same
format as the ones shown above. see this page for a template and guidelines for writing your own example. ...
Testing media queries programmatically - CSS: Cascading Style Sheets
// ... } // run the orientation change handler once. handleorientationchange(mediaquerylist); // add the callback function as a listener to the query list. mediaquerylist.addlistener(handleorientationchange); this code creates the orientation-testing media query list, then adds an event listener to it. after adding the listener, we also call the listener directly. this makes our listener per
form adjustments based on the current device orientation; otherwise, our code might assume the device is in portrait mode at startup, even if it's actually in landscape mode. the handleorientationchange() function would look at the result of the query and handle whatever we need to do on an orientation change: function handleorientationchange(evt) { if (evt.matches) { /* the viewport is curren...
Using media queries - CSS: Cascading Style Sheets
y unless and until the result of the query changes to true. 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. all suitable for all devices. print intended for paged material and documents viewed on a screen in print preview mode. (please see paged media for in
formation about
formatting issues that are specific to these
formats.) screen intended primarily for screens. speech intended for speech synthesizers. 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. the aural type has been rep...
Privacy and the :visited selector - CSS: Cascading Style Sheets
before about 2010, the css :visited selector allowed websites to uncover a user's browsing history and figure out what sites the user had visited. this was done through window.getcomputedstyle and other techniques. this process was quick to execute, and made it possible not only to determine where the user had been on the web, but could also be used to guess a lot of in
formation about the user's identity. to mitigate this problem, browsers have limited the amount of in
formation that can be obtained from visited links. little white lies to preserve users' privacy, firefox and other browsers will lie to web applications under certain circumstances: the window.getcomputedstyle method, and similar functions such as element.queryselector, will always return values indicating that a user has ...
Pseudo-classes - CSS: Cascading Style Sheets
color when the user's pointer hovers over it. /* any button over which the user's pointer is hovering */ button:hover { color: blue; } pseudo-classes let you apply a style to an element not only in relation to the content of the document tree, but also in relation to external factors like the history of the navigator (:visited, for example), the status of its content (like :checked on certain
form elements), or the position of the mouse (like :hover, which lets you know if the mouse is over an element or not). note: in contrast to pseudo-classes, pseudo-elements can be used to style a specific part of an element. syntax selector:pseudo-class { property: value; } like regular classes, you can chain together as many pseudo-classes as you want in a selector. index of standard pseudo...
Pseudo-elements - CSS: Cascading Style Sheets
a css pseudo-element is a keyword added to a selector that lets you style a specific part of the selected element(s). for example, ::first-line can be used to change the font of the first line of a paragraph. /* the first line of every <p> element. */ p::first-line { color: blue; text-trans
form: uppercase; } note: in contrast to pseudo-elements, pseudo-classes can be used to style an element based on its state. syntax selector::pseudo-element { property: value; } you can use only one pseudo-element in a selector. it must appear after the simple selectors in the statement. note: as a rule, double colons (::) should be used instead of a single colon (:). this distinguishes pseudo-classes from pseudo-elements. however, since this distinction was not present in older versions of th...
Cubic Bezier Generator - CSS: Cascading Style Sheets
<html> <canvas id="bezier" width="336" height="336"> </canvas> <
form> <label for="x1">x1 = </label><input onchange="updatecanvas();" type="text" maxlength=6 id="x1" value="0.79" class='field'> <label for="y1">y1 = </label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="y1" value="0.33" class='field'> <label for="x2">x2 = </label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="x2" value="0.14" class='field'> <label for="y2">y2 = </label><input onchange="updatecanvas();return true;" type="text" maxlength=6 id="y2" value="0.53" class='field'> <br> <output id="output">log</output> </
form> </html> .field { width: 40px; } function updatecanvas() { var x1 =...
Tools - CSS: Cascading Style Sheets
ful tools that will help you build the css to style your content using these features. cubic bezier generatorthis is a sample tool; it lets you edit bezier curves. ...
CSS Tutorials - CSS: Cascading Style Sheets
pages is an easy task in css. learn to use counter-reset, counter-increment, counters(), and counter(). css animations css3 animations allow you to define configurations of style, as keyframes, and to transition between them defining an animation. css transitions css3 transitions allow you to define an animation between several styles and to control the way this transition happens. css trans
forms trans
forms allow you to change the position of elements by modifying their coordinate space: it allows for translating, rotating, and de
forming them in the 2d or 3d spaces. css gradients gradients are images that transition smoothly from one color to another. there are several types of gradients allowed in css: linear or radial, repeating or not. this tutorial describes how to use them. adv...
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
ound-color: var(--my-var, var(--my-background, pink)); /* pink if --my-var and --my-background are not defined */ } .three { background-color: var(--my-var, --my-background, pink); /* invalid: "--my-background, pink" */ } including a custom property as a fallback, as seen in the second example above, is the correct way to provide more than one fallback. the technique has been seen to cause per
formance issues as it takes more time to parse through the variables. note: the syntax of the fallback, like that of custom properties, allows commas. for example, var(--foo, red, blue) defines a fallback of red, blue — anything between the first comma and the end of the function is considered a fallback value. validity and values the classical css concept of validity, tied to each property, is...
<angle> - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax the <angle> data type consists of a <number> followed by one of the units listed below. as with all dimensions, there is no space between the unit literal and the number. the angle unit is optional after the number 0. ...
animation-duration - CSS: Cascading Style Sheets
ion should occur. note: negative values are invalid, causing the declaration to be ignored. some early, prefixed, implementations may consider them as identical to 0s. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more in
formation, see setting multiple animation property values.
formal definition initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax <time># examples see css animations for examples. specifications specification status comment css animationsthe definition of 'animation-dura...
animation-iteration-count - CSS: Cascading Style Sheets
repeat; this is 1 by default. you may specify non-integer values to play part of an animation cycle: for example, 0.5 will play half of the animation cycle. negative values are invalid. note: when you specify multiple values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more in
formation, see setting multiple animation property values.
formal definition initial value1applies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax <single-animation-iteration-count>#where <single-animation-iteration-count> = infinite | <number> examples see css animations for examples. specifications specif...
animation-name - CSS: Cascading Style Sheets
dash character must be a letter. also, two dashes are forbidden at the beginning of the identifier. furthermore, the identifier can't be none, unset, initial, or inherit. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more in
formation, see setting multiple animation property values.
formal definition initial valuenoneapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax [ none | <keyframes-name> ]#where <keyframes-name> = <custom-ident> | <string> examples see css animations for examples. specifications specification statu...
animation-play-state - CSS: Cascading Style Sheets
inherit; animation-play-state: initial; animation-play-state: unset; values running the animation is currently playing. paused the animation is currently paused. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more in
formation, see setting multiple animation property values.
formal definition initial valuerunningapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax <single-animation-play-state>#where <single-animation-play-state> = running | paused examples see css animations for examples. specifications specification...
attr() - CSS: Cascading Style Sheets
en value is used as a length, attr() computes it to an absolute length. leading and trailing spaces are stripped. 0%, or, if 0% is not a valid value for the property, the property's minimum value. <fallback> the value to be used if the associated attribute is missing or contains an invalid value. if not set, css will use the default value defined for each <type-or-unit>. ...
border-spacing - CSS: Cascading Style Sheets
defines both the horizontal and vertical spacings between cells. when two <length> values are specified, the first value defines the horizontal spacing between cells (i.e., the space between cells in adjacent columns), and the second value defines the vertical spacing between cells (i.e., the space between cells in adjacent rows). values <length> the size of the spacing as a fixed value.
formal definition initial value0applies totable and inline-table elementsinheritedyescomputed valuetwo absolute lengthsanimation typediscrete
formal syntax <length> <length>? examples spacing and padding table cells this example applies a spacing of .5em vertically and 1em horizontally between a table's cells. note how, along its outside edges, the table's padding values are added to its border-...
box-sizing - CSS: Cascading Style Sheets
: 350px; border: 10px solid black;} renders a box that is 350px wide, with the area for content being 330px wide. the content box can't be negative and is floored to 0, making it impossible to use border-box to make the element disappear. here the dimensions of the element are calculated as: width = border + padding + width of the content, and height = border + padding + height of the content.
formal definition initial valuecontent-boxapplies toall elements that accept width or heightinheritednocomputed valueas specifiedanimation typediscrete
formal syntax content-box | border-box examples box sizes with content-box and border-box this example shows how different box-sizing values alter the rendered size of two otherwise identical elements. html <div class="content-box">content box<...
column-count - CSS: Cascading Style Sheets
it; column-count: initial; column-count: unset; values auto the number of columns is determined by other css properties, such as column-width. <integer> is a strictly positive <integer> describing the ideal number of columns into which the content of the element will be flowed. if the column-width is also set to a non-auto value, it merely indicates the maximum allowed number of columns.
formal definition initial valueautoapplies toblock containers except table wrapper boxesinheritednocomputed valueas specifiedanimation typean integer
formal syntax <integer> | auto examples splitting a paragraph across three columns html <p class="content-box"> this is a bunch of text split into three columns using the css `column-count` property. the text is equally distributed over the c...
column-fill - CSS: Cascading Style Sheets
the room it needs, this may result in some columns remaining empty. balance content is equally divided between columns. in fragmented contexts, such as paged media, only the last fragment is balanced. therefore in paged media, only the last page would be balanced. balance-all content is equally divided between columns. in fragmented contexts, such as paged media, all fragments are balanced.
formal definition initial valuebalanceapplies tomulticol elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax auto | balance | balance-all examples splitting text evenly across columns html <p class="content-box"> this is a bunch of text split into multiple columns. the css `column-fill` property is used to spread the contents evenly across all the columns. ...
column-rule-style - CSS: Cascading Style Sheets
-rule-style: inset; column-rule-style: outset; /* global values */ column-rule-style: inherit; column-rule-style: initial; column-rule-style: unset; the column-rule-style property is specified as a single <'border-style'> value. values <'border-style'> is a keyword defined by border-style describing the style of the rule. the styling must be interpreted as in the collapsing border model.
formal definition initial valuenoneapplies tomulticol elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax <'border-style'> examples setting a dashed column rule html <p>this is a bunch of text split into three columns. the `column-rule-style` property is used to change the style of the line that is drawn between columns. don't you think that's wonderful?</...
column-rule-width - CSS: Cascading Style Sheets
-width: 1px; column-rule-width: 2.5em; /* global values */ column-rule-width: inherit; column-rule-width: initial; column-rule-width: unset; the column-rule-width property is specified as a single <'border-width'> value. values <'border-width'> is a keyword defined by border-width describing the width of the rule. it may be either a <length> or one of the thin, medium, or thick keywords.
formal definition initial valuemediumapplies tomulticol elementsinheritednocomputed valuethe absolute length; 0 if the column-rule-style is none or hiddenanimation typea length
formal syntax <'border-width'> examples setting a thick column rule html <p>this is a bunch of text split into three columns. the `column-rule-width` property is used to change the width of the line that is drawn b...
column-span - CSS: Cascading Style Sheets
column is called a spanning element. syntax the column-span property is specified as one of the keyword values listed below. values none the element does not span multiple columns. all the element spans across all columns. content in the normal flow that appears before the element is automatically balanced across all columns before the element appears. the element establishes a new block
formatting context.
formal definition initial valuenoneapplies toin-flow block-level elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax none | all examples making a heading span columns in this example, the heading is made to span across all the columns of the article. html <article> <h2>header spanning all of the columns</h2> <p> the h2 should span al...
counter() - CSS: Cascading Style Sheets
the name cannot start with two dashes and can't be none, unset, initial, or inherit. <counter-style> a counter style name or symbols() function, where a counter style name is a numeric, alphabetic, or symbolic simple predefined counter style, a complex longhand east asian or ethiopic predefined counter style, or other predefined counter style. ...
direction - CSS: Cascading Style Sheets
alues */ direction: ltr; direction: rtl; /* global values */ direction: inherit; direction: initial; direction: unset; values ltr text and other elements go from left to right. this is the default value. rtl text and other elements go from right to left. for the direction property to have any effect on inline-level elements, the unicode-bidi property's value must be embed or override.
formal definition initial valueltrapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax ltr | rtl examples setting right-to-left direction blockquote { direction: rtl; } specifications specification status comment css writing modes module level 3the definition of 'direction' in that specification. proposed recommendat...
<display-internal> - CSS: Cascading Style Sheets
n> html elements. ruby-base these elements behave like <rb> html elements. ruby-text these elements behave like <rt> html elements. ruby-base-container these elements behave like <rbc> html elements generated as anonymous boxes. ruby-text-container these elements behave like <rtc> html elements. examples css tables example the following example demonstrates laying out a simple
form using css table layout. html <main> <div> <label for="name">name</label> <input type="text" id="name" name="name"> </div> <div> <label for="age">age</label> <input type="text" id="age" name="age"> </div> </main> css main { display: table; } div { display: table-row; } label, input { display: table-cell; margin: 5px; } result specifications speci...
element() - CSS: Cascading Style Sheets
art of the background. <div style="width:400px; height:400px; background:-moz-element(#mybackground1) no-repeat;"> <p>this box uses the element with the #mybackground1 id as its background!</p> </div> <div style="overflow:hidden; height:0;"> <div id="mybackground1" style="width:1024px; height:1024px; background-image: linear-gradient(to right, red, orange, yellow, white);"> <p style="trans
form-origin:0 0; trans
form: rotate(45deg); color:white;">this text is part of the background. cool, huh?</p> </div> </div> the <div> element with the id "mybackground1" is used as the background for the content including the paragraph "this box uses the element with the #mybackground1 id as its background!". a somewhat more bizarre example this example uses a hidden <button> element in a repeat...
env() - CSS: Cascading Style Sheets
that define a rectangle by its top, right, bottom, and left insets from the edge of the viewport, which is safe to put content into without risking it being cut off by the shape of a non‑rectangular display. for rectangular viewports, like your average laptop monitor, their value is equal to zero. for non-rectangular displays — like a round watch face — the four values set by the user agent
form a rectangle such that all content inside the rectangle is visible. note: unlike other css properties, user agent-defined property names are case-sensitive.
formal syntax env( <custom-ident> , <declaration-value>? ) examples the below example makes use of the optional second parameter of env(), which allows you to provide a fallback value in case the environment variable is not available. <...
drop-shadow() - CSS: Cascading Style Sheets
ples and send us a pull request. a drop shadow is effectively a blurred, offset version of the input image's alpha mask, drawn in a specific color and composited below the image. note: this function is somewhat similar to the box-shadow property. the box-shadow property creates a rectangular shadow behind an element's entire box, while the drop-shadow() filter function creates a shadow that con
forms to the shape (alpha channel) of the image itself. syntax drop-shadow(offset-x offset-y blur-radius color) the drop-shadow() function accepts a parameter of type <shadow> (defined in the box-shadow property), with the exception that the inset keyword and spread parameters are not allowed. parameters offset-x offset-y (required) two <length> values that determine the shadow offset. offset...
opacity() - CSS: Cascading Style Sheets
>. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: this function is similar to the more established opacity property. the difference is that with filters, some browsers provide hardware acceleration for better per
formance. syntax opacity(amount) parameters amount the amount of the conversion, specified as a <number> or a <percentage>. a value of 0% is completely transparent, while a value of 100% leaves the input unchanged. values between 0% and 100% are linear multipliers on the effect. the lacuna value for interpolation is 1. examples opacity(0%) /* completely transparent */ opacity(50%) /* 50%...
fit-content() - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the function can be used as a track size in css grid properties, where the maximum size is defined by max-content and the minimum size by auto, which is calculated similar to auto (i.e., minmax(auto, max-content)), except that the track size is clamped at argument if it is greater than the auto minimum. ...
flex-grow - CSS: Cascading Style Sheets
flex items' sizes together. if all sibling items have the same flex grow factor, then all items will receive the same share of remaining space, otherwise it is distributed according to the ratio defined by the different flex grow factors. flex-grow is used alongside the other flex properties flex-shrink and flex-basis, and normally defined using the flex shorthand to ensure all values are set.
formal definition initial value0applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number
formal syntax <number> examples setting flex item grow factor html <h4>this is a flex-grow</h4> <h5>a,b,c and f are flex-grow:1 . d and e are flex-grow:2 .</h5> <div id="content"> <div class="box" style="background-color:red;">a</div> <div class...
flex-shrink - CSS: Cascading Style Sheets
ive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <number> values */ flex-shrink: 2; flex-shrink: 0.6; /* global values */ flex-shrink: inherit; flex-shrink: initial; flex-shrink: unset; the flex-shrink property is specified as a single <number>. values <number> see <number>. negative values are invalid. defaults to 1.
formal definition initial value1applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number
formal syntax <number> examples setting flex item shrink factor html <p>the width of content is 500px; the flex-basis of the flex items is 120px.</p> <p>a, b, c have flex-shrink:1 set. d and e have flex-shrink:2 set</p> <p>the width of d and e is le...
font-optical-sizing - CSS: Cascading Style Sheets
scription optical sizing is enabled by default for fonts that have an optical size variation axis. the optical size variation axis is represented by opsz in font-variation-settings. when optical sizing is used, small text sizes are often rendered with thicker strokes and larger serifs, whereas larger text is often rendered more delicately with more contrast between thicker and thinner strokes.
formal definition initial valueautoapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete
formal syntax auto | none examples disabling optical sizing <p class="optical-sizing">this paragraph is optically sized. this is the default across browsers.</p> <p class="no-optical-sizing">this paragraph is not optically si...
ident - CSS: Cascading Style Sheets
the syntax of <custom-ident> is similar to css identifiers (such as property names), except that it is case-sensitive. it consists of one or more characters, where characters can be any of the following: any alphabetical character (a to z, or a to z), any decimal digit (0 to 9), a hyphen (-), an underscore (_), an escaped character (preceded by a backslash, \), a unicode character (in the
format of a backslash, \, followed by one to six hexadecimal digits, representing its unicode code point) note that id1, id1, id1 and id1 are all different identifiers as they are case-sensitive. on the other hand, as there are several ways to escape a character, toto\? and toto\3f are the same identifiers. examples valid identifiers nono79 a mix of alphanumeric characters and numbers groun...
image-rendering - CSS: Cascading Style Sheets
s. pixelated when scaling the image up, the nearest-neighbor algorithm must be used, so that the image appears to be composed of large pixels. when scaling down, this is the same as auto. note: the values optimizequality and optimizespeed present in an early draft (and coming from its svg counterpart image-rendering) are defined as synonyms for the smooth and pixelated values respectively.
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax auto | crisp-edges | pixelated examples setting image scaling algorithms in practical use, the pixelated and crisp-edges rules can be combined to provide some fallback for each other. (just prepend the actual rules with the fallback.) the canvas api can provide a fal...
image-set() - CSS: Cascading Style Sheets
mples background-image: image-set( "cat.png" 1x, "cat-2x.png" 2x, "cat-print.png" 600dpi); this example shows how to use image-set() to provide two alternative background-image options, chosen depending on the resolution needed: a normal version and a high-resolution version. accessibility concerns browsers do not provide any special in
formation on background images to assistive technology. this is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. if the image contains in
formation critical to understanding the page's overall purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations unders...
Inheritance - CSS: Cascading Style Sheets
unless a user stylesheet exists, in which case that is used instead. then it doubles the font size and applies a font-weight of "bold". see also css values for controlling inheritance: inherit, initial, unset, and revert introducing the css cascade cascade and inheritance css key concepts: css syntax, at-rule, comments, specificity and inheritance, the box, layout modes and visual
formatting models, and margin collapsing, or the initial, computed, resolved, specified, used, and actual values. definitions of value syntax, shorthand properties and replaced elements. ...
Initial value - CSS: Cascading Style Sheets
lied. for non-inherited properties, the initial value is used on all elements, as long as no specified value is supplied. you can explicitly specify the initial value by using the initial keyword. note: the initial value should not be confused with the value specified by the browser's style sheet. specifications specification status comment css cascade 4
formal definition. css level 2 (revision 1)the definition of 'initial value' in that specification. recommendation implicit definition. ...
line-height-step - CSS: Cascading Style Sheets
-step css property sets the step unit for line box heights. when the property is set, line box heights are rounded up to the closest multiple of the unit. /* point values */ line-height-step: 18pt; syntax the line-height-step property is specified as any one of the following: a <length>. values <length> the specified <length> is used in the calculation of the line box height step.
formal definition initial value0applies toblock containersinheritedyescomputed valueabsolute <length>animation typediscrete
formal syntax <length> examples setting step unit for line box height in the following example, the height of line box in each paragraph is rounded up to the step unit. the line box in <h1> does not fit into one step unit and thus occupies two, but it is still centered with...
mask-border-mode - CSS: Cascading Style Sheets
blending mode used in a mask border. syntax /* keyword values */ mask-border-mode: luminance; mask-border-mode: alpha; /* global values */ mask-border-mode: inherit; mask-border-mode: initial; mask-border-mode: unset; values luminance the luminance values of the mask border image are used as the mask values. alpha the alpha values of the mask border image are used as the mask values.
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 fo...
mask-border-outset - CSS: Cascading Style Sheets
lues are specified, the first outset applies to the top, the second to the left and right, the third to the bottom. when four values are specified, the outsets apply to the top, right, bottom, and left in that order (clockwise). values <length> the size of the mask border outset as a dimension. <number> the size of the mask border outset as a multiple of the corresponding border-width.
formal definition initial value0applies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete
formal syntax [ <length> | <number> ]{1,4} examples basic usage this property doesn't appear to be supported anywhere yet. when it...
mask-border-repeat - CSS: Cascading Style Sheets
he gap between each border. tiles may be clipped to achieve the proper fit. round the source image's edge regions are tiled (repeated) to fill the gap between each border. tiles may be stretched to achieve the proper fit. space the source image's edge regions are tiled (repeated) to fill the gap between each border. extra space will be distributed in between tiles to achieve the proper fit.
formal definition initial valuestretchapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax [ stretch | repeat | round | space ]{1,2} examples basic usage this property doesn't appear to be supported anywhere yet. when it eventually starts to be supported, it w...
max() - CSS: Cascading Style Sheets
on can be values combining the addition ( + ), subtraction ( - ), multiplication ( * ) and division ( / ) operators, using standard operator precedence rules. make sure to put a space on each side of the + and - operands. the operands in the expression may be any <length> syntax value. you can (and often need to) combine min() and max() values, or use max() within a clamp() or calc() function. ...
minmax() - CSS: Cascading Style Sheets
or. max-content represents the largest max-content contribution of the grid items occupying the grid track. min-content represents the largest min-content contribution of the grid items occupying the grid track. auto as a maximum, identical to max-content. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. ...
order - CSS: Cascading Style Sheets
ing with the aid of assistive technology such as a screen reader. if the visual (css) order is important, then screen reader users will not have access to the correct reading order. 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. the flexible box layout module automatically creates blocks of equal vertica...
orphans - CSS: Cascading Style Sheets
; /* global values */ orphans: inherit; orphans: initial; orphans: unset; in typography, an orphan is the first line of a paragraph that appears alone at the bottom of a page. (the paragraph continues on a following page.) syntax values <integer> the minimum number of lines that can stay by themselves at the bottom of a fragment before a fragmentation break. the value must be positive.
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. it is used to demonstrate how orphans work...
Guide to scroll anchoring - CSS: Cascading Style Sheets
ails some suppression triggers, which will disable scroll anchoring in places where it might be problematic. if any of the triggers happen on the anchor node, or an ancestor of it, anchoring is suppressed. these suppression triggers are changes to the computed value of any of the following properties: top, left, right, or bottom margin or padding any width or height-related properties trans
form additionally, position changes anywhere inside the scrolling box also disable scroll anchoring. in bug 1584285 the layout.css.scroll-anchoring.suppressions.enabled flag was added to firefox nightly in order to allow the disabling of these triggers further reading explainer document on the wicg site scroll anchoring for web developers on the chromium blog implement a pin-to-bottom scrol...
overflow-anchor - CSS: Cascading Style Sheets
ring in a document or part of a document and need to turn the behavior off. syntax /* keyword values */ overflow-anchor: auto; overflow-anchor: none; /* global values */ overflow-anchor: inherit; overflow-anchor: initial; overflow-anchor: unset; values auto the element becomes a potential anchor when adjusting scroll position. none the element won't be selected as a potential anchor.
formal definition initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax auto | none examples prevent scroll anchoring to prevent scroll anchoring in a document, use the overflow-anchor property. body { overflow-anchor: none; } specifications specification status comment css scroll anchoring module lev...
overflow-wrap - CSS: Cascading Style Sheets
ties introduced by the word break are considered when calculating min-content intrinsic sizes. break-word the same as the anywhere value, with normally unbreakable words allowed to be broken at arbitrary points if there are no otherwise acceptable break points in the line, but soft wrap opportunities introduced by the word break are not considered when calculating min-content intrinsic sizes.
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. html <p>they say the fishing is excellent at lake...
overscroll-behavior-block - CSS: Cascading Style Sheets
scroll overflow behavior occurs as normal. contain default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented.
formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax contain | none | auto examples preventing block overscrolling in this demo we have two block-level boxes, one inside the other. the outer box has a large height set on it so the page will scroll vertically. ...
overscroll-behavior-inline - CSS: Cascading Style Sheets
scroll overflow behavior occurs as normal. contain default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented.
formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax contain | none | auto examples preventing inline overscrolling in this demo we have two block-level boxes, one inside the other. the outer box has a large width set on it so the page will scroll horizontally...
pointer-events - CSS: Cascading Style Sheets
ined control (than just auto and none) in html for which parts of an element will cause it to "catch" pointer events, and when. to help us in deciding how pointer-events should be further extended for html, if you have any particular things that you would like to be able to do with this property, then please add them to the use cases section of this wiki page (don't worry about keeping it tidy).
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax auto | none | visiblepainted | visiblefill | visiblestroke | visible | painted | fill | stroke | all | inherit examples disabling pointer events on all images this example disables pointer events (clicking, dragging, hovering, etc.) on all images. img { pointer-e...
quotes - CSS: Cascading Style Sheets
produce no quotation marks. auto appropriate quote marks will be used for whatever language value is set on the selected elements (i.e. via the lang attribute). [<string> <string>]+ one or more pairs of <string> values for open-quote and close-quote. the first pair represents the outer level of quotation, the second pair is for the first nested level, next pair for third level and so on.
formal definition initial valuedepends on user agentapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax none | auto | [ <string> <string> ]+ examples basic quote marks html <q>to be or not to be. that's the question!</q> css q { quotes: '"' '"' "'" "'"; } q::before { content: open-quote; } q::after { content: close-quote; } result auto q...
radial-gradient() - CSS: Cascading Style Sheets
interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* a gradient at the center of its container, starting red, changing to blue, and finishing green */ radial-gradient(circle at center, red 0, blue, green 100%) values <position> the position of the gradient, interpreted in the same way as background-position or trans
form-origin. if unspecified, it defaults to center. <shape> the gradient's shape. the value can be circle (meaning that the gradient's shape is a circle with constant radius) or ellipse (meaning that the shape is an axis-aligned ellipse). if unspecified, it defaults to ellipse. <extent-keyword> a keyword describing how big the ending shape must be. the possible values are: keyword ...
<ratio> - CSS: Cascading Style Sheets
<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>. in addition a single <number> as a value is allowable. examples use in a media query @media screen and (min-aspect-ratio: 16/9) { ... } common aspect ratios ratio usage 4/3 traditional tv
format in the 20th century. 16/9 modern "widescreen" tv
format. 185/100 = 91/50 the most common movie
format since the 1960s. 239/100 "widescreen," anamorphic movie
format. specifications specification status comment media queries level 4the definition of '<ratio>' in that specification. candidate recommendati...
repeating-linear-gradient() - CSS: Cascading Style Sheets
defining how the gradient progresses between adjacent color stops. the length defines at which point between two color stops the gradient color should reach the midpoint of the color transition. if omitted, the midpoint of the color transition is the midpoint between two color stops. note: rendering of color stops in css gradients follows the same rules as color stops in svg gradients. ...
scroll-snap-align - CSS: Cascading Style Sheets
is axis. end the end alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis. center the center alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis. safari currently has the two value syntax in the wrong order, the first value being inline the second block. see bug #191865.
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax [ none | start | end | center ]{1,2} specifications specification status comment css scroll snap module level 1the definition of 'scroll-snap-align' in that specification. candidate recommendation initial definition ...
scroll-snap-stop - CSS: Cascading Style Sheets
-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. always the scroll container must not "pass over" a possible snap position; and must snap to the first of this elements' snap positions.
formal definition initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax normal | always examples snapping in different axes this example is duplicated from scroll-snap-type with minor variances. css /* setup */ :root, body { height: 100%; display: flex; align-items: center; justify-content: space-between; flex-flow: column ...
scroll-snap-type-x - CSS: Cascading Style Sheets
or resized the scroll offset will be adjusted to maintain the resting on that snap point. proximity the visual viewport of this scroll container may come to rest on a snap point if it isn't currently scrolled horizontally considering the user agent's scroll parameters. if content is added, moved, deleted or resized the scroll offset may be adjusted to maintain the resting on that snap point.
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
ed or resized the scroll offset will be adjusted to maintain the resting on that snap point. proximity the visual viewport of this scroll container may come to rest on a snap point if it isn't currently scrolled vertically considering the user agent's scroll parameters. if content is added, moved, deleted or resized the scroll offset may be adjusted to maintain the resting on that snap point.
formal definition initial valuenoneapplies toscroll containersinheritednocomputed valueas specifiedanimation typediscrete
formal syntax none | mandatory | proximity specifications not part of any standard. ...
scroll-snap-type - CSS: Cascading Style Sheets
oved, deleted or resized the scroll offset will be adjusted to maintain the resting on that snap point. proximity the visual viewport of this scroll container may come to rest on a snap point if it isn't currently scrolled considering the user agent's scroll parameters. if content is added, moved, deleted or resized the scroll offset may be adjusted to maintain the resting on that snap point.
formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax none | [ x | y | block | inline | both ] [ mandatory | proximity ]? examples snapping in different axes html <div class="holster"> <div class="container x mandatory-scroll-snapping" dir="ltr"> <div>x mand. ltr</div> <div>2</div> <div>3</div> <div>4</div> <...
shape-image-threshold - CSS: Cascading Style Sheets
.7; /* global values */ shape-image-threshold: inherit; shape-image-threshold: initial; shape-image-threshold: unset; syntax values <alpha-value> sets the threshold used for extracting a shape from an image. the shape is defined by the pixels whose alpha value is greater than the threshold. values outside the range 0.0 (fully transparent) to 1.0 (fully opaque) are clamped to this range.
formal definition initial value0.0applies tofloatsinheritednocomputed valuethe same as the specified value after clipping the <number> to the range [0.0, 1.0].animation typea number
formal syntax <alpha-value>where <alpha-value> = <number> | <percentage> examples aligning text to a gradient this example creates a <div> block with a gradient background image. the gradient is established as a css ...
table-layout - CSS: Cascading Style Sheets
ntire table can be rendered once the first table row has been downloaded and analyzed. this can speed up rendering time over the "automatic" layout method, but subsequent cell content might not fit in the column widths provided. cells use the overflow property to determine whether to clip any overflowing content, but only if the table has a known width; otherwise, they won't overflow the cells.
formal definition initial valueautoapplies totable and inline-table elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax auto | fixed examples fixed-width tables with text-overflow this example uses a fixed table layout, combined with the width property, to restrict the table's width. the text-overflow property is used to apply an ellipsis to words that are too long ...
text-align-last - CSS: Cascading Style Sheets
eft-to-right and left if direction is right-to-left. left the inline contents are aligned to the left edge of the line box. right the inline contents are aligned to the right edge of the line box. center the inline contents are centered within the line box. justify the text is justified. text should line up their left and right edges to the left and right content edges of the paragraph.
formal definition initial valueautoapplies toblock containersinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax auto | start | end | left | right | center | justify examples justifying the last line <p>integer elementum massa at nulla placerat varius. suspendisse in libero risus, in interdum massa. vestibulum ac leo vitae metus faucibus gravida ac in neque. nullam est er...
text-combine-upright - CSS: Cascading Style Sheets
of a single character within the vertical line of the box. digits <integer>? attempts to display a sequence of consecutive ascii digits (u+0030–u+0039) that has as many or fewer characters than the specified integer, such that it takes up the space of a single character within the vertical line box. if the integer is omitted, it computes to 2. integers outside the range of 2-4 are invalid.
formal definition initial valuenoneapplies tonon-replaced inline elementsinheritedyescomputed valuespecified keyword, plus integer if 'digits'animation typediscrete
formal syntax none | all | [ digits <integer>? ] examples digits the digits value requires less markup than the all value when digits are being combined, but it is currently not very widely supported by browsers. html <p lang="ja" ...
transition-property - CSS: Cascading Style Sheets
all, height, color; transition-property: all, -moz-specific, sliding; /* global values */ transition-property: inherit; transition-property: initial; transition-property: unset; values none no properties will transition. all all properties that can transition will. <custom-ident> a string identifying the property to which a transition effect should be applied when its value changes.
formal definition initial valueallapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete
formal syntax none | <single-transition-property>#where <single-transition-property> = all | <custom-ident> examples there are several examples of css transitions included in the main css transitions article. specifications specificat...
url() - CSS: Cascading Style Sheets
age.png) path references the id of an svg shape -- circle, ellipse, line, path, polygon, polyline, or rect -- using the shape's geometry as the path. <url-modifier> in the future, the url() function may support specifying a modifier, an identifier or a functional notation, which alters the meaning of the url string.this is not supported and not fully defined in the specification. ...
Used value - CSS: Cascading Style Sheets
after the user agent has finished its calculations, every css property has a used value. the used values of dimensions (e.g., width, line-height) are in pixels. the used values of shorthand properties (e.g., background) are consistent with those of their component properties (e.g., background-color or background-size) and with position and float. note: the getcomputedstyle() dom api returns the resolved value, which may either be the computed value or the used value, depending on the property. ...
user-modify - CSS: Cascading Style Sheets
t; user-modify: initial; user-modify: unset; this property has been replaced by the contenteditable attribute. syntax the -moz-user-modify property is specified as one of the keyword values from the list below. values read-only default value. contents are read-only. read-write the user is able to read and write contents. read-write-plaintext-only same as read-write, but rich text
formatting will be lost. write-only the user is able to edit the content, but not to read it.
formal definition value not found in db!
formal syntax syntax not found in db! examples html <div class="readwrite">the user is able to change this text.</div> css .readwrite { -moz-user-modify: read-write; -webkit-user-modify: read-write; } specifications not part of any standard. a simil...
visibility - CSS: Cascading Style Sheets
notes support for visibility: collapse is missing or partially incorrect in some modern browsers. it may not be correctly treated like visibility: hidden on elements other than table rows and columns. visibility: collapse may change the layout of a table if the table has nested tables within the cells that are collapsed, unless visibility: visible is specified explicitly on nested tables.
formal definition initial valuevisibleapplies toall elementsinheritedyescomputed valueas specifiedanimation typea visibility
formal syntax visible | hidden | collapse examples basic example html <p class="visible">the first paragraph is visible.</p> <p class="not-visible">the second paragraph is not visible.</p> <p class="visible">the third paragraph is visible. notice the second paragraph is s...
white-space - CSS: Cascading Style Sheets
rapping end-of-line spaces normal collapse collapse wrap remove nowrap collapse collapse no wrap remove pre preserve preserve no wrap preserve pre-wrap preserve preserve wrap hang pre-line preserve collapse wrap remove break-spaces preserve preserve wrap wrap
formal definition initial valuenormalapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax normal | pre | nowrap | pre-wrap | pre-line | break-spaces examples basic example code { white-space: pre; } line breaks inside <pre> elements pre { word-wrap: break-word; /* ie 5.5-7 */ white-space: pre-wrap; /* modern browsers */ } in action ...
widows - CSS: Cascading Style Sheets
ows: 3; /* global values */ widows: inherit; widows: initial; widows: unset; in typography, a widow is the last line of a paragraph that appears alone at the top of a page. (the paragraph is continued from a prior page.) syntax values <integer> the minimum number of lines that can stay by themselves at the top of a new fragment after a fragmentation break. the value must be positive.
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. it is used to demonstrate how widows work.</p> <p>this is t...
word-break - CSS: Cascading Style Sheets
break: normal and overflow-wrap: anywhere, regardless of the actual value of the overflow-wrap property. note: in contrast to word-break: break-word and overflow-wrap: break-word (see overflow-wrap), word-break: break-all will create a break at the exact place where text would otherwise overflow its container (even if putting an entire word on its own line would negate the need for a break).
formal definition initial valuenormalapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete
formal syntax normal | break-all | keep-all | break-word examples html <p>1. <code>word-break: normal</code></p> <p class="normal narrow">this is a long and honorificabilitudinitatibus califragilisticexpialidocious taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronu...
regexp:match() - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes regexp:match() per
forms regular expression matching on a string, returning the submatches found as a result. syntax regexp:match(targetstring, regexpstring[, flagsstring]) parameters targetstring the string to per
form regular expression matching upon. regexpstring the javascript style regular expression to evaluate. flagsstringoptional an optional string containing character flags. the character flags are: g global match the submatches from every match in the string are returned. if this flag isn't specified, only the submatches from the first match are returned. i case insensitive match if this flag is specified, the match is per
formed in a case insensitive fashion. returns ...
regexp:test() - EXSLT
ing]) parameters teststring the string to test.. regexpstring the javascript style regular expression to evaluate. flagsstringoptional an optional string containing character flags. the character flags are: g global match has no effect for this function; it's allowed for consistency with other regexp functions. i case insensitive match if this flag is specified, the match is per
formed in a case insensitive fashion. returns true if the specified regexp matches the test string. specifications exslt - regexp:test ...
Regular expressions (regexp) - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt regular expressions package provides functions that allow testing, matching, and replacing text using javascript style regular expressions. the namespace for the regular expressions package is http://exslt.org/regular-expressions. regexp:match()regexp:match() per
forms regular expression matching on a string, returning the submatches found as a result.regexp:replace()regexp:replace() replaces the portions of a string that match a given regular expression with the contents of another string.regexp:test()regexp:test() tests to see whether a string matches a specified regular expression. ...
Sets (set) - EXSLT
the namespace for these functions is http://exslt.org/sets. set:difference()set:difference() returns the difference between two node-sets. ...
Index - Event reference
found 2 pages: # page tags and summary 1 event reference event, overview, reference dom events are sent to notify code of interesting things that have taken place. each event is represented by an object which is based on the event interface, and may have additional custom fields and/or functions used to get additional in
formation about what happened. events can represent everything from basic user interactions to automated notifications of things happening in the rendering model. 2 index index, events found 2 pages: ...
Community - Developer guides
of useful mailing lists, newsgroups, forums, or other communities related to ajax, please link to them here. ...
Guide to Web APIs - Developer guides
ent apiddomeencoding apiencrypted media extensionsffetch apifile system api frame timing apifullscreen apiggamepad api geolocation apihhtml drag and drop apihigh resolution timehistory apiiimage capture apiindexeddbintersection observer apillong tasks api mmedia capabilities api media capture and streamsmedia session apimedia source extensions mediastream recordingnnavigation timingnetwork in
formation api ppage visibility apipayment request apiper
formance apiper
formance timeline apipermissions apipointer eventspointer lock apiproximity events 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 notific...
Web Audio playbackRate explained - Developer guides
playbackrate is a multiplier applied to the original rate.) a complete example let's create a <video> element first, and set up video and playback rate controls in html: <video id="myvideo" controls> <source src="https://udn.realityripple.com/samples/6f/08625b424a.m4v" type='video/mp4' /> <source src="https://udn.realityripple.com/samples/5b/8cd6da9c65.webm" type='video/webm' /> </video> <
form> <input id="pbr" type="range" value="1" min="0.5" max="4" step="0.1" > <p>playback rate <span id="currentpbr">1</span></p> </
form> and apply some javascript to it: window.onload = function () { var v = document.getelementbyid("myvideo"); var p = document.getelementbyid("pbr"); var c = document.getelementbyid("currentpbr"); p.addeventlistener('input',function(){ c.innerhtml = p...
Media buffering, seeking, and time ranges - Developer guides
myaudio.seekable; creating our own buffering feedback if we wish to create our own custom player, we may want to provide feedback on how much of the media is ready to be played. in practice a good way to do this is use the seekable attribute, although as we have seen above seekable parts of the media are not neccessarily contiguous — they often are however and we can safely approximate this in
formation to give the user an indication of which parts of the media can be played directly. we can find this point in the media using the following line of code: var seekableend = myaudio.seekable.end(myaudio.seekable.length - 1); note: myaudio.seekable.end(myaudio.seekable.length - 1) actually tells us the end point of the last time range that is seekable (not all seekable media). in practice thi...
Mutation events - Developer guides
eprecated in the dom events specification, as the api's design is flawed (see details in the "dom mutation events replacement: the story so far / existing points of consensus" post to public-webapps). mutation observers are the proposed replacement for mutation events in dom4. they are expected to be included in firefox 14 and chrome 18. the practical reasons to avoid the mutation events are per
formance issues and cross-browser support. per
formance adding dom mutation listeners to a document profoundly degrades the per
formance of further dom modifications to that document (making them 1.5 - 7 times slower!). moreover, removing the listeners does not reverse the damage. the per
formance effect is limited to the documents that have the mutation event listeners. cross-browser support these ...
Overview of events and handlers - Developer guides
le effect until a user interacts with the button either by placing the mouse pointer over the html button and clicking on the left mouse button or by placing a finger or stylus of some kind on the screen above the html button; when that happens, the buttondomelement javascript object would call the example_click_handler function with an event object as an argument. the function, in turn, would per
form whatever action was chosen by the programmer, in this case to open an html alert dialog. note that the handler has access to the ev object since it is passed as an argument; the object has in
formation about the event, notably the time at which the event occurred. as a second example, much modern javascript integrated into web pages is wrapped into an event function call to ensure that the code i...
Introduction to Web development - Developer guides
pping) set of links to learning resources, see the mdn learning pages. note: the recommended resources on this page are subject to change. documentation topics html the basics of hypertext mark-up langage (html) — what exactly is html? basic structure of a web page — the doctype and document 'tree' fundamental html elements — structural, head, list,
form elements and more, explained by category. html beginners tutorial — a tutorial and exercise that recap and take you through the basics you've learned above. html elements reference guide — a comprehensive guide to html elements with details on how browsers support them css getting started with css — an absolute beginners guide to css covers basic concepts and ...
Mobile Web Development - Developer guides
erent 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. test on multiple browsers test your web site on multiple browsers. this means testing on multiple plat
forms — at least ios and android. test mobile safari on the iphone using the ios simulator test opera and firefox using the android sdk. see these additional instructions for running firefox for android using the android emulator. ...
Parsing and serializing XML - Developer guides
xmlserializer serializes dom trees, converting them into strings containing xml. domparser constructs a dom tree by parsing a string containing xml, returning a xmldocument or document as appropriate based on the input data. ...
Printing - Developer guides
user's experience when printing content. there are a number of possible scenarios: you wish to adjust layout to take advantage of the size and shape of the paper. you wish to use different styles to enhance the appearance of your content on paper. you wish to use higher resolution images for a better result. you want to adjust the user experience of printing, such as presenting a specially-
formatted version of your content before printing begins. there may be other cases in which you want to manage the printing process, but these are some of the most common scenarios. this article provides tips and techniques for helping your web content print better. using a print style sheet add the following to your <head> tag. <link href="/path/to/print.css" media="print" rel="stylesheet" /> ...
SVG-in-OpenType - Developer guides
the svg-in-opentype work is currently in the hands of the mpeg group. once we're ready for wider adoption the in
formation from wiki.mozilla.org will be moved here, updated and expanded. ...
The Unicode Bidirectional Text Algorithm - Developer guides
in memory order, from left to right right-to-left override (rlo) u+202e ‮ <bdo dir="rtl"> overrides the bidi algorithm and displays the embedded characters in reverse memory order, from right to left closing unicode bidi algorithm control characters character code point html entity markup equivalent description pop directional
formatting (pdf) u+202c ‬ closing whatever opening tag used the dir attribute used for rle or lre </bdo> used for rlo or lro pop directional isolate (pdi) u+2069 ⁩ closing whatever opening tag used the dir attribute used for rli, lri, or fsi ...
HTML attribute: size - HTML: Hypertext Markup Language
the size attribute defines the width of the <input> and the height of the <select> element. for the input, if the type attribute is text or password then it's the number of characters. this must be an integer value 0 or higher. if no size is specified, or an invalid value is specified, the input has no size declared, and the
form control will be the default width based on the user agent. if css targets the element with properties impacting the width, css takes precedence. the size attribute has no impact on constraint validation. examples by adding size on some input types, the width of the input can be controlled. adding size on a select changes the height, definining how many options are visible in the closed state. <label for="fruit">enter a fruit</label> <input type="text" size...
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
ents are blocked. calling any of the following on a tainted canvas will result in an error: calling getimagedata() on the canvas's context calling toblob() on the <canvas> element itself calling todataurl() on the canvas attempting any of these when the canvas is tainted will cause a securityerror to be thrown. this protects users from having private data exposed by using images to pull in
formation from remote web sites without permission. storing an image from a foreign origin in this example, we wish to permit images from a foreign origin to be retrieved and saved to local storage. implementing this requires configuring the server as well as writing code for the web site itself. web server configuration the first thing we need is a server that's configured to host images with the...
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
accepts flow content; don't use a heading element as a child of the <hgroup> element — it is now deprecated. implicit aria role heading permitted aria roles tab, presentation or none dom interface htmlheadingelement attributes these elements only include the global attributes. the align attribute is obsolete; don't use it. usage notes heading in
formation may be used by user agents, for example, to construct a table of contents for a document automatically. avoid using heading tags to resize text. instead, use the css font-size property. headings use size to indicate their relative importance, but css is preferred for general-purpose resizing. avoid skipping heading levels: always start from <h1>, next use <h2> and so on. you should only u...
<article>: The Article Contents element - HTML: Hypertext Markup Language
global attributes. usage notes each <article> should be identified, typically by including a heading (<h1>-<h6> element) as a child of the <article> element. when an <article> element is nested, the inner element represents an article related to the outer element. for example, the comments of a blog post can be <article> elements nested in the <article> representing the blog post. author in
formation of an <article> element can be provided through the <address> element, but it doesn't apply to nested <article> elements. the publication date and time of an <article> element can be described using the datetime attribute of a <time> element. note that the pubdate attribute of <time> is no longer a part of the w3c html5 standard. examples <article class="film_review"> <header> <h2>...
<base>: The Document Base URL element - HTML: Hypertext Markup Language
f the following attributes are specified, this element must come before other elements with attribute values of urls, such as <link>’s href attribute. href the base url to be used throughout the document for relative urls. absolute and relative urls are allowed. target a keyword or author-defined name of the default browsing context to show the results of navigation from <a>, <area>, or <
form> elements without explicit target attributes. the following keywords have special meanings: _self (default): show the result in the current browsing context. _blank: show the result in a new, unnamed browsing context. _parent: show the result in the parent browsing context of the current one, if the current page is inside a frame. if there is no parent, acts the same as _self. _top: sh...
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
he dir attribute set to the known directionality. but if you don't know the directionality - for example, because embedded-text is being read from a database or entered by the user - you should use <bdi> to prevent the directionality of embedded-text from affecting its surroundings. though the same visual effect can be achieved using the css rule unicode-bidi: isolate on a <span> or another text-
formatting element, html authors should not use this approach because it is not semantic and browsers are allowed to ignore css styling. embedding the characters in <span dir="auto"> has the same effect as using <bdi>, but its semantics are less clear. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omissio...
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
ne, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. implicit aria role no corresponding role permitted aria roles any dom interface htmlquoteelement attributes this element's attributes include the global attributes. cite a url that designates a source document or message for the in
formation quoted. this attribute is intended to point to in
formation explaining the context or the reference for the quote. usage notes to change the indentation applied to the quoted text, use the css margin-left and/or margin-right properties, or the margin shorthand property. to include shorter quotes inline rather than in a separate block, use the <q> (quotation) element. example this exampl...
<col> - HTML: Hypertext Markup Language
e vertical-align property can be used. if the table does use a colspan attribute, the effect can be achieved by combining adequate css attribute selectors like [colspan=n], though this is not trivial. width this attribute specifies a default width for each column in the current column group. in addition to the standard pixel and percentage values, this attribute might take the special
form 0*, which means that the width of each column in the group should be the minimum width necessary to hold the column's contents. relative widths such as 0.5* also can be used. examples please see the <table> page for examples on <col>. specifications specification status comment html living standardthe definition of '<col>' in that specification. living standard...
<element>: The Custom Element element (Obsolete) - HTML: Hypertext Markup Language
the obsolete html <element> element was part of the web components specification; it was intended to be used to define new custom dom elements. it was removed in favor of a javascript-driven approach for creating new custom elements. note: this element has been removed from the specification. see this for more in
formation from the editor of the specification. content categories transparent content. permitted content ??? tag omission none, both the starting and ending tag are mandatory. permitted parent elements ??? dom interface htmlelement attributes this element includes the global attributes. specifications the <element> element was
formerly in a draft specification of custom elements but it has been removed. brow...
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
code snippets <figure> <figcaption>get browser details using <code>navigator</code>.</figcaption> <pre> function navigatorexample() { var txt; txt = "browser codename: " + navigator.appcodename + "; "; txt+= "browser name: " + navigator.appname + "; "; txt+= "browser version: " + navigator.appversion + "; "; txt+= "cookies enabled: " + navigator.cookieenabled + "; "; txt+= "plat
form: " + navigator.plat
form + "; "; txt+= "user-agent header: " + navigator.useragent + "; "; console.log("navigatorexample", txt); } </pre> </figure> quotations <figure> <figcaption><cite>edsger dijkstra:</cite></figcaption> <blockquote>if debugging is the process of removing software bugs, then programming must be the process of putting them in.</blockquote> </figure> poems <...
<frame> - HTML: Hypertext Markup Language
<frame> is an html element which defines a particular area in which another html document can be displayed. a frame should be used within a <frameset>. using the <frame> element is not encouraged because of certain disadvantages such as per
formance problems and lack of accessibility for users with screen readers. instead of the <frame> element, <iframe> may be preferred. attributes like all other html elements, this element supports the global attributes. src this attribute specifies the document that will be displayed by the frame. name this attribute is used for labeling frames. without labeling, every link will open in the frame that it’s in – the closest parent frame. see the target attribute for more in
formation. noresize this attribute prevents resizing of frames by use...
<header> - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, palpable content. permitted content flow content, but with no <header> or <footer> descendant. ...
<hgroup> - HTML: Hypertext Markup Language
emented in any browsers—then the <hgroup> semantics are in practice only theoretical. so the html5 (w3c) specification provides advice on how to mark up subheadings, subtitles, alternative titles and taglines without using <hgroup>. the <hgroup> element allows the primary heading for a document section to be grouped with any secondary headings—such as subheadings or alternative titles—to
form a multi-level heading. in other words, the <hgroup> element prevents any of its secondary <h1>–<h6> children from creating separate sections of their own in the outline—as those <h1>–<h6> elements otherwise normally would if they were not children of any <hgroup>. so in the abstract outline produced by the html outline algorithm defined in the html specification, the <hgroup> as a whole f...
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
ent attributes this element includes the global attributes. manifest specifies the uri of a resource manifest indicating resources that should be cached locally. see using the application cache for details. 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 in
formation in the document type declaration. xmlns specifies the xml namespace of the document. default value is "http://www.w3.org/1999/xhtml". this is required in documents parsed with xml parsers, and optional in text/html documents. example <!doctype html> <html lang="en"> <head>...</head> <body>...</body> </html> accessibility concerns providing a lang attribute with a valid ietf ident...
<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. this feature has been removed from whatwg html, and is no longer supported in browsers. 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. ...
<ins> - HTML: Hypertext Markup Language
this attribute defines the uri of a resource that explains the change, such as a link to meeting minutes or a ticket in a troubleshooting system. datetime this attribute indicates the time and date of the change and must be a valid date with an optional time string. if the value cannot be parsed as a date with an optional time string, the element does not have an associated time stamp. for the
format of the string without a time, see
format of a valid date string. the
format of the string if it includes both date and time is covered in
format of a valid local date and time string. examples <ins>this text has been inserted</ins> result accessibility concerns the presence of the <ins> element is not announced by most screen reading technology in its default configuration. it can be ma...
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
onospace font, although this is not mandated by the html standard. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. <kbd> may be nested in various combinations with the <samp> (sample output) element to represent various
forms of input or output based on visual cues. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role no corresponding role permitted ari...
<legend> - HTML: Hypertext Markup Language
. tag omission none, both the starting and ending tag are mandatory. permitted parents a <fieldset> whose first child is this <legend> element implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmllegendelement attributes this element only includes the global attributes. examples see <
form> for examples on <legend>. specifications specification status comment html living standardthe definition of '<legend>' in that specification. living standard definition of the legend element html5the definition of '<legend>' in that specification. recommendation html 4.01 specificationthe definition of '<legend>' in that specification.
<li> - HTML: Hypertext Markup Language
/github.com/mdn/interactive-examples and send us a pull request. content categories none. permitted content flow content. tag omission the end tag can be omitted if the list item is immediately followed by another <li> element, or if there is no more content in its parent element. permitted parents an <ul>, <ol>, or <menu> element. though not a con
forming usage, the obsolete <dir> can also be a parent. implicit aria role listitem when child of an ol, ul or menu permitted aria roles menuitem, menuitemcheckbox, menuitemradio, option, none, presentation, radio, separator, tab, treeitem dom interface htmllielement attributes this element includes the global attributes. value this integer attribute ind...
<listing> - HTML: Hypertext Markup Language
between the start and end tags without interpreting the html in between and using a monospaced font. the html 2 standard recommended that lines shouldn't be broken when not greater than 132 characters. note: do not use this element. it is deprecated since html 3.2 and was neither implemented by all browsers, nor in a consistent way. even more it is obsoleted in html5 and may be rendered by con
forming user-agents as the <pre> element, which will interpret the internal html! instead use the <pre> element or if semantically adequate the <code> element, eventually escaping the html '<' and '>' so that they don't get interpreted. a monospaced font can also be obtained on a simple <div> element, by applying an adequate css style using monospace as the generic-font value in a font-family proper...
<main> - HTML: Hypertext Markup Language
ment. implicit aria role main permitted aria roles no role permitted dom interface htmlelement attributes this element only includes the global attributes. usage notes the content of a <main> element should be unique to the document. content that is repeated across a set of documents or document sections such as sidebars, navigation links, copyright in
formation, site logos, and search
forms shouldn't be included unless the search
form is the main function of the page. <main> doesn't contribute to the document's outline; that is, unlike elements such as <body>, headings such as <h2>, and such, <main> doesn't affect the dom's concept of the structure of the page. it's strictly in
formative. example <!-- other content --> <main> <h1>apples</h1> ...
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
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. if the http-equiv attribute is set, the meta element is a pragma directive, providing in
formation equivalent to what can be given by a similarly-named http header. if the charset attribute is set, the meta element is a charset declaration, giving the character encoding in which the document is encoded. if the itemprop attribute is set, the meta element provides user-defined metadata. attributes this element includes the global attributes. note: the attribute name has a specific me...
<noframes>: The Frame Fallback element - HTML: Hypertext Markup Language
ode browsers. a <noframes> element can contain any html elements that are allowed within the body of an html document, with the exception of the <frameset> and <frame> elements, since using frames when they aren't supported doesn't make sense. <noframes> can be used to present a message explaining that the user's browser doesn't support frames, but ideally should be used to present an alternate
form of the site that doesn't use frames but still offers the same or similar functionality. in html 5 and later, <noframes> is obsolete and shouldn't be used, since the <frame> and <frameset> elements are also obsolete. when frames are needed at all, they should be presented using the <iframe> element. attributes like all other html elements, this element supports the global attributes. it has n...
<ol>: The Ordered List element - HTML: Hypertext Markup Language
ng marker, such as a number or letter. the <ol> and <ul> elements may nest as deeply as desired, alternating between <ol> and <ul> however you like. the <ol> and <ul> elements both represent a list of items. the difference is with the <ol> element, the order is meaningful. for example: steps in a recipe turn-by-turn directions the list of ingredients in decreasing proportion on nutrition in
formation labels to determine which list to use, try changing the order of the list items; if the meaning changes, use the <ol> element — otherwise you can use <ul>. examples simple example <ol> <li>fee</li> <li>fi</li> <li>fo</li> <li>fum</li> </ol> the above html will output: using roman numeral type <ol type="i"> <li>introduction</li> <li>list of greivances</li> <li>concl...
<option>: The HTML Option element - HTML: Hypertext Markup Language
is that of the element text content. selected if present, this boolean attribute indicates that the option is initially selected. if the <option> element is the descendant of a <select> element whose multiple attribute is not set, only one single <option> of this <select> element may have the selected attribute. value the content of this attribute represents the value to be submitted with the
form, should this option be selected. if this attribute is omitted, the value is taken from the text content of the option element. examples see <select> for examples. specifications specification status comment html living standardthe definition of '<option>' in that specification. living standard html5the definition of '<option>' in that specification...
<picture>: The Picture element - HTML: Hypertext Markup Language
other attributes of the image and its presentation. it provides a fallback in case none of the offered <source> elements are able to provide a usable image. common use cases for <picture>: art direction. cropping or modifying images for different media conditions (for example, loading a simpler version of an image which has too many details, on smaller displays). offering alternative image
formats, for cases where certain
formats are not supported. saving bandwidth and speeding page load times by loading the most appropriate image for the viewer's display. if providing higher-density versions of an image for high-dpi (retina) display, use srcset on the <img> element instead. this lets browsers opt for lower-density versions in data-saving modes, and you don't have to write explicit m...
<q>: The Inline Quotation element - HTML: Hypertext Markup Language
roles any dom interface htmlquoteelement usage note: most modern browsers will automatically add quotation marks around text inside a <q> element. a style rule may be needed to add quotation marks in older browsers. attributes this element includes the global attributes. cite the value of this attribute is a url that designates a source document or message for the in
formation quoted. this attribute is intended to point to in
formation explaining the context or the reference for the quote. example <p>according to mozilla's website, <q cite="https://www.mozilla.org/about/history/details/">firefox 1.0 was released in 2004 and became a big success.</q></p> specifications specification status comment html living standardthe def...
<rt>: The Ruby Text element - HTML: Hypertext Markup Language
the <rt> element must always be contained within a <ruby> element. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. see the article about the <ruby> element for more examples. content categories none. ...
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
cit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. usage notes along with other pure styling elements, the original html underline (<u>) element was deprecated in html 4; however, <u> was restored in html 5 with a new, semantic, meaning: to mark text as having some
form of non-textual annotation applied. be careful to avoid using the <u> element with its default styling (of underlined text) in such a way as to be confused with a hyperlink, which is also underlined by default. use cases valid use cases for the <u> element include annotating spelling errors, applying a proper name mark to denote proper names in chinese text, and other
forms of annotation. yo...
<ul>: The Unordered List element - HTML: Hypertext Markup Language
pe depending on the nesting level of the list. warning: do not use this attribute, as it has been deprecated; use the css list-style-type property instead. usage notes the <ul> element is for grouping a collection of items that do not have a numerical ordering, and their order in the list is meaningless. typically, unordered-list items are displayed with a bullet, which can be of several
forms, like a dot, a circle, or a square. the bullet style is not defined in the html description of the page, but in its associated css, using the list-style-type property. the <ul> and <ol> elements may be nested as deeply as desired. moreover, the nested lists may alternate between <ol> and <ul> without restriction. the <ol> and <ul> elements both represent a list of items. they differ in that, w...
data-* - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. all such custom data are available via the htmlelement interface of the element the attribute is set on. the htmlelement.dataset property gives access to them. ...
id - HTML: Hypertext Markup Language
t identifier), scripting, or styling (with css). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this attribute's value is an opaque string: this means that web authors should not rely on it to convey human-readable in
formation (although having your ids somewhat human-readable can be useful for code comprehension, e.g. consider ticket-18659 versus r45tgfe-freds&$@). id's value must not contain whitespace (spaces, tabs etc.). browsers treat non-con
forming ids that contain whitespace as if the whitespace is part of the id. in contrast to the class attribute, which allows space-separated values, elements can only ha...
itemid - HTML: Hypertext Markup Language
an itemid attribute can only be specified for an element that has both itemscope and itemtype attributes. also, itemid can only be specified on elements that possess an itemscope attribute whose corresponding itemtype refers to or defines a vocabulary that supports global identifiers. the exact meaning of an itemtype's global identifier is provided by the definition of that identifier within the specified vocabulary. the vocabulary defines whether several items with the same global identifier can coexist and, if so, how items with the same identifier are handled. note: the whatwg definition specifies that an itemid must be a url. ...
CORS errors - HTTP
and open the developer tools. now try to reproduce the failing transaction and check the console if you are seeing a cors violation error message. it will probably look like this: the text of the error message will be something similar to the following: cross-origin request blocked: the same origin policy disallows reading the remote resource at https://some-url-here. (reason: additional in
formation here). note: for security reasons, specifics about what went wrong with a cors request are not available to javascript code. all the code knows is that an error occurred. the only way to determine what specifically went wrong is to look at the browser's console for details. cors error messages firefox's console displays messages in its console when requests fail due to cors. part of the...
List of default Accept values - HTTP
note that all browsers add the */* mime type to cover all cases. this is typically used for requests initiated via the address bar of a browser, or via an html <a> element. ...
Cross-Origin Resource Policy (CORP) - HTTP
the concept was originally proposed in 2012 (as from-origin), but resurrected in q2 of 2018 and implemented in safari and chromium. in early 2018, two side-channel hardware vulnerabilities known as meltdown and spectre were disclosed. these vulnerabilities allowed sensitive data disclosure due to a race condition which arose as part of speculative execution functionality, designed to improve per
formance. 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 resou...
Using Feature Policy - HTTP
r both the parent page and the allow attribute. disabling a feature in a policy is a one-way toggle. if a feature has been disabled for a child frame by its parent frame, the child cannot re-enable it, and neither can any of the child's descendants. enforcing best practices for good user experiences it's difficult to build a website that uses all the latest best practices and provides great per
formance and user experiences. as the website evolves, it can become even harder to maintain the user experience over time. you can use feature policies to specify the desired best practices, and rely on the browser to enforce the policies to prevent regressions. there are several policy-controlled features designed to represent functionality that can negatively impact the user experience. these feat...
Accept-Charset - HTTP
browsers usually don't send this header, as the default value for each resource is usually correct and transmitting it would allow fingerprinting. if the server cannot serve any character encoding from this request header, it can theoretically send back a 406 not acceptable error code. ...
Accept-Ranges - HTTP
range. in presence of an accept-ranges header, the browser may try to resume an interrupted download, rather than to start it from the start again. header type response header forbidden header name no syntax accept-ranges: <range-unit> accept-ranges: none directives <range-unit> defines the range unit the server supports. though bytes is the only range unit
formally defined by rfc 7233, additional range units may be registered in the http range unit registry. none no range unit is supported, this makes the header equivalent of its own absence and is therefore rarely used, though some browsers, like ie9, it is used to disable or remove the pause buttons in the download manager. examples accept-ranges: bytes specifications specification ...
Accept - HTTP
browsers set adequate values for this header depending on the context where the request is done: when fetching a css stylesheet a different value is set for the request than when fetching an image, video or a script. ...
Access-Control-Allow-Headers - HTTP
syntax access-control-allow-headers: <header-name>[, <header-name>]* access-control-allow-headers: * directives <header-name> the name of a supported request header. the header may list any number of headers, separated by commas. * (wildcard) the value "*" only counts as a special wildcard value for requests without credentials (requests without http cookies or http authentication in
formation). in requests with credentials, it is treated as the literal header name "*" without special semantics. note that the authorization header can't be wildcarded and always needs to be listed explicitly. examples a custom header here's an example of what an access-control-allow-headers header might look like. it indicates that in addition to the cors-safelisted request headers, a custom hea...
Access-Control-Allow-Methods - HTTP
response header forbidden header name no syntax access-control-allow-methods: <method>, <method>, ... access-control-allow-methods: * directives <method> comma-delimited list of the allowed http request methods. * (wildcard) the value "*" only counts as a special wildcard value for requests without credentials (requests without http cookies or http authentication in
formation). in requests with credentials, it is treated as the literal method name "*" without special semantics. examples access-control-allow-methods: post, get, options access-control-allow-methods: * specifications specification status comment fetchthe definition of 'access-control-allow-methods' in that specification. living standard initial definition ...
Access-Control-Expose-Headers - HTTP
eader-name>, ... access-control-expose-headers: * directives <header-name> a list of exposed headers consisting of zero or more header names other than the cors-safelisted request headers that the resource might use and can be exposed. * (wildcard) the value "*" only counts as a special wildcard value for requests without credentials (requests without http cookies or http authentication in
formation). in requests with credentials, it is treated as the literal header name "*" without special semantics. note that the authorization header can't be wildcarded and always needs to be listed explicitly. examples to expose a non-cors-safelisted request header, you can specify: access-control-expose-headers: content-length to additionally expose a custom header, like x-kuma-revision, you c...
Access-Control-Max-Age - HTTP
header type response header forbidden header name no syntax access-control-max-age: <delta-seconds> directives <delta-seconds> maximum number of seconds the results can be cached. uxp caps this at 24 hours (86400 seconds). chromium (prior to v76) caps at 10 minutes (600 seconds). chromium (starting in v76) caps at 2 hours (7200 seconds). chromium also specifies a default value of 5 seconds. ...
Connection - HTTP
ntrols whether or not the network connection stays open after the current transaction finishes. if the value sent is keep-alive, the connection is persistent and not closed, allowing for subsequent requests to the same server to be done. connection-specific header fields such as connection and keep-alive are prohibited in http/2. chrome and firefox ignore them in http/2 responses, but safari con
forms to the http/2 spec requirements and won’t load any response which contains them. except for the standard hop-by-hop headers (keep-alive, transfer-encoding, te, connection, trailer, upgrade, proxy-authorization and proxy-authenticate), any hop-by-hop headers used by the message must be listed in the connection header, so that the first proxy knows it has to consume them and not forward them f...
Content-Language - HTTP
itive subtags, each separated by a hyphen character ("-", %x2d). in most cases, a language tag consists of a primary language subtag that identifies a broad family of related languages (e.g., "en" = english), which is optionally followed by a series of subtags that refine or narrow that language's range (e.g., "en-ca" = the variety of english as communicated in canada). note: language tags are
formaly defined in rfc 5646, which rely on the iso 639 standard (quite often the iso 639-1 code list) for language codes to be used. examples indicating the language a document is written in the global lang attribute is used on html elements to indicate the language of an entire html document or parts of it. <html lang="de"> do not use this meta element like this for stating a document language:...
CSP: block-all-mixed-content - HTTP
ecurity-policy (csp) block-all-mixed-content directive prevents loading any assets over http when the page uses https. all mixed content resource requests are blocked, including both active and passive mixed content. this also applies to <iframe> documents, ensuring the entire page is mixed content-free. the upgrade-insecure-requests directive is evaluated before block-all-mixed-content. if the
former is set, the latter does nothing, so set one directive or the other – not both, unless you want to force https on older browsers that do not force it after a redirect to http. syntax content-security-policy: block-all-mixed-content; examples content-security-policy: block-all-mixed-content; <meta http-equiv="content-security-policy" content="block-all-mixed-content"> to disallow http as...
CSP: report-to - HTTP
report-to groupname the directive has no effect in and of itself, but only gains meaning in combination with other directives. csp version 1 directive type reporting directive this directive is not supported in the <meta> element. syntax content-security-policy: report-to <json-field-value>; examples see content-security-policy-report-only for more in
formation and examples. report-to: { "group": "csp-endpoint", "max_age": 10886400, "endpoints": [ { "url": "https://example.com/csp-reports" } ] }, { "group": "hpkp-endpoint", "max_age": 10886400, "endpoints": [ { "url": "https://example.com/hpkp-reports" } ] } content-security-polic...
Referer - HTTP
link to the currently requested page was followed. the referer header allows servers to identify where people are visiting them from and may use that data for analytics, logging, or optimized caching, for example. important: although this header has many innocent uses it can have undesirable consequences for user security and privacy. see referer header: privacy and security concerns for more in
formation and mitigations. note that referer is actually a misspelling of the word "referrer". see http referer on wikipedia for more details. a referer header is not sent by browsers if: the referring resource is a local "file" or "data" uri. an unsecured http request is used and the referring page was received with a secure protocol (https). header type request header f...
Retry-After - HTTP
uch as 301 (moved permanently), this indicates the minimum time that the user agent is asked to wait before issuing the redirected request. header type response header forbidden header name no syntax retry-after: <http-date> retry-after: <delay-seconds> directives <http-date> a date after which to retry. see the date header for more details on the http date
format. <delay-seconds> a non-negative decimal integer indicating the seconds to delay after the response is received. examples dealing with scheduled downtime support for the retry-after header on both clients and servers is still inconsistent. however, some crawlers and spiders, like the googlebot, honor the retry-after header. it is useful to send it along with a 503 (service unavailable) res...
Sec-WebSocket-Accept - HTTP
header type response header forbidden header name no syntax sec-websocket-accept: <hashed key> directives <hashed key> the server takes the value of the sec-websocket-key sent in the handshake request, appends 258eafa5-e914-47da-95ca-c5ab0dc85b11, takes sha-1 of the new value, and is then base64 encoded. ...
Server - HTTP
the server header describes the software used by the origin server that handled the request — that is, the server that generated the response. avoid overly-detailed server values, as they can reveal in
formation that might make it (slightly) easier for attackers to exploit known security holes. header type response header forbidden header name no syntax server: <product> directives <product> the name of the software or product that handled the request. usually in a
format similar to user-agent. how much detail to include is an interesting balance to strike; exposing the os version is probably a bad idea, as mentioned in the earlier warning about overly-detailed values. however, exposed apache versions helped browsers work around a bug those ver...
SameSite cookies - HTTP
uests initiated by third party websites. none cookies will be sent in all contexts, i.e sending cross-origin is allowed. none used to be the default value, but recent browser versions made lax the default value to have reasonably robust defense against some classes of cross-site request forgery (csrf) attacks. none requires the secure attribute in latest browser versions. see below for more in
formation. fixing common warnings samesite=none requires secure the following warning might appear in your console: some cookies are misusing the “samesite“ attribute, so it won’t work as expected. cookie “mycookie” rejected because it has the “samesite=none” attribute but is missing the “secure” attribute. the warning appears because any cookie that requests samesite=none bu...
Tk - HTTP
o syntax tk: ! (under construction) tk: ? (dynamic) tk: g (gateway or multiple parties) tk: n (not tracking) tk: t (tracking) tk: c (tracking with consent) tk: p (potential consent) tk: d (disregarding dnt) tk: u (updated) directives ! under construction. the origin server is currently testing its communication of tracking status. ? dynamic. the origin server needs more in
formation to determine tracking status. g gateway or multiple parties. the server is acting as a gateway to an exchange involving multiple parties. n not tracking. t tracking. c tracking with consent. the origin server believes it has received prior consent for tracking this user, user agent, or device. p potential consent. the origin server does not know, in real-time, whether it has receiv...
WWW-Authenticate - HTTP
01 unauthorized response. header type response header forbidden header name no syntax www-authenticate: <type> realm=<realm>[, charset="utf-8"] directives <type> authentication type. a common type is "basic". iana maintains a list of authentication schemes. realm=<realm> a description of the protected area. if no realm is specified, clients often display a
formatted hostname instead. charset=<charset> tells the client the server's prefered encoding scheme when submitting a username and password. the only allowed value is the case insensitive string "utf-8". this does not relate to the encoding of the realm string. examples typically, a server response contains a www-authenticate header that looks like these: www-authenticate: basic www-authentica...
Want-Digest - HTTP
preference ordering among the choices it offers. if want-digest does not include any digest algorithms that the server supports, the server may respond with: a digest calculated using a different digest algorithm, or a 400 bad request error, and include another want-digest header with that response, listing the algorithms that it does support. see the page for the digest header for more in
formation. header type general header forbidden header name no syntax want-digest: <digest-algorithm> // multiple algorithms, weighted with the quality value syntax: want-digest: <digest-algorithm><q-value>,<digest-algorithm><q-value> directives <digest-algorithm> supported digest algorithms are defined in rfc 3230 and rfc 5843, and include sha-256 and sha-512. s...
X-Content-Type-Options - HTTP
r 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 trans
form non-executable mime types into executable mime types. since then, other browsers have introduced it, even if their mime sniffing algorithms were less aggressive. starting with firefox 72, the opting out of mime sniffing is also applied to top-level documents if a content-type is provided. this can cause html web pages to be downloaded instead of being rendered when they are served with a mime ty...
X-Forwarded-Host - HTTP
d by the client in the host http request header. host names and ports of reverse proxies (load balancers, cdns) may differ from the origin server handling the request, in that case the x-forwarded-host header is useful to determine which host was originally used. this header is used for debugging, statistics, and generating location-dependent content and by design it exposes privacy sensitive in
formation, such as the ip address of the client. therefore the user's privacy must be kept in mind when deploying this header. a standardized version of this header is the http forwarded header. header type request header forbidden header name no syntax x-forwarded-host: <host> directives <host> the domain name of the forwarded server. examples x-forwarded-ho...
X-Forwarded-Proto - HTTP
the client and the load balancer, the x-forwarded-proto request header can be used. a standardized version of this header is the http forwarded header. header type request header forbidden header name no syntax x-forwarded-proto: <protocol> directives <protocol> the forwarded protocol (http or https). examples x-forwarded-proto: https other non-standard
forms: # microsoft front-end-https: on x-forwarded-protocol: https x-forwarded-ssl: on x-url-scheme: https specifications not part of any current specification. the standardized version of this header is forwarded. ...
CONNECT - HTTP
then proceeds to make the connection on behalf of the client. once the connection has been established by the server, the proxy server continues to proxy the tcp stream to and from the client. connect is a hop-by-hop method. request has body no successful response has body yes safe no idempotent no cacheable no allowed in html
forms no syntax connect www.example.com:443 http/1.1 example some proxy servers might need authority to create a tunnel. see also the proxy-authorization header. connect server.example.com:80 http/1.1 host: server.example.com:80 proxy-authorization: basic agvsbg86d29ybgq= specifications specification title rfc 7231, section 4.3.6: connect hypertext transfer...
DELETE - HTTP
the http delete request method deletes the specified resource. request has body may successful response has body may safe no idempotent yes cacheable no allowed in html
forms no syntax delete /file.html http/1.1 example request delete /file.html http/1.1 responses if a delete method is successfully applied, there are several response status codes possible: a 202 (accepted) status code if the action will likely succeed but has not yet been enacted. a 204 (no content) status code if the action has been enacted and no further in
formation is to be supplied. a 200 (ok) status code if the action has been enacted and the response message includes a representation describing the status. http/1.1 200 ok date:...
GET - HTTP
the http get method requests a representation of the specified resource. requests using get should only retrieve data. ...
HEAD - HTTP
to describe the response which a similar get request would have received. ...
507 Insufficient Storage - HTTP
the hypertext transfer protocol (http) 507 insufficient storage response status code may be given in the context of the web distributed authoring and versioning (webdav) protocol (see rfc 4918). it indicates that a method could not be per
formed because the server cannot store the representation needed to successfully complete the request. status 507 insufficient storage specifications specification title rfc 4918, section 11.5: 507 insufficient storage web distributed authoring and versioning ...
Keyed collections - JavaScript
, meaning that they are a target of garbage collection (gc) if there is no other reference to the object anymore. the weakmap api is the same as the map api. one difference to map objects is that weakmap keys are not enumerable (i.e., there is no method giving you a list of the keys). if they were, the list would depend on the state of garbage collection, introducing non-determinism. for more in
formation and example code, see also "why weakmap?" on the weakmap reference page. one use case of weakmap objects is to store private data for an object, or to hide implementation details. the following example is from nick fitzgerald's blog post "hiding implementation details with ecmascript 6 weakmaps". the private data and methods belong inside the object and are stored in the privates weakmap ob...
Groups and ranges - JavaScript
in an array whose members are in the same order as the left parentheses in the capturing group. this is usually just the order of the capturing groups themselves. this becomes important when capturing groups are nested. matches are accessed using the index of the the result's elements ([1], ..., [n]) or from the predefined regexp object's properties ($1, ..., $9). capturing groups have a per
formance penalty. if you don't need the matched substring to be recalled, prefer non-capturing parentheses (see below). string.match() won't return groups if the /.../g flag is set. however, you can still use string.matchall() to get all matches. \n where "n" is a positive integer. a back reference to the last substring matching the n parenthetical in the regular expression (...
About the JavaScript reference - JavaScript
you're learning javascript, or need help understanding some of its capabilities or features, check out the javascript guide. the javascript language is intended to be used within some larger environment, be it a browser, server-side scripts, or similar. for the most part, this reference attempts to be environment-agnostic and does not target a web browser environment. where to find javascript in
formation javascript documentation of core language features (pure ecmascript, for the most part) includes the following: the javascript guide the javascript reference if you are new to javascript, start with the guide. once you have a firm grasp of the fundamentals, you can use the reference to get more details on individual objects and language constructs. structure of the reference in the ...
extends - JavaScript
// note: in derived classes, super() must be called before you // can use 'this'. leaving this out will cause a reference error. this.name = 'square'; } get area() { return this.height * this.width; } } using extends with built-in objects this example extends the built-in date object. this example is extracted from this live demo (source). class mydate extends date { get
formatteddate() { var months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']; return this.getdate() + '-' + months[this.getmonth()] + '-' + this.getfullyear(); } } specifications specification ecmascript (ecma-262)the definition of 'extends' in that specification. ...
Warning: 08/09 is not a legal ECMA-262 octal constant - JavaScript
is interpreted as an octal number. because this is not the case with 08 and 09, javascript warns about it. note that octal literals and octal escape sequences are deprecated and will present an additional deprecation warning. with ecmascript 6 and later, the syntax uses a leading zero followed by a lowercase or uppercase latin letter "o" (0o or 0o). see the page about lexical grammar for more in
formation. examples invalid octal numbers 08; 09; // syntaxerror: 08 is not a legal ecma-262 octal constant // syntaxerror: "0"-prefixed octal literals and octal escape sequences // are deprecated valid octal numbers use a leading zero followed by the letter "o"; 0o755; 0o644; ...
SyntaxError: invalid regular expression flag "x" - JavaScript
syntax: var re = /pattern/flags; or var re = new regexp('pattern', 'flags'); regular expression flags flag description g global search. i case-insensitive search. m multi-line search. s allow . to match newlines (added in ecmascript 2018) u unicode; treat pattern as a sequence of unicode code points y per
form a "sticky" search that matches starting at the current position in the target string. see sticky examples there are only six valid regular expression flags. /foo/bar; // syntaxerror: invalid regular expression flag "b" did you intend to create a regular expression? an expression containing two slashes is interpreted as a regular expression literal. let obj = { url: /docs/web }; //...
TypeError: cyclic object value - JavaScript
javascript exception "cyclic object value" occurs when object references were found in json. json.stringify() doesn't try to solve them and fails accordingly. 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? the json
format per se doesn't support object references (although an ietf draft exists), hence json.stringify() doesn't try to solve them and fails accordingly. 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 o...
SyntaxError: identifier starts immediately after numeric literal - JavaScript
when an identifier started with a digit. identifiers can only start with a letter, underscore (_), or dollar sign ($). message syntaxerror: unexpected identifier after numeric literal (edge) syntaxerror: identifier starts immediately after numeric literal (firefox) syntaxerror: unexpected number (chrome) error type syntaxerror what went wrong? the names of variables, called identifiers, con
form to certain rules, which your code must adhere to! a javascript identifier must start with a letter, underscore (_), or dollar sign ($). they can't start with a digit! only subsequent characters can be digits (0-9). examples variable names starting with numeric literals variable names can't start with numbers in javascript. the following fails: var 1life = 'foo'; // syntaxerror: identifier st...
SyntaxError: missing } after function body - JavaScript
ng a function somewhere. check if any closing curly brackets or parenthesis are in the correct order. message syntaxerror: expected '}' (edge) syntaxerror: missing } after function body (firefox) error type syntaxerror what went wrong? there is a syntax mistake when creating a function somewhere. also check if any closing curly brackets or parenthesis are in the correct order. indenting or
formatting the code a bit nicer might also help you to see through the jungle. examples forgotten closing curly bracket oftentimes, there is a missing curly bracket in your function code: var charge = function() { if (sunny) { usesolarcells(); } else { promptbikeride(); }; correct would be: var charge = function() { if (sunny) { usesolarcells(); } else { promptbikeride()...
SyntaxError: missing } after property list - JavaScript
ing comma. message syntaxerror: expected '}' (edge) syntaxerror: missing } after property list (firefox) error type syntaxerror what went wrong? there is a mistake in the object initializer syntax somewhere. might be in fact a missing curly bracket, but could also be a missing comma, for example. also check if any closing curly brackets or parenthesis are in the correct order. indenting or
formatting the code a bit nicer might also help you to see through the jungle. examples forgotten comma oftentimes, there is a missing comma in your object initializer code: var obj = { a: 1, b: { myprop: 2 } c: 3 }; correct would be: var obj = { a: 1, b: { myprop: 2 }, c: 3 }; ...
TypeError: "x" is not a constructor - JavaScript
eerror: 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? there was an attempt to use an object or a variable as a constructor, but that object or variable is not a constructor. see constructor or the new operator for more in
formation on what a constructor is. there are many global objects, like string or array, which are constructable using new. however, some global objects are not and their properties and methods are static. the following javascript standard built-in objects are not a constructor: math, json, symbol, reflect, intl, atomics. generator functions cannot be used as constructors either. examples invalid ...
SyntaxError: unterminated string literal - JavaScript
eds ' + 'to wrap across multiple lines because ' + 'otherwise my code is unreadable.'; or you can use the backslash character ("\") at the end of each line to indicate that the string will continue on the next line. make sure there is no space or any other character after the backslash (except for a line break), or as an indent; otherwise it will not work. ...
arguments.callee - JavaScript
} } sillyfunction(); ecmascript 3 resolved these issues by allowing named function expressions. for example: [1, 2, 3, 4, 5].map(function factorial(n) { return !(n > 1) ? 1 : factorial(n - 1)*n; }); this has numerous benefits: the function can be called like any other from inside your code it does not create a variable in the outer scope (except for ie 8 and below) it has better per
formance than accessing the arguments object another feature that was deprecated was arguments.callee.caller, or more specifically function.caller. why is this? well, at any point in time you can find the deepest caller of any function on the stack, and as i said above looking at the call stack has one single major effect: it makes a large number of optimizations impossible, or much much more diffic...
getter - JavaScript
hold a value, although it is possible to use a getter and a setter in conjunction to create a type of pseudo-property. note the following when working with the get syntax: it can have an identifier which is either a number or a string; it must have exactly zero parameters (see incompatible es5 change: literal getter and setter functions must now have exactly zero or one arguments for more in
formation); it must not appear in an object literal with another get or with a data entry for the same property ({ get x() { }, get x() { } } and { x: ..., get x() { } } are forbidden). examples defining a getter on new objects in object initializers this will create a pseudo-property latest for object obj, which will return the last array item in log. const obj = { log: ['example','test'], ...
Rest parameters - JavaScript
log("manymoreargs", manymoreargs) } myfun("one", "two", "three", "four", "five", "six") // console output: // a, one // b, two // manymoreargs, [three, four, five, six] difference between rest parameters and the arguments object there are three main differences between rest parameters and the arguments object: rest parameters are only the ones that haven't been given a separate name (i.e.
formally defined in function expression), while the arguments object contains all arguments passed to the function; the arguments object is not a real array, while rest parameters are array instances, meaning methods like sort, map, foreach or pop can be applied on it directly; the arguments object has additional functionality specific to itself (like the callee property). from arguments to an arr...
setter - JavaScript
a type of pseudo-property. it is not possible to simultaneously have a setter on a property that holds an actual value. note the following when working with the set syntax: it can have an identifier which is either a number or a string; it must have exactly one parameter (see incompatible es5 change: literal getter and setter functions must now have exactly zero or one arguments for more in
formation); it must not appear in an object literal with another set or with a data entry for the same property. ( { set x(v) { }, set x(v) { } } and { x: ..., set x(v) { } } are forbidden ) examples defining a setter on new objects in object initializers the following example define a pseudo-property current of object language. when current is assigned a value, it updates log with that value:...
Array.prototype.forEach() - JavaScript
ction. converting a for loop to foreach const items = ['item1', 'item2', 'item3'] const copyitems = [] // before for (let i = 0; i < items.length; i++) { copyitems.push(items[i]) } // after items.foreach(function(item){ copyitems.push(item) }) printing the contents of an array note: in order to display the content of an array in the console, you can use console.table(), which prints a
formatted version of the array. the following example illustrates an alternative approach, using foreach(). the following code logs a line for each element in an array: function logarrayelements(element, index, array) { console.log('a[' + index + '] = ' + element) } // notice that index 2 is skipped, since there is no item at // that position in the array... [2, 5, , 9].foreach(logarrayelements...
Array.prototype.indexOf() - JavaScript
nan !== nan, it will never be found. fast-path it. } else // all else for (; i !== len; ++i) if (that[i] === member) return i return -1 // if the value was not found, then return -1 } })(object, math.max, math.min) however, if you are more interested in all the little technical bits defined by the ecma standard, and are less concerned about per
formance or conciseness, then you may find this more descriptive polyfill to be more useful. // production steps of ecma-262, edition 5, 15.4.4.14 // reference: http://es5.github.io/#x15.4.4.14 if (!array.prototype.indexof) { array.prototype.indexof = function(searchelement, fromindex) { "use strict"; var k; // 1. let o be the result of calling toobject passing // the this value...
Array.of() - JavaScript
tual undefined values). array.of(7); // [7] array.of(1, 2, 3); // [1, 2, 3] array(7); // array of 7 empty slots array(1, 2, 3); // [1, 2, 3] syntax array.of(element0[, element1[, ...[, elementn]]]) parameters elementn elements used to create the array. return value a new array instance. description this function is part of the ecmascript 2015 standard. for more in
formation, see: array.of() array.from() proposal array.of() polyfill polyfill running the following code before any other code will create array.of() if it's not natively available. if (!array.of) { array.of = function() { return array.prototype.slice.call(arguments); // or let vals = []; for(let prop in arguments){ vals.push(arguments[prop]); } return vals;...
ArrayBuffer - JavaScript
the arraybuffer object is used to represent a generic, fixed-length raw binary data buffer. 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. the arraybuffer() constructor creates a new arraybuffer of the given length in bytes. you can also get an array buffer from existing data, for example from a base64 string or from a local file. constructor arraybuffer() creates a new arraybuffer object. static properties get arraybuffer[@@species] the constructor function that is used to create derived objects. static m...
AsyncFunction - JavaScript
a new async function object. in javascript, every asynchronous function is actually an asyncfunction object. note that asyncfunction is not a global object. it can be obtained with the following code: object.getprototypeof(async function(){}).constructor syntax new asyncfunction([arg1[, arg2[, ...argn]],] functionbody) parameters arg1, arg2, ... argn names to be used by the function as
formal argument names. each must be a string that corresponds to a valid javascript identifier or a list of such strings separated with a comma; for example "x", "thevalue", or "a,b". functionbody a string containing the javascript statements comprising the function definition. description async function objects created with the asyncfunction constructor are parsed when the function is created. t...
BigInt - JavaScript
↪ 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. be careful coercing values back and forth, however, as the precision of a bigint may be lost when it is coerced to a number. type in
formation 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): +, *, -, **, %. bitwise operators ar...
BigInt64Array() constructor - JavaScript
if control over byte order is needed, use dataview instead. the contents are initialized to 0n. once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation). ...
BigInt64Array - JavaScript
if control over byte order is needed, use dataview instead. the contents are initialized to 0n. once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation). constructor bigint64array() creates a new bigint64array object. static properties bigint64array.bytes_per_element returns a number value of the element size. 8 in the case of a bigint64array. bigint64array.name returns the string value of the constructor name. in the case of the bigint64array type, this is "bigint64array". ...
BigUint64Array() constructor - JavaScript
if control over byte order is needed, use dataview instead. the contents are initialized to 0n. once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation). ...
BigUint64Array - JavaScript
if control over byte order is needed, use dataview instead. the contents are initialized to 0n. once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation). constructor biguint64array() creates a new biguint64array object. static properties biguint64array.bytes_per_element returns a number value of the element size. 8 in the case of a biguint64array. biguint64array.name returns the string value of the constructor name. in the case of the biguint64array type this is "biguint64array". ...
Boolean - JavaScript
ndition in the following if statement evaluates to true: var x = new boolean(false); if (x) { // this code is executed } this behavior does not apply to boolean primitives. for example, the condition in the following if statement evaluates to false: var x = false; if (x) { // this code is not executed } do not use a boolean object to convert a non-boolean value to a boolean value. to per
form this task, instead, use boolean as a function, or a double not operator: var x = boolean(expression); // use this... var x = !!(expression); // ...or this var x = new boolean(expression); // don't use this! if you specify any object, including a boolean object whose value is false, as the initial value of a boolean object, the new boolean object has a value of true. var myfalse =...
DataView() constructor - JavaScript
epresenting the specified data buffer. (that probably wasn't a very helpful description.) you can think of the returned object as an "interpreter" of the array buffer of bytes — it knows how to convert numbers to fit within the buffer correctly, both when reading and writing to it. this means handling integer and float conversion, endianness, and other details of representing numbers in binary
form. exceptions rangeerror thrown if the byteoffset or bytelength parameter values result in the view extending past the end of the buffer. for example, if the buffer is 16 bytes long, the byteoffset is 8, and the bytelength is 10, this error is thrown because the resulting view tries to extend 2 bytes past the total length of the buffer. examples using dataview var buffer = new arrayb...
DataView.prototype.getBigInt64() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.getbigint64(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to read the data from. littleendian optional indicates whether the 64-bit int is stored in little- or big-endian
format. if false or undefined, a big-endian value is read. return value a bigint. errors thrown rangeerror thrown if the byteoffset is set such that it would read beyond the end of the view. description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getbigint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buff...
DataView.prototype.getBigUint64() - JavaScript
f you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.getbiguint64(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to read the data from. littleendian optional indicates whether the 64-bit int is stored in little- or big-endian
format. if false or undefined, a big-endian value is read. return value a bigint. errors thrown rangeerror thrown if the byteoffset is set such that it would read beyond the end of the view. description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getbiguint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buf...
DataView.prototype.getFloat32() - JavaScript
f you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.getfloat32(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data. littleendian optional indicates whether the 32-bit float is stored in little- or big-endian
format. if false or undefined, a big-endian value is read. return value a signed 32-bit float number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view. description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getfloat32 method var buffer = new arraybuffer(8); var dataview = ...
DataView.prototype.getFloat64() - JavaScript
f you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.getfloat64(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data. littleendian optional indicates whether the 64-bit float is stored in little- or big-endian
format. if false or undefined, a big-endian value is read. return value a signed 64-bit float number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view. description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getfloat64 method var buffer = new arraybuffer(8); var dataview = ...
DataView.prototype.getInt16() - JavaScript
y. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.getint16(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data. littleendian optional indicates whether the 16-bit int is stored in little- or big-endian
format. if false or undefined, a big-endian value is read. return value a signed 16-bit integer number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view. description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getint16 method var buffer = new arraybuffer(8); var dataview = ...
DataView.prototype.getInt32() - JavaScript
. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.getint32(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view where to read the data. littleendian optional indicates whether the 32-bit int is stored in little- or big-endian
format. if false or undefined, a big-endian value is read. return value a signed 32-bit integer number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view. description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getint32 method var buffer = new arraybuffer(8); var dataview = ...
DataView.prototype.getUint16() - JavaScript
. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.getuint16(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data. littleendian optional indicates whether the 16-bit int is stored in little- or big-endian
format. if false or undefined, a big-endian value is read. return value an unsigned 16-bit integer number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view. description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getuint16 method var buffer = new arraybuffer(8); var datavie...
DataView.prototype.getUint32() - JavaScript
. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.getuint32(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data. littleendian optional indicates whether the 32-bit int is stored in little- or big-endian
format. if false or undefined, a big-endian value is read. return value an unsigned 32-bit integer number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view. description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getuint32 method var buffer = new arraybuffer(8); var datavie...
DataView.prototype.setBigInt64() - JavaScript
arameters byteoffset the offset, in bytes, from the start of the view to store the data from. value the value to set as a bigint. the highest possible value that fits in a signed 64-bit integer is 2n ** (64n -1n) - 1n (9223372036854775807n). upon overflow, it will be negative (-9223372036854775808n). littleendian optional indicates whether the 64-bit int is stored in little- or big-endian
format. if false or undefined, a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such that it would store beyond the end of the view. examples using the setbigint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setbigint64(0, 3n); dataview.getbigint64(0); // 3n specifications s...
DataView.prototype.setBigUint64() - JavaScript
alue [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to store the data from. value the value to set as a bigint. the highest possible value that fits in an unsigned 64-bit integer is 2n ** 64n - 1n (18446744073709551615n). upon overflow, it will be zero (0n). littleendian optional indicates whether the 64-bit int is stored in little- or big-endian
format. if false or undefined, a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such that it would store beyond the end of the view. examples using the setbiguint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setbiguint64(0, 3n); dataview.getbiguint64(0); // 3n specifications ...
DataView.prototype.setFloat32() - JavaScript
interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.setfloat32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data. value the value to set. littleendian optional indicates whether the 32-bit float is stored in little- or big-endian
format. if false or undefined, a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. examples using the setfloat32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setfloat32(1, 3); dataview.getfloat32(1); // 3 specifications specific...
DataView.prototype.setFloat64() - JavaScript
interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.setfloat64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data. value the value to set. littleendian optional indicates whether the 64-bit float is stored in little- or big-endian
format. if false or undefined, a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. examples using the setfloat64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setfloat64(0, 3); dataview.getfloat64(0); // 3 specifications specific...
DataView.prototype.setInt16() - JavaScript
the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.setint16(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data. value the value to set. littleendian optional indicates whether the 16-bit int is stored in little- or big-endian
format. if false or undefined, a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. examples using the setint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setint16(1, 3); dataview.getint16(1); // 3 specifications specification ...
DataView.prototype.setInt32() - JavaScript
the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.setint32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data. value the value to set. littleendian optional indicates whether the 32-bit int is stored in little- or big-endian
format. if false or undefined, a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. examples using the setint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setint32(1, 3); dataview.getint32(1); // 3 specifications specification ...
DataView.prototype.setUint16() - JavaScript
he interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.setuint16(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data. value the value to set. littleendian optional indicates whether the 16-bit int is stored in little- or big-endian
format. if false or undefined, a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. examples using the setuint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setuint16(1, 3); dataview.getuint16(1); // 3 specifications specificati...
DataView.prototype.setUint32() - JavaScript
he interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dataview.setuint32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data. value the value to set. littleendian optional indicates whether the 32-bit int is stored in little- or big-endian
format. if false or undefined, a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. examples using the setuint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setuint32(1, 3); dataview.getuint32(1); // 3 specifications specificati...
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 plat
form's endianness. description endianness multi-byte number
formats are represented in memory differently depending on machine architecture — see endianness for an explanation. dataview accessors provide explicit control of how data is accessed, regardless of the executing computer's endianness. var littleendian = (function() { var buffer = new arraybuffer(2); new dataview(buffer).setint16(0, 256, true /* littleendian */); // int16array uses the plat
form's endianness. return new int16array(buffer)[0] === 256; })(); console.log(littleendian); // true or false 64-bit integer values because javascript does not currently incl...
Date.prototype.setFullYear() - JavaScript
fy the monthvalue. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the monthvalue and datevalue parameters, the values returned from the getmonth() and getdate() methods are used. if a parameter you specify is outside of the expected range, setfullyear() attempts to update the other parameters and the date in
formation in the date object accordingly. for example, if you specify 15 for monthvalue, the year is incremented by 1 (yearvalue + 1), and 3 is used for the month. examples using setfullyear() var thebigday = new date(); thebigday.setfullyear(1997); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setfullyear' in that specification. ...
Date.prototype.setHours() - JavaScript
alue. return value the number of milliseconds between january 1, 1970 00:00:00 utc and the updated date. description if you do not specify the minutesvalue, secondsvalue, and msvalue parameters, the values returned from the getminutes(), getseconds(), and getmilliseconds() methods are used. if a parameter you specify is outside of the expected range, sethours() attempts to update the date in
formation in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes will be incremented by 1 (minutesvalue + 1), and 40 will be used for seconds. examples using sethours() var thebigday = new date(); thebigday.sethours(7); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.sethours' in that specification. ...
Date.prototype.setMilliseconds() - JavaScript
lone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.setmilliseconds(millisecondsvalue) parameters millisecondsvalue a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you specify a number outside the expected range, the date in
formation in the date object is updated accordingly. for example, if you specify 1005, the number of seconds is incremented by 1, and 5 is used for the milliseconds. examples using setmilliseconds() var thebigday = new date(); thebigday.setmilliseconds(100); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setmilliseconds' in that specificatio...
Date.prototype.setMinutes() - JavaScript
ify the minutesvalue and secondsvalue. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the secondsvalue and msvalue parameters, the values returned from getseconds() and getmilliseconds() methods are used. if a parameter you specify is outside of the expected range, setminutes() attempts to update the date in
formation in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes will be incremented by 1 (minutesvalue + 1), and 40 will be used for seconds. examples using setminutes() var thebigday = new date(); thebigday.setminutes(45); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setminutes' in that specification. ...
Date.prototype.setMonth() - JavaScript
dayvalue optional. an integer from 1 to 31, representing the day of the month. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the dayvalue parameter, the value returned from the getdate() method is used. if a parameter you specify is outside of the expected range, setmonth() attempts to update the date in
formation in the date object accordingly. for example, if you use 15 for monthvalue, the year will be incremented by 1, and 3 will be used for month. the current day of month will have an impact on the behaviour of this method. conceptually it will add the number of days given by the current day of the month to the 1st day of the new month specified as the parameter, to return the new date. for examp...
Date.prototype.setSeconds() - JavaScript
ue optional. a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the msvalue parameter, the value returned from the getmilliseconds() method is used. if a parameter you specify is outside of the expected range, setseconds() attempts to update the date in
formation in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes stored in the date object will be incremented by 1, and 40 will be used for seconds. examples using setseconds() var thebigday = new date(); thebigday.setseconds(30); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setseconds' in that specifica...
Date.prototype.setUTCDate() - JavaScript
.com/mdn/interactive-examples and send us a pull request. syntax dateobj.setutcdate(dayvalue) parameters dayvalue an integer from 1 to 31, representing the day of the month. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if a parameter you specify is outside of the expected range, setutcdate() attempts to update the date in
formation in the date object accordingly. for example, if you use 40 for dayvalue, and the month stored in the date object is june, the day will be changed to 10 and the month will be incremented to july. examples using setutcdate() var thebigday = new date(); thebigday.setutcdate(20); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcdat...
Date.prototype.setUTCFullYear() - JavaScript
onthvalue. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the monthvalue and dayvalue parameters, the values returned from the getutcmonth() and getutcdate() methods are used. if a parameter you specify is outside of the expected range, setutcfullyear() attempts to update the other parameters and the date in
formation in the date object accordingly. for example, if you specify 15 for monthvalue, the year is incremented by 1 (yearvalue + 1), and 3 is used for the month. examples using setutcfullyear() var thebigday = new date(); thebigday.setutcfullyear(1997); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcfullyear' in that specification. ...
Date.prototype.setUTCHours() - JavaScript
rn value the number of milliseconds between january 1, 1970 00:00:00 utc and the updated date. description if you do not specify the minutesvalue, secondsvalue, and msvalue parameters, the values returned from the getutcminutes(), getutcseconds(), and getutcmilliseconds() methods are used. if a parameter you specify is outside of the expected range, setutchours() attempts to update the date in
formation in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes will be incremented by 1 (minutesvalue + 1), and 40 will be used for seconds. examples using setutchours() var thebigday = new date(); thebigday.setutchours(8); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutchours' in that specification.
Date.prototype.setUTCMilliseconds() - JavaScript
send us a pull request. syntax dateobj.setutcmilliseconds(millisecondsvalue) parameters millisecondsvalue a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if a parameter you specify is outside of the expected range, setutcmilliseconds() attempts to update the date in
formation in the date object accordingly. for example, if you use 1100 for millisecondsvalue, the seconds stored in the date object will be incremented by 1, and 100 will be used for milliseconds. examples using setutcmilliseconds() var thebigday = new date(); thebigday.setutcmilliseconds(500); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.
Date.prototype.setUTCMinutes() - JavaScript
inutesvalue and secondsvalue. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the secondsvalue and msvalue parameters, the values returned from getutcseconds() and getutcmilliseconds() methods are used. if a parameter you specify is outside of the expected range, setutcminutes() attempts to update the date in
formation in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes will be incremented by 1 (minutesvalue + 1), and 40 will be used for seconds. examples using setutcminutes() var thebigday = new date(); thebigday.setutcminutes(43); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcminutes' in that specifi...
Date.prototype.setUTCMonth() - JavaScript
alue optional. an integer from 1 to 31, representing the day of the month. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the dayvalue parameter, the value returned from the getutcdate() method is used. if a parameter you specify is outside of the expected range, setutcmonth() attempts to update the date in
formation in the date object accordingly. for example, if you use 15 for monthvalue, the year will be incremented by 1, and 3 will be used for month. examples using setutcmonth() var thebigday = new date(); thebigday.setutcmonth(11); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcmonth' in that specification. ...
Date.prototype.setUTCSeconds() - JavaScript
tional. a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the msvalue parameter, the value returned from the getutcmilliseconds() method is used. if a parameter you specify is outside of the expected range, setutcseconds() attempts to update the date in
formation in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes stored in the date object will be incremented by 1, and 40 will be used for seconds. examples using setutcseconds() var thebigday = new date(); thebigday.setutcseconds(20); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcseconds' in that ...
Error.prototype.name - JavaScript
the name property represents a name for the type of error. the initial value is "error". description by default, error instances are given the name "error". the name property, in addition to the message property, is used by the error.prototype.tostring() method to create a string representation of the error. examples throwing a custom error var e = new error('mal
formed input'); // e.name is 'error' e.name = 'parseerror'; throw e; // e.tostring() would return 'parseerror: mal
formed input' specifications specification ecmascript (ecma-262)the definition of 'error.prototype.name' in that specification. ...
Error - JavaScript
tends error { constructor(foo = 'bar', ...params) { // pass remaining arguments (including vendor specific ones) to parent constructor super(...params) // maintains proper stack trace for where our error was thrown (only available on v8) if (error.capturestacktrace) { error.capturestacktrace(this, customerror) } this.name = 'customerror' // custom debugging in
formation this.foo = foo this.date = new date() } } try { throw new customerror('baz', 'bazmessage') } catch(e) { console.error(e.name) //customerror console.error(e.foo) //baz console.error(e.message) //bazmessage console.error(e.stack) //stacktrace } es5 custom error object all browsers include the customerror constructor in the stack trace when using a prototypal de...
FinalizationRegistry - JavaScript
s. complex factors may lead to objects being held alive for unexpected amounts of time, such as use with certain apis. notes on cleanup callbacks some notes on cleanup callbacks: developers shouldn't rely on cleanup callbacks for essential program logic. cleanup callbacks may be useful for reducing memory usage across the course of a program, but are unlikely to be useful otherwise. a con
forming javascript implementation, even one that does garbage collection, is not required to call cleanup callbacks. when and whether it does so is entirely down to the implementation of the javascript engine. when a registered object is reclaimed, any cleanup callbacks for it may be called then, or some time later, or not at all. it's likely that major implementations will call cleanup callbacks at ...
Float32Array() constructor - JavaScript
if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). ...
Float32Array - JavaScript
if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). constructor float32array() creates a new float32array object. static properties float32array.bytes_per_element returns a number value of the element size. 4 in the case of an float32array. ...
Float64Array() constructor - JavaScript
if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). ...
Float64Array - JavaScript
if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). constructor float64array() creates a new float64array object. static properties float64array.bytes_per_element returns a number value of the element size. 8 in the case of an float64array. ...
Function.prototype.apply() - JavaScript
the global object, and primitive values will be boxed. this argument is required. argsarray optional an array-like object, specifying the arguments with which func should be called, or null or undefined if no arguments should be provided to the function. starting with ecmascript 5 these arguments can be a generic array-like object instead of an array. see below for browser compatibility in
formation. return value the result of calling the function with the specified this value and arguments. description note: while the syntax of this function is almost identical to that of call(), the fundamental difference is that call() accepts an argument list, while apply() accepts a single array of arguments. note: when the first argument is undefined or null a similar outcome can be ach...
Function.length - JavaScript
ect, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of function.length writable no enumerable no configurable yes description length is a property of a function object, and indicates how many arguments the function expects, i.e. the number of
formal parameters. this number excludes the rest parameter and only includes parameters before the first one with a default value. by contrast, arguments.length is local to a function and provides the number of arguments actually passed to the function. data property of the function constructor the function constructor is itself a function object. its length data property has a value of 1. the prope...
Function.name - JavaScript
ull request. property attributes of function.name writable no enumerable no configurable yes note that in non-standard, pre-es2015 implementations the configurable attribute was false as well. javascript compressors and minifiers warning: be careful when using function.name and source code trans
formations, such as those carried out by javascript compressors (minifiers) or obfuscators. these tools are often used as part of a javascript build pipeline to reduce the size of a program prior to deploying it to production. such trans
formations often change a function's name at build-time. source code such as: function foo() {}; let foo = new foo(); if (foo.constructor.name === 'foo') { conso...
Function - JavaScript
every javascript function is actually a function object. this can be seen with the code (function(){}).constructor === function, which returns true. constructor function() creates a new function object. calling the constructor directly can create functions dynamically but suffers from security and similar (but far less significant) per
formance issues to eval. however, unlike eval, the function constructor creates functions that execute in the global scope only. instance properties function.arguments an array corresponding to the arguments passed to a function. this is deprecated as a property of function. use the arguments object (available within the function) instead. function.caller specifies the function that invoked the currently executing function. this property is deprec...
Generator - JavaScript
constructor this object cannot be instantiated directly. instead, a generator instance can be returned from a generator function: function* generator() { yield 1; yield 2; yield 3; } const gen = generator(); // "generator { }" instance methods generator.prototype.next() returns a value yielded by the yield expression. generator.prototype.return() returns the given value and finishes the generator. generator.prototype.throw() throws an error to a generator (also finishes the generator, unless caught from within that generator). ...
GeneratorFunction - JavaScript
nction object. in javascript, every generator function is actually a generatorfunction object. note that generatorfunction is not a global object. it could be obtained by evaluating the following code. object.getprototypeof(function*(){}).constructor syntax new generatorfunction ([arg1[, arg2[, ...argn]],] functionbody) parameters arg1, arg2, ... argn names to be used by the function as
formal argument names. each must be a string that corresponds to a valid javascript identifier or a list of such strings separated with a comma; for example "x", "thevalue", or "a,b". functionbody a string containing the javascript statements comprising the function definition. description generator function objects created with the generatorfunction constructor are parsed when the function is cr...
Int16Array() constructor - JavaScript
if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). ...
Int16Array - JavaScript
if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). constructor int16array() creates a new int16array object. static properties int16array.bytes_per_element returns a number value of the element size. 2 in the case of an int16array. int16array.name returns the string value of the constructor name. in the case of the int16array type: "int16array". ...
Int32Array() constructor - JavaScript
if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). ...
Int32Array - JavaScript
if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). constructor int32array() creates a new int32array object. static properties int32array.bytes_per_element returns a number value of the element size. 4 in the case of an int32array. int32array.name returns the string value of the constructor name. in the case of the int32array type: "int32array". ...
InternalError - JavaScript
n runs 10 times, as per the exit condition. function loop(x) { if (x >= 10) // "x >= 10" is the exit condition return; // do stuff loop(x + 1); // the recursive call } loop(0); setting this condition to an extremely high value, won't work: function loop(x) { if (x >= 1000000000000) return; // do stuff loop(x + 1); } loop(0); // internalerror: too much recursion for more in
formation, see internalerror: too much recursion. specifications not part of any standard. ...
Intl.Collator.supportedLocalesOf() - JavaScript
ale. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax intl.collator.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings. for the general
form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for in
formation about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supp...
Intl.DisplayNames.prototype.of() - JavaScript
e a languagecode ["-" scriptcode] ["-" regioncode ] *("-" variant ) subsequence of the unicode_language_id grammar in uts 35's unicode language and locale identifiers grammar. languagecode is either a two letters iso 639-1 language code or a three letters iso 639-2 language code. if the type is "currency", code should be a 3-letter iso 4217 currency code. return value a language-specific
formatted string. examples using the of method let regionnames = new intl.displaynames(['en'], {type: 'region'}); regionnames.of('419'); // "latin america" let languagenames = new intl.displaynames(['en'], {type: 'language'}); languagenames.of('fr'); // "french" let currencynames = new intl.displaynames(['en'], {type: 'currency'}); currencynames.of('eur'); // "euro" specifications sp...
Intl.DisplayNames - JavaScript
of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.displaynames.prototype.of() this method receives a code and returns a string based on the locale and options provided when instantiating intl.displaynames. intl.displaynames.prototype.resolvedoptions() returns a new object with properties reflecting the locale and
formatting options computed during initialization of the object. examples region code display names to create an intl.displaynames for a locale and get the display name for a region code. // 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'); //...
Intl.Locale.prototype.collation - JavaScript
moji characters eor european ordering rules gb2312 pinyin ordering for latin, gb2312han charset ordering for cjk characters (used in chinese) phonebk phonebook style ordering (such as in german) phonetic phonetic ordering (sorting based on pronunciation) pinyin pinyin ordering for latin and for cjk characters (used in chinese) re
formed re
formed ordering (such as in swedish) search special collation type for string search searchjl special collation type for korean initial consonant search standard default ordering for each language stroke pinyin ordering for latin, stroke order for cjk characters (used in chinese) trad traditional style ordering (such as in spanish...
Intl.Locale.prototype.hourCycle - JavaScript
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. like other additional locale data, hour cycle type is an extension subtag, which extends the data contained in a locale string. the hour cycle type can have several different values, which are listed in the table below. ...
Intl.Locale.prototype.minimize() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax locale.minimize() return value a locale instance whose basename property returns the result of the remove likely subtags algorithm executed against locale.basename. description this method carries out the reverse of maximize(), removing any language, script, or region subtags from the locale language identifier (essentially the contents of basename). ...
Intl.Locale.prototype.toString() - JavaScript
s interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax locale.tostring() return value the locale's unicode locale identifier string. description the locale object is a javascript representation of a concept unicode locale identifier. in
formation about a particular locale (language, script, calendar type, etc.) can be encoded in a locale identifier string. to make it easier to work with these locale identifiers, the locale object was introduced to javascript. calling the tostring method on a locale object will return the identifier string for that particular locale. the tostring method allows locale instances to be provided as an arg...
Intl.PluralRules.select() - JavaScript
the intl.pluralrules.prototype.select method returns a string indicating which plural rule to use for locale-aware
formatting. syntax pluralcategory = pluralrule.select(number) parameters number the number to get a plural rule for. return value a string representing the pluralization category of the number, can be one of zero, one, two, few, many or other. description this function selects a pluralization category according to the locale and
formatting options of a pluralrules object. examples using select() new intl.pluralrules('ar-eg').select(0); // → 'zero' new intl.pluralrules('ar-eg').select(1); // → 'one' new intl.pluralrules('ar-eg').select(2); // → 'two' new intl.pluralrules('ar-eg').select(6); // → 'few' new intl.pluralrules('ar-eg').select(18); // → 'ma...
Math.atan() - JavaScript
se atan() is a static method of math, you always use it as math.atan(), rather than as a method of a math object you created (math is not a constructor). examples using math.atan() math.atan(1); // 0.7853981633974483 math.atan(0); // 0 math.atan(-0); // -0 math.atan(infinity); // 1.5707963267948966 math.atan(-infinity); // -1.5707963267948966 // the angle that the line [(0,0);(x,y)]
forms with the x-axis in a cartesian coordinate system math.atan(y / x); note that you may want to avoid using ±infinity for stylistic reasons. in this case, math.atan2() with 0 as the second argument may be a better solution. specifications specification ecmascript (ecma-262)the definition of 'math.atan' in that specification. ...
Math.clz32() - JavaScript
integer &= (integer << 16) | 0xffff; integer &= (integer << 8 ) | 0x00ff; integer &= (integer << 4 ) | 0x000f; integer &= (integer << 2 ) | 0x0003; integer &= (integer << 1 ) | 0x0001; // 2. now, inversing the bits reveals the lowest zeros return 32 - clon(~integer) |0; */ } make these helper functions into asm.js module; then, you have a true per
formance masterpiece. situations like these are exactly what asm.js was designed for. var counttrailsmethods = (function(stdlib, foreign, heap) { "use asm"; var clz = stdlib.math.clz32; function ctrz(integer) { // count trailing zeros integer = integer | 0; // coerce to an integer // 1. fill in all the higher bits after the first one // asmjs for some reason does n...
Math.fround() - JavaScript
32-bit floating-point numbers, for example if you are reading values from a float32array. this can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. to solve this, math.fround() can be used to cast the 64-bit float to a 32-bit float. internally, javascript continues to treat the number as a 64-bit float, it just per
forms a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to 0. if the number is outside the range of a 32-bit float, infinity or -infinity is returned. because fround() is a static method of math, you always use it as math.fround(), rather than as a method of a math object you created (math is not a constructor). polyfill this can be emulated with the following ...
Math.hypot() - JavaScript
-examples and send us a pull request. syntax math.hypot([value1[, value2[, ...]]]) parameters value1, value2, ... numbers. return value the square root of the sum of squares of the given arguments. if at least one of the arguments cannot be converted to a number, nan is returned. description calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the
formula math.sqrt(v1*v1 + v2*v2), where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. the corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4). this function makes this calculation easier and faster; you simply call math.hypot(v1, v2) , or math...
Number.MAX_SAFE_INTEGER - JavaScript
uest. property attributes of number.max_safe_integer writable no enumerable no configurable no description the max_safe_integer constant has a value of 9007199254740991 (9,007,199,254,740,991 or ~9 quadrillion). the reasoning behind that number is that javascript uses double-precision floating-point
format numbers as specified in ieee 754 and can only safely represent numbers between -(253 - 1) and 253 - 1. safe in this context refers to the ability to represent integers exactly and to correctly compare them. for example, number.max_safe_integer + 1 === number.max_safe_integer + 2 will evaluate to true, which is mathematically incorrect. see number.issafeinteger() for more in
formation. this fie...
Number.MIN_SAFE_INTEGER - JavaScript
property attributes of number.min_safe_integer writable no enumerable no configurable no description the min_safe_integer constant has a value of -9007199254740991 (-9,007,199,254,740,991 or about -9 quadrillion). the reasoning behind that number is that javascript uses double-precision floating-point
format numbers as specified in ieee 754 and can only safely represent numbers between -(253 - 1) and 253 - 1. see number.issafeinteger() for more in
formation. because min_safe_integer is a static property of number, you always use it as number.min_safe_integer, rather than as a property of a number object you created. examples using min_safe_integer number.min_safe_integer // -9007199254740991 -(...
Number.isSafeInteger() - JavaScript
ound-to-nearest and round-to-zero rounding. the safe integers consist of all integers from -(253 - 1) inclusive to 253 - 1 inclusive (± 9007199254740991 or ± 9,007,199,254,740,991). handling values larger or smaller than ~9 quadrillion with full precision requires using an arbitrary precision arithmetic library. see what every programmer needs to know about floating point arithmetic for more in
formation on floating point representations of numbers. for larger integers, consider using the bigint type. syntax number.issafeinteger(testvalue) parameters testvalue the value to be tested for being a safe integer. return value a boolean indicating whether or not the given value is a number that is a safe integer. polyfill number.issafeinteger = number.issafeinteger || function (value...
Number.prototype.toFixed() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax numobj.tofixed([digits]) parameters digits optional the number of digits to appear after the decimal point; this may be a value between 0 and 20, inclusive, and implementations may optionally support a larger range of values. if this argument is omitted, it is treated as 0. return value a string representing the given number using fixed-point notation. exceptions rangeerror if digits is too small or too large. ...
Object.prototype.__defineSetter__() - JavaScript
implementing it. the __definesetter__ method binds an object's property to a function to be called when an attempt is made to set that property. syntax obj.__definesetter__(prop, fun) parameters prop a string containing the name of the property to be bound to the given function. fun a function to be called when there is an attempt to set the specified property. this function takes the
form function(val) { . . . } val an alias for the variable that holds the value attempted to be assigned to prop. return value undefined. description the __definesetter__ method allows a setter to be defined on a pre-existing object. examples non-standard and deprecated way var o = {}; o.__definesetter__('value', function(val) { this.anothervalue = val; }); o.value = 5; console.log...
Object.prototype.constructor - JavaScript
herits chain. function parent() { /* ... */ } parent.prototype.parentmethod = function parentmethod() {} function child() { parent.call(this) // make sure everything is initialized properly } child.prototype = object.create(parent.prototype) // re-define child prototype to parent prototype child.prototype.constructor = child // return original constructor to child but when do we need to per
form the last line here? unfortunately, the answer is: it depends. let's try to define the cases in which re-assignment of the original constructor will play a major role, and when it will be one superfluous line of code. take the following case: the object has the create() method to create itself. function parent() { /* ... */ } function createdconstructor() { parent.call(this) } createdconstr...
Object.create() - JavaScript
to is neither of these a typeerror is thrown. custom and null objects a new object created from a completely custom object (especially one created from the null object, which is basically a custom object with no members) can behave in unexpected ways. this is especially true when debugging, since common object-property converting/detecting utility functions may generate errors, or simply lose in
formation (especially if using silent error-traps that ignore errors). for example, here are two objects: oco = object.create( {} ); // create a normal object ocn = object.create( null ); // create a "null" object > console.log(oco) // {} -- seems normal > console.log(ocn) // {} -- seems normal here too, so far oco.p = 1; // create a simple property on normal obj ocn.p = 0; // create a simple pro...
Object.getOwnPropertyDescriptor() - JavaScript
roperty. prop the name or symbol of the property whose description is to be retrieved. return value a property descriptor of the given property if it exists on the object, undefined otherwise. description this method permits examination of the precise description of a property. a property in javascript consists of either a string-valued name or a symbol and a property descriptor. further in
formation about property descriptor types and their attributes can be found in object.defineproperty(). a property descriptor is a record with some of the following attributes: value the value associated with the property (data descriptors only). writable true if and only if the value associated with the property may be changed (data descriptors only). get a function which serves as a getter ...
Object.getOwnPropertyDescriptors() - JavaScript
which to get all own property descriptors. return value an object containing all own property descriptors of an object. might be an empty object, if there are no properties. description this method permits examination of the precise description of all own properties of an object. a property in javascript consists of either a string-valued name or a symbol and a property descriptor. further in
formation about property descriptor types and their attributes can be found in object.defineproperty(). a property descriptor is a record with some of the following attributes: value the value associated with the property (data descriptors only). writable true if and only if the value associated with the property may be changed (data descriptors only). get a function which serves as a getter ...
Promise() constructor - JavaScript
nature of this function is expected to be: function(resolutionfunc, rejectionfunc){ // typically, some asynchronous operation. } at the time when the constructor generates the new promiseobj, it also generates a corresponding pair of functions for resolutionfunc and rejectionfunc; these are "tethered" to the promiseobj. therefore, the code within the executor has the opportunity to per
form some operation and then reflect the operation's outcome(if the value is not another promise object) as either "fulfilled" or "rejected" by terminating with an invocation of either the resolutionfunc or the rejectionfunc, respectively. the executor has no meaningful return value. it communicates via the side-effect caused by resolutionfunc or rejectionfunc. the side-effect is that the promiseobj ...
Promise.any() - JavaScript
th the value from that promise. if no promises in the iterable fulfil (if all of the given promises are rejected), then the returned promise is rejected with an aggregateerror, a new subclass of error that groups together individual errors. essentially, this method is the opposite of promise.all(). warning! the promise.any() method is experimental and not fully supported by all browsers and plat
forms. it is currently in stage 4 of the tc39 process. syntax promise.any(iterable); parameters iterable an iterable object, such as an array. return value an already resolved promise if the iterable passed is empty. an asynchronously resolved promise if the iterable passed contains no promises. a pending promise in all other cases. this returned promise is then resolved/rejected asyn...
Promise.prototype.catch() - JavaScript
return value internally calls promise.prototype.then on the object upon which it was called, passing the parameters undefined and the received onrejected handler. returns the value of that call, which is a promise. note the examples below are throwing instances of error. this is considered good practice in contrast to throwing strings; otherwise, the part doing the catching would have to per
form checks to see if the argument was a string or an error, and you might lose valuable in
formation like stack traces. demonstration of the internal call: // overriding original promise.prototype.then/catch just to add some logs (function(promise){ var originalthen = promise.prototype.then; var originalcatch = promise.prototype.catch; promise.prototype.then = function(){ conso...
Promise - JavaScript
ode, the transiton of promisea into a "settled" state will cause both instances of .then() to be invoked. const promisea = new promise(myexecutorfunc); const promiseb = promisea.then(handlefulfilled1, handlerejected1); const promisec = promisea.then(handlefulfilled2, handlerejected2); an action can be assigned to an already "settled" promise. in that case the action (if appropriate) will be per
formed at the first asynchronous opportunity. note that promises are guaranteed to be asynchronous. therefore, an action for an already "settled" promise will occur only after the stack has cleared and a clock-tick has passed. the effect is much like that of settimeout(action,10). const promisea = new promise( (resolutionfunc,rejectionfunc) => { resolutionfunc(777); }); // at this point, "promise...
handler.setPrototypeOf() - JavaScript
ow setting a new prototype for your object, your handler's setprototypeof() method can either return false, or it can throw an exception. approach 1: returning false this approach means that any mutating operation that throws an exception on failure to mutate, must create the exception itself. for example, object.setprototypeof() will create and throw a typeerror itself. if the mutation is per
formed by an operation that doesn't ordinarily throw in case of failure, such as reflect.setprototypeof(), no exception will be thrown. const handlerreturnsfalse = { setprototypeof(target, newproto) { return false; } }; const newproto = {}, target = {}; const p1 = new proxy(target, handlerreturnsfalse); object.setprototypeof(p1, newproto); // throws a typeerror reflect.setprototypeo...
Proxy.revocable() - JavaScript
the proxy.revocable() method is used to create a revocable proxy object. syntax proxy.revocable(target, handler); parameters target a target object to wrap with proxy. it can be any sort of object, including a native array, a function, or even another proxy. handler an object whose properties are functions define the behavior of proxy p when an operation is per
formed on it. return value a newly created revocable proxy object is returned. description a revocable proxy is an object with following two properties {proxy: proxy, revoke: revoke}. proxy a proxy object created with new proxy(target, handler) call. revoke a function with no argument to invalidate (switch off) the proxy. if the revoke() function gets called, the proxy becomes unusable: any trap to a handler wil...
RegExp.prototype[@@replace]() - JavaScript
str = '2016-01-01'; var newstr = re[symbol.replace](str, '.'); console.log(newstr); // 2016.01.01 using @@replace in subclasses subclasses of regexp can override the [@@replace]() method to modify the default behavior. class myregexp extends regexp { constructor(pattern, flags, count) { super(pattern, flags); this.count = count; } [symbol.replace](str, replacement) { // per
form @@replace |count| times. var result = str; for (var i = 0; i < this.count; i++) { result = regexp.prototype[symbol.replace].call(this, result, replacement); } return result; } } var re = new myregexp('\\d', '', 3); var str = '01234567'; var newstr = str.replace(re, '#'); // string.prototype.replace calls re[@@replace]. console.log(newstr); // ###34567 specifications ...
RegExp.prototype.global - JavaScript
no enumerable no configurable yes description the value of global is a boolean and true if the "g" flag was used; otherwise, false. the "g" flag indicates that the regular expression should be tested against all possible matches in a string. a regular expression defined as both global ("g") and sticky ("y") will ignore the global flag and per
form sticky matches. you cannot change this property directly. examples using 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 ...
RegExp.$1-$9 - JavaScript
placement text for the string.replace method. when used this way, do not prepend them with regexp. the example below illustrates this. when parentheses are not included in the regular expression, the script interprets $n's literally (where n is a positive integer). examples using $n with string.replace the following script uses the replace() method of the string instance to match a name in the
format first last and output it in the
format last, first. in the replacement text, the script uses $1 and $2 to indicate the results of the corresponding matching parentheses in the regular expression pattern. var re = /(\w+)\s(\w+)/; var str = 'john smith'; str.replace(re, '$2, $1'); // "smith, john" regexp.$1; // "john" regexp.$2; // "smith" using $n with regexp.test the following script uses t...
RegExp.prototype.test() - JavaScript
r the string against which to match the regular expression. returns true if there is a match between the regular expression and the string str. otherwise, false. description use test() whenever you want to know whether a pattern is found in a string. test() returns a boolean, unlike the string.prototype.search() method (which returns the index of a match, or -1 if not found). to get more in
formation (but with slower execution), use the exec() method. (this is similar to the string.prototype.match() method.) as with exec() (or in combination with it), test() called multiple times on the same global regular expression instance will advance past the previous match. examples using test() simple example that tests if "hello" is contained at the very beginning of a string, returning a boo...
SharedArrayBuffer() constructor - JavaScript
the sharedarraybuffer() constructor is used to create a sharedarraybuffer object representing a generic, fixed-length raw binary data buffer, similar to the arraybuffer object. the source for this interactive example is stored in a github repository. ...
String() constructor - JavaScript
syntax new string(thing) string(thing) parameters thing anything to be converted to a string. 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. ...
String.prototype.blink() - JavaScript
g to blink. warning: blinking text is frowned upon by several accessibility standards. the <blink> element itself is non-standard and deprecated! syntax str.blink() return value a string containing a <blink> html element. description the blink() method embeds a string in a <blink> tag: "<blink>str</blink>". ...
String.prototype.bold() - JavaScript
the bold() method creates a <b> html element that causes a string to be displayed as bold. syntax str.bold() return value a string containing a <b> html element. description the bold() method embeds a string in a <b> tag: "<b>str</b>". examples using bold() the following example uses string methods to change the
formatting of a string: var worldstring = 'hello, world'; console.log(worldstring.blink()); // <blink>hello, world</blink> console.log(worldstring.bold()); // <b>hello, world</b> console.log(worldstring.italics()); // <i>hello, world</i> console.log(worldstring.strike()); // <strike>hello, world</strike> specifications specification ecmascript (ecma-262)the definition of 'string.prototype.bold' in that specification. ...
String.prototype.charCodeAt() - JavaScript
nd less than the length of the string. if index is not a number, it defaults to 0. return value a number representing the utf-16 code unit value of the character at the given index. if index is out of range, charcodeat() returns nan. description unicode code points range from 0 to 1114111 (0x10ffff). the first 128 unicode code points are a direct match of the ascii character encoding. (for in
formation on unicode, see the javascript guide.) note: charcodeat() will always return a value that is less than 65536. this is because the higher code points are represented by a pair of (lower valued) "surrogate" pseudo-characters which are used to comprise the real character. because of this, in order to examine (or reproduce) the full character for individual character values of 65536 or greate...
String.prototype.codePointAt() - JavaScript
x); var second; if ( // check if it’s the start of a surrogate pair first >= 0xd800 && first <= 0xdbff && // high surrogate size > index + 1 // there is a next code unit ) { second = string.charcodeat(index + 1); if (second >= 0xdc00 && second <= 0xdfff) { // low surrogate // https://mathiasbynens.be/notes/javascript-encoding#surrogate-
formulae return (first - 0xd800) * 0x400 + second - 0xdc00 + 0x10000; } } return first; }; if (defineproperty) { defineproperty(string.prototype, 'codepointat', { 'value': codepointat, 'configurable': true, 'writable': true }); } else { string.prototype.codepointat = codepointat; } }()); } examples using codep...
String.prototype.concat() - JavaScript
nate to str. return value a new string containing the combined text of the strings provided. description the concat() function concatenates the string arguments to the calling string and returns a new string. changes to the original string or the returned string don't affect the other. if the arguments are not of the type string, they are converted to string values before concatenating. per
formance it is strongly recommended that the assignment operators (+, +=) are used instead of the concat() method. examples using concat() the following example combines strings into a new string. let hello = 'hello, ' console.log(hello.concat('kevin', '. have a nice day.')) // hello, kevin. have a nice day. let greetlist = ['hello', ' ', 'venkat', '!'] "".concat(...greetlist) // "hello venkat!
String.prototype.fixed() - JavaScript
the fixed() method creates a <tt> html element that causes a string to be displayed in fixed-pitch font. syntax str.fixed() return value a string representing a <tt> html element. description the fixed() method embeds a string in a <tt> tag: "<tt>str</tt>". examples using fixed() the following example uses the fixed method to change the
formatting of a string: var worldstring = 'hello, world'; console.log(worldstring.fixed()); // "<tt>hello, world</tt>" specifications specification ecmascript (ecma-262)the definition of 'string.prototype.fixed' in that specification. ...
null - JavaScript
no object is relevant. // foo does not exist. 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 per
forms 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 (ecm...
Destructuring assignment - JavaScript
above, the destructured left-hand side is assigned to an empty object literal on the right-hand side: {size = 'big', coords = {x: 0, y: 0}, radius = 25} = {}. you could have also written the function without the right-hand side assignment. however, if you leave out the right-hand side assignment, the function will look for at least one argument to be supplied when invoked, whereas in its current
form, you can simply call drawchart() without supplying any parameters. the current design is useful if you want to be able to call the function without supplying any parameters, the other can be useful when you want to ensure an object is passed to the function. nested object and array destructuring const metadata = { title: 'scratchpad', translations: [ { locale: 'de', localiz...
Logical AND assignment (&&=) - JavaScript
pr is short-circuit evaluated to the falsy expression; short circuit means that the expr part above is not evaluated, hence any side effects of doing so do not take effect (e.g., if expr is a function call, the calling never takes place). logical and assignment short-circuits as well meaning that x &&= y is equivalent to: x && (x = y); and not equivalent to the following which would always per
form an assignment: x = x && y; examples using logical and assignment let x = 0; let y = 1; x &&= 0; // 0 x &&= 1; // 0 y &&= 1; // 1 y &&= 0; // 0 specifications specification logical assignment operatorsthe definition of 'assignment operators' in that specification. ...
Logical OR assignment (||=) - JavaScript
pull request. syntax expr1 ||= expr2 description short-circuit evaluation the logical or operator works like this: x || y; // returns x when x is truthy // returns y when x is not truthy the logical or operator short-circuits: the second operand is only evaluated if the first operand doesn’t already determine the result. logical or assignment short-circuits as well, meaning it only per
forms an assignment if the logical operation would evaluate the right-hand side. in other words, x ||= y is equivalent to: x || (x = y); and not equivalent to the following which would always per
form an assignment: x = x || y; note that this behavior is different to mathematical and bitwise assignment operators. examples setting default content if the "lyrics" element is empty, set the innerh...
Logical nullish assignment (??=) - JavaScript
hand side proves to be neither null nor undefined. short circuit means that the expr part above is not evaluated, hence any side effects of doing so do not take effect (e.g., if expr is a function call, the calling never takes place). ...
Unary plus (+) - JavaScript
active example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: +x description although unary negation (-) also can convert non-numbers, unary plus is the fastest and preferred way of converting something into a number, because it does not per
form any other operations on the number. it can convert string representations of integers and floats, as well as the non-string values true, false, and null. integers in both decimal and hexadecimal (0x-prefixed)
formats are supported. negative numbers are supported (though not for hex). using the operator on bigint values throws a typeerror. if it cannot parse a particular value, it will evaluate to...
async function expression - JavaScript
n async function statement. the main difference between an async function expression and an async function statement is the function name, which can be omitted in async function expressions to create anonymous functions. an async function expression can be used as an iife (immediately invoked function expression) which runs as soon as it is defined. see also the chapter about functions for more in
formation. examples simple example function resolveafter2seconds(x) { return new promise(resolve => { settimeout(() => { resolve(x); }, 2000); }); }; const add = async function(x) { // async function expression assigned to a variable let a = await resolveafter2seconds(20); let b = await resolveafter2seconds(30); return x + a + b; }; add(10).then(v => { console.log(v); ...
delete operator - JavaScript
keyword, it is marked as "non-configurable" delete nameother; // return false in strict mode, this would have raised an exception. strict vs. non-strict mode when in strict mode, if delete is used on a direct reference to a variable, a function argument or a function name, it will throw a syntaxerror. therefore, to avoid syntax errors in strict mode, you must use the delete operator in the
form of delete object.property or delete object['property']. object.defineproperty(globalthis, 'variable1', { value: 10, configurable: true, }); object.defineproperty(globalthis, 'variable2', { value: 10, configurable: false, }); // syntaxerror in strict mode. console.log(delete variable1); // true // syntaxerror in strict mode. console.log(delete variable2); // false function func(param) { // ...
function* expression - JavaScript
statements which comprise the body of the function. description a function* expression is very similar to and has almost the same syntax as a function* statement. the main difference between a function* expression and a function* statement is the function name, which can be omitted in function* expressions to create anonymous generator functions. see also the chapter about functions for more in
formation. examples using function* the following example defines an unnamed generator function and assigns it to x. the function yields the square of its argument: let x = function*(y) { yield y * y; }; specifications specification ecmascript (ecma-262)the definition of 'function*' in that specification. ...
Function expression - JavaScript
on declaration (see function statement for details). the main difference between a function expression and a function declaration is the function name, which can be omitted in function expressions to create anonymous functions. a function expression can be used as an iife (immediately invoked function expression) which runs as soon as it is defined. see also the chapter about functions for more in
formation. function expression hoisting function expressions in javascript are not hoisted, unlike function declarations. you can't use function expressions before you create them: console.log(nothoisted) // undefined // even though the variable name is hoisted, the definition isn't. so it's undefined. nothoisted(); // typeerror: nothoisted is not a function var nothoisted = function() { conso...
instanceof - JavaScript
nceof and multiple context (e.g. frames or windows) different scopes have different execution environments. this means that they have different built-ins (different global object, different constructors, etc.). this may result in unexpected results. for instance, [] instanceof window.frames[0].array will return false, because array.prototype !== window.frames[0].array and arrays inherit from the
former. this may not make sense at first, but for scripts dealing with multiple frames or windows, and passing objects from one context to another via functions, this will be a valid and strong issue. for instance, you can securely check if a given object is, in fact, an array using array.isarray(myobj) for example, checking if a nodes is a svgelement in a different context, you can use mynode insta...
new operator - JavaScript
ously defined object type by using the function.prototype property. this defines a property that is shared by all objects created with that function, rather than by just one instance of the object type. the following code adds a color property with value "original color" to all objects of type car, and then overwrites that value with the string "black" only in the instance object car1. for more in
formation, see prototype. function car() {} car1 = new car(); car2 = new car(); console.log(car1.color); // undefined car.prototype.color = 'original color'; console.log(car1.color); // 'original color' car1.color = 'black'; console.log(car1.color); // 'black' console.log(object.getprototypeof(car1).color); // 'original color' console.log(object.getprototypeof(car2).color); // 'original ...
new.target - JavaScript
ive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new.target description the new.target syntax consists of the keyword new, a dot, and the identifier target. normally, the left-hand side of the dot is the object on which property access is per
formed, but here, new is not an object. the new.target pseudo-property is available in all functions. in class constructors, it refers to the constructed class. in ordinary functions, it refers to the function itself, assuming it was invoked via the new operator; otherwise new.target is undefined. in arrow functions, new.target is inherited from the surrounding scope. examples new.target in func...
for...in - JavaScript
n array may not visit elements in a consistent order. therefore, it is better to use a for loop with a numeric index (or array.prototype.foreach() or the for...of loop) when iterating over arrays where the order of access is important. iterating over own properties only if you only want to consider properties attached to the object itself, and not its prototypes, use getownpropertynames() or per
form a hasownproperty() check (propertyisenumerable() can also be used). alternatively, if you know there won't be any outside code interference, you can extend built-in prototypes with a check method. why use for...in? given that for...in is built for iterating object properties, not recommended for use with arrays, and options like array.prototype.foreach() and for...of exist, what might be the us...
for - JavaScript
a statement that is executed as long as the condition evaluates to true. to execute multiple statements within the loop, use a block statement ({ ... }) to group those statements. to execute no statement within the loop, use an empty statement (;). examples using for the following for statement starts by declaring the variable i and initializing it to 0. it checks that i is less than nine, per
forms the two succeeding statements, and increments i by 1 after each pass through the loop. for (let i = 0; i < 9; i++) { console.log(i); // more statements } optional for expressions all three expressions in the head of the for loop are optional. for example, in the initialization block it is not required to initialize variables: var i = 0; for (; i < 9; i++) { console.log(i); //...
function declaration - JavaScript
name. param optional the name of an argument to be passed to the function. maximum number of arguments varies in different engines. statements optional the statements which comprise the body of the function. description a function created with a function declaration is a function object and has all the properties, methods and behavior of function objects. see function for detailed in
formation on functions. a function can also be created using an expression (see function expression). by default, functions return undefined. to return any other value, the function must have a return statement that specifies the value to return. conditionally created functions functions can be conditionally declared, that is, a function statement can be nested within an if statement, however the ...
import - JavaScript
fier string needs to be constructed dynamically. (static import only supports static specifiers.) when the module being imported has side effects, and you do not want those side effects unless some condition is true. (it is recommended not to have any side effects in a module, but you sometimes cannot control this in your module dependencies.) use dynamic import only when necessary. the static
form is preferable for loading initial dependencies, and can benefit more readily from static analysis tools and tree shaking. to dynamically import a module, the import keyword may be called as a function. when used this way, it returns a promise. import('/modules/my-module.js') .then((module) => { // do something with the module. }); this
form also supports the await keyword. let module...
return - JavaScript
9 if the value is omitted, undefined is returned instead. the following return statements all break the function execution: return; return true; return false; return x; return x + y / 3; automatic semicolon insertion the return statement is affected by automatic semicolon insertion (asi). no line terminator is allowed between the return keyword and the expression. return a + b; is trans
formed by asi into: return; a + b; the console will warn "unreachable code after return statement". starting with firefox 40, a warning is shown in the console if unreachable code is found after a return statement. to avoid this problem (to prevent asi), you could use parentheses: return ( a + b ); examples interrupt a function a function immediately stops at the point where return is call...
switch - JavaScript
cases in javascript (stack overflow) multi-case : single operation this method takes advantage of the fact that if there is no break below a case clause it will continue to execute the next case clause regardless if the case meets the criteria. (see the section what happens if i forgot a break?) this is an example of a single operation sequential case statement, where four different values per
form exactly the same. var animal = 'giraffe'; switch (animal) { case 'cow': case 'giraffe': case 'dog': case 'pig': console.log('this animal will go on noah\'s ark.'); break; case 'dinosaur': default: console.log('this animal will not.'); } multi-case : chained operations this is an example of a multiple-operation sequential case clause, where, depending on the provided int...
Trailing commas - JavaScript
function calls the following function invocation pairs are legal and equivalent to each other. f(p); f(p,); math.max(10, 20); math.max(10, 20,); illegal trailing commas function parameter definitions or function invocations only containing a comma will throw a syntaxerror. ...
JavaScript reference - JavaScript
uint32array float32array float64array bigint64array biguint64array keyed collections map set weakmap weakset structured data arraybuffer sharedarraybuffer atomics dataview json control abstraction promise generator generatorfunction asyncfunction reflection reflect proxy internationalization intl intl.collator intl.datetime
format intl.displaynames intl.list
format intl.locale intl.number
format intl.pluralrules intl.relativetime
format webassembly webassembly webassembly.module webassembly.instance webassembly.memory webassembly.table webassembly.compileerror webassembly.linkerror webassembly.runtimeerror statements javascript statements and declarations control flowb...
JavaScript shells - JavaScript
a javascript shell allows you to quickly test snippets of javascript code without having to reload a web page. they are extremely useful for developing and debugging code. standalone javascript shells the following javascript shells are stand-alone environments, like perl or python. node.js - node.js is a plat
form for easily building fast, scalable network applications. jsdb - a standalone javascript shell, with compiled binaries for windows, mac, and linux. javalikescript - a standalone, extensible javascript shell including both native and javascript libraries. gluescript - a standalone javascript shell for writing cross-plat
form javascript applications. it can use wxwidgets for gui apps and was
formerly called wxjavascript. jspl - a standalone javascript shell enhanced by perl. c...
display - Web app manifests
on, but can include other ui elements such as a status bar. minimal-ui minimal-ui the application will look and feel like a standalone application, but will have a minimal set of ui elements for controlling navigation. the elements will vary by browser. browser browser the application opens in a conventional browser tab or new window, depending on the browser and plat
form. this is the default. (none) example "display": "standalone" specification specification status comment feedback web app manifestthe definition of 'display' in that specification. working draft initial definition. web app manifest working group drafts ...
icons - Web app manifests
support. purpose defines the purpose of the image, for example if the image is intended to serve some special purpose in the context of the host os (i.e., for better integration). purpose can have one or more of the following values, separated by spaces: monochrome: a user agent can present this icon where a monochrome icon with a solid fill is needed. the color in
formation in the icon is discarded and only the alpha data is used. the icon can then be used by the user agent like a mask over any solid fill. maskable: the image is designed with icon masks and safe zone in mind, such that any part of the image outside the safe zone can safely be ignored and masked away by the user agent. any: the user agent is free to display the icon in any context (thi...
<merror> - MathML
you will still get an xml parsing error (in case of the xhtml notation of mathml), which has nothing to do with <merror>. attributes class, id, style provided for use with stylesheets. href used to set a hyperlink to a specified uri. mathbackground the background color. ...
<mrow> - MathML
he rendering of the expression in several ways: it can improve the display by possibly affecting spacing. it allows for more intelligent line-breaking and indentation. it simplifies the interpretation of the expression by automated systems such as computer algebra systems and audio renderers. attributes class, id, style provided for use with stylesheets. dir overall directionality of
formulas. possible values are either ltr (left to right) or rtl (right to left). href used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. examples <math> <mrow> <mn> 1 </mn> <mo> + </mo> <mn> 1 </mn> </mrow> <mrow> <mo...
<mtable> - MathML
esponding columns (e.g. columnlines="none none solid"). possible values are: none (default), solid and dashed. columnspacing specifies the space between table columns. unimplemented columnwidth specifies the width of table columns. displaystyle a boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display
formulas. the main effect is that larger versions of operators are displayed, when displaystyle is set to true. unimplemented equalcolumns a boolean value indicating whether to force all columns to have the same total height. false is default. unimplemented equalrows a boolean value indicating whether to force all rows to have the same total height. false is default. frame specifies borders of t...
MathML
a dialect of xml for describing mathematical notation and capturing both its structure and content. here you'll find links to documentation, examples, and tools to help you work with this powerful technology. for a quick overview, see the slides for the innovation fairs at mozilla summit 2013. mathml reference mathml element reference details about each mathml element and compatibility in
formation for desktop and mobile browsers. mathml attribute reference in
formation about mathml attributes that modify the appearance or behavior of elements. mathml examples mathml samples and examples to help you understand how it works. authoring mathml suggestions and tips for writing mathml, including suggested mathml editors and how to integrate their output into web content. view all... ...
Using audio and video in HTML - Web media technologies
terfaces are the key to manipulating and playing back media in general, even offscreen. in this guide, we'll review the media elements and how to use them in html content. note: this guide is a planned update to integrate content from various scattered places on mdn into one cohesive document or document set. the work is not yet scheduled but hopefully will come soon. for now, some of the key in
formation you may be looking for can be found in our learning area article on the topic. we don't have a particularly good guide to using these objects offscreen at this time, although audio and video manipulation may be a good start. ...
PWA developer guide - Progressive web apps (PWAs)
ing a web app from an existing site description advanced topics pushing data from the server to your web application some description resource management description integration with the host device description security and privacy description gaming topics for web app developers description polishing web apps web api equivalents for common native apis some description plat
form-specific tips and issues description web application per
formance guide description ensuring a good user experience description related topics some topic some description ...
Graphic design for responsive sites - Progressive web apps (PWAs)
only to hi res devices. programmatic images you should also try to use programmatic/vector graphics as much as possible, as they theoretically scale infinitely so will still look crisp at high resolutions. you could use css3 properties for generating effects like drop shadows, gradients and rounded corners, and you could also consider using svg for other ui elements, instead of raster graphics
formats. the downsides here are that css3 properties and svg don't work on old browsers such as ie6-8 (although polyfills are available, and you could build in fallbacks), and svg isn't suitable for high detail images, such as photographs. using fonts for icons another technique to consider is using web fonts for icons. text is infinitely scalable on the web, and you can also use css text properties...
Web technology reference
links to a selection of key documentation for each. if you're new to web development, consider starting with our learning area, which is filled with step-by-step tutorials that will guide you from total webdev newbie to at least semi-pro! html — structuring the web hypertext markup language is used to define and describe semantically the content (markup) of a web page in a well-structured
format. html provides a means to create structured documents made up of blocks called html elements that are delineated by tags, written using angle brackets. some introduce content into the page directly, others provide in
formation about document text and may include other tags as sub-elements. obviously, browsers do not display them, since they are used to interpret the content of the page. intro...
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
cially in elements that get scrolled or animated. example: text effects svg effects can also be used to add a more dynamic and flexible approach to adding text compared to plain html text. by creating the text using svg elements combined with html you can make a variety of different text effects. you can rotate the text: <svg height="60" width="200"> <text x="0" y="15" fill="blue" trans
form="rotate(30 20,50)">example text</text> </svg> using external references svg used for clipping, masking, and filtering can be loaded from an external source, as long as that source comes from the same origin as the html document to which it's applied. for example, if your css is in a file named default.css, it can look like this: .target { clip-path: url(resources.svg#c1); } the svg is then ...
SVG Styling Attributes - SVG: Scalable Vector Graphics
the svg styling attributes are all the attributes that can be specified on any svg element to apply css styling effects. class style attributes class assigns a class name or set of class names to an element. it functions identically to the class attribute in html. value: any valid id string; animatable: yes style it specifies style in
formation for its element. it functions identically to the style attribute in html. value: any valid style string; animatable: no ...
accumulate - SVG: Scalable Vector Graphics
ibute controls whether or not an animation is cumulative. it is frequently useful for repeated animations to build upon the previous results, accumulating with each iteration. this attribute said to the animation if the value is added to the previous animated attribute's value on each iteration. four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetrans
form> usage notes value none | sum default value none animatable no sum specifies that each repeat iteration after the first builds upon the last value of the previous iteration. none specifies that repeat iterations are not cumulative. this attribute is ignored if the target attribute value does not support addition, or if the animation element does...
additive - SVG: Scalable Vector Graphics
the additive attribute controls whether or not an animation is additive. it is frequently useful to define animation as an offset or delta to an attribute's value, rather than as absolute values. four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetrans
form> usage notes value replace | sum default value replace animatable no sum specifies that the animation will add to the underlying value of the attribute and other lower priority animations. replace specifies that the animation will override the underlying value of the attribute and other lower priority animations. this is the default, however the behavior is also affected by the animation value attributes by and to, as described in smil animation...
attributeName - SVG: Scalable Vector Graphics
the attributename attribute indicates the name of the css property or attribute of the target element that is going to be changed during an animation. four elements are using this attribute: <animate>, <animatecolor>, <animatetrans
form>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indefinite"/> </rect> </svg> usage notes value <name> default value none animatable no <name> this value indicates the name of the css property or attribute of the target element to be animated. specifications specification status co...
attributeType - SVG: Scalable Vector Graphics
the attributetype attribute specifies the namespace in which the target attribute and its associated values are defined. four elements are using this attribute: <animate>, <animatecolor>, <animatetrans
form>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indefinite"/> </rect> </svg> usage notes value css | xml | auto default value auto animatable no css this value specifies that the value of attributename is the name of a css property defined as animatable. xml this value specifies that the value of attributename is the name o...
begin - SVG: Scalable Vector Graphics
retation of a list of start times is detailed in the smil specification in "evaluation of begin and end time lists". each individual value can be one of the following : <offset-value>, <syncbase-value>, <event-value>, <repeat-value>, <accesskey-value>, <wallclock-sync-value> or the keyword indefinite. six elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetrans
form>, <discard>, and <set> animate, animatecolor, animatemotion, animatetrans
form, set for <animate>, <animatecolor>, <animatemotion>, <animatetrans
form>, and <set>, begin defines when the element should begin, i.e. become active. value <begin-value-list> default value 0s animatable no the <begin-value-list> is a semicolon-separated list of values. each v...
by - SVG: Scalable Vector Graphics
the by attribute specifies a relative offset value for an attribute that will be modified during an animation. the starting value for the attribute is either indicated by specifying it as value for the attribute given in the attributename or the from attribute. ...
calcMode - SVG: Scalable Vector Graphics
the calcmode attribute specifies the interpolation mode for the animation. the default mode is linear, however if the attribute does not support linear interpolation (e.g. for strings), the calcmode attribute is ignored and discrete interpolation is used. four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetrans
form> usage notes value discrete | linear | paced | spline default value linear animatable no discrete this specifies that the animation function will jump from one value to the next without any interpolation. linear simple linear interpolation between values is used to calculate the animation function. except for <animatemotion>, this is the default value. paced defines interpolation to p...
clip-path - SVG: Scalable Vector Graphics
geometry. this is the same as having a custom clipping path with a clippathunits set to userspaceonuse --> <rect x="11" y="11" width="8" height="8" stroke="green" clip-path="circle() view-box" /> </svg> usage notes value <url> | [ <basic-shape> || <geometry-box> ] | none default value none animatable yes <geometry-box> an extra in
formation to tell how a <basic-shape> is applied to an element: fill-box indicates to use the object bounding box; stroke-box indicates to use the object bounding box extended with the stroke; view-box indicates to use the nearest svg viewport as the reference box. note: for more details on the clip-path syntax, see the css property clip-path reference page. browser compatibility the compatibility...
color-interpolation-filters - SVG: Scalable Vector Graphics
notes: this property just has an affect on filter operations. therefore, it has no effect on filter primitives like <feoffset>, <feimage>, <fetile> or <feflood>. color-interpolation-filters has a different initial value than color-interpolation. color-interpolation-filters has an initial value of linearrgb, whereas color-interpolation has an initial value of srgb. thus, in the default case, filter effects operations occur in the linearrgb color space, whereas all other color interpolations occur by default in the srgb color space. ...
color-interpolation - SVG: Scalable Vector Graphics
n property on the child determines the type of blending, not the value of the color-interpolation on the parent. for gradients which make use of the href or the deprecated xlink:href attribute to reference another gradient, the gradient uses the propertyʼs value from the gradient element which is directly referenced by the fill or stroke property. when animating colors, color interpolation is per
formed according to the value of the color-interpolation property on the element being animated. note: as a presentation attribute, color-interpolation can be used as a css property. as a presentation attribute, it can be applied to any element but it only has an effect on the following 29 elements: <a>, <animate>, <animatecolor>, <circle>, <clippath>, <defs>, <ellipse>, <foreignobject>, <g>, <glyph...
cursor - SVG: Scalable Vector Graphics
ursor attribute specifies the mouse cursor displayed when the mouse pointer is over an element. this attribute behaves exactly like the css cursor property except that if the browser supports the <cursor> element, you should be able to use it with the <funciri> notation. as a presentation attribute, it also can be used as a property directly inside a css stylesheet, see css cursor for further in
formation. usage context categories presentation attribute value [[<funciri>,]* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize| text | wait | help ]] | inherit animatable yes normative document svg 1.1 (2nd edition) <funciri> functional notation for a r...
data-* - SVG: Scalable Vector Graphics
the data-* svg attributes are called custom data attributes. they let svg markup and its resulting dom share in
formation that standard attributes can't, usually for scripting purposes. their custom data are available via the svgelement interface of the element the attributes belong to, with the svgelement.dataset property. the * can be replaced by any characters allowed in xml's rules for names, with the following restrictions: can't start with xml. no semicolons (;, u+003a). no capital a to z letters. the svgelement.dataset property is a domstringmap that provides the attribute data-test-value via svgelement.dataset.testvalue. hyphen characters (-, u+002d) are removed and the next letter is capitalized, resulting in the camelcase
format. specifications specification s...
direction - SVG: Scalable Vector Graphics
ed result automatically, so this attribute doesn't need to be specified in those cases. for other cases, such as when using right-to-left languages, it may be sufficient to add the direction attribute to the outermost <svg> element, and allow that direction to inherit to all text elements: note: as a presentation attribute, direction can be used as a css property. see css direction for further in
formation. as a presentation attribute, it can be applied to any element but it only has effect on shapes and text context elements, including: <altglyph>, <textpath>, <text>, <tref>, and <tspan>. html, body, svg { height: 100%; } <svg viewbox="0 0 600 72" xmlns="http://www.w3.org/2000/svg" direction="rtl" lang="fa"> <text x="300" y="50" text-anchor="middle" font-size="36">داست...
display - SVG: Scalable Vector Graphics
sks or clip paths. thus, setting display="none" on a child of a <mask> will prevent the given child element from being rendered as part of the mask. similarly, setting display="none" on a child of a <clippath> element will prevent the given child element from contributing to the clipping path. note: as a presentation attribute, display can be used as a css property. see css display for further in
formation. as a presentation attribute, it can be applied to any element. html, body, svg { height: 100%; } <svg viewbox="0 0 220 100" xmlns="http://www.w3.org/2000/svg"> <!-- here the yellow rectangle is displayed --> <rect x="0" y="0" width="100" height="100" fill="skyblue"></rect> <rect x="20" y="20" width="60" height="60" fill="yellow"></rect> <!-- here the yellow rectangle is not...
dominant-baseline - SVG: Scalable Vector Graphics
erty can be used to explicitly set the desired scaled-baseline-table. if there is no baseline table in the nominal font, or if the baseline table lacks an entry for the desired baseline, then the browser may use heuristics to determine the position of the desired baseline. note: as a presentation attribute, dominant-baseline can be used as a css property. see css dominant-baseline for further in
formation. as a presentation attribute, it can be applied to any element but it only has effect on the text content elements, including: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } text { font: bold 14px verdana, helvetica, arial, sans-serif; } <svg viewbox="0 0 200 120" xmlns="http://www.w3.org/2000/svg"> <path d="m20,20 l180,20 m20,50 l180,50 ...
end - SVG: Scalable Vector Graphics
each value can be one of the following: <offset-value> this value defines a clock-value that represents a point in time relative to the beginning of the svg document (usually the load or domcontentloaded event). ...
stemv - SVG: Scalable Vector Graphics
the measurement is meant for the dominant vertical stem in the font because there might be different groupings of vertical stems (e.g., one main one, and one lighter weight one as for an uppercase "m" or "n"). if this attribute is used, the units-per-em must also be used. ...
string - SVG: Scalable Vector Graphics
the string attribute is a hint to the user agent, and specifies a list of
formats that the font referenced by the parent <font-face-uri> element supports. only one element is using this attribute: <font-face-
format> usage notes value <anything> default value none animatable no <anything> this value specifies a list of
formats that are supported by the font referenced by the parent <font-face-uri> element. the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg". see the src descriptor of the @font-face at-rule for more in
formation. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'string' in that specific...
stroke-miterlimit - SVG: Scalable Vector Graphics
for the miter to extend far beyond the thickness of the line stroking the path. the stroke-miterlimit ratio is used to define when the limit is exceeded, if so the join is converted from a miter to a bevel. the ratio of miter length (distance between the outer tip and the inner corner of the miter) to stroke-width is directly related to the angle (theta) between the segments in user space by the
formula: stroke-miterlimit = miterlength stroke-width = 1 sin ( θ 2 ) for example, a miter limit of 1.414 converts miters to bevels for theta less than 90 degrees, a limit of 4.0 converts them for theta less than approximately 29 degrees, and a limit of 10.0 converts them for theta less than approximately 11.5 degrees. usage context value <number> de...
surfaceScale - SVG: Scalable Vector Graphics
value <number> default value 1 animatable yes fediffuselighting for <fediffuselighting>, surfacescale defines the height of the surface. value <number> default value 1 animatable yes ...
systemLanguage - SVG: Scalable Vector Graphics
the systemlanguage attribute represents a list of supported language tags. this list is matched against the language defined in the user preferences. 35 elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetrans
form>, <audio>, <canvas>, <circle>, <clippath>, <cursor>, <defs>, <discard>, <ellipse>, <foreignobject>, <g>, <iframe>, <image>, <line>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <set>, <svg>, <switch>, <text>, <textpath>, <tref>, <tspan>, <unknown>, <use>, and <video> usage notes value <language-tags> default value none animatable no <language-tags> the value is a set of comma-separated tokens, each of which must be a language-tag value, as defined in bcp 47. systemlan...
text-anchor - SVG: Scalable Vector Graphics
it is not applicable to other types of auto-wrapped text. for those cases you should use text-align. for multi-line text, the alignment takes place for each line. the text-anchor attribute is applied to each individual text chunk within a given <text> element. ...
text-decoration - SVG: Scalable Vector Graphics
given by the fill and stroke of the text at the point where the text decoration is declared. the paint order of the text decoration, i.e. the fill and stroke, is determined by the value of the paint-order attribute at the point where the text decoration is declared. note: as a presentation attribute, text-decoration can be used as a css property. see the css text-decoration property for more in
formation. as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 50" xmlns="http://www.w3.org/2000/svg"> <text y="20" text-decoration="underline">underlined text</text> <text x="0" y="40" text-decoration="line-through">st...
text-rendering - SVG: Scalable Vector Graphics
the text-rendering attribute provides hints to the renderer about what tradeoffs to make when rendering text. note: as a presentation attribute, text-rendering can be used as a css property. see the css text-rendering property for more in
formation. as a presentation attribute, it can be applied to any element but it has effect only on the following element: <text> html, body, svg { height: 100%; } <svg viewbox="0 0 140 40" xmlns="http://www.w3.org/2000/svg"> <text y="15" text-rendering="geometricprecision">geometric precision</text> <text y="35" text-rendering="optimizelegibility">optimized legibility</text> </svg> usage notes value auto | optimizespeed | optimizelegibility | geometricprecision default value auto animatable yes au...
unicode-bidi - SVG: Scalable Vector Graphics
the unicode-bidi attribute specifies how the accumulation of the background image is managed. note: as a presentation attribute, unicode-bidi can be used as a css property. see the css unicode-bidi property for more in
formation. as a presentation attribute, it can be applied to any element but it has effect only on the following eleven elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value normal | embed | isolate | bidi-override | isolate-override | plaintext default value normal animatable no for a description of the values, please refer to the css unicode-bidi property. specifications specification status comment css writing modes module level 3the definition of 'unicode-bidi' in that sp...
version - SVG: Scalable Vector Graphics
it is only allowed on the root <svg> element. it is purely advisory and has no influence on rendering or processing. while it is specified to accept any number, the only two valid choices are currently 1.0 and 1.1. ...
visibility - SVG: Scalable Vector Graphics
attribute is set to hidden on a text element, then the text is invisible but still takes up space in text layout calculations. depending on the value of attribute pointer-events, graphics elements which have their visibility attribute set to hidden still might receive events. note: as a presentation attribute, visibility can be used as a css property. see the css visibility property for more in
formation. as a presentation attribute, it can be applied to any element but it has effect only on the following nineteen elements: <a>, <altglyph>, <audio>, <canvas>, <circle>, <ellipse>, <foreignobject>, <iframe>, <image>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, <tspan>, <video> html, body, svg { height: 100%; } <svg viewbox="0 0 220 120" xmlns="http://www.
width - SVG: Scalable Vector Graphics
nes the horizontal length of its area of effect. the exact effect of this attribute is influenced by the maskunits attribute. value <length> | <percentage> default value 120% animatable yes pattern for <pattern>, width defines the horizontal length of the tile pattern. the exact effect of this attribute is influenced by the patternunits and patterntrans
form attributes. value <length> default value 0 animatable yes rect for <rect>, width defines the horizontal length for the rectangle. value auto | <length> | <percentage> default value auto (treated as 0) animatable yes note: starting with svg2, width is a geometry property meaning this attribute can also be used...
word-spacing - SVG: Scalable Vector Graphics
he browser processes the <length> as a width value in the current user coordinate system. if a <length> is provided with one of the unit identifiers (e.g. .25em or 1%), then the browser converts the <length> into a corresponding value in the current user coordinate system. note: as a presentation attribute, word-spacing can be used as a css property. see the css word-spacing property for more in
formation. as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 50" xmlns="http://www.w3.org/2000/svg"> <text y="20" word-spacing="2">bigger spacing between words</text> <text x="0" y="40" word-spacing="-0.5">smaller spa...
writing-mode - SVG: Scalable Vector Graphics
ly to <text> elements; the attribute is ignored for <tspan>, <tref>, <altglyph> and <textpath> sub-elements. (note that the inline-progression-direction can change within a <text> element due to the unicode bidirectional algorithm and properties direction and unicode-bidi.) note: as a presentation attribute, writing-mode can be used as a css property. see the css writing-mode property for more in
formation. as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> usage notes default value horizontal-tb value horizontal-tb | vertical-rl | vertical-lr animatable yes horizontal-tb this value defines a top-to-bottom block flow direction. b...
x - SVG: Scalable Vector Graphics
ft corner of its area of effect. the exact effect of this attribute is influenced by the maskunits attribute. value <length> | <percentage> default value -10% animatable yes pattern for <pattern>, x defines the x coordinate of the uper left corner of the tile pattern. the exact effect of this attribute is influenced by the patternunits and patterntrans
form attributes. value <length> default value 0 animatable yes rect for <rect>, x defines the x coordinate of the uper left corner of the shape. value <length> | <percentage> default value 0 animatable yes note: starting with svg2, x is a geometry property meaning this attribute can also be used as a css property...
xlink:type - SVG: Scalable Vector Graphics
the xlink:type attribute identifies the type of xlink being used. in svg, only simple links are available. twentytwo elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetrans
form>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, and <use> usage notes value simple default value simple animatable no simple this value specifies that the referred resource is a simple link. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'xlink:type' in that specification. recommendation ...
xml:lang - SVG: Scalable Vector Graphics
200 100" xmlns="http://www.w3.org/2000/svg"> <text xml:lang="en-us">this is some english text</text> </svg> usage notes value <language-tag> default value none animatable no <language-tag> this value specifies the language used for the element. the syntax of this value is defined in the bcp 47 specification. the most common syntax is a value
formed by a lowercase two-character part for the language and an uppercase two-character part for the region or country, separated by a minus sign, e.g. en-us for us english or de-at for austrian german. specifications specification status comment scalable vector graphics (svg) 2the definition of 'xml:lang' in that specification. candidate recommendation made the...
y - SVG: Scalable Vector Graphics
eft corner of its area of effect. the exact effect of this attribute is influenced by the maskunits attribute. value <length> | <percentage> default value -10% animatable yes pattern for <pattern>, y defines the y coordinate of the uper left corner of the tile pattern. the exact effect of this attribute is influenced by the patternunits and patterntrans
form attributes. value <length> default value 0 animatable yes rect for <rect>, y defines the y coordinate of the uper left corner of the shape. value <length> | <percentage> default value 0 animatable yes note: starting with svg2, y is a geometry property meaning this attribute can also be used as a css property ...
z - SVG: Scalable Vector Graphics
value <number> default value 1 animatable yes fespotlight for <fespotlight>, z defines the location along the z-axis for the light...
zoomAndPan - SVG: Scalable Vector Graphics
the zoomandpan attribute specifies whether the svg document can be magnified and panned. magnification in this context means the effect of a supplemental scale and translate trans
formation on the outermost svg document fragment. panning represents a translation (i.e., a shift) trans
formation on an svg document fragment in response to a user interface action. two elements are using this attribute: <svg> and <view> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" zoomandpan="disable"> <filter id="diffuselighting" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" zoomandpan="1"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" s...
<a> - SVG: Scalable Vector Graphics
ent element 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, trans
form, vector-effect, visibility xlink attributes most notably: xlink:title aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, ari...
<animateColor> - SVG: Scalable Vector Graphics
this element has been deprecated in svg 1.1 second edition and may be removed in a future version of svg. it provides no features not already available by using the <animate> element. so, authors should use the <animate> element instead. the <animatecolor> svg element specifies a color trans
formation over time. usage context categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:descriptive elements attributes global attributes conditional processing attributes core attributes animation event attributes xlink attributes animation attribute target attributes animation timing attributes animation value attributes animation addition attributes externalresourcesrequired specific attributes by from...
<circle> - SVG: Scalable Vector Graphics
tes 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, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
<font-face-uri> - SVG: Scalable Vector Graphics
the <font-face-uri> svg element points to a remote definition of the current font. usage context categoriesfont elementpermitted contentany number of the following elements, in any order:<font-face-
format> attributes global attributes core attributes xlink attributes specific attributes xlink:href dom interface this element implements the svgfontfaceurielement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of '<font-face-uri>' in that specification. recommendation initial definition ...
<foreignObject> - SVG: Scalable Vector Graphics
ment event attributes, document element 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, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
<glyph> - SVG: Scalable Vector Graphics
example svg <svg width="400px" height="300px" version="1.1" xmlns="http://www.w3.org/2000/svg"> <!-- example copied from https://www.w3.org/tr/svg/fonts.html#glyphelement --> <defs> <font id="font1" horiz-adv-x="1000"> <font-face font-family="super sans" font-weight="bold" font-style="normal" ...
<glyphRef> - SVG: Scalable Vector Graphics
the glyphref element provides a single possible glyph to the referencing <altglyph> substitution. usage context categoriestext content elementpermitted contentempty attributes global attributes core attributes » presentation attributes » xlink attributes » class style specific attributes x y dx dy glyphref
format xlink:href dom interface this element implements the svgglyphrefelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of '<glyphref>' in that specification. recommendation initial definition ...
<hatch> - SVG: Scalable Vector Graphics
example svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <hatch id="hatch" hatchunits="userspaceonuse" pitch="5" rotate="135"> <hatchpath stroke="#a080ff" stroke-width="2"/> </hatch> </defs> <rect fill="url(#hatch)" stroke="black" stroke-width="2" x="10%" ...
<line> - SVG: Scalable Vector Graphics
tes 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, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
<mask> - SVG: Scalable Vector Graphics
styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, display, fill, fill-opacity, fill-rule, filter, mask, opacity, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, trans
form, vector-effect, visibility usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, ...
<path> - SVG: Scalable Vector Graphics
tes 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, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
<polygon> - SVG: Scalable Vector Graphics
tes 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, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
<polyline> - SVG: Scalable Vector Graphics
tes 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, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
<rect> - SVG: Scalable Vector Graphics
tes 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, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
<stop> - SVG: Scalable Vector Graphics
the svg <stop> element defines a color and its position to use on a gradient. this element is always a child of a <lineargradient> or <radialgradient> element. html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <lineargradient id="mygradient" gradienttrans
form="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 offset this attribute defines where the gradient stop is placed along the gradient vector. value type: <number>|<percentage>; default value: 0; animatable: yes stop-color th...
<switch> - SVG: Scalable Vector Graphics
svg <switch> example this example demonstrates showing different text content depending on the browser's language settings. the switch element will display the first of its child elements whose systemlanguage attribute matches the user's language, or the fallback element with no systemlanguage attribute if none of them mat...
<text> - SVG: Scalable Vector Graphics
aphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, 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, text-anchor, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
<textPath> - SVG: Scalable Vector Graphics
tes 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, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
<tspan> - SVG: Scalable Vector Graphics
aphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, 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, text-anchor, trans
form, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, ari...
Namespaces crash course - SVG: Scalable Vector Graphics
ar image = document.createelementns(svg_ns, 'image'); image.setattributens(null, 'width', '100'); image.setattributens(null, 'height', '100'); image.setattributens(xlink_ns, 'xlink:href', 'flower.png'); conclusion make sure you always declare the namespaces you use in your xml files. if you don't, user agents such as firefox won't recognize your content and will simply show the xml markup or in
form the user that there's an error in the xml. it's a good idea to use a template that includes all the commonly used namespace declarations when creating new svg files. if you don't already have one, make one up starting with the following code: <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> </svg> even if you don't use all those namespaces in a particula...
SVG as an Image - SVG: Scalable Vector Graphics
svg images can be used as an image
format, in a number of contexts. many browsers support svg images in: html <img> or <svg> elements css background-image gecko-specific contexts additionally, gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) introduced support for using svg in these contexts: css list-style-image css content svg <image> element svg <feimage> element canvas drawimage function restrictions for security purposes, gecko places some restrictions on svg content when it's being used as an image: javascript is disabled. external resources (e.g. images, stylesheets) cannot be loaded, though they can be used if inlined through data: uris. :visited-link styles aren't rendered. plat
form-native widget styling (based on os theme) is disabled. note tha...
Scripting - SVG: Scalable Vector Graphics
ame() to reference the function. although the adobe svg viewer plugin allows the use of functionname(), it's not the preferred way to do things. according to the svg wiki the "parent" js variable is broken in adobe's svg version 6 preview plugin. the suggested workaround is to use "top" instead of "parent". since it is a beta version of their plugin, we can probably safely ignore this. more in
formation and some examples can be found on the svg wiki inter-document scripting page. setproperty has three parameters the function svgelement.style.setproperty("fill-opacity", "0.0") throws a domexception - syntax err in mozilla. this behaviour is specified by the w3c in the dom level 2 style specification. the function setproperty is defined as a function with three parameters. the above can be ...
Clipping and masking - SVG: Scalable Vector Graphics
to determine, which pixels of the circle "make it" to the final rendering. since the rectangle covers only the upper half of the circle, the lower half of the circle will vanish: screenshotlive sample we now have a semicircle without having to deal with arcs in path elements. for the clipping, every path inside the clippath is inspected and evaluated together with its stroke properties and trans
formation. then every part of the target lying in a transparent area of the resulting clippath's content will not be rendered. color, opacity and such have no effect as long as they don't let parts vanish completely. masking the effect of masking is most impressively presented with a gradient. if you want an element to fade out, you can achieve this effect quite quickly with masks. <svg width="200"...
Fills and Strokes - SVG: Scalable Vector Graphics
so fill, stroke, stroke-dasharray, etc... can all be set this way, in addition to the gradient and pattern versions of those shown below. attributes like width, height, or <path> commands cannot be set through css. it's easiest just to test and find out what is available and what isn't. note: the svg specification decides strictly between attributes that are properties and other attributes. the
former can be modified with css, the latter not. css can be inserted inline with the element via the style attribute: <rect x="10" height="180" y="10" width="180" style="stroke: black; fill: red;"/> or it can be moved to a special style section that you include. instead of shoving such a section into a <head> section like you do in html, though, it's included in an area called <defs>. <defs> sta...
Getting started - SVG: Scalable Vector Graphics
t later elements are rendered atop previous elements. the further down an element is the more it will be visible. 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. if the html is html5, and the browser is a con
forming html5 browser, the svg can also be directly embedded. however, there may be syntax changes necessary to con
form to the html5 specification. 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 u...
SVG fonts - SVG: Scalable Vector Graphics
« previousnext » when svg was specified, support for web fonts was not widespread in browsers. since accessing the correct font file is however crucial for rendering text correctly, a font description technology was added to svg to provide this ability. it was not meant for compatibility with other
formats like postscript or otf, but rather as a simple means of embedding glyph in
formation into svg when rendered. svg fonts are currently supported only in safari and android browser. internet explorer hasn't considered implementing this, the functionality has been removed from chrome 38 (and opera 25) and firefox has postponed its implementation indefinitely to concentrate on woff. other tools however like the adobe svg viewer plugin, batik and parts of inkscape support svg fon...
SVG Tutorial - SVG: Scalable Vector Graphics
page. another good introduction to svg is provided by the w3c's svg primer. the tutorial is in an early stage of development. if you're able, please help out by chipping in and writing a paragraph or two. extra points for writing a whole page! introducing svg from scratch introduction getting started positions basic shapes paths fills and strokes gradients patterns texts basic trans
formations clipping and masking other content in svg filter effects svg fonts svg image tag tools for svg svg and css the following topics are more advanced and hence should get their own tutorials. scripting svg with javascript tbd svg filters tutorial tbd animations with smil in svg tbd creating fonts in svg tbd ...
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
things happen, then mozilla can end up with a media type for files that it doesn't recognize, but which the user knows it should. actions that trigger this bug ... possible solutions how you solve this problem depends on whether it's your operating system or your mozilla profile (mimetypes.rdf) that are corrupt. the latter is more common, so we'll start with that. however, it seems that the
former may also cause the latter. one way to check is to create a new profile and restart mozilla using that profile. if svg works with the new profile, then simply delete the new profile and go about cleaning your old profile using the steps in the section below. if the new profile doesn't work, clean your os file associations, then your mimetypes.rdf. create and remove a bogus file association th...
Certificate Transparency - Web security
d-only, cryptographically assured record of issued tls certificates. in this way, certificate authorities (cas) can be subject to much greater public scrutiny and oversight. potentially malicious certificates, such as those that violate the ca/b forum baseline requirements, can be detected and revoked much more quickly. browser vendors and root store maintainers are also empowered to make more in
formed decisions regarding problematic cas that they may decide to distrust. background ct logs are built upon the foundation of the merkle tree data structure. nodes are labelled with the cryptographic hashes of their child nodes. leaf nodes contain hashes of actual pieces of data. the label of the root node therefore depends on all other nodes in the tree. in the context of certificate transparen...
Features restricted to secure contexts - Web security
this reference lists the web plat
form features available only in secure contexts — see secure contexts for a definition and more details. current features available only in secure contexts this section lists all the apis available only in secure contexts, along with browser versions the limitation was introduced in, as appropriate. note: only the browsers that actually support secure contexts are listed in this document. see here for in
formation on secure contexts support. api chrome/opera edge safari firefox async clipboard api 66 not supported not supported 63 background sync (see syncmanager, for example) 49 not supported not supported not supported cache-control: immutable not supported 15 ...
Securing your site - Web security
there are a number of things you can do to help secure your site. this article offers an assortment of suggestions, as well as links to other articles providing more useful in
formation. note: this article is a work in progress, and is neither complete nor does following its suggestions guarantee your site will be fully secure. user in
formation security how to turn off
form autocompletion
form fields support autocompletion in gecko; that is, their values can be remembered and automatically brought back the next time the user visits your site. for certain types of data, you may wish to disable this feature. privacy and the :visited selector this article discusses changes made to the getcomputedstyle() method that eliminates the ability for malicious sites to figure out the use...
Weak signature algorithms - Web security
weaknesses in hash algorithms can lead to situations in which attackers can create or obtain fraudulent certificates. as new attacks are found and improvements in available technology make attacks more feasible, the use of older algorithms is discouraged and support for them is eventually removed. ...
Using templates and slots - Web Components
let templatecontent = template.content; const shadowroot = this.attachshadow({mode: 'open'}) .appendchild(templatecontent.clonenode(true)); } } ); the key point to note here is that we append a clone of the template content to the shadow root, created using the node.clonenode() method. and because we are appending its contents to a shadow dom, we can include some styling in
formation inside the template in a <style> element, which is then encapsulated inside the custom element. this wouldn't work if we just appended it to the standard dom. so for example: <template id="my-paragraph"> <style> p { color: white; background-color: #666; padding: 5px; } </style> <p>my paragraph</p> </template> now we can use it by just adding it to our html ...